mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
src-tree cleanup: separate surfaces from libraries
libardourcp and now libardour_midisurface are not control surfaces, but helper libraries for those. They need to be deployed to the library folder (shared between ctrl surfaces) and not scanned as ctrl surfaces at runtime.
This commit is contained in:
parent
22007bf882
commit
d521c2ede6
20 changed files with 8 additions and 11 deletions
|
|
@ -0,0 +1,310 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="ardour_cp"
|
||||
ProjectGUID="{546C4F76-AEF4-4686-BA67-402071117061}"
|
||||
RootNamespace="ardour_cp"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug 32|Win32"
|
||||
OutputDirectory="$(ProjectDir)\$(ConfigurationName)\bin"
|
||||
IntermediateDirectory="$(ProjectDir)\$(ConfigurationName)\obj\$(ProjectName)"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\..\..\..\MSVCMixbus3\MSVCMixbus5.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/FI$(TargetSxsFolder)\targetsxs.h"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..;..\..\..\ardour;..\..\..\pbd;..\..\..\fst;"$(GenericIncludeFolder)\ardourext";..\..\..\surfaces\control_protocol;..\..\..\evoral;..\..\..\libltc;..\..\..\temporal;..\..\..\rubberband;"..\..\..\vamp-sdk";"..\..\..\midi++2";..\..\..\taglib;..\..\..\taglib\taglib;..\..\..\taglib\taglib\toolkit;..\..\..\audiographer;..\..\..\lua;"$(GenericLibraryFolder)\glib-2.0\include";"$(GenericIncludeFolder)\libsndfile";"$(GenericIncludeFolder)\gtk-2.0";"$(GenericIncludeFolder)\cairo";"$(GenericIncludeFolder)\freetype2";"$(GenericIncludeFolder)\pango-1.0";"$(GenericIncludeFolder)\gtk-2.0\gdk";"$(GenericIncludeFolder)\atk-2.0";"$(GenericIncludeFolder)\lrdf";"$(GenericIncludeFolder)\raptor""
|
||||
PreprocessorDefinitions="PLATFORM_WINDOWS;COMPILER_MSVC;UINTSDEFINED=1;BUILDING_ARDOUR_CP;LIBCONTROLCP_DLL_EXPORTS;RUBBERBAND_IS_IN_WIN_STATIC_LIB;LUA_BUILD_AS_DLL;USE_CAIRO_IMAGE_SURFACE;NOMINMAX;NO_POSIX_MEMALIGN;INCLUDE_ARDOUR_MISCELLANEOUS=1;BOOST_REGEX_DYN_LINK;BOOST_REGEX_NO_LIB;BOOST_CHRONO_NO_LIB;BOOST_SYSTEM_NO_LIB;BOOST_THREAD_NO_LIB;BOOST_DATE_TIME_NO_LIB;BOOST_ATOMIC_NO_LIB;GNU_WIN32;WIN32;_WIN32;_DEBUG;DEBUG="Debug";ARCH_X86;USE_XMMINTRIN;BUILD_SSE_OPTIMIZATIONS;ENABLE_NLS;PACKAGE="\"ardour_cp\"";_REENTRANT;_USE_MATH_DEFINES;_LARGEFILE_SOURCE;_LARGEFILE64_SOURCE;LIBC_DISABLE_DEPRECATED;BOOST_SYSTEM_NO_DEPRECATED;__STDC_LIMIT_MACROS;__STDC_FORMAT_MACROS;INTERNAL_SHARED_LIBS=1;JACK_SESSION=1;HAVE_GLIB=1;HAVE_GTHREAD=1;HAVE_SNDFILE=1;HAVE_GIOMM=1;HAVE_CURL=1;HAVE_LO=1;HAVE_MODE_T=1;PHONE_HOME=1;FREESOUND=1;WINDOWS_KEY=\"Mod4><Super\";IS_OSX=0;HAVE_XML=1;HAVE_UUID=1;HAVE_LIBS_PBD=1;HAVE_JACK=1;HAVE_LIBS_MIDIPP2=1;HAVE_LIBS_EVORAL=1;HAVE_FFTW3=1;HAVE_FFTW3F=1;HAVE_AUBIO=1;HAVE_LIBS_VAMP_SDK=1;HAVE_LIBS_VAMP_PLUGINS=1;HAVE_LIBS_TAGLIB=1;HAVE_LIBS_LIBLTC=1;HAVE_LIBS_RUBBERBAND=1;HAVE_CONTROL_PROTOCOL=1;HAVE_FRONTIER=1;HAVE_GENERIC_MIDI=1;HAVE_MACKIE=1;HAVE_OSC=1;HAVE_TRANZPORT=1;HAVE_WIIMOTE=1;HAVE_LIBS_SURFACES=1;HAVE_2IN2OUT=1;HAVE_1IN2OUT=1;HAVE_VBAP=1;HAVE_LIBS_PANNERS=1;HAVE_LIBS_TEMPORAL=1;HAVE_LRDF=1;HAVE_SAMPLERATE=1;HAVE_SERD=1;HAVE_SORD=1;HAVE_SRATOM=1;HAVE_LILV=1;HAVE_LILV_0_16_0=1;HAVE_OGG=1;HAVE_FLAC=1;HAVE_RUBBERBAND=1;USE_RUBBERBAND=1;HAVE_JACK_SESSION=1;HAVE_UNISTD=1;HAVE_JACK_ON_INFO_SHUTDOWN=1;HAVE_JACK_VIDEO_SUPPORT=1;HAVE_BOOST_SCOPED_PTR_HPP=1;HAVE_BOOST_PTR_CONTAINER_PTR_LIST_HPP=1;HAVE_LIBS_ARDOUR=1;HAVE_GTKMM=1;HAVE_GTK=1;HAVE_LIBS_GTKMM2EXT=1;HAVE_LIBS_CLEARLOOKS_NEWER=1;HAVE_BOOST_FORMAT_HPP=1;HAVE_LIBS_AUDIOGRAPHER=1;HAVE_GNOMECANVAS=0;HAVE_GNOMECANVASMM=0;HAVE_X11=0;HAVE_FONTCONFIG=1;HAVE_BOOST_SHARED_PTR_HPP=1;HAVE_BOOST_WEAK_PTR_HPP=1;HAVE_GTK2_ARDOUR=1;HAVE_EXPORT=1;HAVE_MIDI_MAPS=1;HAVE_MCP=1;HAVE_PATCHFILES=1;HAVE_TOOLS_SANITY_CHECK=1;SMF_VERSION=\"1.2\""
|
||||
MinimalRebuild="true"
|
||||
RuntimeLibrary="3"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="2"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="$(DllPrefix)glibmm32$(GlibmmDllSuffix)D.lib $(DllPrefix)giomm32$(GlibmmDllSuffix)D.lib pthreadVCE2.lib $(DllPrefix)gthread32$(GlibDllSuffix)D.lib $(DllPrefix)gobject32$(GlibDllSuffix)D.lib $(DllPrefix)gmodule32$(GlibDllSuffix)D.lib $(DllPrefix)glib32$(GlibDllSuffix)D.lib $(DllPrefix)gio32$(GlibDllSuffix)D.lib $(DllPrefix)sigc++32-2.0D.lib $(DllPrefix)temporal32D.lib $(DllPrefix)pbd32D.lib intlD.lib"
|
||||
OutputFile="$(OutDir)\$(DllPrefix)$(ProjectName)32D.dll"
|
||||
AdditionalLibraryDirectories="F:\pthread-win32\Pre-built.2\lib"
|
||||
IgnoreDefaultLibraryNames="libboost_regex-vc80-mt-gd-1_40.lib;msvcrt.lib;dsound.lib"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
UseFAT32Workaround="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="copy /Y "$(OutDir)\$(TargetName).dll" "$(Debug32TargetFolder)\$(TargetName).dll"
copy /Y "$(OutDir)\$(TargetName).dll" "$(Debug32TestSuiteFolder)\$(TargetName).dll"
copy /Y "$(OutDir)\$(TargetName).lib" "$(GenericWin32LibraryFolder)\$(TargetName).lib"
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release 32|Win32"
|
||||
OutputDirectory="$(ProjectDir)\$(ConfigurationName)\bin"
|
||||
IntermediateDirectory="$(ProjectDir)\$(ConfigurationName)\obj\$(ProjectName)"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\..\..\..\MSVCMixbus3\MSVCMixbus5.vsprops"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/FI$(TargetSxsFolder)\targetsxs.h"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..;..\..\..\ardour;..\..\..\pbd;..\..\..\fst;"$(GenericIncludeFolder)\ardourext";..\..\..\surfaces\control_protocol;..\..\..\evoral;..\..\..\libltc;..\..\..\temporal;..\..\..\rubberband;"..\..\..\vamp-sdk";"..\..\..\midi++2";..\..\..\taglib;..\..\..\taglib\taglib;..\..\..\taglib\taglib\toolkit;..\..\..\audiographer;..\..\..\lua;"$(GenericLibraryFolder)\glib-2.0\include";"$(GenericIncludeFolder)\libsndfile";"$(GenericIncludeFolder)\gtk-2.0";"$(GenericIncludeFolder)\cairo";"$(GenericIncludeFolder)\freetype2";"$(GenericIncludeFolder)\pango-1.0";"$(GenericIncludeFolder)\gtk-2.0\gdk";"$(GenericIncludeFolder)\atk-2.0";"$(GenericIncludeFolder)\lrdf";"$(GenericIncludeFolder)\raptor""
|
||||
PreprocessorDefinitions="PLATFORM_WINDOWS;COMPILER_MSVC;UINTSDEFINED=1;_SECURE_SCL=0;BUILDING_ARDOUR_CP;LIBCONTROLCP_DLL_EXPORTS;RUBBERBAND_IS_IN_WIN_STATIC_LIB;LUA_BUILD_AS_DLL;USE_CAIRO_IMAGE_SURFACE;NOMINMAX;NO_POSIX_MEMALIGN;INCLUDE_ARDOUR_MISCELLANEOUS=1;BOOST_REGEX_DYN_LINK;BOOST_REGEX_NO_LIB;BOOST_CHRONO_NO_LIB;BOOST_SYSTEM_NO_LIB;BOOST_THREAD_NO_LIB;BOOST_DATE_TIME_NO_LIB;BOOST_ATOMIC_NO_LIB;GNU_WIN32;WIN32;_WIN32;NDEBUG;ARCH_X86;USE_XMMINTRIN;BUILD_SSE_OPTIMIZATIONS;ENABLE_NLS;PACKAGE="\"ardour_cp\"";_REENTRANT;_USE_MATH_DEFINES;_LARGEFILE_SOURCE;_LARGEFILE64_SOURCE;LIBC_DISABLE_DEPRECATED;BOOST_SYSTEM_NO_DEPRECATED;__STDC_LIMIT_MACROS;__STDC_FORMAT_MACROS;INTERNAL_SHARED_LIBS=1;JACK_SESSION=1;HAVE_GLIB=1;HAVE_GTHREAD=1;HAVE_SNDFILE=1;HAVE_GIOMM=1;HAVE_CURL=1;HAVE_LO=1;HAVE_MODE_T=1;PHONE_HOME=1;FREESOUND=1;WINDOWS_KEY=\"Mod4><Super\";IS_OSX=0;HAVE_XML=1;HAVE_UUID=1;HAVE_LIBS_PBD=1;HAVE_JACK=1;HAVE_LIBS_MIDIPP2=1;HAVE_LIBS_EVORAL=1;HAVE_FFTW3=1;HAVE_FFTW3F=1;HAVE_AUBIO=1;HAVE_LIBS_VAMP_SDK=1;HAVE_LIBS_VAMP_PLUGINS=1;HAVE_LIBS_TAGLIB=1;HAVE_LIBS_LIBLTC=1;HAVE_LIBS_RUBBERBAND=1;HAVE_CONTROL_PROTOCOL=1;HAVE_FRONTIER=1;HAVE_GENERIC_MIDI=1;HAVE_MACKIE=1;HAVE_OSC=1;HAVE_TRANZPORT=1;HAVE_WIIMOTE=1;HAVE_LIBS_SURFACES=1;HAVE_2IN2OUT=1;HAVE_1IN2OUT=1;HAVE_VBAP=1;HAVE_LIBS_PANNERS=1;HAVE_LIBS_TEMPORAL=1;HAVE_LRDF=1;HAVE_SAMPLERATE=1;HAVE_SERD=1;HAVE_SORD=1;HAVE_SRATOM=1;HAVE_LILV=1;HAVE_LILV_0_16_0=1;HAVE_OGG=1;HAVE_FLAC=1;HAVE_RUBBERBAND=1;USE_RUBBERBAND=1;HAVE_JACK_SESSION=1;HAVE_UNISTD=1;HAVE_JACK_ON_INFO_SHUTDOWN=1;HAVE_JACK_VIDEO_SUPPORT=1;HAVE_BOOST_SCOPED_PTR_HPP=1;HAVE_BOOST_PTR_CONTAINER_PTR_LIST_HPP=1;HAVE_LIBS_ARDOUR=1;HAVE_GTKMM=1;HAVE_GTK=1;HAVE_LIBS_GTKMM2EXT=1;HAVE_LIBS_CLEARLOOKS_NEWER=1;HAVE_BOOST_FORMAT_HPP=1;HAVE_LIBS_AUDIOGRAPHER=1;HAVE_GNOMECANVAS=0;HAVE_GNOMECANVASMM=0;HAVE_X11=0;HAVE_FONTCONFIG=1;HAVE_BOOST_SHARED_PTR_HPP=1;HAVE_BOOST_WEAK_PTR_HPP=1;HAVE_GTK2_ARDOUR=1;HAVE_EXPORT=1;HAVE_MIDI_MAPS=1;HAVE_MCP=1;HAVE_PATCHFILES=1;HAVE_TOOLS_SANITY_CHECK=1;SMF_VERSION=\"1.2\""
|
||||
StringPooling="false"
|
||||
RuntimeLibrary="2"
|
||||
EnableEnhancedInstructionSet="1"
|
||||
WarningLevel="3"
|
||||
CompileAs="2"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="$(DllPrefix)glibmm32$(GlibmmDllSuffix).lib $(DllPrefix)giomm32$(GlibmmDllSuffix).lib pthreadVCE2.lib $(DllPrefix)gthread32$(GlibDllSuffix).lib $(DllPrefix)gobject32$(GlibDllSuffix).lib $(DllPrefix)gmodule32$(GlibDllSuffix).lib $(DllPrefix)glib32$(GlibDllSuffix).lib $(DllPrefix)gio32$(GlibDllSuffix).lib $(DllPrefix)sigc++32-2.0.lib $(DllPrefix)temporal32.lib $(DllPrefix)pbd32.lib intl.lib"
|
||||
OutputFile="$(OutDir)\$(DllPrefix)$(ProjectName)32.dll"
|
||||
AdditionalLibraryDirectories="F:\pthread-win32\Pre-built.2\lib"
|
||||
IgnoreDefaultLibraryNames="libboost_regex-vc80-mt-gd-1_40.lib;dsound.lib"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
UseFAT32Workaround="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="copy /Y "$(OutDir)\$(TargetName).dll" "$(Release32TargetFolder)\$(TargetName).dll"
copy /Y "$(OutDir)\$(TargetName).dll" "$(Release32TestSuiteFolder)\$(TargetName).dll"
copy /Y "$(OutDir)\$(TargetName).lib" "$(GenericWin32LibraryFolder)\$(TargetName).lib"
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release 32 with Debugging Capability|Win32"
|
||||
OutputDirectory="$(ProjectDir)\$(ConfigurationName)\bin"
|
||||
IntermediateDirectory="$(ProjectDir)\$(ConfigurationName)\obj\$(ProjectName)"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\..\..\..\MSVCMixbus3\MSVCMixbus5.vsprops"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/FI$(TargetSxsFolder)\targetsxs.h"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..;..\..\..\ardour;..\..\..\pbd;..\..\..\fst;"$(GenericIncludeFolder)\ardourext";..\..\..\surfaces\control_protocol;..\..\..\evoral;..\..\..\libltc;..\..\..\temporal;..\..\..\rubberband;"..\..\..\vamp-sdk";"..\..\..\midi++2";..\..\..\taglib;..\..\..\taglib\taglib;..\..\..\taglib\taglib\toolkit;..\..\..\audiographer;..\..\..\lua;"$(GenericLibraryFolder)\glib-2.0\include";"$(GenericIncludeFolder)\libsndfile";"$(GenericIncludeFolder)\gtk-2.0";"$(GenericIncludeFolder)\cairo";"$(GenericIncludeFolder)\freetype2";"$(GenericIncludeFolder)\pango-1.0";"$(GenericIncludeFolder)\gtk-2.0\gdk";"$(GenericIncludeFolder)\atk-2.0";"$(GenericIncludeFolder)\lrdf";"$(GenericIncludeFolder)\raptor""
|
||||
PreprocessorDefinitions="PLATFORM_WINDOWS;COMPILER_MSVC;UINTSDEFINED=1;_SECURE_SCL=0;BUILDING_ARDOUR_CP;LIBCONTROLCP_DLL_EXPORTS;RUBBERBAND_IS_IN_WIN_STATIC_LIB;LUA_BUILD_AS_DLL;USE_CAIRO_IMAGE_SURFACE;NOMINMAX;NO_POSIX_MEMALIGN;INCLUDE_ARDOUR_MISCELLANEOUS=1;BOOST_REGEX_DYN_LINK;BOOST_REGEX_NO_LIB;BOOST_CHRONO_NO_LIB;BOOST_SYSTEM_NO_LIB;BOOST_THREAD_NO_LIB;BOOST_DATE_TIME_NO_LIB;BOOST_ATOMIC_NO_LIB;GNU_WIN32;WIN32;_WIN32;ARCH_X86;USE_XMMINTRIN;BUILD_SSE_OPTIMIZATIONS;ENABLE_NLS;PACKAGE="\"ardour_cp\"";_REENTRANT;_USE_MATH_DEFINES;_LARGEFILE_SOURCE;_LARGEFILE64_SOURCE;LIBC_DISABLE_DEPRECATED;BOOST_SYSTEM_NO_DEPRECATED;__STDC_LIMIT_MACROS;__STDC_FORMAT_MACROS;INTERNAL_SHARED_LIBS=1;JACK_SESSION=1;HAVE_GLIB=1;HAVE_GTHREAD=1;HAVE_SNDFILE=1;HAVE_GIOMM=1;HAVE_CURL=1;HAVE_LO=1;HAVE_MODE_T=1;PHONE_HOME=1;FREESOUND=1;WINDOWS_KEY=\"Mod4><Super\";IS_OSX=0;HAVE_XML=1;HAVE_UUID=1;HAVE_LIBS_PBD=1;HAVE_JACK=1;HAVE_LIBS_MIDIPP2=1;HAVE_LIBS_EVORAL=1;HAVE_FFTW3=1;HAVE_FFTW3F=1;HAVE_AUBIO=1;HAVE_LIBS_VAMP_SDK=1;HAVE_LIBS_VAMP_PLUGINS=1;HAVE_LIBS_TAGLIB=1;HAVE_LIBS_LIBLTC=1;HAVE_LIBS_RUBBERBAND=1;HAVE_CONTROL_PROTOCOL=1;HAVE_FRONTIER=1;HAVE_GENERIC_MIDI=1;HAVE_MACKIE=1;HAVE_OSC=1;HAVE_TRANZPORT=1;HAVE_WIIMOTE=1;HAVE_LIBS_SURFACES=1;HAVE_2IN2OUT=1;HAVE_1IN2OUT=1;HAVE_VBAP=1;HAVE_LIBS_PANNERS=1;HAVE_LIBS_TEMPORAL=1;HAVE_LRDF=1;HAVE_SAMPLERATE=1;HAVE_SERD=1;HAVE_SORD=1;HAVE_SRATOM=1;HAVE_LILV=1;HAVE_LILV_0_16_0=1;HAVE_OGG=1;HAVE_FLAC=1;HAVE_RUBBERBAND=1;USE_RUBBERBAND=1;HAVE_JACK_SESSION=1;HAVE_UNISTD=1;HAVE_JACK_ON_INFO_SHUTDOWN=1;HAVE_JACK_VIDEO_SUPPORT=1;HAVE_BOOST_SCOPED_PTR_HPP=1;HAVE_BOOST_PTR_CONTAINER_PTR_LIST_HPP=1;HAVE_LIBS_ARDOUR=1;HAVE_GTKMM=1;HAVE_GTK=1;HAVE_LIBS_GTKMM2EXT=1;HAVE_LIBS_CLEARLOOKS_NEWER=1;HAVE_BOOST_FORMAT_HPP=1;HAVE_LIBS_AUDIOGRAPHER=1;HAVE_GNOMECANVAS=0;HAVE_GNOMECANVASMM=0;HAVE_X11=0;HAVE_FONTCONFIG=1;HAVE_BOOST_SHARED_PTR_HPP=1;HAVE_BOOST_WEAK_PTR_HPP=1;HAVE_GTK2_ARDOUR=1;HAVE_EXPORT=1;HAVE_MIDI_MAPS=1;HAVE_MCP=1;HAVE_PATCHFILES=1;HAVE_TOOLS_SANITY_CHECK=1;SMF_VERSION=\"1.2\""
|
||||
StringPooling="false"
|
||||
RuntimeLibrary="2"
|
||||
EnableEnhancedInstructionSet="1"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="2"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="$(DllPrefix)glibmm32$(GlibmmDllSuffix)RDC.lib $(DllPrefix)giomm32$(GlibmmDllSuffix)RDC.lib pthreadVCE2.lib $(DllPrefix)gthread32$(GlibDllSuffix)RDC.lib $(DllPrefix)gobject32$(GlibDllSuffix)RDC.lib $(DllPrefix)gmodule32$(GlibDllSuffix)RDC.lib $(DllPrefix)glib32$(GlibDllSuffix)RDC.lib $(DllPrefix)gio32$(GlibDllSuffix)RDC.lib $(DllPrefix)sigc++32-2.0RDC.lib $(DllPrefix)temporal32RDC.lib $(DllPrefix)pbd32RDC.lib intlRDC.lib"
|
||||
OutputFile="$(OutDir)\$(DllPrefix)$(ProjectName)32RDC.dll"
|
||||
AdditionalLibraryDirectories="F:\pthread-win32\Pre-built.2\lib"
|
||||
IgnoreDefaultLibraryNames="libboost_regex-vc80-mt-gd-1_40.lib;dsound.lib"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
UseFAT32Workaround="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="copy /Y "$(OutDir)\$(TargetName).dll" "$(Release32TestSuiteFolder)\$(TargetName).dll"
copy /Y "$(OutDir)\$(TargetName).lib" "$(GenericWin32LibraryFolder)\$(TargetName).lib"
"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\basic_ui.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\control_protocol.cc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\control_protocol\basic_ui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\control_protocol\control_protocol.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\control_protocol\types.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\..\gtk2_ardour\win32\msvc_resources.rc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
996
libs/ctrl-interface/control_protocol/basic_ui.cc
Normal file
996
libs/ctrl-interface/control_protocol/basic_ui.cc
Normal file
|
|
@ -0,0 +1,996 @@
|
|||
/*
|
||||
* Copyright (C) 2006-2009 David Robillard <d@drobilla.net>
|
||||
* Copyright (C) 2006-2018 Paul Davis <paul@linuxaudiosystems.com>
|
||||
* Copyright (C) 2009-2010 Carl Hetherington <carl@carlh.net>
|
||||
* Copyright (C) 2015 Robin Gareus <robin@gareus.org>
|
||||
* Copyright (C) 2016-2017 Ben Loftis <ben@harrisonconsoles.com>
|
||||
* Copyright (C) 2017-2019 Johannes Mueller <github@johannes-mueller.org>
|
||||
* Copyright (C) 2017 Len Ovens <len@ovenwerks.net>
|
||||
* Copyright (C) 2017 Tim Mayberry <mojofunk@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "pbd/pthread_utils.h"
|
||||
#include "pbd/memento_command.h"
|
||||
|
||||
#include "temporal/tempo.h"
|
||||
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/location.h"
|
||||
#include "ardour/tempo.h"
|
||||
#include "ardour/transport_master_manager.h"
|
||||
#include "ardour/utils.h"
|
||||
|
||||
#include "control_protocol/basic_ui.h"
|
||||
|
||||
#include "pbd/i18n.h"
|
||||
|
||||
using namespace ARDOUR;
|
||||
using namespace Temporal;
|
||||
|
||||
PBD::Signal2<void,std::string,std::string> BasicUI::AccessAction;
|
||||
|
||||
BasicUI::BasicUI (Session& s)
|
||||
: session (&s),
|
||||
_tbank_route_width (8),
|
||||
_tbank_row_height (8),
|
||||
_tbank_start_route (0),
|
||||
_tbank_start_row (0)
|
||||
{
|
||||
}
|
||||
|
||||
BasicUI::BasicUI ()
|
||||
: session (0)
|
||||
{
|
||||
}
|
||||
|
||||
BasicUI::~BasicUI ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::register_thread (std::string name)
|
||||
{
|
||||
std::string pool_name = name;
|
||||
pool_name += " events";
|
||||
|
||||
SessionEvent::create_per_thread_pool (pool_name, 64);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::access_action ( std::string action_path )
|
||||
{
|
||||
int split_at = action_path.find( "/" );
|
||||
std::string group = action_path.substr( 0, split_at );
|
||||
std::string item = action_path.substr( split_at + 1 );
|
||||
|
||||
AccessAction( group, item );
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::loop_toggle ()
|
||||
{
|
||||
if (!session) {
|
||||
return;
|
||||
}
|
||||
|
||||
Location * looploc = session->locations()->auto_loop_location();
|
||||
|
||||
if (!looploc) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (session->get_play_loop()) {
|
||||
|
||||
/* looping enabled, our job is to disable it */
|
||||
|
||||
session->request_play_loop (false);
|
||||
|
||||
} else {
|
||||
|
||||
/* looping not enabled, our job is to enable it.
|
||||
|
||||
loop-is-NOT-mode: this action always starts the transport rolling.
|
||||
loop-IS-mode: this action simply sets the loop play mechanism, but
|
||||
does not start transport.
|
||||
*/
|
||||
if (Config->get_loop_is_mode()) {
|
||||
session->request_play_loop (true, false);
|
||||
} else {
|
||||
session->request_play_loop (true, true);
|
||||
}
|
||||
}
|
||||
|
||||
//show the loop markers
|
||||
looploc->set_hidden (false, this);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::loop_location (timepos_t const & start, timepos_t const & end)
|
||||
{
|
||||
Location* tll;
|
||||
if ((tll = session->locations()->auto_loop_location()) == 0) {
|
||||
Location* loc = new Location (*session, start, end, _("Loop"), Location::IsAutoLoop);
|
||||
session->locations()->add (loc, true);
|
||||
session->set_auto_loop_location (loc);
|
||||
} else {
|
||||
tll->set_hidden (false, this);
|
||||
tll->set (start, end);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::goto_start (bool and_roll)
|
||||
{
|
||||
session->goto_start (and_roll);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::goto_zero ()
|
||||
{
|
||||
session->request_locate (0);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::goto_end ()
|
||||
{
|
||||
session->goto_end ();
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::add_marker (const std::string& markername)
|
||||
{
|
||||
timepos_t where (session->audible_sample());
|
||||
Location *location = new Location (*session, where, where, markername, Location::IsMark);
|
||||
session->begin_reversible_command (_("add marker"));
|
||||
XMLNode &before = session->locations()->get_state();
|
||||
session->locations()->add (location, true);
|
||||
XMLNode &after = session->locations()->get_state();
|
||||
session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
|
||||
session->commit_reversible_command ();
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::remove_marker_at_playhead ()
|
||||
{
|
||||
access_action("Common/remove-location-from-playhead");
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::button_varispeed (bool fwd)
|
||||
{
|
||||
// incrementally increase speed by semitones
|
||||
// (keypress auto-repeat is 100ms)
|
||||
const float maxspeed = Config->get_shuttle_max_speed();
|
||||
float semitone_ratio = exp2f (1.0f/12.0f);
|
||||
const float octave_down = pow (1.0/semitone_ratio, 12.0);
|
||||
float transport_speed = get_transport_speed ();
|
||||
float speed;
|
||||
|
||||
if (Config->get_rewind_ffwd_like_tape_decks()) {
|
||||
|
||||
if (fwd) {
|
||||
if (transport_speed <= 0) {
|
||||
session->request_transport_speed (1.0);
|
||||
session->request_roll (TRS_UI);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (transport_speed >= 0) {
|
||||
session->request_transport_speed (-1.0);
|
||||
session->request_roll (TRS_UI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
if (fabs (transport_speed) <= 0.1) {
|
||||
|
||||
/* close to zero, maybe flip direction */
|
||||
|
||||
if (fwd) {
|
||||
if (transport_speed <= 0) {
|
||||
session->request_transport_speed (1.0);
|
||||
session->request_roll (TRS_UI);
|
||||
}
|
||||
} else {
|
||||
if (transport_speed >= 0) {
|
||||
session->request_transport_speed (-1.0);
|
||||
session->request_roll (TRS_UI);
|
||||
}
|
||||
}
|
||||
|
||||
/* either we've just started, or we're moving as slowly as we
|
||||
* ever should
|
||||
*/
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (fwd) {
|
||||
if (transport_speed < 0.f) {
|
||||
if (fabs (transport_speed) < octave_down) {
|
||||
/* we need to move the speed back towards zero */
|
||||
semitone_ratio = powf (1.f / semitone_ratio, 4.f);
|
||||
} else {
|
||||
semitone_ratio = 1.f / semitone_ratio;
|
||||
}
|
||||
} else {
|
||||
if (fabs (transport_speed) < octave_down) {
|
||||
/* moving very slowly, use 4 semitone steps */
|
||||
semitone_ratio = powf (semitone_ratio, 4.f);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (transport_speed > 0.f) {
|
||||
/* we need to move the speed back towards zero */
|
||||
|
||||
if (transport_speed < octave_down) {
|
||||
semitone_ratio = powf (1.f / semitone_ratio, 4.f);
|
||||
} else {
|
||||
semitone_ratio = 1.f / semitone_ratio;
|
||||
}
|
||||
} else {
|
||||
if (fabs (transport_speed) < octave_down) {
|
||||
/* moving very slowly, use 4 semitone steps */
|
||||
semitone_ratio = powf (semitone_ratio, 4.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
speed = semitone_ratio * transport_speed;
|
||||
speed = std::max (-maxspeed, std::min (maxspeed, speed));
|
||||
session->request_transport_speed (speed);
|
||||
session->request_roll (TRS_UI);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::rewind ()
|
||||
{
|
||||
button_varispeed (false);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::ffwd ()
|
||||
{
|
||||
button_varispeed (true);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::transport_stop ()
|
||||
{
|
||||
session->request_stop ();
|
||||
}
|
||||
|
||||
bool
|
||||
BasicUI::stop_button_onoff () const
|
||||
{
|
||||
return session->transport_stopped_or_stopping ();
|
||||
}
|
||||
|
||||
bool
|
||||
BasicUI::play_button_onoff () const
|
||||
{
|
||||
return get_transport_speed() == 1.0;
|
||||
}
|
||||
|
||||
bool
|
||||
BasicUI::ffwd_button_onoff () const
|
||||
{
|
||||
return get_transport_speed() > 1.0;
|
||||
}
|
||||
|
||||
bool
|
||||
BasicUI::rewind_button_onoff () const
|
||||
{
|
||||
return get_transport_speed() < 0.0;
|
||||
}
|
||||
|
||||
bool
|
||||
BasicUI::loop_button_onoff () const
|
||||
{
|
||||
return session->get_play_loop();
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::transport_play (bool from_last_start)
|
||||
{
|
||||
/* ::toggle_roll() is smarter and preferred */
|
||||
|
||||
if (!session) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (session->is_auditioning()) {
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (session->config.get_external_sync()) {
|
||||
switch (TransportMasterManager::instance().current().type()) {
|
||||
case Engine:
|
||||
break;
|
||||
default:
|
||||
/* transport controlled by the master */
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool rolling = transport_rolling();
|
||||
|
||||
if (session->get_play_loop()) {
|
||||
|
||||
/* If loop playback is not a mode, then we should cancel
|
||||
it when this action is requested. If it is a mode
|
||||
we just leave it in place.
|
||||
*/
|
||||
|
||||
if (!Config->get_loop_is_mode()) {
|
||||
/* XXX it is not possible to just leave seamless loop and keep
|
||||
playing at present (nov 4th 2009)
|
||||
*/
|
||||
if (rolling) {
|
||||
/* stop loop playback but keep rolling */
|
||||
session->request_play_loop (false, false);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (session->get_play_range () ) {
|
||||
/* stop playing a range if we currently are */
|
||||
session->request_play_range (0, true);
|
||||
}
|
||||
|
||||
if (rolling) {
|
||||
session->request_transport_speed (1.0, TRS_UI);
|
||||
} else {
|
||||
session->request_roll ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::rec_enable_toggle ()
|
||||
{
|
||||
switch (session->record_status()) {
|
||||
case Session::Disabled:
|
||||
if (session->ntracks() == 0) {
|
||||
// string txt = _("Please create 1 or more track\nbefore trying to record.\nCheck the Session menu.");
|
||||
// MessageDialog msg (*editor, txt);
|
||||
// msg.run ();
|
||||
return;
|
||||
}
|
||||
session->maybe_enable_record ();
|
||||
break;
|
||||
case Session::Recording:
|
||||
case Session::Enabled:
|
||||
session->disable_record (false, true);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::all_tracks_rec_in ()
|
||||
{
|
||||
session->set_all_tracks_record_enabled (true);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::all_tracks_rec_out ()
|
||||
{
|
||||
session->set_all_tracks_record_enabled (false);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::save_state ()
|
||||
{
|
||||
session->save_state ("");
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::prev_marker ()
|
||||
{
|
||||
access_action("Common/jump-backward-to-mark");
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::next_marker ()
|
||||
{
|
||||
access_action("Common/jump-forward-to-mark");
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::set_transport_speed (double speed)
|
||||
{
|
||||
session->request_roll (TRS_UI);
|
||||
session->request_transport_speed (speed);
|
||||
}
|
||||
|
||||
double
|
||||
BasicUI::get_transport_speed () const
|
||||
{
|
||||
return session->actual_speed ();
|
||||
}
|
||||
|
||||
double
|
||||
BasicUI::transport_rolling () const
|
||||
{
|
||||
return !session->transport_stopped_or_stopping ();
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::trigger_stop_all (bool stop_all)
|
||||
{
|
||||
session->trigger_stop_all (stop_all);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::trigger_cue_row (int cue_idx)
|
||||
{
|
||||
session->trigger_cue_row (cue_idx);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::tbank_set_size (int width, int height)
|
||||
{
|
||||
_tbank_route_width = width;
|
||||
_tbank_row_height = height;
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::tbank_step_routes (int step_size)
|
||||
{
|
||||
_tbank_start_route += step_size;
|
||||
if (_tbank_start_route + _tbank_route_width > session->num_triggerboxes() ) {
|
||||
_tbank_start_route=session->num_triggerboxes() - _tbank_route_width;
|
||||
}
|
||||
if (_tbank_start_route < 0) {
|
||||
_tbank_start_route=0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::tbank_step_rows (int step_size)
|
||||
{
|
||||
_tbank_start_row += step_size;
|
||||
if (_tbank_start_row + _tbank_row_height > TriggerBox::default_triggers_per_box ) {
|
||||
_tbank_start_row=TriggerBox::default_triggers_per_box - _tbank_row_height;
|
||||
}
|
||||
if (_tbank_start_row < 0) {
|
||||
_tbank_start_row=0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::store_mixer_scene (int idx)
|
||||
{
|
||||
session->store_nth_mixer_scene (idx);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::apply_mixer_scene (int idx)
|
||||
{
|
||||
session->apply_nth_mixer_scene (idx);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::undo ()
|
||||
{
|
||||
access_action ("Editor/undo");
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::redo ()
|
||||
{
|
||||
access_action ("Editor/redo");
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::toggle_all_rec_enables ()
|
||||
{
|
||||
if (session->get_record_enabled()) {
|
||||
// session->record_disenable_all ();
|
||||
} else {
|
||||
// session->record_enable_all ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::toggle_punch_in ()
|
||||
{
|
||||
session->config.set_punch_in (!session->config.get_punch_in());
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::toggle_punch_out ()
|
||||
{
|
||||
session->config.set_punch_out (!session->config.get_punch_out());
|
||||
}
|
||||
|
||||
bool
|
||||
BasicUI::get_record_enabled ()
|
||||
{
|
||||
return session->get_record_enabled();
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::set_record_enable (bool yn)
|
||||
{
|
||||
if (yn) {
|
||||
session->maybe_enable_record ();
|
||||
} else {
|
||||
session->disable_record (false, true);
|
||||
}
|
||||
}
|
||||
|
||||
samplepos_t
|
||||
BasicUI::transport_sample ()
|
||||
{
|
||||
return session->transport_sample();
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::locate (samplepos_t where, LocateTransportDisposition ltd)
|
||||
{
|
||||
session->request_locate (where, false, ltd);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::locate (samplepos_t where, bool roll)
|
||||
{
|
||||
session->request_locate (where, false, roll ? MustRoll : RollIfAppropriate);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::jump_by_seconds (double secs, LocateTransportDisposition ltd)
|
||||
{
|
||||
samplepos_t current = session->transport_sample();
|
||||
double s = (double) current / (double) session->nominal_sample_rate();
|
||||
|
||||
s+= secs;
|
||||
if (s < 0) {
|
||||
s = 0;
|
||||
}
|
||||
s = s * session->nominal_sample_rate();
|
||||
|
||||
session->request_locate (floor(s), false, ltd);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::jump_by_bars (int bars, LocateTransportDisposition ltd)
|
||||
{
|
||||
TempoMap::SharedPtr tmap (TempoMap::fetch());
|
||||
Temporal::BBT_Time bbt (tmap->bbt_at (timepos_t (session->transport_sample())));
|
||||
|
||||
bbt.bars += bars;
|
||||
if (bbt.bars < 0) {
|
||||
bbt.bars = 1;
|
||||
}
|
||||
bbt.beats = 1;
|
||||
bbt.ticks = 0;
|
||||
|
||||
session->request_locate (tmap->sample_at (bbt), false, ltd);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::jump_by_beats (int beats, LocateTransportDisposition ltd)
|
||||
{
|
||||
Beats qn_goal = timepos_t (session->transport_sample ()).beats() + Beats (beats, 0);
|
||||
|
||||
if (qn_goal < Beats()) {
|
||||
qn_goal = Beats();
|
||||
}
|
||||
session->request_locate (timepos_t (qn_goal).samples());
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::toggle_monitor_mute ()
|
||||
{
|
||||
if (session->monitor_out()) {
|
||||
boost::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
|
||||
if (mon->cut_all ()) {
|
||||
mon->set_cut_all (false);
|
||||
} else {
|
||||
mon->set_cut_all (true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::toggle_monitor_dim ()
|
||||
{
|
||||
if (session->monitor_out()) {
|
||||
boost::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
|
||||
if (mon->dim_all ()) {
|
||||
mon->set_dim_all (false);
|
||||
} else {
|
||||
mon->set_dim_all (true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::toggle_monitor_mono ()
|
||||
{
|
||||
if (session->monitor_out()) {
|
||||
boost::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
|
||||
if (mon->mono()) {
|
||||
mon->set_mono (false);
|
||||
} else {
|
||||
mon->set_mono (true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::midi_panic ()
|
||||
{
|
||||
session->midi_panic ();
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::toggle_click ()
|
||||
{
|
||||
bool state = !Config->get_clicking();
|
||||
Config->set_clicking (state);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode)
|
||||
{
|
||||
/* TO BE KEPT IN SYNC WITH ARDOUR_UI::toggle_roll() */
|
||||
|
||||
if (!session) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (session->is_auditioning()) {
|
||||
session->cancel_audition ();
|
||||
return;
|
||||
}
|
||||
|
||||
if (session->config.get_external_sync()) {
|
||||
switch (TransportMasterManager::instance().current()->type()) {
|
||||
case Engine:
|
||||
break;
|
||||
default:
|
||||
/* transport controlled by the master */
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool rolling = transport_rolling();
|
||||
|
||||
if (rolling) {
|
||||
|
||||
if (roll_out_of_bounded_mode) {
|
||||
/* drop out of loop/range playback but leave transport rolling */
|
||||
|
||||
if (session->get_play_loop()) {
|
||||
|
||||
if (session->actively_recording()) {
|
||||
/* actually stop transport because
|
||||
otherwise the captured data will make
|
||||
no sense.
|
||||
*/
|
||||
session->request_play_loop (false, true);
|
||||
|
||||
} else {
|
||||
session->request_play_loop (false, false);
|
||||
}
|
||||
|
||||
} else if (session->get_play_range ()) {
|
||||
|
||||
session->request_cancel_play_range ();
|
||||
}
|
||||
|
||||
} else {
|
||||
session->request_stop (with_abort, true);
|
||||
}
|
||||
|
||||
} else { /* not rolling */
|
||||
|
||||
if (session->get_play_loop() && Config->get_loop_is_mode()) {
|
||||
session->request_locate (session->locations()->auto_loop_location()->start().samples(), false, MustRoll);
|
||||
} else {
|
||||
session->request_roll (TRS_UI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::stop_forget ()
|
||||
{
|
||||
session->request_stop (true, true);
|
||||
}
|
||||
|
||||
void BasicUI::mark_in () { access_action("Common/start-range-from-playhead"); }
|
||||
void BasicUI::mark_out () { access_action("Common/finish-range-from-playhead"); }
|
||||
|
||||
void BasicUI::set_punch_range () { access_action("Editor/set-punch-from-edit-range"); }
|
||||
void BasicUI::set_loop_range () { access_action("Editor/set-loop-from-edit-range"); }
|
||||
void BasicUI::set_session_range () { access_action("Editor/set-session-from-edit-range"); }
|
||||
|
||||
void BasicUI::quick_snapshot_stay () { access_action("Main/QuickSnapshotStay"); }
|
||||
void BasicUI::quick_snapshot_switch () { access_action("Main/QuickSnapshotSwitch"); }
|
||||
|
||||
void BasicUI::fit_1_track() { access_action("Editor/fit_1_track"); }
|
||||
void BasicUI::fit_2_tracks() { access_action("Editor/fit_2_tracks"); }
|
||||
void BasicUI::fit_4_tracks() { access_action("Editor/fit_4_tracks"); }
|
||||
void BasicUI::fit_8_tracks() { access_action("Editor/fit_8_tracks"); }
|
||||
void BasicUI::fit_16_tracks() { access_action("Editor/fit_16_tracks"); }
|
||||
void BasicUI::fit_32_tracks() { access_action("Editor/fit_32_tracks"); }
|
||||
void BasicUI::fit_all_tracks() { access_action("Editor/fit_all_tracks"); }
|
||||
|
||||
void BasicUI::zoom_10_ms() { access_action("Editor/zoom_10_ms"); }
|
||||
void BasicUI::zoom_100_ms() { access_action("Editor/zoom_100_ms"); }
|
||||
void BasicUI::zoom_1_sec() { access_action("Editor/zoom_1_sec"); }
|
||||
void BasicUI::zoom_10_sec() { access_action("Editor/zoom_10_sec"); }
|
||||
void BasicUI::zoom_1_min() { access_action("Editor/zoom_1_min"); }
|
||||
void BasicUI::zoom_5_min() { access_action("Editor/zoom_5_min"); }
|
||||
void BasicUI::zoom_10_min() { access_action("Editor/zoom_10_min"); }
|
||||
void BasicUI::zoom_to_session() { access_action("Editor/zoom-to-session"); }
|
||||
void BasicUI::temporal_zoom_in() { access_action("Editor/temporal-zoom-in"); }
|
||||
void BasicUI::temporal_zoom_out() { access_action("Editor/temporal-zoom-out"); }
|
||||
|
||||
void BasicUI::scroll_up_1_track() { access_action("Editor/step-tracks-up"); }
|
||||
void BasicUI::scroll_dn_1_track() { access_action("Editor/step-tracks-down"); }
|
||||
void BasicUI::scroll_up_1_page() { access_action("Editor/scroll-tracks-up"); }
|
||||
void BasicUI::scroll_dn_1_page() { access_action("Editor/scroll-tracks-down"); }
|
||||
|
||||
|
||||
bool
|
||||
BasicUI::locating ()
|
||||
{
|
||||
return session->locate_pending();
|
||||
}
|
||||
|
||||
bool
|
||||
BasicUI::locked ()
|
||||
{
|
||||
return session->transport_locked ();
|
||||
}
|
||||
|
||||
ARDOUR::samplecnt_t
|
||||
BasicUI::timecode_frames_per_hour ()
|
||||
{
|
||||
return session->timecode_frames_per_hour ();
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::timecode_time (samplepos_t where, Timecode::Time& timecode)
|
||||
{
|
||||
session->timecode_time (where, *((Timecode::Time *) &timecode));
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::timecode_to_sample (Timecode::Time& timecode, samplepos_t & sample, bool use_offset, bool use_subframes) const
|
||||
{
|
||||
session->timecode_to_sample (*((Timecode::Time*)&timecode), sample, use_offset, use_subframes);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::sample_to_timecode (samplepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const
|
||||
{
|
||||
session->sample_to_timecode (sample, *((Timecode::Time*)&timecode), use_offset, use_subframes);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::cancel_all_solo ()
|
||||
{
|
||||
if (session) {
|
||||
session->cancel_all_solo ();
|
||||
}
|
||||
}
|
||||
|
||||
struct SortLocationsByPosition {
|
||||
bool operator() (Location* a, Location* b) {
|
||||
return a->start() < b->start();
|
||||
}
|
||||
};
|
||||
|
||||
void
|
||||
BasicUI::goto_nth_marker (int n)
|
||||
{
|
||||
if (!session) {
|
||||
return;
|
||||
}
|
||||
|
||||
const Locations::LocationList& l (session->locations()->list());
|
||||
Locations::LocationList ordered;
|
||||
ordered = l;
|
||||
|
||||
SortLocationsByPosition cmp;
|
||||
ordered.sort (cmp);
|
||||
|
||||
for (Locations::LocationList::iterator i = ordered.begin(); n >= 0 && i != ordered.end(); ++i) {
|
||||
if ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_session_range()) {
|
||||
if (n == 0) {
|
||||
session->request_locate ((*i)->start().samples());
|
||||
break;
|
||||
}
|
||||
--n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ARDOUR::TriggerPtr
|
||||
BasicUI::find_trigger (int x, int y)
|
||||
{
|
||||
boost::shared_ptr<Route> r = session->get_remote_nth_route (x);
|
||||
if (!r) {
|
||||
return TriggerPtr();
|
||||
}
|
||||
boost::shared_ptr<TriggerBox> tb = r->triggerbox();
|
||||
|
||||
if (!tb || !tb->active()) {
|
||||
return TriggerPtr();
|
||||
}
|
||||
|
||||
TriggerPtr tp (tb->trigger (y));
|
||||
|
||||
if (!tp) {
|
||||
return TriggerPtr();
|
||||
}
|
||||
|
||||
return tp;
|
||||
}
|
||||
|
||||
float
|
||||
BasicUI::trigger_progress_at (int x)
|
||||
{
|
||||
boost::shared_ptr<TriggerBox> tb = session->triggerbox_at (_tbank_start_route + x);
|
||||
if (tb) {
|
||||
ARDOUR::TriggerPtr trigger = tb->currently_playing ();
|
||||
if (trigger) {
|
||||
return trigger->position_as_fraction ();
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
BasicUI::TriggerDisplay
|
||||
BasicUI::trigger_display_at (int x, int y)
|
||||
{
|
||||
TriggerDisplay disp;
|
||||
|
||||
boost::shared_ptr<TriggerBox> tb = session->triggerbox_at (_tbank_start_route + x);
|
||||
if (tb) {
|
||||
ARDOUR::TriggerPtr current = tb->currently_playing ();
|
||||
TriggerPtr tp = tb->trigger (_tbank_start_row + y);
|
||||
if (tp) {
|
||||
if (!tp->region()) {
|
||||
disp.state = -1;
|
||||
} else if (tp == current) {
|
||||
disp.state = 1;
|
||||
} else {
|
||||
disp.state = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return disp;
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::bang_trigger_at (int x, int y)
|
||||
{
|
||||
session->bang_trigger_at (_tbank_start_route + x, _tbank_start_row + y);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::unbang_trigger_at (int x, int y)
|
||||
{
|
||||
session->unbang_trigger_at (_tbank_start_route + x, _tbank_start_row + y);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
this stuff is waiting to go in so that all UIs can offer complex solo/mute functionality
|
||||
|
||||
void
|
||||
BasicUI::solo_release (boost::shared_ptr<Route> r)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::solo_press (boost::shared_ptr<Route> r, bool momentary, bool global, bool exclusive, bool isolate, bool solo_group)
|
||||
{
|
||||
if (momentary) {
|
||||
_solo_release = new SoloMuteRelease (_route->soloed());
|
||||
}
|
||||
|
||||
if (global) {
|
||||
|
||||
if (_solo_release) {
|
||||
_solo_release->routes = _session->get_routes ();
|
||||
}
|
||||
|
||||
if (Config->get_solo_control_is_listen_control()) {
|
||||
_session->set_listen (_session->get_routes(), !_route->listening(), Session::rt_cleanup, true);
|
||||
} else {
|
||||
_session->set_solo (_session->get_routes(), !_route->soloed(), Session::rt_cleanup, true);
|
||||
}
|
||||
|
||||
} else if (exclusive) {
|
||||
|
||||
if (_solo_release) {
|
||||
_solo_release->exclusive = true;
|
||||
|
||||
boost::shared_ptr<RouteList> routes = _session->get_routes();
|
||||
|
||||
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
|
||||
if ((*i)->soloed ()) {
|
||||
_solo_release->routes_on->push_back (*i);
|
||||
} else {
|
||||
_solo_release->routes_off->push_back (*i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Config->get_solo_control_is_listen_control()) {
|
||||
/* ??? we need a just_one_listen() method */
|
||||
} else {
|
||||
_session->set_just_one_solo (_route, true);
|
||||
}
|
||||
|
||||
} else if (isolate) {
|
||||
|
||||
// shift-click: toggle solo isolated status
|
||||
|
||||
_route->set_solo_isolated (!_route->solo_isolated(), this);
|
||||
delete _solo_release;
|
||||
_solo_release = 0;
|
||||
|
||||
} else if (solo_group) {
|
||||
|
||||
/* Primary-button1: solo mix group.
|
||||
NOTE: Primary-button2 is MIDI learn.
|
||||
*/
|
||||
|
||||
if (_route->route_group()) {
|
||||
|
||||
if (_solo_release) {
|
||||
_solo_release->routes = _route->route_group()->route_list();
|
||||
}
|
||||
|
||||
if (Config->get_solo_control_is_listen_control()) {
|
||||
_session->set_listen (_route->route_group()->route_list(), !_route->listening(), Session::rt_cleanup, true);
|
||||
} else {
|
||||
_session->set_solo (_route->route_group()->route_list(), !_route->soloed(), Session::rt_cleanup, true);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
/* click: solo this route */
|
||||
|
||||
boost::shared_ptr<RouteList> rl (new RouteList);
|
||||
rl->push_back (route());
|
||||
|
||||
if (_solo_release) {
|
||||
_solo_release->routes = rl;
|
||||
}
|
||||
|
||||
if (Config->get_solo_control_is_listen_control()) {
|
||||
_session->set_listen (rl, !_route->listening());
|
||||
} else {
|
||||
_session->set_solo (rl, !_route->soloed());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
433
libs/ctrl-interface/control_protocol/control_protocol.cc
Normal file
433
libs/ctrl-interface/control_protocol/control_protocol.cc
Normal file
|
|
@ -0,0 +1,433 @@
|
|||
/*
|
||||
* Copyright (C) 2006-2009 David Robillard <d@drobilla.net>
|
||||
* Copyright (C) 2006-2017 Paul Davis <paul@linuxaudiosystems.com>
|
||||
* Copyright (C) 2015-2016 Tim Mayberry <mojofunk@gmail.com>
|
||||
* Copyright (C) 2015-2017 Robin Gareus <robin@gareus.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "pbd/convert.h"
|
||||
#include "pbd/error.h"
|
||||
#include "pbd/pthread_utils.h"
|
||||
|
||||
#include "temporal/superclock.h"
|
||||
#include "temporal/tempo.h"
|
||||
|
||||
#include "ardour/control_protocol_manager.h"
|
||||
#include "ardour/gain_control.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/record_enable_control.h"
|
||||
#include "ardour/route.h"
|
||||
#include "ardour/audio_track.h"
|
||||
#include "ardour/meter.h"
|
||||
#include "ardour/amp.h"
|
||||
#include "ardour/selection.h"
|
||||
#include "control_protocol/control_protocol.h"
|
||||
|
||||
using namespace ARDOUR;
|
||||
using namespace std;
|
||||
using namespace PBD;
|
||||
|
||||
Signal0<void> ControlProtocol::ZoomToSession;
|
||||
Signal0<void> ControlProtocol::ZoomOut;
|
||||
Signal0<void> ControlProtocol::ZoomIn;
|
||||
Signal0<void> ControlProtocol::Enter;
|
||||
Signal0<void> ControlProtocol::Undo;
|
||||
Signal0<void> ControlProtocol::Redo;
|
||||
Signal1<void,float> ControlProtocol::ScrollTimeline;
|
||||
Signal1<void,uint32_t> ControlProtocol::GotoView;
|
||||
Signal0<void> ControlProtocol::CloseDialog;
|
||||
PBD::Signal0<void> ControlProtocol::VerticalZoomInAll;
|
||||
PBD::Signal0<void> ControlProtocol::VerticalZoomOutAll;
|
||||
PBD::Signal0<void> ControlProtocol::VerticalZoomInSelected;
|
||||
PBD::Signal0<void> ControlProtocol::VerticalZoomOutSelected;
|
||||
PBD::Signal0<void> ControlProtocol::StepTracksDown;
|
||||
PBD::Signal0<void> ControlProtocol::StepTracksUp;
|
||||
|
||||
StripableNotificationList ControlProtocol::_last_selected;
|
||||
PBD::ScopedConnection ControlProtocol::selection_connection;
|
||||
bool ControlProtocol::selection_connected = false;
|
||||
|
||||
const std::string ControlProtocol::state_node_name ("Protocol");
|
||||
|
||||
ControlProtocol::ControlProtocol (Session& s, string str)
|
||||
: BasicUI (s)
|
||||
, _name (str)
|
||||
, glib_event_callback (boost::bind (&ControlProtocol::event_loop_precall, this))
|
||||
, _active (false)
|
||||
{
|
||||
if (!selection_connected) {
|
||||
/* this is all static, connect it only once (and early), for all ControlProtocols */
|
||||
ControlProtocolManager::StripableSelectionChanged.connect_same_thread (selection_connection, boost::bind (&ControlProtocol::notify_stripable_selection_changed, _1));
|
||||
selection_connected = true;
|
||||
}
|
||||
}
|
||||
|
||||
ControlProtocol::~ControlProtocol ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::event_loop_precall ()
|
||||
{
|
||||
/* reload the thread-local ptr to the tempo map */
|
||||
Temporal::TempoMap::fetch ();
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::install_precall_handler (Glib::RefPtr<Glib::MainContext> context)
|
||||
{
|
||||
glib_event_callback.attach (context);
|
||||
}
|
||||
|
||||
int
|
||||
ControlProtocol::set_active (bool yn)
|
||||
{
|
||||
_active = yn;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::next_track (uint32_t initial_id)
|
||||
{
|
||||
// STRIPABLE route_table[0] = _session->get_nth_stripable (++initial_id, RemoteControlID::Route);
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::prev_track (uint32_t initial_id)
|
||||
{
|
||||
if (!initial_id) {
|
||||
return;
|
||||
}
|
||||
// STRIPABLE route_table[0] = _session->get_nth_stripable (--initial_id, RemoteControlID::Route);
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::set_route_table_size (uint32_t size)
|
||||
{
|
||||
while (route_table.size() < size) {
|
||||
route_table.push_back (boost::shared_ptr<Route> ((Route*) 0));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::set_route_table (uint32_t table_index, boost::shared_ptr<ARDOUR::Route> r)
|
||||
{
|
||||
if (table_index >= route_table.size()) {
|
||||
return;
|
||||
}
|
||||
|
||||
route_table[table_index] = r;
|
||||
|
||||
// XXX SHAREDPTR need to handle r->GoingAway
|
||||
}
|
||||
|
||||
bool
|
||||
ControlProtocol::set_route_table (uint32_t table_index, uint32_t remote_control_id)
|
||||
{
|
||||
#if 0 // STRIPABLE
|
||||
boost::shared_ptr<Route> r = session->route_by_remote_id (remote_control_id);
|
||||
|
||||
if (!r) {
|
||||
return false;
|
||||
}
|
||||
|
||||
set_route_table (table_index, r);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::route_set_rec_enable (uint32_t table_index, bool yn)
|
||||
{
|
||||
if (table_index >= route_table.size()) {
|
||||
return;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Route> r = route_table[table_index];
|
||||
|
||||
boost::shared_ptr<AudioTrack> at = boost::dynamic_pointer_cast<AudioTrack>(r);
|
||||
|
||||
if (at) {
|
||||
at->rec_enable_control()->set_value (1.0, Controllable::UseGroup);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
ControlProtocol::route_get_rec_enable (uint32_t table_index)
|
||||
{
|
||||
if (table_index >= route_table.size()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Route> r = route_table[table_index];
|
||||
|
||||
boost::shared_ptr<AudioTrack> at = boost::dynamic_pointer_cast<AudioTrack>(r);
|
||||
|
||||
if (at) {
|
||||
return at->rec_enable_control()->get_value();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
float
|
||||
ControlProtocol::route_get_gain (uint32_t table_index)
|
||||
{
|
||||
if (table_index >= route_table.size()) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Route> r = route_table[table_index];
|
||||
|
||||
if (r == 0) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
return r->gain_control()->get_value();
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::route_set_gain (uint32_t table_index, float gain)
|
||||
{
|
||||
if (table_index >= route_table.size()) {
|
||||
return;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Route> r = route_table[table_index];
|
||||
|
||||
if (r != 0) {
|
||||
r->gain_control()->set_value (gain, Controllable::UseGroup);
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
ControlProtocol::route_get_effective_gain (uint32_t table_index)
|
||||
{
|
||||
if (table_index >= route_table.size()) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Route> r = route_table[table_index];
|
||||
|
||||
if (r == 0) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
return r->amp()->gain_control()->get_value();
|
||||
}
|
||||
|
||||
|
||||
float
|
||||
ControlProtocol::route_get_peak_input_power (uint32_t table_index, uint32_t which_input)
|
||||
{
|
||||
if (table_index >= route_table.size()) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Route> r = route_table[table_index];
|
||||
|
||||
if (r == 0) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
return r->peak_meter()->meter_level (which_input, MeterPeak);
|
||||
}
|
||||
|
||||
bool
|
||||
ControlProtocol::route_get_muted (uint32_t table_index)
|
||||
{
|
||||
if (table_index >= route_table.size()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Route> r = route_table[table_index];
|
||||
|
||||
if (r == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return r->mute_control()->muted ();
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::route_set_muted (uint32_t table_index, bool yn)
|
||||
{
|
||||
if (table_index >= route_table.size()) {
|
||||
return;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Route> r = route_table[table_index];
|
||||
|
||||
if (r != 0) {
|
||||
r->mute_control()->set_value (yn ? 1.0 : 0.0, Controllable::UseGroup);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
ControlProtocol::route_get_soloed (uint32_t table_index)
|
||||
{
|
||||
if (table_index >= route_table.size()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Route> r = route_table[table_index];
|
||||
|
||||
if (r == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return r->soloed ();
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::route_set_soloed (uint32_t table_index, bool yn)
|
||||
{
|
||||
if (table_index >= route_table.size()) {
|
||||
return;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Route> r = route_table[table_index];
|
||||
|
||||
if (r != 0) {
|
||||
session->set_control (r->solo_control(), yn ? 1.0 : 0.0, Controllable::UseGroup);
|
||||
}
|
||||
}
|
||||
|
||||
string
|
||||
ControlProtocol:: route_get_name (uint32_t table_index)
|
||||
{
|
||||
if (table_index >= route_table.size()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
boost::shared_ptr<Route> r = route_table[table_index];
|
||||
|
||||
if (r == 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return r->name();
|
||||
}
|
||||
|
||||
list<boost::shared_ptr<Bundle> >
|
||||
ControlProtocol::bundles ()
|
||||
{
|
||||
return list<boost::shared_ptr<Bundle> > ();
|
||||
}
|
||||
|
||||
XMLNode&
|
||||
ControlProtocol::get_state () const
|
||||
{
|
||||
XMLNode* node = new XMLNode (state_node_name);
|
||||
|
||||
node->set_property ("name", _name);
|
||||
node->set_property ("feedback", get_feedback());
|
||||
|
||||
return *node;
|
||||
}
|
||||
|
||||
int
|
||||
ControlProtocol::set_state (XMLNode const & node, int /* version */)
|
||||
{
|
||||
bool feedback;
|
||||
if (node.get_property ("feedback", feedback)) {
|
||||
set_feedback (feedback);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Stripable>
|
||||
ControlProtocol::first_selected_stripable () const
|
||||
{
|
||||
return session->selection().first_selected_stripable ();
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::add_stripable_to_selection (boost::shared_ptr<ARDOUR::Stripable> s)
|
||||
{
|
||||
session->selection().add (s, boost::shared_ptr<AutomationControl>());
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::set_stripable_selection (boost::shared_ptr<ARDOUR::Stripable> s)
|
||||
{
|
||||
session->selection().select_stripable_and_maybe_group (s, true, true, 0);
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::toggle_stripable_selection (boost::shared_ptr<ARDOUR::Stripable> s)
|
||||
{
|
||||
session->selection().toggle (s, boost::shared_ptr<AutomationControl>());
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::remove_stripable_from_selection (boost::shared_ptr<ARDOUR::Stripable> s)
|
||||
{
|
||||
session->selection().remove (s, boost::shared_ptr<AutomationControl>());
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::add_rid_to_selection (int rid)
|
||||
{
|
||||
boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
|
||||
if (s) {
|
||||
session->selection().add (s, boost::shared_ptr<AutomationControl>());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::set_rid_selection (int rid)
|
||||
{
|
||||
boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
|
||||
if (s) {
|
||||
session->selection().select_stripable_and_maybe_group (s, true, true, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::toggle_rid_selection (int rid)
|
||||
{
|
||||
boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
|
||||
if (s) {
|
||||
session->selection().toggle (s, boost::shared_ptr<AutomationControl>());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::remove_rid_from_selection (int rid)
|
||||
{
|
||||
boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
|
||||
if (s) {
|
||||
session->selection().remove (s, boost::shared_ptr<AutomationControl>());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::clear_stripable_selection ()
|
||||
{
|
||||
session->selection().clear_stripables ();
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::notify_stripable_selection_changed (StripableNotificationListPtr sp)
|
||||
{
|
||||
_last_selected = *sp;
|
||||
}
|
||||
|
||||
206
libs/ctrl-interface/control_protocol/control_protocol/basic_ui.h
Normal file
206
libs/ctrl-interface/control_protocol/control_protocol/basic_ui.h
Normal file
|
|
@ -0,0 +1,206 @@
|
|||
/*
|
||||
* Copyright (C) 2006-2010 David Robillard <d@drobilla.net>
|
||||
* Copyright (C) 2007-2017 Paul Davis <paul@linuxaudiosystems.com>
|
||||
* Copyright (C) 2010 Carl Hetherington <carl@carlh.net>
|
||||
* Copyright (C) 2015 Robin Gareus <robin@gareus.org>
|
||||
* Copyright (C) 2016 Ben Loftis <ben@harrisonconsoles.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __ardour_basic_ui_h__
|
||||
#define __ardour_basic_ui_h__
|
||||
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "pbd/signals.h"
|
||||
|
||||
#include "temporal/timeline.h"
|
||||
|
||||
#include "ardour/types.h"
|
||||
#include "ardour/presentation_info.h"
|
||||
|
||||
#include "temporal/time.h"
|
||||
|
||||
#include "control_protocol/visibility.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
class Session;
|
||||
class SessionEvent;
|
||||
class Stripable;
|
||||
class Trigger;
|
||||
}
|
||||
|
||||
class LIBCONTROLCP_API BasicUI {
|
||||
public:
|
||||
BasicUI (ARDOUR::Session&);
|
||||
virtual ~BasicUI ();
|
||||
|
||||
void add_marker (const std::string& = std::string());
|
||||
void remove_marker_at_playhead ();
|
||||
|
||||
// void mark_in();
|
||||
// void mark_out();
|
||||
|
||||
void register_thread (std::string name);
|
||||
|
||||
/* transport control */
|
||||
|
||||
void loop_toggle ();
|
||||
void loop_location (Temporal::timepos_t const & start, Temporal::timepos_t const & end);
|
||||
void access_action ( std::string action_path );
|
||||
static PBD::Signal2<void,std::string,std::string> AccessAction;
|
||||
void goto_zero ();
|
||||
void goto_start (bool and_roll = false);
|
||||
void goto_end ();
|
||||
void button_varispeed (bool fwd);
|
||||
void rewind ();
|
||||
void ffwd ();
|
||||
void transport_stop ();
|
||||
void transport_play (bool jump_back = false);
|
||||
void set_transport_speed (double speed);
|
||||
|
||||
double get_transport_speed () const;
|
||||
double transport_rolling () const;
|
||||
|
||||
void jump_by_seconds (double sec, ARDOUR::LocateTransportDisposition ltd = ARDOUR::RollIfAppropriate);
|
||||
void jump_by_bars (int bars, ARDOUR::LocateTransportDisposition ltd = ARDOUR::RollIfAppropriate);
|
||||
void jump_by_beats (int beats, ARDOUR::LocateTransportDisposition ltd = ARDOUR::RollIfAppropriate);
|
||||
|
||||
ARDOUR::samplepos_t transport_sample ();
|
||||
void locate (ARDOUR::samplepos_t sample, ARDOUR::LocateTransportDisposition ltd);
|
||||
void locate (ARDOUR::samplepos_t sample, bool);
|
||||
bool locating ();
|
||||
bool locked ();
|
||||
|
||||
void save_state ();
|
||||
void prev_marker ();
|
||||
void next_marker ();
|
||||
void undo ();
|
||||
void redo ();
|
||||
void toggle_punch_in ();
|
||||
void toggle_punch_out ();
|
||||
|
||||
void mark_in();
|
||||
void mark_out();
|
||||
|
||||
void toggle_click();
|
||||
void midi_panic();
|
||||
|
||||
void trigger_cue_row (int cue);
|
||||
void trigger_stop_all (bool stop_now = false);
|
||||
|
||||
void store_mixer_scene (int scn);
|
||||
void apply_mixer_scene (int scn);
|
||||
|
||||
void toggle_monitor_mute();
|
||||
void toggle_monitor_dim();
|
||||
void toggle_monitor_mono();
|
||||
|
||||
void cancel_all_solo ();
|
||||
|
||||
void quick_snapshot_stay ();
|
||||
void quick_snapshot_switch ();
|
||||
|
||||
void toggle_roll(bool with_abort, bool roll_out_of_bounded_mode); //this provides the same operation as the "spacebar", it's a lot smarter than "play".
|
||||
|
||||
void stop_forget();
|
||||
|
||||
void set_punch_range();
|
||||
void set_loop_range();
|
||||
void set_session_range();
|
||||
|
||||
void set_record_enable (bool yn);
|
||||
bool get_record_enabled ();
|
||||
|
||||
//editor visibility stuff (why do we have to make explicit numbers here? because "gui actions" don't accept args
|
||||
void fit_1_track();
|
||||
void fit_2_tracks();
|
||||
void fit_4_tracks();
|
||||
void fit_8_tracks();
|
||||
void fit_16_tracks();
|
||||
void fit_32_tracks();
|
||||
void fit_all_tracks();
|
||||
void zoom_10_ms();
|
||||
void zoom_100_ms();
|
||||
void zoom_1_sec();
|
||||
void zoom_10_sec();
|
||||
void zoom_1_min();
|
||||
void zoom_5_min();
|
||||
void zoom_10_min();
|
||||
void zoom_to_session();
|
||||
void temporal_zoom_in();
|
||||
void temporal_zoom_out();
|
||||
|
||||
void scroll_up_1_track();
|
||||
void scroll_dn_1_track();
|
||||
void scroll_up_1_page();
|
||||
void scroll_dn_1_page();
|
||||
|
||||
void rec_enable_toggle ();
|
||||
void toggle_all_rec_enables ();
|
||||
|
||||
void all_tracks_rec_in ();
|
||||
void all_tracks_rec_out ();
|
||||
|
||||
void goto_nth_marker (int n);
|
||||
|
||||
ARDOUR::samplecnt_t timecode_frames_per_hour ();
|
||||
|
||||
void timecode_time (samplepos_t where, Timecode::Time&);
|
||||
void timecode_to_sample (Timecode::Time& timecode, samplepos_t & sample, bool use_offset, bool use_subframes) const;
|
||||
void sample_to_timecode (samplepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const;
|
||||
|
||||
bool stop_button_onoff() const;
|
||||
bool play_button_onoff() const;
|
||||
bool ffwd_button_onoff() const;
|
||||
bool rewind_button_onoff() const;
|
||||
bool loop_button_onoff() const;
|
||||
|
||||
/* These functions access Triggers in the order they are displayed on the Cue page, WITH an optional bank offset
|
||||
Use this for a launchpad-style NxM (route x row) matrix that maps directly to the Cue page layout.
|
||||
Trigger banking is separate from 'route' banking implemented by a fader surface.
|
||||
To match a fader/mute/solo to the Trigger banking, the tentative plan is:
|
||||
request trigger-tracks-only to be displayed on the surface
|
||||
bank the faders using the offset reported here
|
||||
*/
|
||||
void tbank_set_size (int route_width, int row_height);
|
||||
void tbank_step_routes (int step_size);
|
||||
void tbank_step_rows (int step_size);
|
||||
float trigger_progress_at (int x); /* 0..1 or -1 for not playing; */
|
||||
struct TriggerDisplay {
|
||||
int state;
|
||||
TriggerDisplay () {
|
||||
state = -1; /* -1=empty; 0=stopped; 1=playing */ /*potentially extend to include */
|
||||
//potentially name, color, launch style, follow action(s) etc
|
||||
}
|
||||
};
|
||||
TriggerDisplay trigger_display_at (int x, int y);
|
||||
void bang_trigger_at (int x, int y);
|
||||
void unbang_trigger_at (int x, int y);
|
||||
|
||||
/* it would be nice to use TriggerPtr here but that implies including ardour/triggerbox.h */
|
||||
boost::shared_ptr<ARDOUR::Trigger> find_trigger (int x, int y);
|
||||
|
||||
protected:
|
||||
BasicUI ();
|
||||
ARDOUR::Session* session;
|
||||
|
||||
int _tbank_route_width, _tbank_row_height;
|
||||
int _tbank_start_route, _tbank_start_row;
|
||||
};
|
||||
|
||||
#endif /* __ardour_basic_ui_h__ */
|
||||
|
|
@ -0,0 +1,209 @@
|
|||
/*
|
||||
* Copyright (C) 2006-2012 David Robillard <d@drobilla.net>
|
||||
* Copyright (C) 2006-2017 Paul Davis <paul@linuxaudiosystems.com>
|
||||
* Copyright (C) 2009-2010 Carl Hetherington <carl@carlh.net>
|
||||
* Copyright (C) 2013-2017 John Emmas <john@creativepost.co.uk>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef ardour_control_protocols_h
|
||||
#define ardour_control_protocols_h
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include "pbd/signals.h"
|
||||
#include "pbd/stateful.h"
|
||||
#include "pbd/glib_event_source.h"
|
||||
|
||||
#include "control_protocol/basic_ui.h"
|
||||
#include "control_protocol/types.h"
|
||||
#include "control_protocol/visibility.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
|
||||
class Route;
|
||||
class Session;
|
||||
class Bundle;
|
||||
class Stripable;
|
||||
|
||||
class LIBCONTROLCP_API ControlProtocol : public PBD::Stateful, public PBD::ScopedConnectionList, public BasicUI
|
||||
{
|
||||
public:
|
||||
ControlProtocol (Session&, std::string name);
|
||||
virtual ~ControlProtocol ();
|
||||
|
||||
virtual std::string name () const { return _name; }
|
||||
|
||||
virtual int set_active (bool yn);
|
||||
virtual bool active () const { return _active; }
|
||||
|
||||
virtual int set_feedback (bool /*yn*/) { return 0; }
|
||||
virtual bool get_feedback () const { return false; }
|
||||
|
||||
virtual void midi_connectivity_established () {}
|
||||
|
||||
virtual void stripable_selection_changed () = 0;
|
||||
|
||||
PBD::Signal0<void> ActiveChanged;
|
||||
|
||||
/* signals that a control protocol can emit and other (presumably graphical)
|
||||
* user interfaces can respond to
|
||||
*/
|
||||
|
||||
static PBD::Signal0<void> ZoomToSession;
|
||||
static PBD::Signal0<void> ZoomIn;
|
||||
static PBD::Signal0<void> ZoomOut;
|
||||
static PBD::Signal0<void> Enter;
|
||||
static PBD::Signal0<void> Undo;
|
||||
static PBD::Signal0<void> Redo;
|
||||
static PBD::Signal1<void, float> ScrollTimeline;
|
||||
static PBD::Signal1<void, uint32_t> GotoView;
|
||||
static PBD::Signal0<void> CloseDialog;
|
||||
static PBD::Signal0<void> VerticalZoomInAll;
|
||||
static PBD::Signal0<void> VerticalZoomOutAll;
|
||||
static PBD::Signal0<void> VerticalZoomInSelected;
|
||||
static PBD::Signal0<void> VerticalZoomOutSelected;
|
||||
static PBD::Signal0<void> StepTracksDown;
|
||||
static PBD::Signal0<void> StepTracksUp;
|
||||
|
||||
void add_stripable_to_selection (boost::shared_ptr<ARDOUR::Stripable>);
|
||||
void set_stripable_selection (boost::shared_ptr<ARDOUR::Stripable>);
|
||||
void toggle_stripable_selection (boost::shared_ptr<ARDOUR::Stripable>);
|
||||
void remove_stripable_from_selection (boost::shared_ptr<ARDOUR::Stripable>);
|
||||
void clear_stripable_selection ();
|
||||
|
||||
virtual void add_rid_to_selection (int rid);
|
||||
virtual void set_rid_selection (int rid);
|
||||
virtual void toggle_rid_selection (int rid);
|
||||
virtual void remove_rid_from_selection (int rid);
|
||||
|
||||
boost::shared_ptr<ARDOUR::Stripable> first_selected_stripable () const;
|
||||
|
||||
/* the model here is as follows:
|
||||
|
||||
we imagine most control surfaces being able to control
|
||||
from 1 to N tracks at a time, with a session that may
|
||||
contain 1 to M tracks, where M may be smaller, larger or
|
||||
equal to N.
|
||||
|
||||
the control surface has a fixed set of physical controllers
|
||||
which can potentially be mapped onto different tracks/busses
|
||||
via some mechanism.
|
||||
|
||||
therefore, the control protocol object maintains
|
||||
a table that reflects the current mapping between
|
||||
the controls and route object.
|
||||
*/
|
||||
|
||||
void set_route_table_size (uint32_t size);
|
||||
void set_route_table (uint32_t table_index, boost::shared_ptr<ARDOUR::Route>);
|
||||
bool set_route_table (uint32_t table_index, uint32_t remote_control_id);
|
||||
|
||||
void route_set_rec_enable (uint32_t table_index, bool yn);
|
||||
bool route_get_rec_enable (uint32_t table_index);
|
||||
|
||||
float route_get_gain (uint32_t table_index);
|
||||
void route_set_gain (uint32_t table_index, float);
|
||||
float route_get_effective_gain (uint32_t table_index);
|
||||
|
||||
float route_get_peak_input_power (uint32_t table_index, uint32_t which_input);
|
||||
|
||||
bool route_get_muted (uint32_t table_index);
|
||||
void route_set_muted (uint32_t table_index, bool);
|
||||
|
||||
bool route_get_soloed (uint32_t table_index);
|
||||
void route_set_soloed (uint32_t table_index, bool);
|
||||
|
||||
std::string route_get_name (uint32_t table_index);
|
||||
|
||||
virtual std::list<boost::shared_ptr<ARDOUR::Bundle> > bundles ();
|
||||
|
||||
virtual bool has_editor () const { return false; }
|
||||
virtual void* get_gui () const { return 0; }
|
||||
virtual void tear_down_gui () {}
|
||||
|
||||
XMLNode& get_state () const;
|
||||
int set_state (XMLNode const&, int version);
|
||||
|
||||
static const std::string state_node_name;
|
||||
|
||||
static StripableNotificationList const& last_selected () { return _last_selected; }
|
||||
static void notify_stripable_selection_changed (StripableNotificationListPtr);
|
||||
|
||||
protected:
|
||||
void next_track (uint32_t initial_id);
|
||||
void prev_track (uint32_t initial_id);
|
||||
|
||||
std::vector<boost::shared_ptr<ARDOUR::Route> > route_table;
|
||||
std::string _name;
|
||||
GlibEventLoopCallback glib_event_callback;
|
||||
virtual void event_loop_precall ();
|
||||
void install_precall_handler (Glib::RefPtr<Glib::MainContext>);
|
||||
|
||||
private:
|
||||
LIBCONTROLCP_LOCAL ControlProtocol (const ControlProtocol&); /* noncopyable */
|
||||
|
||||
bool _active;
|
||||
|
||||
static StripableNotificationList _last_selected;
|
||||
static PBD::ScopedConnection selection_connection;
|
||||
static bool selection_connected;
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
class ControlProtocolDescriptor
|
||||
{
|
||||
public:
|
||||
const char* name; /* descriptive */
|
||||
const char* id; /* unique and version-specific */
|
||||
void* ptr; /* protocol can store a value here */
|
||||
void* module; /* not for public access */
|
||||
int mandatory; /* if non-zero, always load and do not make optional */
|
||||
bool supports_feedback; /* if true, protocol has toggleable feedback mechanism */
|
||||
bool (*probe) (ControlProtocolDescriptor*);
|
||||
ControlProtocol* (*initialize) (ControlProtocolDescriptor*, Session*);
|
||||
void (*destroy) (ControlProtocolDescriptor*, ControlProtocol*);
|
||||
/* this is required if the control protocol connects to signals
|
||||
* from libardour. they all do. It should allocate a
|
||||
* type-specific request buffer for the calling thread, and
|
||||
* store it in a thread-local location that will be used to
|
||||
* find it when sending the event loop a message
|
||||
* (e.g. call_slot()). It should also return the allocated
|
||||
* buffer as a void*.
|
||||
*/
|
||||
void* (*request_buffer_factory) (uint32_t);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/* this is where the strange inheritance pattern hits the wall. A control
|
||||
protocol thread/event loop is inherited from AbstractUI, but the precall
|
||||
handler is inherited from ControlProtocol. When the AbstractUI sets up the
|
||||
event loop, it will call attach_request_source() which will in turn pass a
|
||||
Glib::MainContext to maybe_install_precall_handler(). We override the
|
||||
definition of that method here to make it actuall install the
|
||||
ControlProtocol's handler.
|
||||
*/
|
||||
|
||||
#define CONTROL_PROTOCOL_THREADS_NEED_TEMPO_MAP_DECL() \
|
||||
void maybe_install_precall_handler (Glib::RefPtr<Glib::MainContext> ctxt) { install_precall_handler (ctxt); }
|
||||
|
||||
|
||||
#endif // ardour_control_protocols_h
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (C) 2012-2016 Paul Davis <paul@linuxaudiosystems.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __ardour_control_protocol_types_h__
|
||||
#define __ardour_control_protocol_types_h__
|
||||
|
||||
#include <vector>
|
||||
#include <boost/smart_ptr.hpp>
|
||||
|
||||
namespace ARDOUR {
|
||||
class Route;
|
||||
class Stripable;
|
||||
|
||||
typedef std::vector<boost::weak_ptr<ARDOUR::Route> > RouteNotificationList;
|
||||
typedef boost::shared_ptr<RouteNotificationList> RouteNotificationListPtr;
|
||||
typedef std::vector<boost::shared_ptr<ARDOUR::Route> > StrongRouteNotificationList;
|
||||
|
||||
typedef std::vector<boost::weak_ptr<ARDOUR::Stripable> > StripableNotificationList;
|
||||
typedef boost::shared_ptr<StripableNotificationList> StripableNotificationListPtr;
|
||||
typedef std::vector<boost::shared_ptr<ARDOUR::Stripable> > StrongStripableNotificationList;
|
||||
}
|
||||
|
||||
#endif /* __ardour_control_protocol_types_h__ */
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright (C) 2013-2015 Paul Davis <paul@linuxaudiosystems.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __libcontrolcp_visibility_h__
|
||||
#define __libcontrolcp_visibility_h__
|
||||
|
||||
#if defined(COMPILER_MSVC)
|
||||
#define LIBCONTROLCP_DLL_IMPORT __declspec(dllimport)
|
||||
#define LIBCONTROLCP_DLL_EXPORT __declspec(dllexport)
|
||||
#define LIBCONTROLCP_DLL_LOCAL
|
||||
#else
|
||||
#define LIBCONTROLCP_DLL_IMPORT __attribute__ ((visibility ("default")))
|
||||
#define LIBCONTROLCP_DLL_EXPORT __attribute__ ((visibility ("default")))
|
||||
#define LIBCONTROLCP_DLL_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
#endif
|
||||
|
||||
#ifdef LIBCONTROLCP_DLL_EXPORTS // defined if we are building the libcontrolcp DLL (instead of using it)
|
||||
#define LIBCONTROLCP_API LIBCONTROLCP_DLL_EXPORT
|
||||
#else
|
||||
#define LIBCONTROLCP_API LIBCONTROLCP_DLL_IMPORT
|
||||
#endif
|
||||
#define LIBCONTROLCP_LOCAL LIBCONTROLCP_DLL_LOCAL
|
||||
|
||||
/* These should be used by surfaces/control interfaces. They use (probably)
|
||||
* libcontrolcp but they are not part of it. The idea here is to avoid
|
||||
* having to define per-surface macros for each and every surface. Instead,
|
||||
* every surface defines ARDOURSURFACE_DLL_EXPORTS during building and
|
||||
* uses ARDOURSURFACE_API in its declarations.
|
||||
*/
|
||||
|
||||
#ifdef ARDOURSURFACE_DLL_EXPORTS // defined if we are building the libcontrolcp DLL (instead of using it)
|
||||
#define ARDOURSURFACE_API LIBCONTROLCP_DLL_EXPORT
|
||||
#else
|
||||
#define ARDOURSURFACE_API LIBCONTROLCP_DLL_IMPORT
|
||||
#endif
|
||||
#define ARDOURSURFACE_LOCAL LIBCONTROLCP_DLL_LOCAL
|
||||
|
||||
|
||||
#endif /* __libcontrolcp_visibility_h__ */
|
||||
40
libs/ctrl-interface/control_protocol/wscript
Normal file
40
libs/ctrl-interface/control_protocol/wscript
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/env python
|
||||
from waflib.extras import autowaf as autowaf
|
||||
import os
|
||||
|
||||
# Mandatory variables
|
||||
top = '.'
|
||||
out = 'build'
|
||||
|
||||
controlcp_sources = [
|
||||
'basic_ui.cc',
|
||||
'control_protocol.cc',
|
||||
]
|
||||
|
||||
def options(opt):
|
||||
autowaf.set_options(opt)
|
||||
|
||||
def configure(conf):
|
||||
pass
|
||||
|
||||
def build(bld):
|
||||
if bld.is_defined ('INTERNAL_SHARED_LIBS'):
|
||||
obj = bld.shlib(features = 'c cxx cshlib cxxshlib', source=controlcp_sources)
|
||||
# defines for this library
|
||||
obj.defines = [ 'LIBCONTROLCP_DLL_EXPORTS' ]
|
||||
else:
|
||||
obj = bld.stlib(features = 'c cxx cstlib cxxstlib', source=controlcp_sources)
|
||||
obj.cxxflags = [ bld.env['compiler_flags_dict']['pic'] ]
|
||||
obj.defines = [ ]
|
||||
|
||||
obj.export_includes = ['.', './control_protocol' ]
|
||||
obj.defines += [ 'PACKAGE="ardour_cp"' ]
|
||||
obj.includes = ['.', './control_protocol']
|
||||
obj.name = 'libardour_cp'
|
||||
obj.target = 'ardourcp'
|
||||
obj.use = 'libardour libpbd'
|
||||
obj.uselib = 'GLIBMM SIGCPP XML OSX'
|
||||
obj.install_path = bld.env['LIBDIR']
|
||||
|
||||
def shutdown():
|
||||
autowaf.shutdown()
|
||||
Loading…
Add table
Add a link
Reference in a new issue