From ea074c609f70f900a4880590b001954ef1d10a91 Mon Sep 17 00:00:00 2001 From: bill auger Date: Sat, 19 Dec 2015 02:48:43 -0500 Subject: [PATCH] disable runtime features via cli args (issue #34) * recovers gracefully from audio device init failures * fixed testaudio caps * added Controls->audioToggle * added AvCaster::HandleCliParamsTerminating() * merged AvCaster::HandleCliParamsPreInit() and AvCaster::HandleCliParamsPostInit() into AvCaster::ProcessCliParams() * added Gstreamer::RemoveElement() , Gstreamer::IsInBin() * added AvCaster::GetIsChatEnabled() , AvCaster::IsInitialized , AvCaster::GetIsInitialized() * removed AvCaster::GetGuiXwinHandle() * renamed AvCasterStore->toogleControl() to AvCasterStore->revertControl() * renamed Gstreamer::PreviewSink to Gstreamer::PreviewRealSink * added Gstreamer::PreviewQueue , Gstreamer::PreviewFauxSink * added Gstreamer::AudioAlsaSource , Gstreamer::AudioPulseSource , Gstreamer::AudioJackSource , Gstreamer::AudioTestSource , Gstreamer::AudioCaps * added Gstreamer::PreviewXwin * added Gstreamer::ReloadConfig() * renamed all Gstreamer::Configure*Bin() to Gstreamer::Build*Bin() * renamed Gstreamer::ConfigureFauxVideo() to Gstreamer::ConfigureTestVideo() * renamed Gstreamer::ConfigureFauxAudio() to Gstreamer::ConfigureFauxSource() * removed Gstreamer::ConfigurePipeline() , Gstreamer::ReconfigureBin() , Gstreamer::RecreateBin() * added Gstreamer::SetMessageHandler() , Gstreamer::HandleMessage() , Gstreamer::HandleErrorMessage() * added Gstreamer::ConfigurePreview() , Gstreamer::ConfigureAudio() * removed Gstreamer::DeleteElement() , Gstreamer::DestroyBin() , Gstreamer::RecreateBin() * added Gstreamer::RemoveElement() , Gstreamer::DestroyElement() * added Gstreamer::GetElementId() , Gstreamer::GetPadId() , Gstreamer::IsInBin() * removed Gstreamer::GetVersionMajor() , Gstreamer::GetVersionMinor() --- .travis.yml | 3 + AvCaster.jucer | 2 +- .../MacOSX/AvCaster.xcodeproj/project.pbxproj | 8 +- Builds/MacOSX/Info.plist | 4 +- Builds/Makefile/Makefile | 8 +- Builds/Scripts/setup-build-helpers | 13 +- Builds/VisualStudio2008/AvCaster.vcproj | 4 +- Builds/VisualStudio2008/resources.rc | 6 +- Builds/VisualStudio2015/AvCaster.vcxproj | 4 +- Builds/VisualStudio2015/resources.rc | 6 +- JuceLibraryCode/JuceHeader.h | 4 +- README.md | 13 +- Source/AvCaster.cpp | 179 ++- Source/AvCaster.h | 14 +- Source/AvCasterStore.cpp | 6 +- Source/AvCasterStore.h | 12 +- Source/Background.h | 6 +- Source/Chat.cpp | 34 +- Source/Chat.h | 44 +- Source/ChatList.cpp | 34 +- Source/ChatList.h | 44 +- Source/ChatListItem.cpp | 34 +- Source/ChatListItem.h | 44 +- Source/Config.cpp | 19 +- Source/Config.h | 7 +- Source/Constants.h | 246 ++-- Source/Controls.cpp | 1082 +++++++++-------- Source/Controls.h | 196 +-- Source/Gstreamer.cpp | 652 ++++++---- Source/Gstreamer.h | 75 +- Source/IrcClient.cpp | 2 +- Source/IrcClient.h | 2 +- Source/Main.cpp | 18 +- Source/MainContent.h | 6 +- Source/Preset.h | 6 +- Source/PresetSeed.cpp | 8 +- Source/Presets.cpp | 1026 ++++++++-------- Source/Presets.h | 205 ++-- Source/Preview.h | 6 +- Source/Trace/TraceAvCaster.h | 158 ++- Source/Trace/TraceAvCasterStore.h | 7 +- Source/Trace/TraceGstreamer.h | 313 +++-- 42 files changed, 2472 insertions(+), 2088 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5dbcda7..68125ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,9 @@ script: - wget $LIBIRCCLIENT_MIRROR/$LIBIRCCLIENTDEV - sudo dpkg -i $LIBIRCCLIENT - sudo dpkg -i $LIBIRCCLIENTDEV + - mkdir libircclient + - cp /usr/include/libirc* libircclient/ + - sudo mv libircclient/ /usr/include/ - make CONFIG=Release # TARGET_ARCH='-march=x86-64' - # $BUILD_DIR/build/$PROJECT_NAME --version diff --git a/AvCaster.jucer b/AvCaster.jucer index 20ca353..8b02356 100644 --- a/AvCaster.jucer +++ b/AvCaster.jucer @@ -1,6 +1,6 @@ - diff --git a/Builds/MacOSX/AvCaster.xcodeproj/project.pbxproj b/Builds/MacOSX/AvCaster.xcodeproj/project.pbxproj index c60f398..471f08d 100644 --- a/Builds/MacOSX/AvCaster.xcodeproj/project.pbxproj +++ b/Builds/MacOSX/AvCaster.xcodeproj/project.pbxproj @@ -1446,8 +1446,8 @@ "_DEBUG=1", "DEBUG=1", "JUCER_XCODE_MAC_F6D2F4CF=1", - "JUCE_APP_VERSION=0.16.002", - "JUCE_APP_VERSION_HEX=0x1002", ); + "JUCE_APP_VERSION=0.16.003", + "JUCE_APP_VERSION_HEX=0x1003", ); GCC_VERSION = com.apple.compilers.llvm.clang.1_0; HEADER_SEARCH_PATHS = ("../../JuceLibraryCode", "../../JuceLibraryCode/modules", "$(inherited)"); INFOPLIST_FILE = Info.plist; @@ -1466,8 +1466,8 @@ "_NDEBUG=1", "NDEBUG=1", "JUCER_XCODE_MAC_F6D2F4CF=1", - "JUCE_APP_VERSION=0.16.002", - "JUCE_APP_VERSION_HEX=0x1002", ); + "JUCE_APP_VERSION=0.16.003", + "JUCE_APP_VERSION_HEX=0x1003", ); GCC_SYMBOLS_PRIVATE_EXTERN = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; HEADER_SEARCH_PATHS = ("../../JuceLibraryCode", "../../JuceLibraryCode/modules", "$(inherited)"); diff --git a/Builds/MacOSX/Info.plist b/Builds/MacOSX/Info.plist index 7b91447..cdd49ca 100644 --- a/Builds/MacOSX/Info.plist +++ b/Builds/MacOSX/Info.plist @@ -16,9 +16,9 @@ CFBundleSignature ???? CFBundleShortVersionString - 0.16.002 + 0.16.003 CFBundleVersion - 0.16.002 + 0.16.003 NSHumanReadableCopyright NSHighResolutionCapable diff --git a/Builds/Makefile/Makefile b/Builds/Makefile/Makefile index 8f54696..0142e09 100644 --- a/Builds/Makefile/Makefile +++ b/Builds/Makefile/Makefile @@ -18,12 +18,12 @@ ifeq ($(CONFIG),Debug) TARGET_ARCH := -march=native endif - CPPFLAGS := $(DEPFLAGS) -std=c++11 -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_9CCEB774=1" -D "JUCE_APP_VERSION=0.16.002" -D "JUCE_APP_VERSION_HEX=0x1002" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules + CPPFLAGS := $(DEPFLAGS) -std=c++11 -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_9CCEB774=1" -D "JUCE_APP_VERSION=0.16.003" -D "JUCE_APP_VERSION_HEX=0x1003" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0 `pkg-config --cflags gstreamer-1.0` CXXFLAGS += $(CFLAGS) LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -lX11 -lXext -lXinerama -ldl -lfreetype -lpthread -lrt -lircclient `pkg-config --libs gstreamer-1.0` `pkg-config --libs gstreamer-video-1.0` LDDEPS := - RESFLAGS := -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_9CCEB774=1" -D "JUCE_APP_VERSION=0.16.002" -D "JUCE_APP_VERSION_HEX=0x1002" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules + RESFLAGS := -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_9CCEB774=1" -D "JUCE_APP_VERSION=0.16.003" -D "JUCE_APP_VERSION_HEX=0x1003" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules TARGET := av-caster-dbg BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) CLEANCMD = rm -rf $(OUTDIR)/$(TARGET) $(OBJDIR) @@ -39,12 +39,12 @@ ifeq ($(CONFIG),Release) TARGET_ARCH := -march=native endif - CPPFLAGS := $(DEPFLAGS) -std=c++11 -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_9CCEB774=1" -D "JUCE_APP_VERSION=0.16.002" -D "JUCE_APP_VERSION_HEX=0x1002" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules + CPPFLAGS := $(DEPFLAGS) -std=c++11 -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_9CCEB774=1" -D "JUCE_APP_VERSION=0.16.003" -D "JUCE_APP_VERSION_HEX=0x1003" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -O3 `pkg-config --cflags gstreamer-1.0` CXXFLAGS += $(CFLAGS) LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -fvisibility=hidden -lX11 -lXext -lXinerama -ldl -lfreetype -lpthread -lrt -lircclient `pkg-config --libs gstreamer-1.0` `pkg-config --libs gstreamer-video-1.0` LDDEPS := - RESFLAGS := -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_9CCEB774=1" -D "JUCE_APP_VERSION=0.16.002" -D "JUCE_APP_VERSION_HEX=0x1002" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules + RESFLAGS := -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_9CCEB774=1" -D "JUCE_APP_VERSION=0.16.003" -D "JUCE_APP_VERSION_HEX=0x1003" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules TARGET := av-caster BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) CLEANCMD = rm -rf $(OUTDIR)/$(TARGET) $(OBJDIR) diff --git a/Builds/Scripts/setup-build-helpers b/Builds/Scripts/setup-build-helpers index 09c1cb1..4b6ed01 100755 --- a/Builds/Scripts/setup-build-helpers +++ b/Builds/Scripts/setup-build-helpers @@ -2,6 +2,8 @@ SCRIPTS_DIR="$(dirname "$(readlink -f "$0")")" PROJECT_DIR=$SCRIPTS_DIR/../../ +BASE_INC_DIR=/usr/include +LIBIRC_INC_DIR=$BASE_INC_DIR/libircclient/ cp $SCRIPTS_DIR/cppcheck-filtered $PROJECT_DIR/ ; chmod a+x $PROJECT_DIR/cppcheck-filtered ; @@ -10,4 +12,13 @@ cp $SCRIPTS_DIR/mk $PROJECT_DIR/ ; chmod a+x $PROJECT_DIR/mk cp $SCRIPTS_DIR/mk-clean $PROJECT_DIR/ ; chmod a+x $PROJECT_DIR/mk-clean ; cp $SCRIPTS_DIR/mk-reset $PROJECT_DIR/ ; chmod a+x $PROJECT_DIR/mk-reset ; -echo "copyied helper scripts to the project root directory - they can be now run from there" +echo "copied helper scripts to the project root directory - they can be now run from there" +if [ -d $LIBIRC_INC_DIR ] ; then + sudo cp $INC_DIR/libircclient.h $LIBIRC_INC_DIR + sudo cp $INC_DIR/libirc_errors.h $LIBIRC_INC_DIR + sudo cp $INC_DIR/libirc_events.h $LIBIRC_INC_DIR + sudo cp $INC_DIR/libirc_options.h $LIBIRC_INC_DIR + sudo cp $INC_DIR/libirc_rfcnumeric.h $LIBIRC_INC_DIR + + echo "copied libircclient headers to $LIBIRC_INC_DIR" +fi diff --git a/Builds/VisualStudio2008/AvCaster.vcproj b/Builds/VisualStudio2008/AvCaster.vcproj index b991649..215d61a 100644 --- a/Builds/VisualStudio2008/AvCaster.vcproj +++ b/Builds/VisualStudio2008/AvCaster.vcproj @@ -32,7 +32,7 @@ BufferSecurityCheck="" DebugInformationFormat="4" AdditionalIncludeDirectories="..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules" - PreprocessorDefinitions="WIN32;_WINDOWS;DEBUG;_DEBUG;JUCER_VS2008_78A5006=1;JUCE_APP_VERSION=0.16.002;JUCE_APP_VERSION_HEX=0x1002" + PreprocessorDefinitions="WIN32;_WINDOWS;DEBUG;_DEBUG;JUCER_VS2008_78A5006=1;JUCE_APP_VERSION=0.16.003;JUCE_APP_VERSION_HEX=0x1003" RuntimeLibrary="1" RuntimeTypeInfo="true" UsePrecompiledHeader="0" @@ -88,7 +88,7 @@ InlineFunctionExpansion="1" StringPooling="true" AdditionalIncludeDirectories="..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules" - PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;JUCER_VS2008_78A5006=1;JUCE_APP_VERSION=0.16.002;JUCE_APP_VERSION_HEX=0x1002" + PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;JUCER_VS2008_78A5006=1;JUCE_APP_VERSION=0.16.003;JUCE_APP_VERSION_HEX=0x1003" RuntimeLibrary="0" RuntimeTypeInfo="true" UsePrecompiledHeader="0" diff --git a/Builds/VisualStudio2008/resources.rc b/Builds/VisualStudio2008/resources.rc index 2a94315..f1037a4 100644 --- a/Builds/VisualStudio2008/resources.rc +++ b/Builds/VisualStudio2008/resources.rc @@ -7,16 +7,16 @@ #include VS_VERSION_INFO VERSIONINFO -FILEVERSION 0,16,002,0 +FILEVERSION 0,16,003,0 BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904E4" BEGIN VALUE "FileDescription", "AvCaster\0" - VALUE "FileVersion", "0.16.002\0" + VALUE "FileVersion", "0.16.003\0" VALUE "ProductName", "AvCaster\0" - VALUE "ProductVersion", "0.16.002\0" + VALUE "ProductVersion", "0.16.003\0" END END diff --git a/Builds/VisualStudio2015/AvCaster.vcxproj b/Builds/VisualStudio2015/AvCaster.vcxproj index e9de1d7..caaee00 100644 --- a/Builds/VisualStudio2015/AvCaster.vcxproj +++ b/Builds/VisualStudio2015/AvCaster.vcxproj @@ -58,7 +58,7 @@ Disabled EditAndContinue ..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;DEBUG;_DEBUG;JUCER_VS2015_78A5022=1;JUCE_APP_VERSION=0.16.002;JUCE_APP_VERSION_HEX=0x1002;%(PreprocessorDefinitions) + WIN32;_WINDOWS;DEBUG;_DEBUG;JUCER_VS2015_78A5022=1;JUCE_APP_VERSION=0.16.003;JUCE_APP_VERSION_HEX=0x1003;%(PreprocessorDefinitions) MultiThreadedDebug true @@ -99,7 +99,7 @@ Full ..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;NDEBUG;JUCER_VS2015_78A5022=1;JUCE_APP_VERSION=0.16.002;JUCE_APP_VERSION_HEX=0x1002;%(PreprocessorDefinitions) + WIN32;_WINDOWS;NDEBUG;JUCER_VS2015_78A5022=1;JUCE_APP_VERSION=0.16.003;JUCE_APP_VERSION_HEX=0x1003;%(PreprocessorDefinitions) MultiThreaded true diff --git a/Builds/VisualStudio2015/resources.rc b/Builds/VisualStudio2015/resources.rc index 2a94315..f1037a4 100644 --- a/Builds/VisualStudio2015/resources.rc +++ b/Builds/VisualStudio2015/resources.rc @@ -7,16 +7,16 @@ #include VS_VERSION_INFO VERSIONINFO -FILEVERSION 0,16,002,0 +FILEVERSION 0,16,003,0 BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904E4" BEGIN VALUE "FileDescription", "AvCaster\0" - VALUE "FileVersion", "0.16.002\0" + VALUE "FileVersion", "0.16.003\0" VALUE "ProductName", "AvCaster\0" - VALUE "ProductVersion", "0.16.002\0" + VALUE "ProductVersion", "0.16.003\0" END END diff --git a/JuceLibraryCode/JuceHeader.h b/JuceLibraryCode/JuceHeader.h index 304b67c..264020c 100644 --- a/JuceLibraryCode/JuceHeader.h +++ b/JuceLibraryCode/JuceHeader.h @@ -30,8 +30,8 @@ namespace ProjectInfo { const char* const projectName = "AvCaster"; - const char* const versionString = "0.16.002"; - const int versionNumber = 0x1002; + const char* const versionString = "0.16.003"; + const int versionNumber = 0x1003; } #endif diff --git a/README.md b/README.md index 3820856..bca622e 100644 --- a/README.md +++ b/README.md @@ -121,10 +121,8 @@ $ ./build/av-caster Install the corresponding libraries as above for your system. -#### Developers and Designers +### Developers and Designers You will find in the Builds/Scripts directory some helper scripts to aid in building and debugging this application. Note that we are currently locked at JUCE v3.1.1 until [an issue affecting scaled monitor resolutions](http://www.juce.com/forum/topic/juce-v320-and-v401-apps-window-not-visible-scaled-monitor-resolutions) is resolved. This is not relevant to most development tasks, but if you must use the Introjucer GUI builder for design or project maintenance, please compile it from [this branch](https://github.com/bill-auger/JUCE/tree/v3-1-1). - -Note that branches other than 'master' tend to be rebased often so you may need to force pull those. ``` ### Build the Introjucer GUI builder and project manager ### $ git clone --depth 1 https://github.com/bill-auger/JUCE.git @@ -135,6 +133,13 @@ $ ./build/Introjucer ### Then select "Open" from the Introjucer "File" menu and browse to the AvCaster.jucer file in this project root directory. ### ``` +Note that branches other than 'master' tend to be rebased often so you may need to force pull those. Ideally, all branches should be a fast-foreward from master so that in most cases the cleanest way to re-sync is like: +``` +$ git fetch all +$ git checkout development +$ git reset --hard master +$ git merge upstream/development +``` ### Similar Projects @@ -153,7 +158,7 @@ Also, the original ffmpeg bash script with all of the features that this project [gstreamer]: http://gstreamer.freedesktop.org/ [lctv]: https://www.livecoding.tv/ [deb]: https://packagecloud.io/ninjam/av-caster -[wiki]: https://github.com/bill-auger/av-caster/wiki +[wiki]: https://github.com/bill-auger/av-caster/wiki/AvCaster-Wiki [tracker]: https://github.com/bill-auger/av-caster/issues [gitter-img]: https://badges.gitter.im/Join%20Chat.svg [gitter]: https://gitter.im/bill-auger/av-caster diff --git a/Source/AvCaster.cpp b/Source/AvCaster.cpp index b169178..7d6a525 100644 --- a/Source/AvCaster.cpp +++ b/Source/AvCaster.cpp @@ -31,7 +31,8 @@ ScopedPointer AvCaster::Store ; // Initialize() MainContent* AvCaster::Gui = nullptr ; // Initialize() ScopedPointer AvCaster::Irc = nullptr ; // Initialize() -StringArray AvCaster::CliParams ; // initialize() +StringArray AvCaster::CliParams ; // Initialize() +bool AvCaster::IsInitialized = false ; // Initialize() bool AvCaster::IsMediaEnabled = true ; // HandleCliParamsPreInit() bool AvCaster::IsScreenEnabled = true ; // HandleCliParamsPreInit() bool AvCaster::IsCameraEnabled = true ; // HandleCliParamsPreInit() @@ -41,8 +42,8 @@ bool AvCaster::IsCompositorEnabled = true ; // HandleCliP bool AvCaster::IsPreviewEnabled = true ; // HandleCliParamsPreInit() bool AvCaster::IsAudioEnabled = true ; // HandleCliParamsPreInit() bool AvCaster::IsChatEnabled = true ; // HandleCliParamsPreInit() -Array AvCaster::Alerts ; -bool AvCaster::IsAlertModal = false ; // Warning() , Error() +Array AvCaster::Alerts ; // Warning() , Error() +bool AvCaster::IsAlertModal = false ; // GetModalCb() , OnModalDismissed() /* AvCaster public class methods */ @@ -75,6 +76,8 @@ ModalComponentManager::Callback* AvCaster::GetModalCb() void AvCaster::OnModalDismissed(int result , int unused) { IsAlertModal = false ; } +bool AvCaster::GetIsInitialized() { return IsInitialized ; } + bool AvCaster::GetIsMediaEnabled() { return IsMediaEnabled ; } bool AvCaster::GetIsScreenEnabled() { return IsScreenEnabled ; } @@ -91,7 +94,7 @@ bool AvCaster::GetIsPreviewEnabled() { return IsPreviewEnabled ; } bool AvCaster::GetIsAudioEnabled() { return IsAudioEnabled ; } -void* AvCaster::GetGuiXwinHandle() { return Gui->getWindowHandle() ; } +bool AvCaster::GetIsChatEnabled() { return IsChatEnabled ; } Rectangle AvCaster::GetPreviewBounds() { return Gui->getPreviewBounds() ; } @@ -102,6 +105,8 @@ DEBUG_TRACE_SET_CONFIG Store->setConfig(a_key , a_value) ; } +ValueTree AvCaster::GetConfigStore() { return ValueTree(Store->config) ; } + void AvCaster::StorePreset(String preset_name) { Store->storePreset(preset_name) ; } void AvCaster::RenamePreset(String preset_name) { Store->renamePreset(preset_name) ; } @@ -125,7 +130,7 @@ bool AvCaster::SetPreset(String preset_name , int option_n) DEBUG_TRACE_HANDLE_PRESETCOMBO // reject empty preset name - if (!is_valid_option) if (is_empty) return false ; + if (!is_valid_option && is_empty) return false ; // rename preset , restore selection , or commit preset change if (should_rename_preset) RenamePreset(preset_name) ; @@ -135,8 +140,6 @@ DEBUG_TRACE_HANDLE_PRESETCOMBO return true ; } -ValueTree AvCaster::GetConfigStore() { return Store->config ; } - bool AvCaster::RejectPresetChange() { bool is_output_on = bool(Store->config[CONFIG::IS_OUTPUT_ACTIVE_ID]) ; @@ -249,43 +252,11 @@ bool AvCaster::Initialize(MainContent* main_content) Gui = main_content ; CliParams = JUCEApplicationBase::getCommandLineParameterArray() ; - // debug feature switches -#ifdef NO_INITIALIZE_MEDIA - CliParams.add(APP::CLI_DISABLE_MEDIA_TOKEN) ; -#endif // NO_INITIALIZE_MEDIA -#ifdef SCREEN_ONLY - CliParams.add(APP::CLI_SCREEN_ONLY_TOKEN) ; -#endif // SCREEN_ONLY -#ifdef CAMERA_ONLY - CliParams.add(APP::CLI_CAMERA_ONLY_TOKEN) ; -#endif // CAMERA_ONLY -#ifdef TEXT_ONLY -# ifndef DISABLE_TEXT_BIN - CliParams.add(APP::CLI_TEXT_ONLY_TOKEN) ; -# endif // DISABLE_TEXT_BIN -#endif // TEXT_ONLY -#ifdef IMAGE_ONLY -# ifndef DISABLE_IMAGE_BIN - CliParams.add(APP::CLI_IMAGE_ONLY_TOKEN) ; -# endif // DISABLE_IMAGE_BIN -#endif // IMAGE_ONLY -#if NO_INITIALIZE_PREVIEW - CliParams.add(APP::CLI_DISABLE_PREVIEW_TOKEN) ; -#endif // NO_INITIALIZE_PREVIEW -#if NO_INITIALIZE_AUDIO - CliParams.add(APP::CLI_DISABLE_AUDIO_TOKEN) ; -#endif // NO_INITIALIZE_AUDIO -#ifdef NO_INSTANTIATE_IRC - CliParams.add(APP::CLI_DISABLE_CHAT_TOKEN) ; -#endif // NO_INSTANTIATE_IRC -#ifdef DISABLE_TEXT_BIN - IsTextEnabled = false ; -#endif // DISABLE_TEXT_BIN -#ifdef DISABLE_IMAGE_BIN - IsImageEnabled = false ; -#endif // DISABLE_IMAGE_BIN - - if (!HandleCliParamsPreInit()) return false ; + CliParams.removeEmptyStrings() ; CliParams.removeDuplicates(false) ; + +DEBUG_DISABLE_FEATURES + + if (HandleCliParamsTerminating()) return false ; DEBUG_TRACE_INIT_PHASE_1 @@ -299,28 +270,30 @@ DEBUG_TRACE_INIT_PHASE_2 DEBUG_TRACE_INIT_PHASE_3 // initialze GUI - Gui->initialize(Store->servers) ; SetWindowTitle() ; RefreshGui() ; + Gui->initialize(Store->servers) ; SetWindowTitle() ; + + if (!ProcessCliParams()) return false ; DEBUG_TRACE_INIT_PHASE_4 // initialize libgtreamer - if (IsMediaEnabled && !Gstreamer::Initialize()) return false ; + if (GetIsMediaEnabled() && !Gstreamer::Initialize(Gui->getWindowHandle())) return false ; DEBUG_TRACE_INIT_PHASE_5 // initialize libircclient - if (IsChatEnabled && (Irc = new IrcClient(Store->servers)) == nullptr) return false ; + if (GetIsChatEnabled() && (Irc = new IrcClient(Store->servers)) == nullptr) return false ; DEBUG_TRACE_INIT_PHASE_6 - if (!HandleCliParamsPostInit()) return false ; - - SetStatusL(GUI::READY_STATUS_TEXT) ; + // finalize initialization + StorePreset(GetPresetName()) ; RefreshGui() ; + IsInitialized = Gstreamer::IsInitialized() ; // subscribe to model change events Store->listen(true) ; - return true ; + return IsInitialized ; } void AvCaster::Shutdown() @@ -330,15 +303,13 @@ void AvCaster::Shutdown() DEBUG_TRACE_SHUTDOWN_PHASE_1 // shutdown network - if (IsChatEnabled && Irc != nullptr && Irc->isThreadRunning()) Irc->stopThread(5000) ; + if (GetIsChatEnabled() && Irc != nullptr && Irc->isThreadRunning()) Irc->stopThread(500) ; Irc = nullptr ; -#ifndef NO_INITIALIZE_MEDIA DEBUG_TRACE_SHUTDOWN_PHASE_2 // shutdown media - Gstreamer::Shutdown() ; -#endif // NO_INITIALIZE_MEDIA + if (GetIsMediaEnabled()) Gstreamer::Shutdown() ; DEBUG_TRACE_SHUTDOWN_PHASE_3 @@ -350,10 +321,10 @@ void AvCaster::HandleTimer(int timer_id) { switch (timer_id) { - case APP::GUI_TIMER_HI_ID: break ; - case APP::GUI_TIMER_MED_ID: UpdateStatusGUI() ; DisplayAlert() ; break ; - case APP::GUI_TIMER_LO_ID: if (IsChatEnabled) Irc->startThread() ; break ; - default: break ; + case APP::TIMER_HI_ID: break ; + case APP::TIMER_MED_ID: UpdateStatusGUI() ; DisplayAlert() ; break ; + case APP::TIMER_LO_ID: if (IsChatEnabled) Irc->startThread() ; break ; + default: break ; } } @@ -378,7 +349,7 @@ void AvCaster::HandleConfigChanged(const Identifier& a_key) Gui->chat->updateVisiblilty() ; // reconfigure gStreamer element - bool is_config_pending = bool(Store->root[CONFIG::IS_PENDING_ID ]) ; + bool is_config_pending = bool(Store->root[CONFIG::IS_PENDING_ID]) ; if (Gstreamer::Reconfigure(a_key , is_config_pending)) { StorePreset(GetPresetName()) ; @@ -387,10 +358,13 @@ void AvCaster::HandleConfigChanged(const Identifier& a_key) a_key == CONFIG::PRESET_ID ) RefreshGui() ; else if (a_key == CONFIG::IS_OUTPUT_ACTIVE_ID) SetWindowTitle() ; } - else - { - Store->toogleControl(a_key) ; RefreshGui() ; return ; - } + // FIXME: revertControl() is now unnecessary for audio button + // ideally it should be removed if we can handle all analagous errors gracefully + // revertControl() was introduced here to allow reverting failed control changes + // without this method firing again - but ideally that is precicely what should happen + // if the media class were capable of reconfiguring itself robustly to any configuration + else if (a_key != CONFIG::IS_AUDIO_ACTIVE_ID) { Store->revertControl(a_key) ; RefreshGui() ; } + else RefreshGui() ; } void AvCaster::RefreshGui() @@ -405,9 +379,13 @@ void AvCaster::RefreshGui() DEBUG_TRACE_REFRESH_GUI + // propogate configuration change to all interested panes Gui->background ->toFront(true) ; control_component->toFront(true) ; view_component ->toFront(true) ; + + // set statusbar text + if (GetIsInitialized()) SetStatusL(GUI::READY_STATUS_TEXT) ; } void AvCaster::SetWindowTitle() @@ -417,24 +395,24 @@ void AvCaster::SetWindowTitle() String title_text ; if (!is_output_active ) title_text = GUI::IDLE_TITLE_TEXT ; - else if (sink_idx == CONFIG::FILE_STREAM_IDX) title_text = GUI::FILE_TITLE_TEXT ; - else if (sink_idx == CONFIG::RTMP_STREAM_IDX) title_text = GUI::RTMP_TITLE_TEXT ; + else if (sink_idx == CONFIG::FILE_OUTPUT_IDX) title_text = GUI::FILE_TITLE_TEXT ; + else if (sink_idx == CONFIG::RTMP_OUTPUT_IDX) title_text = GUI::RTMP_TITLE_TEXT ; else return ; Gui->getTopLevelComponent()->setName(APP::APP_NAME + " - " + title_text) ; } -bool AvCaster::HandleCliParamsPreInit() +bool AvCaster::HandleCliParamsTerminating() { -DEBUG_TRACE_HANDLE_CLI_PARAMS_PRE_INIT +DEBUG_TRACE_HANDLE_CLI_PARAMS_TERMINATING - if (CliParams.contains(APP::CLI_VERSION_TOKEN)) - { printf("%s\n" , CHARSTAR(APP::CLI_VERSION_MSG)) ; return false ; } - else if (CliParams.contains(APP::CLI_HELP_TOKEN )) - { printf("%s\n" , CHARSTAR(APP::CLI_USAGE_MSG )) ; return false ; } + if (CliParams.contains(APP::CLI_HELP_TOKEN )) + { printf("%s\n" , CHARSTAR(APP::CLI_USAGE_MSG )) ; return true ; } else if (CliParams.contains(APP::CLI_PRESETS_TOKEN)) { - int n_presets = Store->presets.getNumChildren() ; if (n_presets == 0) return false ; + // load persistent configuration as normal + Store = new AvCasterStore() ; int n_presets = Store->presets.getNumChildren() ; + if (Store == nullptr || n_presets == 0) return true ; // dump preset indices and names then quit printf("Presets:\n") ; @@ -445,30 +423,19 @@ DEBUG_TRACE_HANDLE_CLI_PARAMS_PRE_INIT printf("\t%d: \"%s\"\n" , preset_n , CHARSTAR(preset_name)) ; } - return false ; + return true ; } - else if (CliParams.contains(APP::CLI_DISABLE_MEDIA_TOKEN )) - IsMediaEnabled = IsScreenEnabled = IsCameraEnabled = - IsTextEnabled = IsCompositorEnabled = IsPreviewEnabled = false ; - else if (CliParams.contains(APP::CLI_SCREEN_ONLY_TOKEN )) - IsCameraEnabled = IsTextEnabled = IsImageEnabled = IsCompositorEnabled = false ; - else if (CliParams.contains(APP::CLI_CAMERA_ONLY_TOKEN )) - IsScreenEnabled = IsTextEnabled = IsImageEnabled = IsCompositorEnabled = false ; - else if (CliParams.contains(APP::CLI_TEXT_ONLY_TOKEN )) - IsScreenEnabled = IsCameraEnabled = IsImageEnabled = IsCompositorEnabled = false ; - else if (CliParams.contains(APP::CLI_IMAGE_ONLY_TOKEN )) - IsScreenEnabled = IsCameraEnabled = IsTextEnabled = IsCompositorEnabled = false ; - else if (CliParams.contains(APP::CLI_DISABLE_PREVIEW_TOKEN)) IsPreviewEnabled = false ; - else if (CliParams.contains(APP::CLI_DISABLE_AUDIO_TOKEN )) IsAudioEnabled = false ; - else if (CliParams.contains(APP::CLI_DISABLE_CHAT_TOKEN )) IsChatEnabled = false ; + else if (CliParams.contains(APP::CLI_VERSION_TOKEN)) + { printf("%s\n" , CHARSTAR(APP::CLI_VERSION_MSG)) ; return true ; } - return true ; + return false ; } -bool AvCaster::HandleCliParamsPostInit() +bool AvCaster::ProcessCliParams() { -DEBUG_TRACE_HANDLE_CLI_PARAMS_POST_INIT +DEBUG_TRACE_HANDLE_CLI_PARAMS + // load initial configuration preset if (CliParams.contains(APP::CLI_PRESET_TOKEN)) { // set initial preset from cli param @@ -478,7 +445,35 @@ DEBUG_TRACE_HANDLE_CLI_PARAMS_POST_INIT if (~preset_idx) Store->setConfig(CONFIG::PRESET_ID , preset_idx) ; } - return true ; + // disable features + for (String* token = CliParams.begin() ; token != CliParams.end() ; ++token) + if (*token == APP::CLI_DISABLE_MEDIA_TOKEN ) + IsMediaEnabled = IsScreenEnabled = IsCameraEnabled = IsTextEnabled = + IsImageEnabled = IsCompositorEnabled = IsPreviewEnabled = IsAudioEnabled = false ; + else if (*token == APP::CLI_SCREEN_ONLY_TOKEN ) + IsCameraEnabled = IsTextEnabled = IsImageEnabled = false ; + else if (*token == APP::CLI_CAMERA_ONLY_TOKEN ) + IsScreenEnabled = IsTextEnabled = IsImageEnabled = false ; + else if (*token == APP::CLI_TEXT_ONLY_TOKEN ) + IsScreenEnabled = IsCameraEnabled = IsImageEnabled = false ; + else if (*token == APP::CLI_IMAGE_ONLY_TOKEN ) + IsScreenEnabled = IsCameraEnabled = IsTextEnabled = false ; + else if (*token == APP::CLI_DISABLE_PREVIEW_TOKEN) IsPreviewEnabled = false ; + else if (*token == APP::CLI_DISABLE_AUDIO_TOKEN ) IsAudioEnabled = false ; + else if (*token == APP::CLI_DISABLE_CHAT_TOKEN ) IsChatEnabled = false ; + + // assert dependent compositor elements (TODO: remove these restrictions allowing any configuration) + int n_video_inputs = static_cast(IsScreenEnabled) + static_cast(IsCameraEnabled) + + static_cast(IsTextEnabled ) + static_cast(IsImageEnabled ) ; + IsCompositorEnabled = n_video_inputs == APP::N_COMPOSITOR_INPUTS ; + IsPreviewEnabled = IsCompositorEnabled && IsPreviewEnabled ; + bool is_sane = n_video_inputs == APP::N_COMPOSITOR_INPUTS || + ( IsMediaEnabled && n_video_inputs < 2) || + (!IsMediaEnabled && n_video_inputs == 0) ; + +DUMP_DEBUG_MEDIA_SWITCHES + + return is_sane ; } bool AvCaster::ValidateEnvironment() diff --git a/Source/AvCaster.h b/Source/AvCaster.h index 9ed3e32..204736f 100644 --- a/Source/AvCaster.h +++ b/Source/AvCaster.h @@ -70,6 +70,7 @@ class AvCaster static void OnModalDismissed(int result , int unused) ; // getters/setters + static bool GetIsInitialized () ; static bool GetIsMediaEnabled () ; static bool GetIsScreenEnabled () ; static bool GetIsCameraEnabled () ; @@ -78,15 +79,15 @@ class AvCaster static bool GetIsCompositorEnabled() ; static bool GetIsPreviewEnabled () ; static bool GetIsAudioEnabled () ; - static void* GetGuiXwinHandle () ; + static bool GetIsChatEnabled () ; static Rectangle GetPreviewBounds () ; static void SetConfig (const Identifier& a_key , var a_value) ; + static ValueTree GetConfigStore () ; static void StorePreset (String preset_name) ; static void RenamePreset (String preset_name) ; static void DeletePreset () ; static void ResetPreset () ; static bool SetPreset (String preset_name , int option_n) ; - static ValueTree GetConfigStore () ; static bool RejectPresetChange () ; static bool IsStaticPreset () ; static int GetPresetIdx () ; @@ -124,10 +125,10 @@ class AvCaster static void SetWindowTitle () ; // helpers - static bool HandleCliParamsPreInit () ; - static bool HandleCliParamsPostInit() ; - static bool ValidateEnvironment () ; - static void DisplayAlert () ; + static bool HandleCliParamsTerminating() ; + static bool ProcessCliParams () ; + static bool ValidateEnvironment () ; + static void DisplayAlert () ; static MainContent* Gui ; @@ -140,6 +141,7 @@ class AvCaster static ScopedPointer Store ; // runtime features + static bool IsInitialized ; static bool IsMediaEnabled ; static bool IsScreenEnabled ; static bool IsCameraEnabled ; diff --git a/Source/AvCasterStore.cpp b/Source/AvCasterStore.cpp index c2a1b46..d806915 100644 --- a/Source/AvCasterStore.cpp +++ b/Source/AvCasterStore.cpp @@ -553,6 +553,8 @@ DEBUG_TRACE_STORE_SERVER void AvCasterStore::listen(bool should_listen) { + if (!AvCaster::GetIsInitialized()) return ; + if (should_listen) { this->root.addListener (this) ; this->config.addListener (this) ; } else { this->root.removeListener(this) ; this->config.removeListener(this) ; } } @@ -618,9 +620,9 @@ StringArray AvCasterStore::getCameraResolutions() return StringArray::fromLines(STRING(camera_store[CONFIG::CAMERA_RESOLUTIONS_ID])) ; } -void AvCasterStore::toogleControl(const Identifier& a_key) +void AvCasterStore::revertControl(const Identifier& a_key) { -DEBUG_TRACE_TOGGLE_CONTROL +DEBUG_TRACE_REVERT_CONTROL listen(false) ; setConfig(a_key , !bool(this->config[a_key])) ; diff --git a/Source/AvCasterStore.h b/Source/AvCasterStore.h index 1467c9a..9df84fc 100644 --- a/Source/AvCasterStore.h +++ b/Source/AvCasterStore.h @@ -37,20 +37,14 @@ class AvCasterStore : ValueTree::Listener ~AvCasterStore() ; - - enum AudioApi { ALSA_AUDIO , PULSE_AUDIO , JACK_AUDIO } ; - enum AudioCodec { MP3_AUDIO , AAC_AUDIO } ; - enum OutputStream { FILE_OUTPUT , RTMP_OUTPUT } ; + // class helpers + static StringArray PropertyValues(ValueTree root_node , Identifier property_id) ; private: AvCasterStore() ; - // class helpers - static StringArray PropertyValues(ValueTree root_node , Identifier property_id) ; - - // persistence ValueTree verifyConfig (ValueTree config_store , Identifier root_node_id) ; ValueTree getOrCreatePresets() ; @@ -108,7 +102,7 @@ class AvCasterStore : ValueTree::Listener StringArray audioNames () ; ValueTree getCameraConfig () ; StringArray getCameraResolutions() ; - void toogleControl (const Identifier& a_key) ; + void revertControl (const Identifier& a_key) ; void setConfig (const Identifier& a_key , var a_value) ; void updateIrcHost (StringArray alias_uris , String actual_host) ; #ifdef PREFIX_CHAT_NICKS diff --git a/Source/Background.h b/Source/Background.h index 2fc6cc5..b79beb9 100644 --- a/Source/Background.h +++ b/Source/Background.h @@ -16,8 +16,8 @@ |*| along with AvCaster. If not, see . \*/ -#ifndef __JUCE_HEADER_1288B153F353A5D8__ -#define __JUCE_HEADER_1288B153F353A5D8__ +#ifndef _BACKGROUND_H_ +#define _BACKGROUND_H_ //[Headers] -- You can add your own extra header files here -- @@ -64,4 +64,4 @@ class Background : public Component //[EndFile] You can add extra defines here... //[/EndFile] -#endif // __JUCE_HEADER_1288B153F353A5D8__ +#endif // _BACKGROUND_H_ diff --git a/Source/Chat.cpp b/Source/Chat.cpp index 4ed7f4f..6908b72 100644 --- a/Source/Chat.cpp +++ b/Source/Chat.cpp @@ -1,21 +1,21 @@ -/* - ============================================================================== +/*\ +|*| Copyright 2015 bill-auger +|*| +|*| This file is part of the AvCaster program. +|*| +|*| AvCaster is free software: you can redistribute it and/or modify +|*| it under the terms of the GNU Lesser General Public License version 3 +|*| as published by the Free Software Foundation. +|*| +|*| AvCaster 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 Lesser General Public License for more details. +|*| +|*| You should have received a copy of the GNU Lesser General Public License +|*| along with AvCaster. If not, see . +\*/ - This is an automatically generated GUI class created by the Introjucer! - - Be careful when adding custom code to these files, as only the code within - the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded - and re-saved. - - Created with Introjucer version: 3.1.1 - - ------------------------------------------------------------------------------ - - The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-13 by Raw Material Software Ltd. - - ============================================================================== -*/ //[Headers] You can add your own extra header files here... diff --git a/Source/Chat.h b/Source/Chat.h index 19ef4ea..7dd7dad 100644 --- a/Source/Chat.h +++ b/Source/Chat.h @@ -1,24 +1,24 @@ -/* - ============================================================================== - - This is an automatically generated GUI class created by the Introjucer! - - Be careful when adding custom code to these files, as only the code within - the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded - and re-saved. - - Created with Introjucer version: 3.1.1 - - ------------------------------------------------------------------------------ - - The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-13 by Raw Material Software Ltd. - - ============================================================================== -*/ - -#ifndef __JUCE_HEADER_8B23E8CA1D72080__ -#define __JUCE_HEADER_8B23E8CA1D72080__ +/*\ +|*| Copyright 2015 bill-auger +|*| +|*| This file is part of the AvCaster program. +|*| +|*| AvCaster is free software: you can redistribute it and/or modify +|*| it under the terms of the GNU Lesser General Public License version 3 +|*| as published by the Free Software Foundation. +|*| +|*| AvCaster 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 Lesser General Public License for more details. +|*| +|*| You should have received a copy of the GNU Lesser General Public License +|*| along with AvCaster. If not, see . +\*/ + + +#ifndef _CHAT_H_ +#define _CHAT_H_ //[Headers] -- You can add your own extra header files here -- @@ -100,4 +100,4 @@ class Chat : public Component, //[EndFile] You can add extra defines here... //[/EndFile] -#endif // __JUCE_HEADER_8B23E8CA1D72080__ +#endif // _CHAT_H_ diff --git a/Source/ChatList.cpp b/Source/ChatList.cpp index 1f49eef..e3ed308 100644 --- a/Source/ChatList.cpp +++ b/Source/ChatList.cpp @@ -1,21 +1,21 @@ -/* - ============================================================================== +/*\ +|*| Copyright 2015 bill-auger +|*| +|*| This file is part of the AvCaster program. +|*| +|*| AvCaster is free software: you can redistribute it and/or modify +|*| it under the terms of the GNU Lesser General Public License version 3 +|*| as published by the Free Software Foundation. +|*| +|*| AvCaster 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 Lesser General Public License for more details. +|*| +|*| You should have received a copy of the GNU Lesser General Public License +|*| along with AvCaster. If not, see . +\*/ - This is an automatically generated GUI class created by the Introjucer! - - Be careful when adding custom code to these files, as only the code within - the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded - and re-saved. - - Created with Introjucer version: 3.1.1 - - ------------------------------------------------------------------------------ - - The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-13 by Raw Material Software Ltd. - - ============================================================================== -*/ //[Headers] You can add your own extra header files here... diff --git a/Source/ChatList.h b/Source/ChatList.h index 26aa043..d5b951b 100644 --- a/Source/ChatList.h +++ b/Source/ChatList.h @@ -1,24 +1,24 @@ -/* - ============================================================================== - - This is an automatically generated GUI class created by the Introjucer! - - Be careful when adding custom code to these files, as only the code within - the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded - and re-saved. - - Created with Introjucer version: 3.1.1 - - ------------------------------------------------------------------------------ - - The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-13 by Raw Material Software Ltd. - - ============================================================================== -*/ - -#ifndef __JUCE_HEADER_CF0070E7070C0E60__ -#define __JUCE_HEADER_CF0070E7070C0E60__ +/*\ +|*| Copyright 2015 bill-auger +|*| +|*| This file is part of the AvCaster program. +|*| +|*| AvCaster is free software: you can redistribute it and/or modify +|*| it under the terms of the GNU Lesser General Public License version 3 +|*| as published by the Free Software Foundation. +|*| +|*| AvCaster 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 Lesser General Public License for more details. +|*| +|*| You should have received a copy of the GNU Lesser General Public License +|*| along with AvCaster. If not, see . +\*/ + + +#ifndef _CHATLIST_H_ +#define _CHATLIST_H_ //[Headers] -- You can add your own extra header files here -- @@ -84,4 +84,4 @@ class ChatList : public Component, //[EndFile] You can add extra defines here... //[/EndFile] -#endif // __JUCE_HEADER_CF0070E7070C0E60__ +#endif // _CHATLIST_H_ diff --git a/Source/ChatListItem.cpp b/Source/ChatListItem.cpp index ce5086e..63d8427 100644 --- a/Source/ChatListItem.cpp +++ b/Source/ChatListItem.cpp @@ -1,21 +1,21 @@ -/* - ============================================================================== +/*\ +|*| Copyright 2015 bill-auger +|*| +|*| This file is part of the AvCaster program. +|*| +|*| AvCaster is free software: you can redistribute it and/or modify +|*| it under the terms of the GNU Lesser General Public License version 3 +|*| as published by the Free Software Foundation. +|*| +|*| AvCaster 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 Lesser General Public License for more details. +|*| +|*| You should have received a copy of the GNU Lesser General Public License +|*| along with AvCaster. If not, see . +\*/ - This is an automatically generated GUI class created by the Introjucer! - - Be careful when adding custom code to these files, as only the code within - the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded - and re-saved. - - Created with Introjucer version: 3.1.1 - - ------------------------------------------------------------------------------ - - The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-13 by Raw Material Software Ltd. - - ============================================================================== -*/ //[Headers] You can add your own extra header files here... diff --git a/Source/ChatListItem.h b/Source/ChatListItem.h index c8ae8af..aeb7d06 100644 --- a/Source/ChatListItem.h +++ b/Source/ChatListItem.h @@ -1,24 +1,24 @@ -/* - ============================================================================== - - This is an automatically generated GUI class created by the Introjucer! - - Be careful when adding custom code to these files, as only the code within - the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded - and re-saved. - - Created with Introjucer version: 3.1.1 - - ------------------------------------------------------------------------------ - - The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-13 by Raw Material Software Ltd. - - ============================================================================== -*/ - -#ifndef __JUCE_HEADER_B5AA576BA216A776__ -#define __JUCE_HEADER_B5AA576BA216A776__ +/*\ +|*| Copyright 2015 bill-auger +|*| +|*| This file is part of the AvCaster program. +|*| +|*| AvCaster is free software: you can redistribute it and/or modify +|*| it under the terms of the GNU Lesser General Public License version 3 +|*| as published by the Free Software Foundation. +|*| +|*| AvCaster 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 Lesser General Public License for more details. +|*| +|*| You should have received a copy of the GNU Lesser General Public License +|*| along with AvCaster. If not, see . +\*/ + + +#ifndef _CHATLISTITEM_H_ +#define _CHATLISTITEM_H_ //[Headers] -- You can add your own extra header files here -- #include "JuceHeader.h" @@ -70,4 +70,4 @@ class ChatListItem : public Component, //[EndFile] You can add extra defines here... //[/EndFile] -#endif // __JUCE_HEADER_B5AA576BA216A776__ +#endif // _CHATLISTITEM_H_ diff --git a/Source/Config.cpp b/Source/Config.cpp index bc01bc1..df77910 100644 --- a/Source/Config.cpp +++ b/Source/Config.cpp @@ -975,18 +975,17 @@ DEBUG_TRACE_CONFIG_LOAD_CONFIG int text_pos_idx = int (config_store[CONFIG::TEXT_POSITION_ID]) ; String motd_text = STRING(config_store[CONFIG::MOTD_TEXT_ID ]) ; String interstitial_text = STRING(config_store[CONFIG::IMAGE_ID ]) ; - int output_sink_idx = int (config_store[CONFIG::OUTPUT_SINK_ID ]) ; + int output_idx = int (config_store[CONFIG::OUTPUT_SINK_ID ]) ; String output_w_text = STRING(config_store[CONFIG::OUTPUT_W_ID ]) ; String output_h_text = STRING(config_store[CONFIG::OUTPUT_H_ID ]) ; int framerate_idx = int (config_store[CONFIG::FRAMERATE_ID ]) ; int video_bitrate_idx = int (config_store[CONFIG::VIDEO_BITRATE_ID]) ; String output_dest_text = STRING(config_store[CONFIG::OUTPUT_DEST_ID ]) ; - bool is_lctv = AvCaster::GetPresetIdx() == CONFIG::LCTV_PRESET_IDX ; - String output_sink = CONFIG::OUTPUT_SINKS[output_sink_idx] ; - String output_label_text = (is_lctv ) ? GUI::DEST_LCTV_TEXT : - (output_sink == CONFIG::FILE_OUTPUT) ? GUI::DEST_FILE_TEXT : - (output_sink == CONFIG::RTMP_OUTPUT) ? GUI::DEST_RTMP_TEXT : - "ERR" ; + bool is_lctv_preset = AvCaster::GetPresetIdx() == CONFIG::LCTV_PRESET_IDX ; + String output_label_text = (is_lctv_preset ) ? GUI::DEST_LCTV_TEXT : + (output_idx == CONFIG::FILE_OUTPUT_IDX) ? GUI::DEST_FILE_TEXT : + (output_idx == CONFIG::RTMP_OUTPUT_IDX) ? GUI::DEST_RTMP_TEXT : + "ERR" ; this->displaySlider ->setValue (display_n ) ; this->screenSlider ->setValue (screen_n ) ; @@ -1034,7 +1033,7 @@ DEBUG_TRACE_CONFIG_LOAD_CONFIG this->audioBitrateCombo->setSelectedItemIndex(audio_bitrate_idx , juce::dontSendNotification) ; this->textStyleCombo ->setSelectedItemIndex(text_style_idx , juce::dontSendNotification) ; this->textPosCombo ->setSelectedItemIndex(text_pos_idx , juce::dontSendNotification) ; - this->outputSinkCombo ->setSelectedItemIndex(output_sink_idx , juce::dontSendNotification) ; + this->outputSinkCombo ->setSelectedItemIndex(output_idx , juce::dontSendNotification) ; this->framerateCombo ->setSelectedItemIndex(framerate_idx , juce::dontSendNotification) ; this->videoBitrateCombo->setSelectedItemIndex(video_bitrate_idx , juce::dontSendNotification) ; @@ -1048,7 +1047,7 @@ void Config::enableComponents() this->audioCodecCombo->setEnabled(!is_static_preset) ; // TODO: videoCodecCombo this->outputSinkCombo->setEnabled(!is_static_preset) ; // TODO: outputMuxerCombo -#ifdef DISABLE_CONTROLS_NYI +#ifdef DISABLE_GUI_CONTROLS_NYI this->displaySlider ->setEnabled(false) ; this->screenSlider ->setEnabled(false) ; this->xOffsetText ->setEnabled(false) ; @@ -1061,7 +1060,7 @@ this->textStyleCombo ->setEnabled(false) ; this->textPosCombo ->setEnabled(false) ; this->interstitialText->setEnabled(false) ; this->browseButton ->setEnabled(false) ; -#endif // DISABLE_CONTROLS_NYI +#endif // DISABLE_GUI_CONTROLS_NYI } //[/MiscUserCode] diff --git a/Source/Config.h b/Source/Config.h index 05c9bf5..d8d0457 100644 --- a/Source/Config.h +++ b/Source/Config.h @@ -16,8 +16,9 @@ |*| along with AvCaster. If not, see . \*/ -#ifndef __JUCE_HEADER_21AE3B746DB36E0C__ -#define __JUCE_HEADER_21AE3B746DB36E0C__ + +#ifndef _CONFIG_H_ +#define _CONFIG_H_ //[Headers] -- You can add your own extra header files here -- @@ -138,4 +139,4 @@ class Config : public Component, //[EndFile] You can add extra defines here... //[/EndFile] -#endif // __JUCE_HEADER_21AE3B746DB36E0C__ +#endif // _CONFIG_H_ diff --git a/Source/Constants.h b/Source/Constants.h index 5f8f050..834ecfc 100644 --- a/Source/Constants.h +++ b/Source/Constants.h @@ -21,26 +21,25 @@ #define _CONSTANTS_H_ // enable standard features -// #define NO_INITIALIZE_MEDIA +#define DISABLE_CHAT +// #define DISABLE_MEDIA // #define SCREEN_ONLY // #define CAMERA_ONLY // #define TEXT_ONLY // #define IMAGE_ONLY -// #define NO_INITIALIZE_AUDIO -// #define FAUX_CAMERA // replace camera-real-source with fakesrc -// #define FAUX_AUDIO // replace audio-real-source with fakesrc -#define NO_INITIALIZE_PREVIEW (! JUCE_LINUX) // replace composite-sink with fakesink -// #define FAUX_OUTPUT // replace filesink or rtmpsink -// #define NO_INSTANTIATE_IRC +#define TEXT_BIN_NYI 1 +#define IMAGE_BIN_NYI 1 +#define DISABLE_GUI_CONTROLS_NYI +#define DISABLE_PREVIEW (! JUCE_LINUX) // replace preview-sink with fakesink +// #define FAUX_CAMERA // replace camera-real-source with fakesrc +// #define DISABLE_AUDIO // replace audio-real-source with fakesrc +// #define FAUX_OUTPUT // replace filesink or rtmpsink with fakesink // #define SUPRESS_ALERTS -#define DISABLE_TEXT_BIN -#define DISABLE_IMAGE_BIN -#define DISABLE_CONTROLS_NYI // debugging tweaks and kludges #define INJECT_DEFAULT_CAMERA_DEVICE_INFO #define FIX_OUTPUT_RESOLUTION_TO_LARGEST_INPUT -#define RESIZE_PREVIEW_BIN_INSTEAD_OF_RECREATE +// #define RESIZE_PREVIEW_BIN_INSTEAD_OF_RECREATE // #define DETACH_PREVIEW_BIN_INSTEAD_OF_RECREATE // #define DETACH_OUTPUT_BIN_INSTEAD_OF_RECREATE #define NATIVE_CAMERA_RESOLUTION_ONLY @@ -67,9 +66,9 @@ #define DEBUG_TRACE (DEBUG_DEFINED && 1) #define DEBUG_TRACE_EVENTS (DEBUG_DEFINED && 1) #define DEBUG_TRACE_GUI (DEBUG_DEFINED && 1) -#define DEBUG_TRACE_MEDIA (DEBUG_DEFINED && 0) +#define DEBUG_TRACE_MEDIA (DEBUG_DEFINED && 1) #define DEBUG_TRACE_CONFIG (DEBUG_DEFINED && 1) -#define DEBUG_TRACE_CHAT (DEBUG_DEFINED && 1) +#define DEBUG_TRACE_CHAT (DEBUG_DEFINED && 0) #define DEBUG_TRACE_STATE (DEBUG_DEFINED && 1) #define DEBUG_TRACE_VB (DEBUG_DEFINED && 0) @@ -95,15 +94,18 @@ namespace APP static const String REPLACE_CHARS = String::repeatedString("-" , FILTER_CHARS.length()) ; // timers - static const int GUI_TIMER_HI_ID = 1 ; static const int GUI_UPDATE_HI_IVL = 125 ; - static const int GUI_TIMER_MED_ID = 2 ; static const int GUI_UPDATE_MED_IVL = 500 ; - static const int GUI_TIMER_LO_ID = 3 ; static const int GUI_UPDATE_LO_IVL = 1000 ; + static const int N_TIMERS = 3 ; + static const int TIMER_HI_ID = 1 ; static const int TIMER_HI_IVL = 125 ; + static const int TIMER_MED_ID = 2 ; static const int TIMER_MED_IVL = 500 ; + static const int TIMER_LO_ID = 3 ; static const int TIMER_LO_IVL = 1000 ; + static const int TIMER_IDS [N_TIMERS] = { TIMER_HI_ID , TIMER_MED_ID , TIMER_LO_ID } ; + static const int TIMER_IVLS[N_TIMERS] = { TIMER_HI_IVL , TIMER_MED_IVL , TIMER_LO_IVL } ; // cli args static const String CLI_HELP_TOKEN = "--help" ; static const String CLI_PRESETS_TOKEN = "--presets" ; - static const String CLI_PRESET_TOKEN = "--preset" ; static const String CLI_VERSION_TOKEN = "--version" ; + static const String CLI_PRESET_TOKEN = "--preset" ; static const String CLI_DISABLE_MEDIA_TOKEN = "--no-media" ; static const String CLI_SCREEN_ONLY_TOKEN = "--screen-only" ; static const String CLI_CAMERA_ONLY_TOKEN = "--camera-only" ; @@ -113,30 +115,40 @@ namespace APP static const String CLI_DISABLE_AUDIO_TOKEN = "--no-audio" ; static const String CLI_DISABLE_CHAT_TOKEN = "--no-chat" ; static const String CLI_VERSION_MSG = "AvCaster v" + String(ProjectInfo::versionString) ; - static const String CLI_USAGE_MSG = "AvCaster Usage:\n\n\tav-caster [ " + CLI_HELP_TOKEN + " ] |" + - "\n\t [ " + CLI_PRESETS_TOKEN + " ] |" + - "\n\t [ " + CLI_PRESET_TOKEN + " n ] |" + - "\n\t [ " + CLI_VERSION_TOKEN + " ] |" + - "\n\t [ " + CLI_DISABLE_MEDIA_TOKEN + " ] |" + - "\n\t [ " + CLI_SCREEN_ONLY_TOKEN + " ] |" + - "\n\t [ " + CLI_CAMERA_ONLY_TOKEN + " ] |" + - "\n\t [ " + CLI_TEXT_ONLY_TOKEN + " ] |" + - "\n\t [ " + CLI_IMAGE_ONLY_TOKEN + " ] |" + - "\n\t [ " + CLI_DISABLE_PREVIEW_TOKEN + " ] |" + - "\n\t [ " + CLI_DISABLE_AUDIO_TOKEN + " ] |" + - "\n\t [ " + CLI_DISABLE_CHAT_TOKEN + " ] |" + - "\n\n\t" + CLI_HELP_TOKEN + "\n\t\t\tprints this message" + - "\n\n\t" + CLI_PRESETS_TOKEN + "\n\t\t\tlist stored presets" + - "\n\n\t" + CLI_PRESET_TOKEN + " n" + "\n\t\t\tstart with initial preset number n" + - "\n\n\t" + CLI_VERSION_TOKEN + "\n\t\t\tprints the application version string" + - "\n\n\t" + CLI_DISABLE_MEDIA_TOKEN + "\n\t\t\tdisables all media and stream output (debugging)" + - "\n\n\t" + CLI_SCREEN_ONLY_TOKEN + "\n\t\t\tdisables compositing and uses screen capture only (debugging)" + - "\n\n\t" + CLI_CAMERA_ONLY_TOKEN + "\n\t\t\tdisables compositing and uses webcam capture only (debugging)" + - "\n\n\t" + CLI_TEXT_ONLY_TOKEN + "\n\t\t\tdisables compositing and uses text overlay only (debugging)" + - "\n\n\t" + CLI_IMAGE_ONLY_TOKEN + "\n\t\t\tdisables compositing and uses static image only (debugging)" + - "\n\n\t" + CLI_DISABLE_PREVIEW_TOKEN + "\n\t\t\tdisables realtime preview (debugging)" + - "\n\n\t" + CLI_DISABLE_AUDIO_TOKEN + "\n\t\t\tdisables audio capture (debugging)" + - "\n\n\t" + CLI_DISABLE_CHAT_TOKEN + "\n\t\t\tdisables chat (debugging)" ; + static const String CLI_USAGE_MSG = "AvCaster Usage:\n\n\tav-caster [ " + CLI_HELP_TOKEN + " | " + + CLI_PRESETS_TOKEN + " | " + + CLI_VERSION_TOKEN + " ]" + + "\n\n\tav-caster [ " + CLI_PRESET_TOKEN + " n ] " + + "\n\t [ " + CLI_DISABLE_MEDIA_TOKEN + " ] " + + "[ " + CLI_DISABLE_PREVIEW_TOKEN + " ] " + + "[ " + CLI_DISABLE_AUDIO_TOKEN + " ] " + + "[ " + CLI_DISABLE_CHAT_TOKEN + " ]" + + "\n\t [ " + CLI_SCREEN_ONLY_TOKEN + " | " + + " " + CLI_CAMERA_ONLY_TOKEN + " | " + + " " + CLI_TEXT_ONLY_TOKEN + " | " + + " " + CLI_IMAGE_ONLY_TOKEN + " ] " + + "\n\n\n\tINFORMATION:" + + "\n\n\t\t" + CLI_HELP_TOKEN + "\n\t\t\tprints this message and exits" + + "\n\n\t\t" + CLI_PRESETS_TOKEN + "\n\t\t\tlist stored presets and exits" + + "\n\n\t\t" + CLI_VERSION_TOKEN + "\n\t\t\tprints the application version string and exits" + + "\n\n\n\tCONFIGURATION:" + + "\n\n\t\t" + CLI_PRESET_TOKEN + " n" + "\n\t\t\tstarts " + APP_NAME + " with initial preset number n" + + "\n\n\n\tFEATURE SWITCHES:" + + "\n\n\t\t" + CLI_DISABLE_MEDIA_TOKEN + "\n\t\t\tdisables all media and stream output" + + "\n\n\t\t" + CLI_SCREEN_ONLY_TOKEN + "\n\t\t\tdisables compositing and uses screen capture only" + + "\n\n\t\t" + CLI_CAMERA_ONLY_TOKEN + "\n\t\t\tdisables compositing and uses webcam capture only" + + "\n\n\t\t" + CLI_TEXT_ONLY_TOKEN + "\n\t\t\tdisables compositing and uses text overlay only" + + "\n\n\t\t" + CLI_IMAGE_ONLY_TOKEN + "\n\t\t\tdisables compositing and uses static image only" + + "\n\n\t\t" + CLI_DISABLE_PREVIEW_TOKEN + "\n\t\t\tdisables realtime preview" + + "\n\n\t\t" + CLI_DISABLE_AUDIO_TOKEN + "\n\t\t\tdisables audio capture" + + "\n\n\t\t" + CLI_DISABLE_CHAT_TOKEN + "\n\t\t\tdisables chat" ; + +// NOTE: INPUTS are either mutually exclusive (compositor disabled) or must all be enabled (compositor enabled) +// N_COMPOSITOR_INPUTS is coupled to AvCaster::Is*Enabled flags in AvCaster::ProcessCliParams() +#define INPUTS String(APP::CLI_SCREEN_ONLY_TOKEN + newLine + APP::CLI_CAMERA_ONLY_TOKEN + \ + String((TEXT_BIN_NYI ) ? "" : newLine + APP::CLI_TEXT_ONLY_TOKEN) + \ + String((IMAGE_BIN_NYI) ? "" : newLine + APP::CLI_IMAGE_ONLY_TOKEN) ) + static const int N_COMPOSITOR_INPUTS = StringArray::fromLines(INPUTS).size() ; // filesystem static const File HOME_DIR = File::getSpecialLocation(File::userHomeDirectory ) ; @@ -247,6 +259,9 @@ namespace GUI static const String PRESET_NAME_ERROR_MSG = "Enter a name for this preset in the \"Preset\" box then press \"Save\" again." ; static const String PRESET_RENAME_ERROR_MSG = "A preset already exists with that name." ; static const String CONFIG_CHANGE_ERROR_MSG = "Can not re-configure while the stream is active." ; + static const String ALSA_INIT_ERROR_MSG = "Error initializing ALSA capture device.\n\n" ; + static const String PULSE_INIT_ERROR_MSG = "Error connecting to PulseAudio server.\n\n" ; + static const String JACK_INIT_ERROR_MSG = "Error connecting to Jack server.\n\n" ; } @@ -369,6 +384,40 @@ namespace CONFIG } + // config indices + enum StaticPreset { FILE_PRESET_IDX , RTMP_PRESET_IDX , LCTV_PRESET_IDX } ; + enum AudioApi { ALSA_AUDIO_IDX , PULSE_AUDIO_IDX , JACK_AUDIO_IDX } ; + enum AudioCodec { MP3_AUDIO_IDX , AAC_AUDIO_IDX } ; + enum OutputStream { FILE_OUTPUT_IDX , RTMP_OUTPUT_IDX } ; + static const int CONFIG_IDX_INVALID = -1 ; + + // config strings + static const StringArray AUDIO_APIS = StringArray::fromLines("ALSA" + newLine + + "Pulse" + newLine + + "JACK" ) ; + static const StringArray AUDIO_CODECS = StringArray::fromLines("MP3" + newLine + + "AAC" ) ; + static const StringArray AUDIO_SAMPLERATES = StringArray::fromLines("11025" + newLine + + "22050" + newLine + + "44100" ) ; + static const StringArray AUDIO_BITRATES = StringArray::fromLines("64k" + newLine + + "96k" + newLine + + "128k" + newLine + + "192k" ) ; + static const StringArray TEXT_STYLES = StringArray::fromLines("Static" + newLine + + "Marquee" ) ; + static const StringArray TEXT_POSITIONS = StringArray::fromLines("Top" + newLine + + "Bottom" ) ; + static const StringArray OUTPUT_SINKS = StringArray::fromLines("File" + newLine + + "RTMP" ) ; + static const StringArray OUTPUT_MUXERS = StringArray::fromLines(".flv" ) ; + static const StringArray FRAMERATES = StringArray::fromLines("8" + newLine + + "12" + newLine + + "20" + newLine + + "30" ) ; + static const StringArray VIDEO_BITRATES = StringArray::fromLines("800k" + newLine + + "1200k" ) ; + // nodes static const Identifier STORAGE_ID = "av-caster-config" ; static const Identifier PRESETS_ID = "presets" ; @@ -382,7 +431,7 @@ namespace CONFIG static const Identifier CHATTERS_ID = "active-chatters" ; // config root IDs static const Identifier CONFIG_VERSION_ID = "config-version" ; - static const Identifier PRESET_ID = "preset-idx" ; + static const Identifier PRESET_ID = "current-preset-idx" ; static const Identifier IS_PENDING_ID = "is-config-pending" ; // control IDs static const Identifier PRESET_NAME_ID = "preset-name" ; @@ -432,15 +481,16 @@ namespace CONFIG static const Identifier CHAT_NICK_ID = "chat-nick" ; // root defaults +#ifdef JUCE_LINUX + static const String STORAGE_DIRNAME = ".config/av-caster/" ; + static const String STORAGE_FILENAME = "av-caster.bin" ; +#endif // JUCE_LINUX #ifdef JUCE_WINDOWS static const String STORAGE_DIRNAME = "AvCaster\\" ; static const String STORAGE_FILENAME = "AvCaster.bin" ; -#else // JUCE_WINDOWS - static const String STORAGE_DIRNAME = ".av-caster/" ; - static const String STORAGE_FILENAME = "av-caster.bin" ; #endif // JUCE_WINDOWS static const double CONFIG_VERSION = 0.3 ; - static const int DEFAULT_PRESET_IDX = 0 ; // ASSERT: must be 0 + static const int DEFAULT_PRESET_IDX = FILE_PRESET_IDX ; // ASSERT: must be 0 static const int N_STATIC_PRESETS = 3 ; // ASSERT: num PresetSeed subclasses static const bool DEFAULT_IS_PENDING = false ; @@ -450,11 +500,11 @@ namespace CONFIG static const String LCTV_PRESET_NAME = "livecoding.tv" ; static const String DEFAULT_PRESET_NAME = FILE_PRESET_NAME ; static const Identifier DEFAULT_PRESET_ID = FilterId(DEFAULT_PRESET_NAME , APP::VALID_ID_CHARS) ; -#ifdef DISABLE_CONTROLS_NYI +#ifdef DISABLE_GUI_CONTROLS_NYI static const bool DEFAULT_IS_SCREENCAP_ACTIVE = true ; -#else // DISABLE_CONTROLS_NYI +#else // DISABLE_GUI_CONTROLS_NYI static const bool DEFAULT_IS_SCREENCAP_ACTIVE = false ; -#endif // DISABLE_CONTROLS_NYI +#endif // DISABLE_GUI_CONTROLS_NYI static const bool DEFAULT_IS_CAMERA_ACTIVE = false ; static const bool DEFAULT_IS_TEXT_ACTIVE = false ; static const bool DEFAULT_IS_IMAGE_ACTIVE = true ; @@ -472,9 +522,9 @@ namespace CONFIG static const int DEFAULT_CAMERA_DEVICE_IDX = -1 ; static const int DEFAULT_CAMERA_RES_IDX = -1 ; // audio defaults - static const int DEFAULT_AUDIO_API_IDX = 0 ; + static const int DEFAULT_AUDIO_API_IDX = ALSA_AUDIO_IDX ; static const int DEFAULT_AUDIO_DEVICE_IDX = -1 ; - static const int DEFAULT_AUDIO_CODEC_IDX = 0 ; + static const int DEFAULT_AUDIO_CODEC_IDX = MP3_AUDIO_IDX ; static const int DEFAULT_N_CHANNELS = 2 ; static const int DEFAULT_SAMPLERATE_IDX = 0 ; static const int DEFAULT_AUDIO_BITRATE_IDX = 0 ; @@ -485,7 +535,7 @@ namespace CONFIG // interstitial defaults static const String DEFAULT_IMAGE_LOCATION = "" ; // output defaults - static const int DEFAULT_OUTPUT_SINK_IDX = 0 ; + static const int DEFAULT_OUTPUT_SINK_IDX = FILE_OUTPUT_IDX ; static const int DEFAULT_OUTPUT_MUXER_IDX = 0 ; static const int DEFAULT_OUTPUT_W = 640 ; static const int DEFAULT_OUTPUT_H = 480 ; @@ -493,43 +543,6 @@ namespace CONFIG static const int DEFAULT_VIDEO_BITRATE_IDX = 0 ; static const String DEFAULT_OUTPUT_DEST = APP::APP_NAME + ".flv" ; - // config indices - static const int FILE_PRESET_IDX = 0 ; - static const int RTMP_PRESET_IDX = 1 ; - static const int LCTV_PRESET_IDX = 2 ; - static const int FILE_STREAM_IDX = 0 ; - static const int RTMP_STREAM_IDX = 1 ; - - // config strings - static const String FILE_OUTPUT = "File" ; - static const String RTMP_OUTPUT = "RTMP" ; - static const String FLV_MUXER = ".flv" ; - static const StringArray AUDIO_APIS = StringArray::fromLines("ALSA" + newLine + - "Pulse" + newLine + - "JACK" ) ; - static const StringArray AUDIO_CODECS = StringArray::fromLines("MP3" + newLine + - "AAC" ) ; - static const StringArray AUDIO_SAMPLERATES = StringArray::fromLines("11025" + newLine + - "22050" + newLine + - "44100" ) ; - static const StringArray AUDIO_BITRATES = StringArray::fromLines("64k" + newLine + - "96k" + newLine + - "128k" + newLine + - "192k" ) ; - static const StringArray TEXT_STYLES = StringArray::fromLines("Static" + newLine + - "Marquee" ) ; - static const StringArray TEXT_POSITIONS = StringArray::fromLines("Top" + newLine + - "Bottom" ) ; - static const StringArray OUTPUT_SINKS = StringArray::fromLines(FILE_OUTPUT + newLine + - RTMP_OUTPUT ) ; - static const StringArray OUTPUT_MUXERS = StringArray::fromLines(FLV_MUXER ) ; - static const StringArray FRAMERATES = StringArray::fromLines("8" + newLine + - "12" + newLine + - "20" + newLine + - "30" ) ; - static const StringArray VIDEO_BITRATES = StringArray::fromLines("800k" + newLine + - "1200k" ) ; - static ValueTree DefaultStore() { @@ -552,36 +565,47 @@ namespace GST static const unsigned int MIN_MAJOR_VERSION = 1 ; static const unsigned int MIN_MINOR_VERSION = 4 ; - static const String PIPELINE_ID = "pipeline" ; - static const String SCREENCAP_BIN_ID = "screencap-bin" ; - static const String CAMERA_BIN_ID = "camera-bin" ; - static const String TEXT_BIN_ID = "text-bin" ; - static const String IMAGE_BIN_ID = "interstitial-bin" ; - static const String COMPOSITOR_BIN_ID = "compositor-bin" ; - static const String PREVIEW_BIN_ID = "preview-bin" ; - static const String AUDIO_BIN_ID = "audio-bin" ; - static const String MUXER_BIN_ID = "muxer-bin" ; - static const String OUTPUT_BIN_ID = "output-bin" ; + // element IDs + static const String PIPELINE_ID = "pipeline" ; + static const String SCREENCAP_BIN_ID = "screencap-bin" ; + static const String CAMERA_BIN_ID = "camera-bin" ; + static const String TEXT_BIN_ID = "text-bin" ; + static const String IMAGE_BIN_ID = "interstitial-bin" ; + static const String COMPOSITOR_BIN_ID = "compositor-bin" ; + static const String PREVIEW_BIN_ID = "preview-bin" ; + static const String PREVIEW_SINK_ID = "preview-real-sink" ; + static const String PREVIEW_FAUXSINK_ID = "preview-faux-sink" ; + static const String PREVIEW_SINKPAD_ID = "preview-sinkpad" ; + static const String AUDIO_BIN_ID = "audio-bin" ; + static const String MUXER_BIN_ID = "muxer-bin" ; + static const String OUTPUT_BIN_ID = "output-bin" ; + // plugin IDs + static const String FAUXSRC_PLUGIN_ID = "fakesrc" ; + static const String FAUXSINK_PLUGIN_ID = "fakesink" ; #if JUCE_LINUX - static const String SCREEN_PLUGIN_ID = "ximagesrc" ; + static const String SCREEN_PLUGIN_ID = "ximagesrc" ; #endif //JUCE_LINUX - static const String V4L2_PLUGIN_ID = "v4l2src" ; - static const String FAUX_VIDEO_PLUGIN_ID = "videotestsrc" ; - static const String ALSA_PLUGIN_ID = "alsasrc" ; - static const String PULSE_PLUGIN_ID = "pulsesrc" ; - static const String JACK_PLUGIN_ID = "jackaudiosrc" ; - static const String FAUX_AUDIO_PLUGIN_ID = "audiotestsrc" ; + static const String V4L2_PLUGIN_ID = "v4l2src" ; + static const String TESTVIDEO_PLUGIN_ID = "videotestsrc" ; + static const String ALSA_PLUGIN_ID = "alsasrc" ; + static const String PULSE_PLUGIN_ID = "pulsesrc" ; + static const String JACK_PLUGIN_ID = "jackaudiosrc" ; + static const String TESTAUDIO_PLUGIN_ID = "audiotestsrc" ; #if JUCE_LINUX - static const String PREVIEW_PLUGIN_ID = "xvimagesink" ; + static const String PREVIEW_PLUGIN_ID = "xvimagesink" ; #endif //JUCE_LINUX - static const String FILE_SINK_PLUGIN_ID = "filesink" ; - static const String RTMP_SINK_PLUGIN_ID = "rtmpsink" ; - static const String FAUX_SINK_PLUGIN_ID = "fakesink" ; - static const String FAUX_AUDIO_CAPS = "audio/x-raw, format=(string)S16LE, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2" ; + static const String FILESINK_PLUGIN_ID = "filesink" ; + static const String RTMPSINK_PLUGIN_ID = "rtmpsink" ; static const String LCTV_RTMP_URL = "rtmp://usmedia3.livecoding.tv:1935/livecodingtv/" ; + + // library error messages + static const String ALSA_INIT_ERROR = "Could not open audio device for recording. Device is being used by another application." ; + static const String PULSE_INIT_ERROR = "Failed to connect: Connection refused" ; + static const String JACK_INIT_ERROR = "Jack server not found" ; } + /** the IRC namespace defines configuration constants pertaining to the libircclient network backend */ namespace IRC diff --git a/Source/Controls.cpp b/Source/Controls.cpp index a64742b..8094e51 100644 --- a/Source/Controls.cpp +++ b/Source/Controls.cpp @@ -1,525 +1,557 @@ -/*\ -|*| Copyright 2015 bill-auger -|*| -|*| This file is part of the AvCaster program. -|*| -|*| AvCaster is free software: you can redistribute it and/or modify -|*| it under the terms of the GNU Lesser General Public License version 3 -|*| as published by the Free Software Foundation. -|*| -|*| AvCaster 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 Lesser General Public License for more details. -|*| -|*| You should have received a copy of the GNU Lesser General Public License -|*| along with AvCaster. If not, see . -\*/ - -//[Headers] You can add your own extra header files here... - -#include "AvCaster.h" - -//[/Headers] - -#include "Controls.h" - - -//[MiscUserDefs] You can add your own user definitions and misc code here... -//[/MiscUserDefs] - -//============================================================================== -Controls::Controls () -{ - addAndMakeVisible (controlsGroup = new GroupComponent ("controlsGroup", - TRANS("Controls"))); - controlsGroup->setColour (GroupComponent::outlineColourId, Colours::white); - controlsGroup->setColour (GroupComponent::textColourId, Colours::white); - - addAndMakeVisible (screencapToggle = new ToggleButton ("screencapToggle")); - screencapToggle->setExplicitFocusOrder (1); - screencapToggle->setButtonText (TRANS("Screen")); - screencapToggle->addListener (this); - screencapToggle->setColour (ToggleButton::textColourId, Colours::white); - - addAndMakeVisible (cameraToggle = new ToggleButton ("cameraToggle")); - cameraToggle->setExplicitFocusOrder (2); - cameraToggle->setButtonText (TRANS("Camera")); - cameraToggle->addListener (this); - cameraToggle->setColour (ToggleButton::textColourId, Colours::white); - - addAndMakeVisible (textToggle = new ToggleButton ("textToggle")); - textToggle->setExplicitFocusOrder (3); - textToggle->setButtonText (TRANS("Text")); - textToggle->addListener (this); - textToggle->setColour (ToggleButton::textColourId, Colours::white); - - addAndMakeVisible (interstitialToggle = new ToggleButton ("interstitialToggle")); - interstitialToggle->setExplicitFocusOrder (4); - interstitialToggle->setButtonText (TRANS("Pause")); - interstitialToggle->addListener (this); - interstitialToggle->setColour (ToggleButton::textColourId, Colours::white); - - addAndMakeVisible (previewToggle = new ToggleButton ("previewToggle")); - previewToggle->setExplicitFocusOrder (5); - previewToggle->setButtonText (TRANS("Preview")); - previewToggle->addListener (this); - previewToggle->setColour (ToggleButton::textColourId, Colours::white); - - addAndMakeVisible (outputToggle = new ToggleButton ("outputToggle")); - outputToggle->setExplicitFocusOrder (6); - outputToggle->setButtonText (TRANS("Broadcast")); - outputToggle->addListener (this); - outputToggle->setColour (ToggleButton::textColourId, Colours::white); - - addAndMakeVisible (presetsCombo = new ComboBox ("presetsCombo")); - presetsCombo->setExplicitFocusOrder (7); - presetsCombo->setEditableText (true); - presetsCombo->setJustificationType (Justification::centredLeft); - presetsCombo->setTextWhenNothingSelected (String::empty); - presetsCombo->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); - presetsCombo->addListener (this); - - addAndMakeVisible (configButton = new ImageButton ("configButton")); - configButton->setExplicitFocusOrder (8); - configButton->addListener (this); - - configButton->setImages (false, true, true, - ImageCache::getFromMemory (preferencessystem_png, preferencessystem_pngSize), 1.000f, Colour (0x00000000), - ImageCache::getFromMemory (confighover_png, confighover_pngSize), 1.000f, Colour (0x00000000), - ImageCache::getFromMemory (configpushed_png, configpushed_pngSize), 1.000f, Colour (0x00000000)); - - //[UserPreSize] - //[/UserPreSize] - - setSize (1, 1); - - - //[Constructor] You can add your own custom stuff here.. - - this->mainContent->configureCombobox(this->presetsCombo) ; - - //[/Constructor] -} - -Controls::~Controls() -{ - //[Destructor_pre]. You can add your own custom destruction code here.. - //[/Destructor_pre] - - controlsGroup = nullptr; - screencapToggle = nullptr; - cameraToggle = nullptr; - textToggle = nullptr; - interstitialToggle = nullptr; - previewToggle = nullptr; - outputToggle = nullptr; - presetsCombo = nullptr; - configButton = nullptr; - - - //[Destructor]. You can add your own custom destruction code here.. - //[/Destructor] -} - -//============================================================================== -void Controls::paint (Graphics& g) -{ - //[UserPrePaint] Add your own custom painting code here.. - //[/UserPrePaint] - - g.setColour (Colour (0xff303030)); - g.fillRoundedRectangle (20.0f, 22.0f, static_cast (getWidth() - 40), 52.0f, 4.000f); - - //[UserPaint] Add your own custom painting code here.. - //[/UserPaint] -} - -void Controls::resized() -{ - //[UserPreResize] Add your own custom resize code here.. - //[/UserPreResize] - - controlsGroup->setBounds (16, 12, getWidth() - 32, 64); - screencapToggle->setBounds (32, 36, 72, 24); - cameraToggle->setBounds (108, 36, 76, 24); - textToggle->setBounds (188, 36, 52, 24); - interstitialToggle->setBounds (244, 36, 64, 24); - previewToggle->setBounds (314, 36, 78, 24); - outputToggle->setBounds (396, 36, 90, 24); - presetsCombo->setBounds (512, 36, 176, 24); - configButton->setBounds (696, 36, 24, 24); - //[UserResized] Add your own custom resize handling here.. - //[/UserResized] -} - -void Controls::buttonClicked (Button* buttonThatWasClicked) -{ - //[UserbuttonClicked_Pre] - - Identifier key ; - var value = var(buttonThatWasClicked->getToggleState()) ; - - //[/UserbuttonClicked_Pre] - - if (buttonThatWasClicked == screencapToggle) - { - //[UserButtonCode_screencapToggle] -- add your button handler code here.. - - key = CONFIG::IS_SCREENCAP_ACTIVE_ID ; - - //[/UserButtonCode_screencapToggle] - } - else if (buttonThatWasClicked == cameraToggle) - { - //[UserButtonCode_cameraToggle] -- add your button handler code here.. - - key = CONFIG::IS_CAMERA_ACTIVE_ID ; - - //[/UserButtonCode_cameraToggle] - } - else if (buttonThatWasClicked == textToggle) - { - //[UserButtonCode_textToggle] -- add your button handler code here.. - - key = CONFIG::IS_TEXT_ACTIVE_ID ; - - //[/UserButtonCode_textToggle] - } - else if (buttonThatWasClicked == interstitialToggle) - { - //[UserButtonCode_interstitialToggle] -- add your button handler code here.. - - key = CONFIG::IS_IMAGE_ACTIVE_ID ; - - //[/UserButtonCode_interstitialToggle] - } - else if (buttonThatWasClicked == previewToggle) - { - //[UserButtonCode_previewToggle] -- add your button handler code here.. - - key = CONFIG::IS_PREVIEW_ACTIVE_ID ; - - //[/UserButtonCode_previewToggle] - } - else if (buttonThatWasClicked == outputToggle) - { - //[UserButtonCode_outputToggle] -- add your button handler code here.. - - key = CONFIG::IS_OUTPUT_ACTIVE_ID ; - - //[/UserButtonCode_outputToggle] - } - else if (buttonThatWasClicked == configButton) - { - //[UserButtonCode_configButton] -- add your button handler code here.. - - if (AvCaster::RejectPresetChange()) return ; - - key = CONFIG::IS_PENDING_ID ; - value = var(!AvCaster::GetIsConfigPending()) ; - - //[/UserButtonCode_configButton] - } - - //[UserbuttonClicked_Post] - - AvCaster::SetConfig(key , value) ; - - //[/UserbuttonClicked_Post] -} - -void Controls::comboBoxChanged (ComboBox* comboBoxThatHasChanged) -{ - //[UsercomboBoxChanged_Pre] - //[/UsercomboBoxChanged_Pre] - - if (comboBoxThatHasChanged == presetsCombo) - { - //[UserComboBoxCode_presetsCombo] -- add your combo box handling code here.. - //[/UserComboBoxCode_presetsCombo] - } - - //[UsercomboBoxChanged_Post] - //[/UsercomboBoxChanged_Post] -} - - - -//[MiscUserCode] You can add your own definitions of your custom methods or any other code here... - -void Controls::broughtToFront() { loadConfig() ; } - -void Controls::loadConfig() -{ - ValueTree config_store = AvCaster::GetConfigStore() ; - bool is_screencap_on = bool(config_store[CONFIG::IS_SCREENCAP_ACTIVE_ID]) ; - bool is_camera_on = bool(config_store[CONFIG::IS_CAMERA_ACTIVE_ID ]) ; - bool is_text_on = bool(config_store[CONFIG::IS_TEXT_ACTIVE_ID ]) ; - bool is_interstitial_on = bool(config_store[CONFIG::IS_IMAGE_ACTIVE_ID ]) ; - bool is_preview_on = bool(config_store[CONFIG::IS_PREVIEW_ACTIVE_ID ]) ; - bool is_output_on = bool(config_store[CONFIG::IS_OUTPUT_ACTIVE_ID ]) ; - bool is_media_enabled = AvCaster::GetIsMediaEnabled() ; - bool is_preview_enabled = AvCaster::GetIsPreviewEnabled() ; - - this->screencapToggle ->setToggleState (is_screencap_on , juce::dontSendNotification) ; - this->cameraToggle ->setToggleState (is_camera_on , juce::dontSendNotification) ; - this->textToggle ->setToggleState (is_text_on , juce::dontSendNotification) ; - this->interstitialToggle->setToggleState (is_interstitial_on , juce::dontSendNotification) ; - this->previewToggle ->setToggleState (is_preview_on , juce::dontSendNotification) ; - this->outputToggle ->setToggleState (is_output_on , juce::dontSendNotification) ; - this->mainContent ->loadPresetsCombo(this->presetsCombo) ; - - // disable controls per cli args - this->screencapToggle ->setEnabled(is_media_enabled ) ; - this->cameraToggle ->setEnabled(is_media_enabled ) ; - this->textToggle ->setEnabled(is_media_enabled ) ; - this->interstitialToggle->setEnabled(is_media_enabled ) ; - this->previewToggle ->setEnabled(is_preview_enabled) ; - this->outputToggle ->setEnabled(is_media_enabled ) ; - -#ifdef DISABLE_CONTROLS_NYI -this->screencapToggle ->setEnabled(false) ; -this->cameraToggle ->setEnabled(false) ; -this->textToggle ->setEnabled(false) ; -this->interstitialToggle->setEnabled(false) ; -#endif // DISABLE_CONTROLS_NYI -} - -//[/MiscUserCode] - - -//============================================================================== -#if 0 -/* -- Introjucer information section -- - - This is where the Introjucer stores the metadata that describe this GUI layout, so - make changes in here at your peril! - -BEGIN_JUCER_METADATA - - - - - - - - - - - - - - - - -END_JUCER_METADATA -*/ -#endif - -//============================================================================== -// Binary resources - be careful not to edit any of these sections! - -// JUCER_RESOURCE: preferencessystem_png, 2129, "../Assets/preferences-system.png" -static const unsigned char resource_Controls_preferencessystem_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122,244,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100, -136,0,0,8,8,73,68,65,84,88,133,237,150,107,80,84,231,25,199,255,231,186,247,93,129,101,193,101,65,46,106,21,144,155,58,136,241,66,172,162,226,68,99,106,173,237,76,167,173,218,241,139,83,149,96,65,116, -82,167,41,176,98,117,180,214,100,72,140,153,100,58,109,194,180,90,13,70,136,134,161,157,198,154,78,210,40,226,133,5,21,185,45,236,194,194,46,44,123,238,167,31,194,102,86,5,177,147,15,253,210,103,230,153, -247,125,207,121,159,231,255,123,158,247,157,51,7,248,191,253,143,141,152,110,67,77,77,213,114,154,165,223,7,72,29,8,220,151,5,225,195,96,80,120,235,240,225,195,220,243,138,84,31,127,167,72,3,245,139,146, -146,157,190,255,10,224,200,145,35,38,149,144,2,105,169,179,145,151,187,16,254,64,0,173,183,91,56,239,160,215,205,5,133,130,131,7,15,14,76,39,126,228,196,187,251,21,85,169,161,40,170,91,16,164,229,135, -74,119,62,138,124,79,62,43,184,172,172,108,148,38,169,149,221,61,143,198,253,129,128,226,72,112,96,237,154,245,218,172,204,236,36,131,73,119,254,89,177,117,117,117,212,209,83,239,157,101,117,154,95,45, -46,40,64,98,74,138,157,97,168,127,87,158,120,59,235,185,1,0,160,180,180,252,239,156,40,173,250,228,202,101,82,85,85,94,146,36,100,45,200,166,12,122,195,130,234,163,175,23,78,90,245,145,119,76,15,7,198, -155,76,102,243,214,156,188,69,6,86,163,65,130,195,65,217,29,142,104,82,37,111,214,214,214,50,83,2,84,85,85,197,60,249,172,98,127,197,231,0,252,162,40,246,2,0,207,243,72,77,77,51,176,180,102,203,164,212, -58,234,171,248,248,248,252,172,220,28,3,69,83,0,0,89,145,225,245,122,130,4,65,252,120,215,174,93,226,164,0,78,103,229,90,146,86,7,79,157,58,241,253,200,231,213,199,170,115,1,88,104,154,14,210,52,13,146, -36,97,52,26,9,154,166,83,38,211,39,84,196,204,153,157,162,17,4,1,162,192,67,18,121,180,223,109,227,4,94,108,40,223,187,253,15,145,123,31,3,96,52,204,217,156,236,92,72,138,244,199,218,218,55,94,6,128,154, -154,202,28,66,82,46,205,73,155,251,154,193,96,72,209,104,52,208,106,181,224,56,78,5,224,126,82,220,233,172,181,200,138,60,67,146,68,8,124,8,178,40,96,208,227,81,125,67,222,17,130,147,127,246,228,126,250, -49,0,134,25,74,116,36,217,147,103,165,208,127,189,120,238,188,179,166,18,10,128,204,5,11,78,173,88,86,88,161,170,170,86,146,36,208,52,141,222,222,30,73,20,197,199,10,56,92,91,171,39,56,182,121,254,188, -52,81,149,37,198,239,243,33,20,26,71,95,159,135,32,20,101,83,89,217,206,209,167,186,21,185,56,126,162,166,50,125,126,102,89,110,206,66,138,36,31,191,30,178,44,35,24,12,66,81,20,48,12,3,94,224,209,208, -80,207,9,146,184,109,127,73,249,133,195,181,181,122,109,136,105,202,202,152,147,103,182,152,152,150,86,215,120,32,48,118,23,42,62,133,138,107,229,37,219,47,76,122,92,145,139,202,202,202,56,163,89,239, -218,242,202,86,51,203,178,144,101,25,36,73,130,32,8,72,146,4,138,162,224,243,249,208,218,218,10,155,205,6,91,156,13,13,13,245,28,47,202,27,21,38,246,96,94,230,188,130,168,40,35,123,227,86,251,248,240, -176,255,205,178,189,219,75,39,19,141,52,42,114,209,212,212,20,44,90,183,198,237,114,181,173,115,36,56,104,171,213,10,134,97,192,48,12,100,89,134,63,48,2,69,86,32,138,34,8,226,107,246,244,140,12,218,245, -112,224,71,89,233,223,113,196,217,162,217,214,59,29,33,239,224,200,219,229,251,182,151,76,39,254,84,7,194,118,244,168,115,19,205,210,103,140,6,163,46,198,106,37,131,193,160,226,241,12,208,162,40,106,54, -20,191,164,10,188,72,0,128,170,170,104,117,117,195,26,19,13,251,204,88,180,220,233,224,251,221,222,51,229,251,118,236,126,30,241,41,1,128,175,191,100,15,30,220,75,87,41,34,142,84,136,49,134,209,223,148, -229,208,28,138,97,63,91,91,180,222,32,240,34,113,235,94,39,44,22,11,18,29,241,184,211,246,16,238,158,46,129,87,134,102,31,122,245,80,247,183,6,152,204,146,214,87,165,199,154,177,35,35,129,218,189,98,225, -60,54,198,98,192,172,36,59,218,58,30,129,33,9,36,217,103,40,215,174,127,54,52,62,198,103,84,84,84,120,159,39,231,180,159,226,176,165,110,168,222,174,101,153,127,189,178,110,197,158,144,38,149,250,221, -249,14,24,45,209,232,184,223,13,40,50,210,231,38,33,33,33,145,204,206,202,141,214,25,53,95,58,157,78,203,243,228,165,166,223,2,164,108,168,218,200,178,236,217,31,110,46,212,23,46,76,38,181,122,3,57,60, -202,227,131,198,155,200,77,53,35,63,103,46,104,154,6,207,243,112,56,18,73,89,146,13,254,209,225,205,75,242,11,222,109,110,110,22,159,149,123,90,128,228,226,170,124,154,162,46,110,46,94,166,15,242,42,254, -113,203,141,78,247,48,236,54,11,6,60,126,89,30,119,203,75,114,231,80,0,1,138,162,192,113,28,146,147,83,72,127,192,31,37,138,252,218,252,252,130,247,155,155,155,229,169,242,63,243,8,102,173,175,94,69,145, -212,149,245,171,243,245,10,65,193,235,27,131,251,126,11,186,239,126,142,241,96,16,163,33,62,232,13,138,251,46,55,126,204,41,170,2,69,81,64,146,36,2,129,0,94,40,88,78,199,218,108,57,49,214,25,245,117,117, -117,83,22,58,37,64,90,113,213,46,134,165,62,218,92,188,204,164,213,233,136,62,143,31,195,125,247,16,10,142,32,193,145,136,142,78,175,192,243,194,141,243,167,15,158,86,68,233,229,134,198,75,188,44,75,0, -0,130,32,16,12,6,81,184,98,21,107,54,91,86,14,120,251,254,164,170,234,164,23,254,41,128,185,47,253,214,154,178,193,89,175,51,232,143,253,96,83,161,94,33,41,136,2,143,177,1,23,252,195,62,216,237,9,24,26, -37,133,238,190,129,118,132,212,141,0,80,90,90,222,168,168,202,150,203,141,151,4,94,224,65,16,4,100,89,6,207,243,88,253,221,34,86,171,209,110,60,253,198,201,55,167,5,72,46,174,250,133,4,241,161,221,110, -91,179,109,243,139,6,5,4,28,49,90,244,60,184,13,239,224,32,226,227,227,49,52,70,9,157,61,3,46,112,120,225,193,213,114,127,56,246,213,189,191,172,135,130,109,159,92,185,204,115,28,7,154,166,191,129,88, -245,226,26,13,69,51,63,61,249,251,99,7,158,4,248,166,45,41,197,206,21,172,134,249,40,115,126,154,57,43,35,5,51,244,20,102,70,105,113,238,227,102,116,118,245,32,46,214,10,129,178,72,109,237,189,46,240, -88,26,41,30,105,199,79,30,221,70,168,196,123,171,87,175,101,89,134,69,32,16,192,224,224,32,28,14,7,26,175,92,230,68,94,182,31,56,112,96,248,169,14,168,80,87,197,217,98,76,171,151,206,67,70,146,25,105, -51,77,56,215,120,29,157,143,122,96,54,154,64,234,172,184,215,209,55,42,16,82,209,84,226,0,80,178,103,255,7,36,77,237,188,122,181,81,8,113,33,248,253,126,120,60,30,4,2,1,68,69,69,201,36,169,44,154,226, -8,148,78,45,67,134,76,58,26,93,253,1,156,185,240,5,58,31,118,128,102,52,136,77,72,69,107,91,119,136,31,243,110,237,169,63,228,195,19,255,17,17,221,164,1,104,246,236,222,247,103,158,227,75,154,155,63,21, -162,162,163,144,158,158,14,131,209,128,145,145,97,50,20,18,219,34,131,40,0,44,0,189,42,140,121,57,173,227,231,160,52,218,81,78,66,215,131,54,8,188,128,164,148,185,232,118,251,5,159,183,255,98,79,147,243, -47,0,180,0,52,19,113,228,132,40,11,64,63,225,6,0,134,171,87,155,92,121,121,57,30,119,191,123,249,128,167,95,112,185,238,73,195,195,35,135,94,255,245,111,174,79,232,18,0,20,2,128,101,34,169,214,182,232, -39,43,77,51,231,215,46,93,156,169,229,3,253,0,163,135,66,25,240,229,87,183,199,251,254,249,214,247,120,95,231,32,0,46,194,229,9,151,34,138,97,1,48,225,185,213,106,37,178,179,179,163,219,219,219,123,187, -186,186,2,0,4,0,226,196,200,19,0,76,97,0,0,26,219,226,29,69,6,91,218,81,179,217,32,147,20,67,13,251,252,228,88,207,141,215,6,91,62,252,91,56,104,194,185,136,185,28,33,76,79,192,132,171,84,1,40,17,160, -225,28,66,184,3,68,4,177,14,0,99,76,204,138,54,38,44,89,8,146,212,7,123,91,110,140,62,186,230,137,168,86,136,232,128,56,145,60,242,30,144,19,99,216,213,8,136,240,252,177,128,201,46,83,120,140,124,175, -98,146,4,223,214,254,3,174,151,133,37,87,153,47,161,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* Controls::preferencessystem_png = (const char*) resource_Controls_preferencessystem_png; -const int Controls::preferencessystem_pngSize = 2129; - -// JUCER_RESOURCE: confighover_png, 4254, "../Assets/config-hover.png" -static const unsigned char resource_Controls_confighover_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122,244,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187, -127,0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,223,10,28,2,20,3,203,224,166,93,0,0,16,43,73,68,65,84,88,9,1,32,16,223,239,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,88, -255,255,255,220,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,241,255,255,255,105, -0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,255,255,255,154,0,0,0,41,0,0,0,79,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,23,0,0,0,2,255,255,255,161,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,132,255,255,255,120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,49,255,255,255,161,0,0,0,0,4,255,255,255, -49,0,0,0,71,0,0,0,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,167,164,61,3,5,3,162,0,0,2,9,0,1,0,221,254,251,251,169,248,248,252,154,96,96,96,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,165,170,182,70,5,0,255,204,86,86,75,238,0,0,0,0,1,1,1,207,255,255,255,226,255,255,255,83,1,255,255,255,195,0,0,0,139,1,1,1,178,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,167,167,13, -255,0,253,242,26,26,27,0,38,37,38,0,244,245,245,0,223,224,222,248,241,241,240,231,250,248,252,57,92,92,92,233,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,172,183,117,254,255,255, -138,2,2,2,227,252,252,253,61,93,87,75,225,0,0,0,0,255,255,255,50,0,0,0,161,1,255,255,255,237,0,0,0,23,1,1,1,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,169,166,62,1,3,1,183,48,47,51,8,21,20,21,2,0, -0,0,0,221,222,220,253,224,224,223,202,84,83,86,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,191,191,3,233,239,250,155,3,5,3,86,34,35,36,11,240,240,241,253,234,231,230,241,253,255,253,65,92,84, -76,210,255,255,255,4,0,0,0,237,2,0,0,0,18,1,1,1,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,87,90,194,250,252,253,66,204,204,202,2,0,0,0,249,253,253,253,0,35,34,36,3,8,8,9,45,165,168,162,64, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,167,182,13,232,239,249,190,10,11,10,86,36,37,39,11,4,5,6,0,20,21,21,3,19,21,21,18,1,255,2,209,179,179,179,5,1,1,1,252,0,0,0,14,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,164,164,164,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,92,88,92,201,0,0,0,241,252,252,252,229,0,0,0,0,250,250,250,0,26,25,26,11,5,3,5,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,2,207,18,18,18,55,34,36, -36,11,2,3,3,0,0,0,0,0,254,255,253,0,240,240,240,245,1,1,0,93,77,77,77,251,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,166,166,164,71,2,3,0,236,174,174,172,85,0,0,0,0,0,0,0,0,0,0,0,0,165,170,165,49,0,0,0, -15,3,3,3,245,3,3,3,0,2,2,2,0,9,9,9,1,3,3,3,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,27,27,25,7,252,252,252,0,253,252,250,0,253,252,250,0,228,225,227,248,252,251,252,184,90,84,74,164,0,0,0,0, -0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,4,5,3,158,36,36,36,0,253,255,253,166,179,179,176,80,0,0,0,0,167,167,164,48,1,253,255,181,28,27,28,126,8,8,8,33,5,5,5,0,6,6,6,0,250,250,250,255,0,0,0,231,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,166,166,179,15,254,254,254,16,253,253,252,0,251,251,249,0,253,252,252,0,241,240,240,255,243,242,240,240,1,250,254,97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0, -3,4,4,237,22,21,23,26,24,23,25,4,196,197,195,175,166,167,164,0,255,0,0,0,33,33,33,147,46,45,48,122,255,255,255,8,253,253,253,0,3,3,3,0,235,236,235,252,252,252,253,2,0,0,0,0,0,0,0,0,0,0,0,0,160,179,179, -10,1,250,4,192,31,30,26,251,0,254,253,5,245,242,242,0,249,249,249,0,237,237,239,1,1,254,255,79,89,89,75,243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,255,255,255,1,1,1,1,0,0,0,0,170,172,167,133,32,31,33,119, -37,36,39,3,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,254,254,254,0,248,248,248,0,254,254,254,0,4,4,4,0,251,251,251,0,202,202,199,248,251,253,252,88,88,86,90,177,160,179,179,10,6,249,3,190,34,32,28,50,11,11,10,5, -221,223,227,246,246,246,247,215,0,255,0,189,0,255,0,198,90,86,74,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,164,164,164,23,9,10,7,218,63,62,65,14,4,4,4,0,254, -254,254,0,1,1,1,0,1,1,1,0,253,253,253,0,2,2,2,0,243,243,243,0,223,223,223,0,16,16,16,0,17,18,17,0,202,202,199,248,251,252,254,78,254,4,15,123,38,33,30,57,12,12,9,6,220,223,229,246,244,243,244,151,89,84, -74,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,0,0,0,0,170,173,169,95,4,3,4,152,54,52,54,8,20,20,21,0,255,255,255,0,0,0,0,0,248,248,248, -0,245,246,244,0,253,252,254,0,236,236,236,0,3,3,3,0,9,9,9,0,9,10,8,0,197,202,210,253,33,31,30,254,18,17,15,5,222,223,228,247,238,239,242,154,90,85,74,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,168,168,166,79,3,5,3,156,9,8,9,9,14,15,15,2,248,248,248,254,240,239,238,4,252,252,253,7,56,56,57,255,252,251,253,1,0, -0,0,0,255,255,255,0,223,227,234,0,15,15,14,0,19,18,15,0,222,225,229,249,238,237,241,156,90,85,74,108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255, -255,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,191,191,3,231,231,226,42,255,2,1,23,2,255,1,244,3,3,7,209,254,254,250,37,2,4,4,197,54,52,55,11,251,251,252,1,222,226,232,0,12,11,11,0,21,21,18,0,225,227, -232,0,237,235,233,250,251,255,242,36,93,86,93,227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,119,164,42,15,10,0,99,33,21,3,108,46,38,30,6,14,11,8,0,23,22,19,0,227,229,233,0,4,2,1,0,22,19,12,254,213,214,212,237,248,247,250,43,92,92,92,235,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90,120,165,98,6,4,4,202,62,54,47,111,249,5,25,3,174,195, -229,0,9,11,13,0,229,230,235,0,0,255,254,0,31,28,22,0,21,21,22,2,35,35,36,18,7,9,6,205,166,166,166,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,89,120,164,78,3,5,4,148,66,62,48,11,45,39,26,3,46,41,31,3,24,25,21,0,150,174,207,0,246,248,249,0,37,33,27,0,4,4,4,0,247,247,247,0,31,30,32,3,31,30,31,25,7, -8,4,199,160,160,160,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,120,164,55,2,2,3,166,60,54,43,9,244,247,253, -0,180,199,225,0,211,221,235,0,23,21,16,0,7,6,7,253,216,222,227,251,255,0,254,0,255,255,255,0,2,2,2,0,245,245,245,0,37,36,38,4,21,22,23,37,13,14,11,191,160,160,160,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,119,165,66,2,1,3,187,55,51,41,10,254,0,3,0,241,243,247,0,237,230,222,0,235,226,215,0,248,247,248,0,246,249,251,245,240, -247,253,113,201,203,201,248,254,255,254,0,254,254,254,0,2,2,2,0,245,245,245,0,45,43,46,4,16,17,17,48,14,15,12,180,191,191,191,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,90,120,164,103,4,4,2,179,61,55,45,13,6,6,7,1,237,240,244,0,243,237,226,0,250,248,244,0,20,21,21,0,229,233,240,250,251,251,252,208,131,112,92,149,255,252,253,80,202,203,200,249, -254,254,253,0,0,0,0,0,1,1,1,0,247,247,247,0,48,46,49,6,11,10,11,63,239,241,237,167,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,122,169,20,89,120,166,180, -7,8,8,141,65,59,48,10,255,2,2,0,252,252,250,0,247,239,228,0,245,243,243,0,19,19,20,0,242,246,2,250,235,236,239,219,0,249,255,78,0,0,0,0,87,87,90,185,255,255,254,84,201,203,200,250,251,251,251,0,1,1,1, -0,254,254,254,0,251,251,251,0,51,51,53,6,6,5,6,78,176,177,173,151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,88,120,164,110,253,0,252,223,19,20,16,69,66,60,49,11,255,0,1,0,20,14, -6,0,235,231,224,0,240,241,241,0,18,18,18,0,242,247,2,250,232,235,239,218,0,250,0,59,166,141,90,241,0,0,0,0,0,0,0,0,86,84,89,180,0,254,0,88,203,205,201,249,250,250,250,0,3,3,3,0,254,254,254,0,250,250,250, -0,50,49,52,7,2,3,4,96,173,175,170,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,255,255,255,1,1,1,1,89,120,166,62,4,5,4,179,33,31,26,14,35,32,25,0,12,7,2,0,18,13,6,0,195,201,208,0,232,233,235,0,17,16,15,0, -252,2,11,252,227,228,236,218,0,251,0,58,166,141,90,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,170,173,168,88,1,255,1,161,51,51,53,6,5,4,5,0,245,245,245,0,241,241,241,0,21,21,21,0,203,204,201,248,252, -251,254,26,91,91,91,239,0,0,0,0,255,255,255,255,2,0,0,0,0,0,0,0,0,255,0,255,66,18,16,14,13,51,43,30,0,32,22,10,0,26,19,10,0,195,203,214,0,232,232,235,0,11,9,10,0,2,7,15,0,226,229,237,243,251,1,253,70, -166,141,90,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,86,83,88,168,2,3,2,100,205,205,203,250,249,250,249,0,245,245,245,0,240,240,240,0,246,246,246,0,13,13,13,253,2,2,255,52,0,0,0,0,0,0,0,0,0, -0,0,0,2,0,0,0,0,0,0,0,0,0,0,255,224,6,4,1,247,10,7,3,0,233,238,246,0,181,197,217,0,232,231,229,0,3,4,5,0,15,20,25,0,223,226,234,247,251,247,240,86,235,199,157,238,64,64,64,4,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,64,64,64,1,64,64,64,4,64,64,64,7,147,145,149,172,251,250,251,114,208,208,206,250,13,13,13,0,31,31,31,0,8,9,8,0,244,244,243,2,249,249,252,217,0,0,0,0,0,0,0,0,0,0,0,0,1,250,250,250,239,161,161,161, -42,176,188,206,8,15,35,61,207,48,44,37,15,6,7,6,0,223,221,219,0,249,247,245,0,25,27,30,0,235,238,247,250,235,233,231,176,233,205,163,122,0,0,0,251,0,0,0,250,0,0,0,250,0,0,0,249,0,0,0,254,0,0,0,1,0,0,0, -5,0,0,0,4,0,0,0,5,0,0,0,3,0,0,0,2,92,92,89,88,11,13,13,130,7,7,7,254,250,250,249,1,244,244,245,124,164,162,165,158,0,0,0,251,123,123,123,6,67,67,67,224,1,225,225,225,109,251,251,251,18,100,100,100,160, -17,39,71,63,9,19,31,153,44,39,33,8,251,246,238,0,0,4,7,0,254,2,9,0,218,219,223,246,236,214,180,83,251,242,232,236,0,0,0,248,0,0,0,248,0,0,0,248,0,0,0,253,0,0,0,253,0,0,0,252,0,0,0,3,0,0,0,6,0,0,0,6,0, -0,0,5,0,0,0,6,0,0,0,6,15,15,15,1,35,35,35,18,229,229,229,229,233,233,233,242,0,0,0,250,0,0,0,251,174,174,174,107,8,8,8,233,1,0,0,0,13,228,228,228,155,208,208,208,162,140,140,140,218,17,40,74,70,8,16,26, -139,10,11,9,253,2,2,3,3,243,243,245,2,247,235,220,126,241,221,191,193,0,0,0,250,0,0,0,249,0,0,0,249,0,0,0,248,0,0,0,249,0,0,0,249,0,0,0,253,0,0,0,6,0,0,0,5,0,0,0,4,0,0,0,3,0,0,0,3,0,0,0,1,0,0,0,255,0, -0,0,254,0,0,0,253,0,0,0,252,0,0,0,250,164,164,164,43,24,24,24,103,4,4,4,95,1,0,0,0,1,0,0,0,5,239,239,239,158,242,242,242,228,207,207,207,183,153,166,179,237,9,20,42,51,0,2,1,10,248,235,222,208,246,233, -212,234,0,0,0,253,0,0,0,253,0,0,0,250,0,0,0,248,0,0,0,248,0,0,0,251,192,192,192,254,0,0,0,0,0,0,0,0,64,64,64,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,255,0,0,0,255,0,0,0,254,178,178,178,13,13,13,13,101, -0,0,0,44,1,1,1,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,87,254,254,254,221,254,254,254,255,253,253,253,255,252,252,252,255,252,252,252,255,252,252,252,255,253,253,253,255,254,254,254,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,239,255,255,255,99,0,0,0,0,0,0,0,0,0,0,0,0,142,119,220,132,34,208,196,92,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* Controls::confighover_png = (const char*) resource_Controls_confighover_png; -const int Controls::confighover_pngSize = 4254; - -// JUCER_RESOURCE: configpushed_png, 4254, "../Assets/config-pushed.png" -static const unsigned char resource_Controls_configpushed_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122,244,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187, -127,0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,223,10,28,2,22,54,175,101,0,252,0,0,16,43,73,68,65,84,88,9,1,32,16,223,239,1,0,0,0,0,0,0,0,0,0,0,0,0,181,181,181,88, -203,203,203,132,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,242, -53,53,53,120,75,75,75,151,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,168,168,168,154,216,216,216,231,0,0,0,170,128,128,128,213,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,8,0,0,0,99,40,40,40,54,88,88,88,95,0,0,0,0,0,0,0,0,0,168,168,168,132,128,128,128,120,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128, -49,168,168,168,161,0,0,0,0,1,181,181,181,49,203,203,203,154,0,0,0,55,128,128,128,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,103,103,100,61,3,5,3,162,0,0,2,9,0,0,0,221,254,252,251,169,248,248,252,154,160,160, -160,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,101,106,117,70,5,0,0,204,150,150,139,238,0,0,0,0,0,0,0,0,128,128,128,131,53,53,53,208,3,38,38,38,171,0,0,0,135,128, -128,128,216,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,102,102,13,0,1,254,218,24,24,25,16,48,47,50,12,19,19,19,29,248,250,249,65,253,255,252,95,47,45,47,168,207,207,207,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,108,119,117,0,0,255,162,0,3,3,90,48,51,57,174,207,204,198,241,0,0,0,0,64,64,64,241,230,230,230,145,2,0,0,0,42,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,154,154, -154,243,3,2,3,63,234,235,233,246,245,246,245,254,21,20,21,0,53,51,54,8,35,33,35,30,9,10,7,175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,127,127,3,104,110,120,158,5,6,5,127,40,43,43,0, -22,25,24,26,3,3,2,206,99,108,116,46,0,0,0,0,0,0,0,210,0,0,0,30,2,0,0,0,18,128,128,128,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,151,151,154,194,250,252,253,66,204,204,201,2,255,255,255,249,253, -253,253,0,34,33,35,3,8,8,8,45,101,104,98,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,102,117,13,231,239,249,190,10,10,11,86,36,38,39,11,4,5,5,0,20,21,21,3,20,21,21,18,2,255,1,209,114,114,114,5,128, -128,128,252,0,0,0,14,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,100,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,156,152,156,201,0,0,0,241,253,253,253,229,0,0,0,0,251,251,251,0,25,25,27,11,4,3,5,84,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,3,207,18,18,18,55,34,37,36,11,2,3,2,0,0,0,0,0,254,254,254,0,240,241,239,245,1,1,1,93,142,142,142,251,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,102,102,99,71,2,3,255,236,110, -110,108,85,0,0,0,0,0,0,0,0,0,0,0,0,101,105,101,49,0,0,0,15,3,3,3,245,3,3,3,0,2,2,2,0,9,9,9,1,3,3,3,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,0,19,28,27,24,7,252,252,251,0,252,251,251,0,253,252, -251,0,228,226,227,248,252,250,253,184,154,148,138,164,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,3,5,4,158,36,35,37,0,253,254,253,166,114,114,112,80,0,0,0,0,103,103,99,48,1,253,254,181,27,26,29, -126,8,8,8,33,6,6,6,0,6,6,6,0,250,250,250,255,0,0,0,231,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,102,114,15,254,255,253,16,253,253,253,0,251,250,250,0,254,253,252,0,241,240,240,255,243,241,240,240,0,250,253, -97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,237,21,21,23,26,24,24,25,4,196,197,194,175,102,103,99,0,255,0,0,0,33,34,34,147,46,45,48,122,255,255,255,8,253,253,253,0,3,3,3,0,236,236, -235,252,253,252,252,2,0,0,0,0,0,0,0,0,0,0,0,0,96,114,114,10,0,250,5,192,31,30,26,251,255,254,253,5,245,243,242,0,249,249,249,0,237,237,239,1,0,254,255,79,154,154,139,243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,4,0,0,0,0,0,0,0,0,0,0,0,0,253,253,252,179,235,235,233,42,36,36,38,3,74,73,77,0,0,0,0,0,0,0,0,0,0,0,0,109,249,249,249,0,247,247,247,0,255,255,255,0,4,4,4,0,38,38,39,5,202,202,238,89,104,106,102,177,152, -150,154,177,96,114,114,10,6,250,4,190,34,32,27,43,11,11,10,5,221,223,227,246,246,246,247,215,0,255,0,189,0,255,0,198,154,150,139,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,249, -247,252,146,226,228,227,108,33,33,35,14,2,2,2,0,254,254,254,0,1,1,1,0,1,1,1,0,255,255,255,0,10,10,10,0,243,243,243,0,217,217,217,0,16,16,16,0,54,53,57,8,202,202,199,168,102,105,102,78,255,250,4,123,36, -33,30,49,13,13,9,5,220,222,228,246,246,246,247,151,154,148,138,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,157,157,157,233,254,254,254,110,195,196,193, -248,244,244,243,0,9,9,9,0,8,8,8,0,7,7,7,0,2,2,2,0,245,246,244,0,255,255,255,0,12,12,12,0,255,255,255,0,247,247,247,0,54,54,56,8,1,3,12,183,35,32,27,58,16,16,12,6,225,226,231,247,243,243,245,155,154,148, -138,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,148,151,161,104,104,102,240,199,200,198,156,9,9,9,9,14,15,15,2,248,247,247,254,239, -240,239,4,253,252,252,7,56,56,58,255,12,12,12,1,0,0,0,0,0,0,0,0,214,218,226,0,32,30,30,3,18,17,15,3,222,225,229,249,238,239,241,158,154,149,139,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,152,154,177,20,19,22,24,242,241,239,57,227,228,225,78,236,235,235,68,1,255,3,17,2,1,0,47,204,205,203,245,6,7,6,255,2,2,2,0,224, -228,234,0,12,12,11,0,19,19,16,0,225,227,231,0,240,237,236,1,253,254,238,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,129,129,129,253,0,0,0,211,0,0,0,211,0,0,0,0,0,0,0,0,22,55,100,252,16,10,252,154,220,233,199,108,47,38,30,6,14,12,10,0,22,21,18,0,227,229,233,0,6,4,3,0,47,44,37,4,213,214,211,205,100,100, -100,43,156,156,156,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,56,101,98,6,4,4,202, -61,54,47,111,250,6,26,3,173,196,229,0,9,11,13,0,229,230,234,0,0,255,254,0,31,28,22,0,20,20,21,2,35,35,37,18,7,9,5,205,102,102,102,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,56,100,78,4,5,4,148,67,61,48,11,46,39,26,3,46,41,31,3,25,25,21,0,150,174,207,0,246,248,250,0,37,33,27,0,4,4,4,0,247,247, -247,0,31,30,32,3,31,29,32,25,6,8,4,199,96,96,96,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,55,100,55,2,2,2, -166,59,53,43,9,244,248,253,0,180,199,225,0,211,221,235,0,23,20,17,0,6,6,7,253,215,221,227,251,255,0,254,0,254,254,254,0,3,3,3,0,245,245,245,0,36,36,37,4,22,22,23,37,13,14,11,191,96,96,96,6,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,55,101,66,2,2,2,187,55,50,42,10,255,1,2,0,240,243,247,0,237,230,222,0,234,226,214,0,248,248,248, -0,247,249,251,245,241,248,252,113,201,202,201,248,255,0,255,0,254,254,254,0,2,2,2,0,246,246,246,0,44,42,45,4,16,16,16,48,14,15,12,180,127,127,127,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,55,100,103,4,4,2,179,61,55,45,13,6,7,6,1,236,240,245,0,244,236,226,0,249,248,244,0,21,21,22,0,229,232,240,250,250,251,251,208,195,176,157,149,255,253,253, -80,202,202,200,249,254,254,253,0,0,0,0,0,1,1,1,0,248,248,248,0,48,47,50,6,10,10,11,63,239,240,237,167,191,191,191,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,58,105, -20,25,56,102,180,7,9,8,141,65,59,48,10,254,2,3,0,252,252,251,0,247,239,228,0,244,244,242,0,20,19,20,0,241,246,2,250,234,237,239,219,0,249,0,78,0,0,0,0,151,151,154,185,254,0,254,84,201,203,200,250,250, -251,250,0,0,0,0,0,254,254,254,0,251,251,251,0,51,50,52,6,6,6,6,78,176,176,173,151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,24,55,100,110,253,0,252,223,19,20,16,69,66,60,48,11, -255,0,1,0,21,14,6,0,235,230,224,0,241,241,241,0,18,18,18,0,242,247,2,250,232,235,238,218,0,250,0,59,231,205,154,241,0,0,0,0,0,0,0,0,151,148,153,180,0,254,0,88,204,204,202,249,250,250,250,0,3,3,3,0,253, -253,253,0,251,251,251,0,49,48,51,7,2,3,3,96,108,111,105,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,25,55,102,62,5,6,5,131,37,33,31,12,52,47,38,6,9,7,3,0,36,26,13,0,216,216,217,0,235,237,239, -0,16,15,15,0,250,255,8,252,232,235,240,220,0,250,0,60,231,205,154,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,150,152,175,255,0,255,96,204,205,202,250,247,248,247,0,253,253,253,0,242,242,242,0,228,228,228, -0,45,44,47,7,253,251,254,126,101,101,101,17,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,255,0,255,66,17,16,15,13,51,44,30,0,33,23,11,0,27,19,9,0,195,203,214,0,232,233,235,0,10,9,9,0,2,6,15,0,226,229,236, -243,252,1,253,70,231,205,154,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,148,152,168,1,3,2,100,205,205,203,250,250,250,250,0,245,245,245,0,239,239,239,0,245,245,245,0,12,13,13,253,1,1,254, -52,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,254,224,6,4,1,247,10,6,3,0,233,238,245,0,181,197,217,0,232,231,229,0,3,4,5,0,16,20,26,0,223,227,234,247,250,247,241,86,235,199,157,238,0,0,0,4,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,7,148,145,149,172,251,250,250,114,208,208,205,250,12,13,12,0,32,32,32,0,9,9,9,0,244,244,243,2,250,250,253,217,0,0,0,0,0,0,0,0,0,0,0,0,3,60,60,60,112,255,255, -255,162,225,221,216,229,250,6,22,101,0,3,5,8,246,249,253,0,233,231,228,0,252,250,251,0,22,25,28,0,234,237,244,250,242,241,239,178,236,207,166,173,0,0,0,8,0,0,0,7,0,0,0,6,0,0,0,2,0,0,0,4,0,0,0,6,0,0,0, -10,0,0,0,10,0,0,0,11,0,0,0,11,205,205,207,218,37,37,36,234,237,239,238,61,239,239,237,250,227,228,226,252,244,244,245,124,162,161,163,200,0,0,0,3,82,82,82,12,22,22,22,105,4,32,32,32,126,236,236,236,102, -195,195,152,160,5,16,31,110,208,212,0,153,44,39,33,8,17,13,9,0,0,17,16,0,255,2,5,0,237,238,239,252,239,218,187,159,0,0,0,17,0,0,0,248,0,0,0,248,0,0,0,248,0,0,0,7,0,0,0,253,0,0,0,252,0,0,0,3,0,0,0,6,0, -0,0,6,0,0,0,5,0,0,0,6,165,165,168,189,15,15,15,190,35,35,35,18,228,228,228,229,234,234,234,242,0,0,0,6,0,0,0,1,34,34,34,107,46,46,46,116,3,178,178,178,215,95,95,95,98,4,4,4,231,210,198,182,208,3,11,23, -221,238,244,252,65,247,252,0,248,244,246,252,253,230,230,235,253,247,235,221,127,246,233,212,216,0,0,0,251,0,0,0,251,0,0,0,252,0,0,0,251,0,0,0,250,0,0,0,248,0,0,0,250,0,0,0,0,0,0,0,255,0,0,0,254,0,0,0, -252,0,0,0,251,0,0,0,247,249,249,249,245,231,231,231,235,245,245,245,246,0,0,0,251,0,0,0,250,110,110,110,42,52,52,52,70,87,87,87,125,1,0,0,0,1,0,0,0,5,155,155,155,158,209,209,209,228,223,223,223,183,190, -203,215,237,9,20,42,51,0,1,2,10,248,236,221,208,246,233,213,234,0,0,0,253,0,0,0,253,0,0,0,250,0,0,0,248,0,0,0,248,0,0,0,251,0,0,0,254,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,255, -0,0,0,255,0,0,0,254,119,119,119,13,9,9,9,101,40,40,40,44,88,88,88,96,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,181,181,181,87,202,202,202,134,0,0,0,34,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1, -1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,53,53,53,116,75,75,75,157,0,0,0,0,0,0,0,0,22,82,238,110,38,194,229,141,0,0, -0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* Controls::configpushed_png = (const char*) resource_Controls_configpushed_png; -const int Controls::configpushed_pngSize = 4254; - - -//[EndFile] You can add extra defines here... -//[/EndFile] +/*\ +|*| Copyright 2015 bill-auger +|*| +|*| This file is part of the AvCaster program. +|*| +|*| AvCaster is free software: you can redistribute it and/or modify +|*| it under the terms of the GNU Lesser General Public License version 3 +|*| as published by the Free Software Foundation. +|*| +|*| AvCaster 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 Lesser General Public License for more details. +|*| +|*| You should have received a copy of the GNU Lesser General Public License +|*| along with AvCaster. If not, see . +\*/ + +//[Headers] You can add your own extra header files here... + +#include "AvCaster.h" + +//[/Headers] + +#include "Controls.h" + + +//[MiscUserDefs] You can add your own user definitions and misc code here... +//[/MiscUserDefs] + +//============================================================================== +Controls::Controls () +{ + addAndMakeVisible (controlsGroup = new GroupComponent ("controlsGroup", + TRANS("Controls"))); + controlsGroup->setColour (GroupComponent::outlineColourId, Colours::white); + controlsGroup->setColour (GroupComponent::textColourId, Colours::white); + + addAndMakeVisible (screencapToggle = new ToggleButton ("screencapToggle")); + screencapToggle->setExplicitFocusOrder (1); + screencapToggle->setButtonText (TRANS("Screen")); + screencapToggle->addListener (this); + screencapToggle->setColour (ToggleButton::textColourId, Colours::white); + + addAndMakeVisible (cameraToggle = new ToggleButton ("cameraToggle")); + cameraToggle->setExplicitFocusOrder (2); + cameraToggle->setButtonText (TRANS("Camera")); + cameraToggle->addListener (this); + cameraToggle->setColour (ToggleButton::textColourId, Colours::white); + + addAndMakeVisible (textToggle = new ToggleButton ("textToggle")); + textToggle->setExplicitFocusOrder (3); + textToggle->setButtonText (TRANS("Text")); + textToggle->addListener (this); + textToggle->setColour (ToggleButton::textColourId, Colours::white); + + addAndMakeVisible (interstitialToggle = new ToggleButton ("interstitialToggle")); + interstitialToggle->setExplicitFocusOrder (4); + interstitialToggle->setButtonText (TRANS("Pause")); + interstitialToggle->addListener (this); + interstitialToggle->setColour (ToggleButton::textColourId, Colours::white); + + addAndMakeVisible (previewToggle = new ToggleButton ("previewToggle")); + previewToggle->setExplicitFocusOrder (5); + previewToggle->setButtonText (TRANS("Preview")); + previewToggle->addListener (this); + previewToggle->setColour (ToggleButton::textColourId, Colours::white); + + addAndMakeVisible (audioToggle = new ToggleButton ("audioToggle")); + audioToggle->setExplicitFocusOrder (6); + audioToggle->setButtonText (TRANS("Audio")); + audioToggle->addListener (this); + audioToggle->setColour (ToggleButton::textColourId, Colours::white); + + addAndMakeVisible (outputToggle = new ToggleButton ("outputToggle")); + outputToggle->setExplicitFocusOrder (7); + outputToggle->setButtonText (TRANS("Broadcast")); + outputToggle->addListener (this); + outputToggle->setColour (ToggleButton::textColourId, Colours::white); + + addAndMakeVisible (presetsCombo = new ComboBox ("presetsCombo")); + presetsCombo->setExplicitFocusOrder (8); + presetsCombo->setEditableText (true); + presetsCombo->setJustificationType (Justification::centredLeft); + presetsCombo->setTextWhenNothingSelected (TRANS("livecoding.tv")); + presetsCombo->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); + presetsCombo->addListener (this); + + addAndMakeVisible (configButton = new ImageButton ("configButton")); + configButton->setExplicitFocusOrder (9); + configButton->addListener (this); + + configButton->setImages (false, true, true, + ImageCache::getFromMemory (preferencessystem_png, preferencessystem_pngSize), 1.000f, Colour (0x00000000), + ImageCache::getFromMemory (confighover_png, confighover_pngSize), 1.000f, Colour (0x00000000), + ImageCache::getFromMemory (configpushed_png, configpushed_pngSize), 1.000f, Colour (0x00000000)); + + //[UserPreSize] + //[/UserPreSize] + + setSize (1, 1); + + + //[Constructor] You can add your own custom stuff here.. + + this->mainContent->configureCombobox(this->presetsCombo) ; + + //[/Constructor] +} + +Controls::~Controls() +{ + //[Destructor_pre]. You can add your own custom destruction code here.. + //[/Destructor_pre] + + controlsGroup = nullptr; + screencapToggle = nullptr; + cameraToggle = nullptr; + textToggle = nullptr; + interstitialToggle = nullptr; + previewToggle = nullptr; + audioToggle = nullptr; + outputToggle = nullptr; + presetsCombo = nullptr; + configButton = nullptr; + + + //[Destructor]. You can add your own custom destruction code here.. + //[/Destructor] +} + +//============================================================================== +void Controls::paint (Graphics& g) +{ + //[UserPrePaint] Add your own custom painting code here.. + //[/UserPrePaint] + + g.setColour (Colour (0xff303030)); + g.fillRoundedRectangle (20.0f, 22.0f, static_cast (getWidth() - 40), 52.0f, 4.000f); + + //[UserPaint] Add your own custom painting code here.. + //[/UserPaint] +} + +void Controls::resized() +{ + //[UserPreResize] Add your own custom resize code here.. + //[/UserPreResize] + + controlsGroup->setBounds (16, 12, getWidth() - 32, 64); + screencapToggle->setBounds (32, 36, 72, 24); + cameraToggle->setBounds (108, 36, 76, 24); + textToggle->setBounds (188, 36, 52, 24); + interstitialToggle->setBounds (244, 36, 64, 24); + previewToggle->setBounds (314, 36, 78, 24); + audioToggle->setBounds (396, 36, 64, 24); + outputToggle->setBounds (464, 36, 90, 24); + presetsCombo->setBounds (560, 36, 128, 24); + configButton->setBounds (696, 36, 24, 24); + //[UserResized] Add your own custom resize handling here.. + //[/UserResized] +} + +void Controls::buttonClicked (Button* buttonThatWasClicked) +{ + //[UserbuttonClicked_Pre] + + Identifier key ; + var value = var(buttonThatWasClicked->getToggleState()) ; + + //[/UserbuttonClicked_Pre] + + if (buttonThatWasClicked == screencapToggle) + { + //[UserButtonCode_screencapToggle] -- add your button handler code here.. + + key = CONFIG::IS_SCREENCAP_ACTIVE_ID ; + + //[/UserButtonCode_screencapToggle] + } + else if (buttonThatWasClicked == cameraToggle) + { + //[UserButtonCode_cameraToggle] -- add your button handler code here.. + + key = CONFIG::IS_CAMERA_ACTIVE_ID ; + + //[/UserButtonCode_cameraToggle] + } + else if (buttonThatWasClicked == textToggle) + { + //[UserButtonCode_textToggle] -- add your button handler code here.. + + key = CONFIG::IS_TEXT_ACTIVE_ID ; + + //[/UserButtonCode_textToggle] + } + else if (buttonThatWasClicked == interstitialToggle) + { + //[UserButtonCode_interstitialToggle] -- add your button handler code here.. + + key = CONFIG::IS_IMAGE_ACTIVE_ID ; + + //[/UserButtonCode_interstitialToggle] + } + else if (buttonThatWasClicked == previewToggle) + { + //[UserButtonCode_previewToggle] -- add your button handler code here.. + + key = CONFIG::IS_PREVIEW_ACTIVE_ID ; + + //[/UserButtonCode_previewToggle] + } + else if (buttonThatWasClicked == audioToggle) + { + //[UserButtonCode_audioToggle] -- add your button handler code here.. + + key = CONFIG::IS_AUDIO_ACTIVE_ID ; + + //[/UserButtonCode_audioToggle] + } + else if (buttonThatWasClicked == outputToggle) + { + //[UserButtonCode_outputToggle] -- add your button handler code here.. + + key = CONFIG::IS_OUTPUT_ACTIVE_ID ; + + //[/UserButtonCode_outputToggle] + } + else if (buttonThatWasClicked == configButton) + { + //[UserButtonCode_configButton] -- add your button handler code here.. + + if (AvCaster::RejectPresetChange()) return ; + + key = CONFIG::IS_PENDING_ID ; + value = var(!AvCaster::GetIsConfigPending()) ; + + //[/UserButtonCode_configButton] + } + + //[UserbuttonClicked_Post] + + AvCaster::SetConfig(key , value) ; + + //[/UserbuttonClicked_Post] +} + +void Controls::comboBoxChanged (ComboBox* comboBoxThatHasChanged) +{ + //[UsercomboBoxChanged_Pre] + //[/UsercomboBoxChanged_Pre] + + if (comboBoxThatHasChanged == presetsCombo) + { + //[UserComboBoxCode_presetsCombo] -- add your combo box handling code here.. + + String preset_name = this->presetsCombo->getText() ; + int option_n = this->presetsCombo->getSelectedItemIndex() ; + + AvCaster::SetPreset(preset_name , option_n) ; + + return ; + + //[/UserComboBoxCode_presetsCombo] + } + + //[UsercomboBoxChanged_Post] + //[/UsercomboBoxChanged_Post] +} + + + +//[MiscUserCode] You can add your own definitions of your custom methods or any other code here... + +void Controls::broughtToFront() { loadConfig() ; } + +void Controls::loadConfig() +{ + ValueTree config_store = AvCaster::GetConfigStore() ; + bool is_screencap_on = bool(config_store[CONFIG::IS_SCREENCAP_ACTIVE_ID]) ; + bool is_camera_on = bool(config_store[CONFIG::IS_CAMERA_ACTIVE_ID ]) ; + bool is_text_on = bool(config_store[CONFIG::IS_TEXT_ACTIVE_ID ]) ; + bool is_interstitial_on = bool(config_store[CONFIG::IS_IMAGE_ACTIVE_ID ]) ; + bool is_preview_on = bool(config_store[CONFIG::IS_PREVIEW_ACTIVE_ID ]) ; + bool is_audio_on = bool(config_store[CONFIG::IS_AUDIO_ACTIVE_ID ]) ; + bool is_output_on = bool(config_store[CONFIG::IS_OUTPUT_ACTIVE_ID ]) ; + bool is_media_enabled = AvCaster::GetIsMediaEnabled() ; + bool is_preview_enabled = AvCaster::GetIsPreviewEnabled() ; + bool is_audio_enabled = AvCaster::GetIsAudioEnabled() ; + + this->screencapToggle ->setToggleState (is_screencap_on , juce::dontSendNotification) ; + this->cameraToggle ->setToggleState (is_camera_on , juce::dontSendNotification) ; + this->textToggle ->setToggleState (is_text_on , juce::dontSendNotification) ; + this->interstitialToggle->setToggleState (is_interstitial_on , juce::dontSendNotification) ; + this->previewToggle ->setToggleState (is_preview_on , juce::dontSendNotification) ; + this->audioToggle ->setToggleState (is_audio_on , juce::dontSendNotification) ; + this->outputToggle ->setToggleState (is_output_on , juce::dontSendNotification) ; + this->mainContent ->loadPresetsCombo(this->presetsCombo) ; + + // disable controls per cli args + this->screencapToggle ->setEnabled(is_media_enabled ) ; + this->cameraToggle ->setEnabled(is_media_enabled ) ; + this->textToggle ->setEnabled(is_media_enabled ) ; + this->interstitialToggle->setEnabled(is_media_enabled ) ; + this->previewToggle ->setEnabled(is_preview_enabled) ; + this->audioToggle ->setEnabled(is_audio_enabled ) ; + this->outputToggle ->setEnabled(is_media_enabled ) ; + +#ifdef DISABLE_GUI_CONTROLS_NYI +this->screencapToggle ->setEnabled(false) ; +this->cameraToggle ->setEnabled(false) ; +this->textToggle ->setEnabled(false) ; +this->interstitialToggle->setEnabled(false) ; +#endif // DISABLE_GUI_CONTROLS_NYI +} + +//[/MiscUserCode] + + +//============================================================================== +#if 0 +/* -- Introjucer information section -- + + This is where the Introjucer stores the metadata that describe this GUI layout, so + make changes in here at your peril! + +BEGIN_JUCER_METADATA + + + + + + + + + + + + + + + + + +END_JUCER_METADATA +*/ +#endif + +//============================================================================== +// Binary resources - be careful not to edit any of these sections! + +// JUCER_RESOURCE: preferencessystem_png, 2129, "../Assets/preferences-system.png" +static const unsigned char resource_Controls_preferencessystem_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122,244,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100, +136,0,0,8,8,73,68,65,84,88,133,237,150,107,80,84,231,25,199,255,231,186,247,93,129,101,193,101,65,46,106,21,144,155,58,136,241,66,172,162,226,68,99,106,173,237,76,167,173,218,241,139,83,149,96,65,116, +82,167,41,176,98,117,180,214,100,72,140,153,100,58,109,194,180,90,13,70,136,134,161,157,198,154,78,210,40,226,133,5,21,185,45,236,194,194,46,44,123,238,167,31,194,102,86,5,177,147,15,253,210,103,230,153, +247,125,207,121,159,231,255,123,158,247,157,51,7,248,191,253,143,141,152,110,67,77,77,213,114,154,165,223,7,72,29,8,220,151,5,225,195,96,80,120,235,240,225,195,220,243,138,84,31,127,167,72,3,245,139,146, +146,157,190,255,10,224,200,145,35,38,149,144,2,105,169,179,145,151,187,16,254,64,0,173,183,91,56,239,160,215,205,5,133,130,131,7,15,14,76,39,126,228,196,187,251,21,85,169,161,40,170,91,16,164,229,135, +74,119,62,138,124,79,62,43,184,172,172,108,148,38,169,149,221,61,143,198,253,129,128,226,72,112,96,237,154,245,218,172,204,236,36,131,73,119,254,89,177,117,117,117,212,209,83,239,157,101,117,154,95,45, +46,40,64,98,74,138,157,97,168,127,87,158,120,59,235,185,1,0,160,180,180,252,239,156,40,173,250,228,202,101,82,85,85,94,146,36,100,45,200,166,12,122,195,130,234,163,175,23,78,90,245,145,119,76,15,7,198, +155,76,102,243,214,156,188,69,6,86,163,65,130,195,65,217,29,142,104,82,37,111,214,214,214,50,83,2,84,85,85,197,60,249,172,98,127,197,231,0,252,162,40,246,2,0,207,243,72,77,77,51,176,180,102,203,164,212, +58,234,171,248,248,248,252,172,220,28,3,69,83,0,0,89,145,225,245,122,130,4,65,252,120,215,174,93,226,164,0,78,103,229,90,146,86,7,79,157,58,241,253,200,231,213,199,170,115,1,88,104,154,14,210,52,13,146, +36,97,52,26,9,154,166,83,38,211,39,84,196,204,153,157,162,17,4,1,162,192,67,18,121,180,223,109,227,4,94,108,40,223,187,253,15,145,123,31,3,96,52,204,217,156,236,92,72,138,244,199,218,218,55,94,6,128,154, +154,202,28,66,82,46,205,73,155,251,154,193,96,72,209,104,52,208,106,181,224,56,78,5,224,126,82,220,233,172,181,200,138,60,67,146,68,8,124,8,178,40,96,208,227,81,125,67,222,17,130,147,127,246,228,126,250, +49,0,134,25,74,116,36,217,147,103,165,208,127,189,120,238,188,179,166,18,10,128,204,5,11,78,173,88,86,88,161,170,170,86,146,36,208,52,141,222,222,30,73,20,197,199,10,56,92,91,171,39,56,182,121,254,188, +52,81,149,37,198,239,243,33,20,26,71,95,159,135,32,20,101,83,89,217,206,209,167,186,21,185,56,126,162,166,50,125,126,102,89,110,206,66,138,36,31,191,30,178,44,35,24,12,66,81,20,48,12,3,94,224,209,208, +80,207,9,146,184,109,127,73,249,133,195,181,181,122,109,136,105,202,202,152,147,103,182,152,152,150,86,215,120,32,48,118,23,42,62,133,138,107,229,37,219,47,76,122,92,145,139,202,202,202,56,163,89,239, +218,242,202,86,51,203,178,144,101,25,36,73,130,32,8,72,146,4,138,162,224,243,249,208,218,218,10,155,205,6,91,156,13,13,13,245,28,47,202,27,21,38,246,96,94,230,188,130,168,40,35,123,227,86,251,248,240, +176,255,205,178,189,219,75,39,19,141,52,42,114,209,212,212,20,44,90,183,198,237,114,181,173,115,36,56,104,171,213,10,134,97,192,48,12,100,89,134,63,48,2,69,86,32,138,34,8,226,107,246,244,140,12,218,245, +112,224,71,89,233,223,113,196,217,162,217,214,59,29,33,239,224,200,219,229,251,182,151,76,39,254,84,7,194,118,244,168,115,19,205,210,103,140,6,163,46,198,106,37,131,193,160,226,241,12,208,162,40,106,54, +20,191,164,10,188,72,0,128,170,170,104,117,117,195,26,19,13,251,204,88,180,220,233,224,251,221,222,51,229,251,118,236,126,30,241,41,1,128,175,191,100,15,30,220,75,87,41,34,142,84,136,49,134,209,223,148, +229,208,28,138,97,63,91,91,180,222,32,240,34,113,235,94,39,44,22,11,18,29,241,184,211,246,16,238,158,46,129,87,134,102,31,122,245,80,247,183,6,152,204,146,214,87,165,199,154,177,35,35,129,218,189,98,225, +60,54,198,98,192,172,36,59,218,58,30,129,33,9,36,217,103,40,215,174,127,54,52,62,198,103,84,84,84,120,159,39,231,180,159,226,176,165,110,168,222,174,101,153,127,189,178,110,197,158,144,38,149,250,221, +249,14,24,45,209,232,184,223,13,40,50,210,231,38,33,33,33,145,204,206,202,141,214,25,53,95,58,157,78,203,243,228,165,166,223,2,164,108,168,218,200,178,236,217,31,110,46,212,23,46,76,38,181,122,3,57,60, +202,227,131,198,155,200,77,53,35,63,103,46,104,154,6,207,243,112,56,18,73,89,146,13,254,209,225,205,75,242,11,222,109,110,110,22,159,149,123,90,128,228,226,170,124,154,162,46,110,46,94,166,15,242,42,254, +113,203,141,78,247,48,236,54,11,6,60,126,89,30,119,203,75,114,231,80,0,1,138,162,192,113,28,146,147,83,72,127,192,31,37,138,252,218,252,252,130,247,155,155,155,229,169,242,63,243,8,102,173,175,94,69,145, +212,149,245,171,243,245,10,65,193,235,27,131,251,126,11,186,239,126,142,241,96,16,163,33,62,232,13,138,251,46,55,126,204,41,170,2,69,81,64,146,36,2,129,0,94,40,88,78,199,218,108,57,49,214,25,245,117,117, +117,83,22,58,37,64,90,113,213,46,134,165,62,218,92,188,204,164,213,233,136,62,143,31,195,125,247,16,10,142,32,193,145,136,142,78,175,192,243,194,141,243,167,15,158,86,68,233,229,134,198,75,188,44,75,0, +0,130,32,16,12,6,81,184,98,21,107,54,91,86,14,120,251,254,164,170,234,164,23,254,41,128,185,47,253,214,154,178,193,89,175,51,232,143,253,96,83,161,94,33,41,136,2,143,177,1,23,252,195,62,216,237,9,24,26, +37,133,238,190,129,118,132,212,141,0,80,90,90,222,168,168,202,150,203,141,151,4,94,224,65,16,4,100,89,6,207,243,88,253,221,34,86,171,209,110,60,253,198,201,55,167,5,72,46,174,250,133,4,241,161,221,110, +91,179,109,243,139,6,5,4,28,49,90,244,60,184,13,239,224,32,226,227,227,49,52,70,9,157,61,3,46,112,120,225,193,213,114,127,56,246,213,189,191,172,135,130,109,159,92,185,204,115,28,7,154,166,191,129,88, +245,226,26,13,69,51,63,61,249,251,99,7,158,4,248,166,45,41,197,206,21,172,134,249,40,115,126,154,57,43,35,5,51,244,20,102,70,105,113,238,227,102,116,118,245,32,46,214,10,129,178,72,109,237,189,46,240, +88,26,41,30,105,199,79,30,221,70,168,196,123,171,87,175,101,89,134,69,32,16,192,224,224,32,28,14,7,26,175,92,230,68,94,182,31,56,112,96,248,169,14,168,80,87,197,217,98,76,171,151,206,67,70,146,25,105, +51,77,56,215,120,29,157,143,122,96,54,154,64,234,172,184,215,209,55,42,16,82,209,84,226,0,80,178,103,255,7,36,77,237,188,122,181,81,8,113,33,248,253,126,120,60,30,4,2,1,68,69,69,201,36,169,44,154,226, +8,148,78,45,67,134,76,58,26,93,253,1,156,185,240,5,58,31,118,128,102,52,136,77,72,69,107,91,119,136,31,243,110,237,169,63,228,195,19,255,17,17,221,164,1,104,246,236,222,247,103,158,227,75,154,155,63,21, +162,162,163,144,158,158,14,131,209,128,145,145,97,50,20,18,219,34,131,40,0,44,0,189,42,140,121,57,173,227,231,160,52,218,81,78,66,215,131,54,8,188,128,164,148,185,232,118,251,5,159,183,255,98,79,147,243, +47,0,180,0,52,19,113,228,132,40,11,64,63,225,6,0,134,171,87,155,92,121,121,57,30,119,191,123,249,128,167,95,112,185,238,73,195,195,35,135,94,255,245,111,174,79,232,18,0,20,2,128,101,34,169,214,182,232, +39,43,77,51,231,215,46,93,156,169,229,3,253,0,163,135,66,25,240,229,87,183,199,251,254,249,214,247,120,95,231,32,0,46,194,229,9,151,34,138,97,1,48,225,185,213,106,37,178,179,179,163,219,219,219,123,187, +186,186,2,0,4,0,226,196,200,19,0,76,97,0,0,26,219,226,29,69,6,91,218,81,179,217,32,147,20,67,13,251,252,228,88,207,141,215,6,91,62,252,91,56,104,194,185,136,185,28,33,76,79,192,132,171,84,1,40,17,160, +225,28,66,184,3,68,4,177,14,0,99,76,204,138,54,38,44,89,8,146,212,7,123,91,110,140,62,186,230,137,168,86,136,232,128,56,145,60,242,30,144,19,99,216,213,8,136,240,252,177,128,201,46,83,120,140,124,175, +98,146,4,223,214,254,3,174,151,133,37,87,153,47,161,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* Controls::preferencessystem_png = (const char*) resource_Controls_preferencessystem_png; +const int Controls::preferencessystem_pngSize = 2129; + +// JUCER_RESOURCE: confighover_png, 4254, "../Assets/config-hover.png" +static const unsigned char resource_Controls_confighover_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122,244,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187, +127,0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,223,10,28,2,20,3,203,224,166,93,0,0,16,43,73,68,65,84,88,9,1,32,16,223,239,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,88, +255,255,255,220,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,241,255,255,255,105, +0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,255,255,255,154,0,0,0,41,0,0,0,79,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,23,0,0,0,2,255,255,255,161,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,132,255,255,255,120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,49,255,255,255,161,0,0,0,0,4,255,255,255, +49,0,0,0,71,0,0,0,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,167,164,61,3,5,3,162,0,0,2,9,0,1,0,221,254,251,251,169,248,248,252,154,96,96,96,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,165,170,182,70,5,0,255,204,86,86,75,238,0,0,0,0,1,1,1,207,255,255,255,226,255,255,255,83,1,255,255,255,195,0,0,0,139,1,1,1,178,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,167,167,13, +255,0,253,242,26,26,27,0,38,37,38,0,244,245,245,0,223,224,222,248,241,241,240,231,250,248,252,57,92,92,92,233,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,172,183,117,254,255,255, +138,2,2,2,227,252,252,253,61,93,87,75,225,0,0,0,0,255,255,255,50,0,0,0,161,1,255,255,255,237,0,0,0,23,1,1,1,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,169,166,62,1,3,1,183,48,47,51,8,21,20,21,2,0, +0,0,0,221,222,220,253,224,224,223,202,84,83,86,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,191,191,3,233,239,250,155,3,5,3,86,34,35,36,11,240,240,241,253,234,231,230,241,253,255,253,65,92,84, +76,210,255,255,255,4,0,0,0,237,2,0,0,0,18,1,1,1,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,87,90,194,250,252,253,66,204,204,202,2,0,0,0,249,253,253,253,0,35,34,36,3,8,8,9,45,165,168,162,64, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,167,182,13,232,239,249,190,10,11,10,86,36,37,39,11,4,5,6,0,20,21,21,3,19,21,21,18,1,255,2,209,179,179,179,5,1,1,1,252,0,0,0,14,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,164,164,164,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,92,88,92,201,0,0,0,241,252,252,252,229,0,0,0,0,250,250,250,0,26,25,26,11,5,3,5,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,2,207,18,18,18,55,34,36, +36,11,2,3,3,0,0,0,0,0,254,255,253,0,240,240,240,245,1,1,0,93,77,77,77,251,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,166,166,164,71,2,3,0,236,174,174,172,85,0,0,0,0,0,0,0,0,0,0,0,0,165,170,165,49,0,0,0, +15,3,3,3,245,3,3,3,0,2,2,2,0,9,9,9,1,3,3,3,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,27,27,25,7,252,252,252,0,253,252,250,0,253,252,250,0,228,225,227,248,252,251,252,184,90,84,74,164,0,0,0,0, +0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,4,5,3,158,36,36,36,0,253,255,253,166,179,179,176,80,0,0,0,0,167,167,164,48,1,253,255,181,28,27,28,126,8,8,8,33,5,5,5,0,6,6,6,0,250,250,250,255,0,0,0,231,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,166,166,179,15,254,254,254,16,253,253,252,0,251,251,249,0,253,252,252,0,241,240,240,255,243,242,240,240,1,250,254,97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0, +3,4,4,237,22,21,23,26,24,23,25,4,196,197,195,175,166,167,164,0,255,0,0,0,33,33,33,147,46,45,48,122,255,255,255,8,253,253,253,0,3,3,3,0,235,236,235,252,252,252,253,2,0,0,0,0,0,0,0,0,0,0,0,0,160,179,179, +10,1,250,4,192,31,30,26,251,0,254,253,5,245,242,242,0,249,249,249,0,237,237,239,1,1,254,255,79,89,89,75,243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,255,255,255,1,1,1,1,0,0,0,0,170,172,167,133,32,31,33,119, +37,36,39,3,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,254,254,254,0,248,248,248,0,254,254,254,0,4,4,4,0,251,251,251,0,202,202,199,248,251,253,252,88,88,86,90,177,160,179,179,10,6,249,3,190,34,32,28,50,11,11,10,5, +221,223,227,246,246,246,247,215,0,255,0,189,0,255,0,198,90,86,74,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,164,164,164,23,9,10,7,218,63,62,65,14,4,4,4,0,254, +254,254,0,1,1,1,0,1,1,1,0,253,253,253,0,2,2,2,0,243,243,243,0,223,223,223,0,16,16,16,0,17,18,17,0,202,202,199,248,251,252,254,78,254,4,15,123,38,33,30,57,12,12,9,6,220,223,229,246,244,243,244,151,89,84, +74,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,0,0,0,0,170,173,169,95,4,3,4,152,54,52,54,8,20,20,21,0,255,255,255,0,0,0,0,0,248,248,248, +0,245,246,244,0,253,252,254,0,236,236,236,0,3,3,3,0,9,9,9,0,9,10,8,0,197,202,210,253,33,31,30,254,18,17,15,5,222,223,228,247,238,239,242,154,90,85,74,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,168,168,166,79,3,5,3,156,9,8,9,9,14,15,15,2,248,248,248,254,240,239,238,4,252,252,253,7,56,56,57,255,252,251,253,1,0, +0,0,0,255,255,255,0,223,227,234,0,15,15,14,0,19,18,15,0,222,225,229,249,238,237,241,156,90,85,74,108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255, +255,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,191,191,3,231,231,226,42,255,2,1,23,2,255,1,244,3,3,7,209,254,254,250,37,2,4,4,197,54,52,55,11,251,251,252,1,222,226,232,0,12,11,11,0,21,21,18,0,225,227, +232,0,237,235,233,250,251,255,242,36,93,86,93,227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,119,164,42,15,10,0,99,33,21,3,108,46,38,30,6,14,11,8,0,23,22,19,0,227,229,233,0,4,2,1,0,22,19,12,254,213,214,212,237,248,247,250,43,92,92,92,235,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90,120,165,98,6,4,4,202,62,54,47,111,249,5,25,3,174,195, +229,0,9,11,13,0,229,230,235,0,0,255,254,0,31,28,22,0,21,21,22,2,35,35,36,18,7,9,6,205,166,166,166,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,89,120,164,78,3,5,4,148,66,62,48,11,45,39,26,3,46,41,31,3,24,25,21,0,150,174,207,0,246,248,249,0,37,33,27,0,4,4,4,0,247,247,247,0,31,30,32,3,31,30,31,25,7, +8,4,199,160,160,160,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,120,164,55,2,2,3,166,60,54,43,9,244,247,253, +0,180,199,225,0,211,221,235,0,23,21,16,0,7,6,7,253,216,222,227,251,255,0,254,0,255,255,255,0,2,2,2,0,245,245,245,0,37,36,38,4,21,22,23,37,13,14,11,191,160,160,160,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,119,165,66,2,1,3,187,55,51,41,10,254,0,3,0,241,243,247,0,237,230,222,0,235,226,215,0,248,247,248,0,246,249,251,245,240, +247,253,113,201,203,201,248,254,255,254,0,254,254,254,0,2,2,2,0,245,245,245,0,45,43,46,4,16,17,17,48,14,15,12,180,191,191,191,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,90,120,164,103,4,4,2,179,61,55,45,13,6,6,7,1,237,240,244,0,243,237,226,0,250,248,244,0,20,21,21,0,229,233,240,250,251,251,252,208,131,112,92,149,255,252,253,80,202,203,200,249, +254,254,253,0,0,0,0,0,1,1,1,0,247,247,247,0,48,46,49,6,11,10,11,63,239,241,237,167,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,122,169,20,89,120,166,180, +7,8,8,141,65,59,48,10,255,2,2,0,252,252,250,0,247,239,228,0,245,243,243,0,19,19,20,0,242,246,2,250,235,236,239,219,0,249,255,78,0,0,0,0,87,87,90,185,255,255,254,84,201,203,200,250,251,251,251,0,1,1,1, +0,254,254,254,0,251,251,251,0,51,51,53,6,6,5,6,78,176,177,173,151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,88,120,164,110,253,0,252,223,19,20,16,69,66,60,49,11,255,0,1,0,20,14, +6,0,235,231,224,0,240,241,241,0,18,18,18,0,242,247,2,250,232,235,239,218,0,250,0,59,166,141,90,241,0,0,0,0,0,0,0,0,86,84,89,180,0,254,0,88,203,205,201,249,250,250,250,0,3,3,3,0,254,254,254,0,250,250,250, +0,50,49,52,7,2,3,4,96,173,175,170,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,255,255,255,1,1,1,1,89,120,166,62,4,5,4,179,33,31,26,14,35,32,25,0,12,7,2,0,18,13,6,0,195,201,208,0,232,233,235,0,17,16,15,0, +252,2,11,252,227,228,236,218,0,251,0,58,166,141,90,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,170,173,168,88,1,255,1,161,51,51,53,6,5,4,5,0,245,245,245,0,241,241,241,0,21,21,21,0,203,204,201,248,252, +251,254,26,91,91,91,239,0,0,0,0,255,255,255,255,2,0,0,0,0,0,0,0,0,255,0,255,66,18,16,14,13,51,43,30,0,32,22,10,0,26,19,10,0,195,203,214,0,232,232,235,0,11,9,10,0,2,7,15,0,226,229,237,243,251,1,253,70, +166,141,90,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,86,83,88,168,2,3,2,100,205,205,203,250,249,250,249,0,245,245,245,0,240,240,240,0,246,246,246,0,13,13,13,253,2,2,255,52,0,0,0,0,0,0,0,0,0, +0,0,0,2,0,0,0,0,0,0,0,0,0,0,255,224,6,4,1,247,10,7,3,0,233,238,246,0,181,197,217,0,232,231,229,0,3,4,5,0,15,20,25,0,223,226,234,247,251,247,240,86,235,199,157,238,64,64,64,4,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,64,64,64,1,64,64,64,4,64,64,64,7,147,145,149,172,251,250,251,114,208,208,206,250,13,13,13,0,31,31,31,0,8,9,8,0,244,244,243,2,249,249,252,217,0,0,0,0,0,0,0,0,0,0,0,0,1,250,250,250,239,161,161,161, +42,176,188,206,8,15,35,61,207,48,44,37,15,6,7,6,0,223,221,219,0,249,247,245,0,25,27,30,0,235,238,247,250,235,233,231,176,233,205,163,122,0,0,0,251,0,0,0,250,0,0,0,250,0,0,0,249,0,0,0,254,0,0,0,1,0,0,0, +5,0,0,0,4,0,0,0,5,0,0,0,3,0,0,0,2,92,92,89,88,11,13,13,130,7,7,7,254,250,250,249,1,244,244,245,124,164,162,165,158,0,0,0,251,123,123,123,6,67,67,67,224,1,225,225,225,109,251,251,251,18,100,100,100,160, +17,39,71,63,9,19,31,153,44,39,33,8,251,246,238,0,0,4,7,0,254,2,9,0,218,219,223,246,236,214,180,83,251,242,232,236,0,0,0,248,0,0,0,248,0,0,0,248,0,0,0,253,0,0,0,253,0,0,0,252,0,0,0,3,0,0,0,6,0,0,0,6,0, +0,0,5,0,0,0,6,0,0,0,6,15,15,15,1,35,35,35,18,229,229,229,229,233,233,233,242,0,0,0,250,0,0,0,251,174,174,174,107,8,8,8,233,1,0,0,0,13,228,228,228,155,208,208,208,162,140,140,140,218,17,40,74,70,8,16,26, +139,10,11,9,253,2,2,3,3,243,243,245,2,247,235,220,126,241,221,191,193,0,0,0,250,0,0,0,249,0,0,0,249,0,0,0,248,0,0,0,249,0,0,0,249,0,0,0,253,0,0,0,6,0,0,0,5,0,0,0,4,0,0,0,3,0,0,0,3,0,0,0,1,0,0,0,255,0, +0,0,254,0,0,0,253,0,0,0,252,0,0,0,250,164,164,164,43,24,24,24,103,4,4,4,95,1,0,0,0,1,0,0,0,5,239,239,239,158,242,242,242,228,207,207,207,183,153,166,179,237,9,20,42,51,0,2,1,10,248,235,222,208,246,233, +212,234,0,0,0,253,0,0,0,253,0,0,0,250,0,0,0,248,0,0,0,248,0,0,0,251,192,192,192,254,0,0,0,0,0,0,0,0,64,64,64,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,255,0,0,0,255,0,0,0,254,178,178,178,13,13,13,13,101, +0,0,0,44,1,1,1,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,87,254,254,254,221,254,254,254,255,253,253,253,255,252,252,252,255,252,252,252,255,252,252,252,255,253,253,253,255,254,254,254,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,239,255,255,255,99,0,0,0,0,0,0,0,0,0,0,0,0,142,119,220,132,34,208,196,92,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* Controls::confighover_png = (const char*) resource_Controls_confighover_png; +const int Controls::confighover_pngSize = 4254; + +// JUCER_RESOURCE: configpushed_png, 4254, "../Assets/config-pushed.png" +static const unsigned char resource_Controls_configpushed_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122,244,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187, +127,0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,223,10,28,2,22,54,175,101,0,252,0,0,16,43,73,68,65,84,88,9,1,32,16,223,239,1,0,0,0,0,0,0,0,0,0,0,0,0,181,181,181,88, +203,203,203,132,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,242, +53,53,53,120,75,75,75,151,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,168,168,168,154,216,216,216,231,0,0,0,170,128,128,128,213,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,8,0,0,0,99,40,40,40,54,88,88,88,95,0,0,0,0,0,0,0,0,0,168,168,168,132,128,128,128,120,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128, +49,168,168,168,161,0,0,0,0,1,181,181,181,49,203,203,203,154,0,0,0,55,128,128,128,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,103,103,100,61,3,5,3,162,0,0,2,9,0,0,0,221,254,252,251,169,248,248,252,154,160,160, +160,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,101,106,117,70,5,0,0,204,150,150,139,238,0,0,0,0,0,0,0,0,128,128,128,131,53,53,53,208,3,38,38,38,171,0,0,0,135,128, +128,128,216,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,102,102,13,0,1,254,218,24,24,25,16,48,47,50,12,19,19,19,29,248,250,249,65,253,255,252,95,47,45,47,168,207,207,207,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,108,119,117,0,0,255,162,0,3,3,90,48,51,57,174,207,204,198,241,0,0,0,0,64,64,64,241,230,230,230,145,2,0,0,0,42,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,154,154, +154,243,3,2,3,63,234,235,233,246,245,246,245,254,21,20,21,0,53,51,54,8,35,33,35,30,9,10,7,175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,127,127,3,104,110,120,158,5,6,5,127,40,43,43,0, +22,25,24,26,3,3,2,206,99,108,116,46,0,0,0,0,0,0,0,210,0,0,0,30,2,0,0,0,18,128,128,128,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,151,151,154,194,250,252,253,66,204,204,201,2,255,255,255,249,253, +253,253,0,34,33,35,3,8,8,8,45,101,104,98,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,102,117,13,231,239,249,190,10,10,11,86,36,38,39,11,4,5,5,0,20,21,21,3,20,21,21,18,2,255,1,209,114,114,114,5,128, +128,128,252,0,0,0,14,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,100,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,156,152,156,201,0,0,0,241,253,253,253,229,0,0,0,0,251,251,251,0,25,25,27,11,4,3,5,84,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,3,207,18,18,18,55,34,37,36,11,2,3,2,0,0,0,0,0,254,254,254,0,240,241,239,245,1,1,1,93,142,142,142,251,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,102,102,99,71,2,3,255,236,110, +110,108,85,0,0,0,0,0,0,0,0,0,0,0,0,101,105,101,49,0,0,0,15,3,3,3,245,3,3,3,0,2,2,2,0,9,9,9,1,3,3,3,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,0,19,28,27,24,7,252,252,251,0,252,251,251,0,253,252, +251,0,228,226,227,248,252,250,253,184,154,148,138,164,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,3,5,4,158,36,35,37,0,253,254,253,166,114,114,112,80,0,0,0,0,103,103,99,48,1,253,254,181,27,26,29, +126,8,8,8,33,6,6,6,0,6,6,6,0,250,250,250,255,0,0,0,231,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,102,114,15,254,255,253,16,253,253,253,0,251,250,250,0,254,253,252,0,241,240,240,255,243,241,240,240,0,250,253, +97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,237,21,21,23,26,24,24,25,4,196,197,194,175,102,103,99,0,255,0,0,0,33,34,34,147,46,45,48,122,255,255,255,8,253,253,253,0,3,3,3,0,236,236, +235,252,253,252,252,2,0,0,0,0,0,0,0,0,0,0,0,0,96,114,114,10,0,250,5,192,31,30,26,251,255,254,253,5,245,243,242,0,249,249,249,0,237,237,239,1,0,254,255,79,154,154,139,243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,4,0,0,0,0,0,0,0,0,0,0,0,0,253,253,252,179,235,235,233,42,36,36,38,3,74,73,77,0,0,0,0,0,0,0,0,0,0,0,0,109,249,249,249,0,247,247,247,0,255,255,255,0,4,4,4,0,38,38,39,5,202,202,238,89,104,106,102,177,152, +150,154,177,96,114,114,10,6,250,4,190,34,32,27,43,11,11,10,5,221,223,227,246,246,246,247,215,0,255,0,189,0,255,0,198,154,150,139,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,249, +247,252,146,226,228,227,108,33,33,35,14,2,2,2,0,254,254,254,0,1,1,1,0,1,1,1,0,255,255,255,0,10,10,10,0,243,243,243,0,217,217,217,0,16,16,16,0,54,53,57,8,202,202,199,168,102,105,102,78,255,250,4,123,36, +33,30,49,13,13,9,5,220,222,228,246,246,246,247,151,154,148,138,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,157,157,157,233,254,254,254,110,195,196,193, +248,244,244,243,0,9,9,9,0,8,8,8,0,7,7,7,0,2,2,2,0,245,246,244,0,255,255,255,0,12,12,12,0,255,255,255,0,247,247,247,0,54,54,56,8,1,3,12,183,35,32,27,58,16,16,12,6,225,226,231,247,243,243,245,155,154,148, +138,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,148,151,161,104,104,102,240,199,200,198,156,9,9,9,9,14,15,15,2,248,247,247,254,239, +240,239,4,253,252,252,7,56,56,58,255,12,12,12,1,0,0,0,0,0,0,0,0,214,218,226,0,32,30,30,3,18,17,15,3,222,225,229,249,238,239,241,158,154,149,139,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,152,154,177,20,19,22,24,242,241,239,57,227,228,225,78,236,235,235,68,1,255,3,17,2,1,0,47,204,205,203,245,6,7,6,255,2,2,2,0,224, +228,234,0,12,12,11,0,19,19,16,0,225,227,231,0,240,237,236,1,253,254,238,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,129,129,129,253,0,0,0,211,0,0,0,211,0,0,0,0,0,0,0,0,22,55,100,252,16,10,252,154,220,233,199,108,47,38,30,6,14,12,10,0,22,21,18,0,227,229,233,0,6,4,3,0,47,44,37,4,213,214,211,205,100,100, +100,43,156,156,156,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,56,101,98,6,4,4,202, +61,54,47,111,250,6,26,3,173,196,229,0,9,11,13,0,229,230,234,0,0,255,254,0,31,28,22,0,20,20,21,2,35,35,37,18,7,9,5,205,102,102,102,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,56,100,78,4,5,4,148,67,61,48,11,46,39,26,3,46,41,31,3,25,25,21,0,150,174,207,0,246,248,250,0,37,33,27,0,4,4,4,0,247,247, +247,0,31,30,32,3,31,29,32,25,6,8,4,199,96,96,96,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,55,100,55,2,2,2, +166,59,53,43,9,244,248,253,0,180,199,225,0,211,221,235,0,23,20,17,0,6,6,7,253,215,221,227,251,255,0,254,0,254,254,254,0,3,3,3,0,245,245,245,0,36,36,37,4,22,22,23,37,13,14,11,191,96,96,96,6,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,55,101,66,2,2,2,187,55,50,42,10,255,1,2,0,240,243,247,0,237,230,222,0,234,226,214,0,248,248,248, +0,247,249,251,245,241,248,252,113,201,202,201,248,255,0,255,0,254,254,254,0,2,2,2,0,246,246,246,0,44,42,45,4,16,16,16,48,14,15,12,180,127,127,127,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,55,100,103,4,4,2,179,61,55,45,13,6,7,6,1,236,240,245,0,244,236,226,0,249,248,244,0,21,21,22,0,229,232,240,250,250,251,251,208,195,176,157,149,255,253,253, +80,202,202,200,249,254,254,253,0,0,0,0,0,1,1,1,0,248,248,248,0,48,47,50,6,10,10,11,63,239,240,237,167,191,191,191,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,58,105, +20,25,56,102,180,7,9,8,141,65,59,48,10,254,2,3,0,252,252,251,0,247,239,228,0,244,244,242,0,20,19,20,0,241,246,2,250,234,237,239,219,0,249,0,78,0,0,0,0,151,151,154,185,254,0,254,84,201,203,200,250,250, +251,250,0,0,0,0,0,254,254,254,0,251,251,251,0,51,50,52,6,6,6,6,78,176,176,173,151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,24,55,100,110,253,0,252,223,19,20,16,69,66,60,48,11, +255,0,1,0,21,14,6,0,235,230,224,0,241,241,241,0,18,18,18,0,242,247,2,250,232,235,238,218,0,250,0,59,231,205,154,241,0,0,0,0,0,0,0,0,151,148,153,180,0,254,0,88,204,204,202,249,250,250,250,0,3,3,3,0,253, +253,253,0,251,251,251,0,49,48,51,7,2,3,3,96,108,111,105,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,25,55,102,62,5,6,5,131,37,33,31,12,52,47,38,6,9,7,3,0,36,26,13,0,216,216,217,0,235,237,239, +0,16,15,15,0,250,255,8,252,232,235,240,220,0,250,0,60,231,205,154,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,150,152,175,255,0,255,96,204,205,202,250,247,248,247,0,253,253,253,0,242,242,242,0,228,228,228, +0,45,44,47,7,253,251,254,126,101,101,101,17,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,255,0,255,66,17,16,15,13,51,44,30,0,33,23,11,0,27,19,9,0,195,203,214,0,232,233,235,0,10,9,9,0,2,6,15,0,226,229,236, +243,252,1,253,70,231,205,154,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,148,152,168,1,3,2,100,205,205,203,250,250,250,250,0,245,245,245,0,239,239,239,0,245,245,245,0,12,13,13,253,1,1,254, +52,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,254,224,6,4,1,247,10,6,3,0,233,238,245,0,181,197,217,0,232,231,229,0,3,4,5,0,16,20,26,0,223,227,234,247,250,247,241,86,235,199,157,238,0,0,0,4,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,7,148,145,149,172,251,250,250,114,208,208,205,250,12,13,12,0,32,32,32,0,9,9,9,0,244,244,243,2,250,250,253,217,0,0,0,0,0,0,0,0,0,0,0,0,3,60,60,60,112,255,255, +255,162,225,221,216,229,250,6,22,101,0,3,5,8,246,249,253,0,233,231,228,0,252,250,251,0,22,25,28,0,234,237,244,250,242,241,239,178,236,207,166,173,0,0,0,8,0,0,0,7,0,0,0,6,0,0,0,2,0,0,0,4,0,0,0,6,0,0,0, +10,0,0,0,10,0,0,0,11,0,0,0,11,205,205,207,218,37,37,36,234,237,239,238,61,239,239,237,250,227,228,226,252,244,244,245,124,162,161,163,200,0,0,0,3,82,82,82,12,22,22,22,105,4,32,32,32,126,236,236,236,102, +195,195,152,160,5,16,31,110,208,212,0,153,44,39,33,8,17,13,9,0,0,17,16,0,255,2,5,0,237,238,239,252,239,218,187,159,0,0,0,17,0,0,0,248,0,0,0,248,0,0,0,248,0,0,0,7,0,0,0,253,0,0,0,252,0,0,0,3,0,0,0,6,0, +0,0,6,0,0,0,5,0,0,0,6,165,165,168,189,15,15,15,190,35,35,35,18,228,228,228,229,234,234,234,242,0,0,0,6,0,0,0,1,34,34,34,107,46,46,46,116,3,178,178,178,215,95,95,95,98,4,4,4,231,210,198,182,208,3,11,23, +221,238,244,252,65,247,252,0,248,244,246,252,253,230,230,235,253,247,235,221,127,246,233,212,216,0,0,0,251,0,0,0,251,0,0,0,252,0,0,0,251,0,0,0,250,0,0,0,248,0,0,0,250,0,0,0,0,0,0,0,255,0,0,0,254,0,0,0, +252,0,0,0,251,0,0,0,247,249,249,249,245,231,231,231,235,245,245,245,246,0,0,0,251,0,0,0,250,110,110,110,42,52,52,52,70,87,87,87,125,1,0,0,0,1,0,0,0,5,155,155,155,158,209,209,209,228,223,223,223,183,190, +203,215,237,9,20,42,51,0,1,2,10,248,236,221,208,246,233,213,234,0,0,0,253,0,0,0,253,0,0,0,250,0,0,0,248,0,0,0,248,0,0,0,251,0,0,0,254,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,255, +0,0,0,255,0,0,0,254,119,119,119,13,9,9,9,101,40,40,40,44,88,88,88,96,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,181,181,181,87,202,202,202,134,0,0,0,34,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1, +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,53,53,53,116,75,75,75,157,0,0,0,0,0,0,0,0,22,82,238,110,38,194,229,141,0,0, +0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* Controls::configpushed_png = (const char*) resource_Controls_configpushed_png; +const int Controls::configpushed_pngSize = 4254; + + +//[EndFile] You can add extra defines here... +//[/EndFile] diff --git a/Source/Controls.h b/Source/Controls.h index 7afa81c..0f8d58d 100644 --- a/Source/Controls.h +++ b/Source/Controls.h @@ -1,97 +1,99 @@ -/*\ -|*| Copyright 2015 bill-auger -|*| -|*| This file is part of the AvCaster program. -|*| -|*| AvCaster is free software: you can redistribute it and/or modify -|*| it under the terms of the GNU Lesser General Public License version 3 -|*| as published by the Free Software Foundation. -|*| -|*| AvCaster 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 Lesser General Public License for more details. -|*| -|*| You should have received a copy of the GNU Lesser General Public License -|*| along with AvCaster. If not, see . -\*/ - -#ifndef __JUCE_HEADER_7E49606CC1E6A40__ -#define __JUCE_HEADER_7E49606CC1E6A40__ - -//[Headers] -- You can add your own extra header files here -- - -#include "JuceHeader.h" - -class MainContent ; - -//[/Headers] - - - -//============================================================================== -/** - //[Comments] - Controls is the media selection and preview GUI for the AvCaster application. - It serves only as a consistent backdrop and/or interstitial. - //[/Comments] -*/ -class Controls : public Component, - public ButtonListener, - public ComboBoxListener -{ -public: - //============================================================================== - Controls (); - ~Controls(); - - //============================================================================== - //[UserMethods] -- You can add your own custom methods in this section. - //[/UserMethods] - - void paint (Graphics& g); - void resized(); - void buttonClicked (Button* buttonThatWasClicked); - void comboBoxChanged (ComboBox* comboBoxThatHasChanged); - - // Binary resources: - static const char* preferencessystem_png; - static const int preferencessystem_pngSize; - static const char* confighover_png; - static const int confighover_pngSize; - static const char* configpushed_png; - static const int configpushed_pngSize; - - -private: - //[UserVariables] -- You can add your own custom variables in this section. - - void broughtToFront() override ; - - void loadConfig() ; - - - MainContent* mainContent ; - - //[/UserVariables] - - //============================================================================== - ScopedPointer controlsGroup; - ScopedPointer screencapToggle; - ScopedPointer cameraToggle; - ScopedPointer textToggle; - ScopedPointer interstitialToggle; - ScopedPointer previewToggle; - ScopedPointer outputToggle; - ScopedPointer presetsCombo; - ScopedPointer configButton; - - - //============================================================================== - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Controls) -}; - -//[EndFile] You can add extra defines here... -//[/EndFile] - -#endif // __JUCE_HEADER_7E49606CC1E6A40__ +/*\ +|*| Copyright 2015 bill-auger +|*| +|*| This file is part of the AvCaster program. +|*| +|*| AvCaster is free software: you can redistribute it and/or modify +|*| it under the terms of the GNU Lesser General Public License version 3 +|*| as published by the Free Software Foundation. +|*| +|*| AvCaster 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 Lesser General Public License for more details. +|*| +|*| You should have received a copy of the GNU Lesser General Public License +|*| along with AvCaster. If not, see . +\*/ + + +#ifndef _CONTROLS_H_ +#define _CONTROLS_H_ + +//[Headers] -- You can add your own extra header files here -- + +#include "JuceHeader.h" + +class MainContent ; + +//[/Headers] + + + +//============================================================================== +/** + //[Comments] + Controls is the media selection and preview GUI for the AvCaster application. + It serves only as a consistent backdrop and/or interstitial. + //[/Comments] +*/ +class Controls : public Component, + public ButtonListener, + public ComboBoxListener +{ +public: + //============================================================================== + Controls (); + ~Controls(); + + //============================================================================== + //[UserMethods] -- You can add your own custom methods in this section. + //[/UserMethods] + + void paint (Graphics& g); + void resized(); + void buttonClicked (Button* buttonThatWasClicked); + void comboBoxChanged (ComboBox* comboBoxThatHasChanged); + + // Binary resources: + static const char* preferencessystem_png; + static const int preferencessystem_pngSize; + static const char* confighover_png; + static const int confighover_pngSize; + static const char* configpushed_png; + static const int configpushed_pngSize; + + +private: + //[UserVariables] -- You can add your own custom variables in this section. + + void broughtToFront() override ; + + void loadConfig() ; + + + MainContent* mainContent ; + + //[/UserVariables] + + //============================================================================== + ScopedPointer controlsGroup; + ScopedPointer screencapToggle; + ScopedPointer cameraToggle; + ScopedPointer textToggle; + ScopedPointer interstitialToggle; + ScopedPointer previewToggle; + ScopedPointer audioToggle; + ScopedPointer outputToggle; + ScopedPointer presetsCombo; + ScopedPointer configButton; + + + //============================================================================== + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Controls) +}; + +//[EndFile] You can add extra defines here... +//[/EndFile] + +#endif // _CONTROLS_H_ diff --git a/Source/Gstreamer.cpp b/Source/Gstreamer.cpp index 966292b..fa4b738 100644 --- a/Source/Gstreamer.cpp +++ b/Source/Gstreamer.cpp @@ -28,24 +28,34 @@ /* GstElement private class variables */ -GstElement* Gstreamer::Pipeline = nullptr ; -GstElement* Gstreamer::ScreencapBin = nullptr ; -GstElement* Gstreamer::CameraBin = nullptr ; -GstElement* Gstreamer::TextBin = nullptr ; -GstElement* Gstreamer::ImageBin = nullptr ; -GstElement* Gstreamer::CompositorBin = nullptr ; -GstElement* Gstreamer::PreviewBin = nullptr ; -GstElement* Gstreamer::PreviewSink = nullptr ; -GstElement* Gstreamer::AudioBin = nullptr ; -GstElement* Gstreamer::MuxerBin = nullptr ; -GstElement* Gstreamer::OutputBin = nullptr ; -ValueTree Gstreamer::ConfigStore ; // Configure() +GstElement* Gstreamer::Pipeline = nullptr ; +GstElement* Gstreamer::ScreencapBin = nullptr ; +GstElement* Gstreamer::CameraBin = nullptr ; +GstElement* Gstreamer::TextBin = nullptr ; +GstElement* Gstreamer::ImageBin = nullptr ; +GstElement* Gstreamer::CompositorBin = nullptr ; +GstElement* Gstreamer::PreviewBin = nullptr ; +GstElement* Gstreamer::PreviewQueue = nullptr ; +GstElement* Gstreamer::PreviewFauxSink = nullptr ; +GstElement* Gstreamer::PreviewRealSink = nullptr ; +GstElement* Gstreamer::AudioBin = nullptr ; +GstElement* Gstreamer::AudioAlsaSource = nullptr ; +GstElement* Gstreamer::AudioPulseSource = nullptr ; +GstElement* Gstreamer::AudioJackSource = nullptr ; +GstElement* Gstreamer::AudioTestSource = nullptr ; +GstElement* Gstreamer::AudioCaps = nullptr ; +GstElement* Gstreamer::MuxerBin = nullptr ; +GstElement* Gstreamer::OutputBin = nullptr ; +guintptr Gstreamer::PreviewXwin = 0 ; // Initialize() +ValueTree Gstreamer::ConfigStore = ValueTree::invalid ; // Configure() /* GstElement private class methods */ -bool Gstreamer::Initialize() +bool Gstreamer::Initialize(void* x_window_handle) { + PreviewXwin = (guintptr)x_window_handle ; + DEBUG_TRACE_GST_INIT_PHASE_1 // initialize gStreamer (NOTE: this will terminate the app on failure) @@ -54,26 +64,19 @@ DEBUG_TRACE_GST_INIT_PHASE_1 DEBUG_TRACE_GST_INIT_PHASE_2 // instantiate pipeline - if (!(Pipeline = NewPipeline(GST::PIPELINE_ID )) || - !(ScreencapBin = NewBin (GST::SCREENCAP_BIN_ID )) || - !(CameraBin = NewBin (GST::CAMERA_BIN_ID )) || - !(TextBin = NewBin (GST::TEXT_BIN_ID )) || - !(ImageBin = NewBin (GST::IMAGE_BIN_ID )) || - !(CompositorBin = NewBin (GST::COMPOSITOR_BIN_ID)) || - !(PreviewBin = NewBin (GST::PREVIEW_BIN_ID )) || - !(AudioBin = NewBin (GST::AUDIO_BIN_ID )) || - !(MuxerBin = NewBin (GST::MUXER_BIN_ID )) || - !(OutputBin = NewBin (GST::OUTPUT_BIN_ID )) ) + if (!(Pipeline = NewPipeline(GST::PIPELINE_ID )) || + !(ScreencapBin = NewBin (GST::SCREENCAP_BIN_ID )) || + !(CameraBin = NewBin (GST::CAMERA_BIN_ID )) || + !(TextBin = NewBin (GST::TEXT_BIN_ID )) || + !(ImageBin = NewBin (GST::IMAGE_BIN_ID )) || + !(CompositorBin = NewBin (GST::COMPOSITOR_BIN_ID)) || + !(PreviewBin = NewBin (GST::PREVIEW_BIN_ID )) || + !(AudioBin = NewBin (GST::AUDIO_BIN_ID )) || + !(MuxerBin = NewBin (GST::MUXER_BIN_ID )) || + !(OutputBin = NewBin (GST::OUTPUT_BIN_ID )) ) { AvCaster::Error(GUI::GST_PIPELINE_INST_ERROR_MSG) ; return false ; } - // prune unused bins per cli args (debugging) - if (!AvCaster::GetIsScreenEnabled() ) { DestroyBin(ScreencapBin) ; ScreencapBin = nullptr ; } - if (!AvCaster::GetIsCameraEnabled() ) { DestroyBin(CameraBin) ; CameraBin = nullptr ; } - if (!AvCaster::GetIsTextEnabled() ) { DestroyBin(TextBin) ; TextBin = nullptr ; } - if (!AvCaster::GetIsImageEnabled() ) { DestroyBin(ImageBin) ; ImageBin = nullptr ; } - if (!AvCaster::GetIsCompositorEnabled()) { DestroyBin(CompositorBin) ; CompositorBin = nullptr ; } - if (!AvCaster::GetIsPreviewEnabled() ) { DestroyBin(PreviewBin) ; PreviewBin = nullptr ; } - if (!AvCaster::GetIsAudioEnabled() ) { DestroyBin(AudioBin) ; AudioBin = nullptr ; } + SetMessageHandler(GST_PIPELINE(Pipeline) , (GstBusSyncHandler)HandleMessage) ; DEBUG_TRACE_GST_INIT_PHASE_3 @@ -83,10 +86,14 @@ DEBUG_TRACE_GST_INIT_PHASE_3 !AddBin(AudioBin) || !AddBin(MuxerBin) || !AddBin(OutputBin) ) { AvCaster::Error(GUI::GST_ADD_ERROR_MSG) ; return false ; } -DEBUG_TRACE_GST_INIT_PHASE_4 +DEBUG_TRACE_GST_INIT_PHASE_4 DEBUG_TRACE_INITIALIZE_PIPELINE - // configure elements - if (!InitializePipeline()) return false ; + // configure bins + ReloadConfig() ; + if (!BuildCompositorBin() || !BuildMuxerBin() || !BuildScreencapBin() || + !BuildCameraBin() || !BuildTextBin() || !BuildImageBin() || + !BuildPreviewBin() || !BuildAudioBin() || !BuildOutputBin() ) + { AvCaster::Error(GUI::GST_PIPELINE_INIT_ERROR_MSG) ; return false ; } DEBUG_TRACE_GST_INIT_PHASE_5 @@ -102,13 +109,17 @@ if (!bool(ConfigStore[CONFIG::IS_OUTPUT_ACTIVE_ID])) RemoveBin(OutputBin) ; #endif // DETACH_OUTPUT_BIN_INSTEAD_OF_RECREATE DEBUG_TRACE_GST_INIT_PHASE_6 -DEBUG_MAKE_GRAPHVIZ +// DEBUG_MAKE_GRAPHVIZ return true ; } +void Gstreamer::ReloadConfig() { ConfigStore = AvCaster::GetConfigStore() ; } + void Gstreamer::Shutdown() { +// DEBUG_MAKE_GRAPHVIZ + // cleanup gStreamer // TODO: to shut down correctly (flushing the buffers) // gst_element_send_event(Pipeline , gst_event_eos()) ; @@ -125,48 +136,13 @@ void Gstreamer::Shutdown() if (!IsInPipeline(TextBin) ) SetState(TextBin , GST_STATE_NULL) ; if (!IsInPipeline(CameraBin) ) SetState(CameraBin , GST_STATE_NULL) ; if (!IsInPipeline(ScreencapBin) ) SetState(ScreencapBin , GST_STATE_NULL) ; - DeleteElement(Pipeline) ; - - ConfigStore = ValueTree::invalid ; -} - -bool Gstreamer::InitializePipeline() -{ -DEBUG_TRACE_INITIALIZE_PIPELINE - - if (!IsInitialized()) return false ; - GstElement* link_bin = (AvCaster::GetIsCompositorEnabled()) ? CompositorBin : MuxerBin ; - ConfigStore = AvCaster::GetConfigStore() ; + DestroyElement(Pipeline) ; - if (!ConfigureCompositorBin() || !ConfigureMuxerBin() || - !ConfigureScreencapBin(link_bin) || !ConfigureCameraBin(link_bin) || - !ConfigureTextBin(link_bin) || !ConfigureImageBin(link_bin) || - !ConfigurePreviewBin() || !ConfigureAudioBin() || - !ConfigureOutputBin() ) - { AvCaster::Error(GUI::GST_PIPELINE_INIT_ERROR_MSG) ; return false ; } - - return true ; + ConfigStore = ValueTree::invalid ; } -/* -bool Gstreamer::ConfigurePipeline() -{ -DEBUG_TRACE_CONFIGURE_PIPELINE - if (!IsInitialized()) return false ; - - ConfigStore = AvCaster::GetConfigStore() ; - - // FIXME: most of these are not guarded against !Is*Enabled - if (!ConfigureCompositor() || !ConfigureMuxer() || !ConfigureScreencap() || - !ConfigureCamera() || !ConfigureText() || !ConfigureImage() || - !ConfigurePreview() || !ConfigureAudio() || !ConfigureOutput() ) - { AvCaster::Error(GUI::GST_CONFIG_ERROR_MSG) ; return false ; } - - return true ; -} -*/ -bool Gstreamer::ConfigureScreencapBin(GstElement* link_bin) +bool Gstreamer::BuildScreencapBin() { if (!AvCaster::GetIsScreenEnabled()) return true ; @@ -181,7 +157,7 @@ bool Gstreamer::ConfigureScreencapBin(GstElement* link_bin) String screen_caps_str = MakeScreenCapsString(screencap_w , screencap_h , framerate) ; String faux_caps_str = MakeVideoCapsString (screencap_w , screencap_h , framerate) ; String caps_str = (is_enabled) ? screen_caps_str : faux_caps_str ; - String plugin_id = (is_enabled) ? GST::SCREEN_PLUGIN_ID : GST::FAUX_VIDEO_PLUGIN_ID ; + String plugin_id = (is_enabled) ? GST::SCREEN_PLUGIN_ID : GST::TESTVIDEO_PLUGIN_ID ; DEBUG_TRACE_CONFIGURE_SCREENCAP_BIN @@ -207,13 +183,13 @@ DEBUG_TRACE_CONFIGURE_SCREENCAP_BIN !LinkElements (capsfilter , converter ) || !LinkElements (converter , queue ) || !NewGhostSrcPad(ScreencapBin , queue , "screen-source") || - !LinkElements (ScreencapBin , link_bin ) ) + !LinkElements (ScreencapBin , CompositorBin) ) { AvCaster::Error(GUI::SCREENCAP_LINK_ERROR_MSG) ; return false ; } return true ; } -bool Gstreamer::ConfigureCameraBin(GstElement* link_bin) +bool Gstreamer::BuildCameraBin() { if (!AvCaster::GetIsCameraEnabled()) return true ; @@ -237,12 +213,12 @@ bool Gstreamer::ConfigureCameraBin(GstElement* link_bin) #endif // JUCE_LINUX #ifdef FAUX_CAMERA -UNUSED(is_enabled) ; is_enabled = false ; // TODO: GUI support +UNUSED(is_enabled) ; is_enabled = false ; #endif // FAUX_CAMERA if (!is_enabled) { - plugin_id = GST::FAUX_VIDEO_PLUGIN_ID ; + plugin_id = GST::TESTVIDEO_PLUGIN_ID ; caps_str = MakeVideoCapsString(160 , 120 , 12) ; } @@ -269,13 +245,13 @@ DEBUG_TRACE_CONFIGURE_CAMERA_BIN !LinkElements (capsfilter , converter ) || !LinkElements (converter , queue ) || !NewGhostSrcPad(CameraBin , queue , "camera-source") || - !LinkElements (CameraBin , link_bin) ) + !LinkElements (CameraBin , CompositorBin) ) { AvCaster::Error(GUI::CAMERA_LINK_ERROR_MSG) ; return false ; } return true ; } -bool Gstreamer::ConfigureTextBin(GstElement* link_bin) +bool Gstreamer::BuildTextBin() { if (!AvCaster::GetIsTextEnabled()) return true ; @@ -319,13 +295,13 @@ FcBool fontAddStatus = FcConfigAppFOntAddFile(FcConfigGetCurrent(),file); !LinkElements (source , converter ) || !LinkElements (converter , queue ) || !NewGhostSrcPad(TextBin , queue , "text-source") || - !LinkElements (TextBin , link_bin ) ) + !LinkElements (TextBin , CompositorBin) ) { AvCaster::Error(GUI::TEXT_LINK_ERROR_MSG) ; return false ; } return true ; } -bool Gstreamer::ConfigureImageBin(GstElement* link_bin) +bool Gstreamer::BuildImageBin() { if (!AvCaster::GetIsImageEnabled()) return true ; @@ -396,7 +372,7 @@ DEBUG_TRACE_CONFIGURE_IMAGE_BIN !LinkElements (freezer , freezer_filter) || !LinkElements (freezer_filter , queue ) || !NewGhostSrcPad(CameraBin , queue , "interstitial-source") || - !LinkElements (CameraBin , link_bin ) ) + !LinkElements (CameraBin , CompositorBin ) ) { AvCaster::Error(GUI::IMAGE_LINK_ERROR_MSG) ; return false ; } # else // STATIC_IMAGE @@ -409,7 +385,7 @@ DEBUG_TRACE_CONFIGURE_IMAGE_BIN int interstitial_h = int(ConfigStore[CONFIG::SCREENCAP_H_ID]) ; int framerate_n = int(ConfigStore[CONFIG::FRAMERATE_ID ]) ; int framerate = CONFIG::FRAMERATES[framerate_n].getIntValue() ; - String plugin_id = GST::FAUX_VIDEO_PLUGIN_ID ; + String plugin_id = GST::TESTVIDEO_PLUGIN_ID ; String caps_str = String("video/x-raw, ") + "width=(int)" + String(interstitial_w) + ", " + "height=(int)" + String(interstitial_h) + ", " + @@ -429,7 +405,7 @@ DEBUG_TRACE_CONFIGURE_IMAGE_BIN { AvCaster::Error(GUI::IMAGE_INIT_ERROR_MSG) ; return false ; } // configure elements - ConfigureFauxVideo(source , 1) ; + ConfigureTestVideo(source , 1) ; ConfigureCaps(capsfilter , caps) ; // link elements @@ -441,7 +417,7 @@ DEBUG_TRACE_CONFIGURE_IMAGE_BIN !LinkElements (capsfilter , converter ) || !LinkElements (converter , queue ) || !NewGhostSrcPad(ImageBin , queue , "image-source")) -// !LinkElements (ImageBin , link_bin ) +// !LinkElements (ImageBin , CompositorBin ) { AvCaster::Error(GUI::IMAGE_LINK_ERROR_MSG) ; return false ; } # endif // STATIC_IMAGE @@ -449,7 +425,7 @@ DEBUG_TRACE_CONFIGURE_IMAGE_BIN return true ; } -bool Gstreamer::ConfigureCompositorBin() +bool Gstreamer::BuildCompositorBin() { if (!AvCaster::GetIsCompositorEnabled()) return true ; @@ -546,6 +522,8 @@ DEBUG_TRACE_CONFIGURE_COMPOSITOR_BIN // re-link to input and output bins if (!LinkElements(ScreencapBin , CompositorBin) || !LinkElements(CameraBin , CompositorBin) || +// !LinkElements(TextBin , CompositorBin) || +// !LinkElements(ImageBin , CompositorBin) || !LinkElements(CompositorBin , MuxerBin ) || !LinkElements(CompositorBin , PreviewBin ) ) { AvCaster::Error(GUI::MIXER_BIN_LINK_ERROR_MSG) ; return false ; } @@ -553,121 +531,65 @@ DEBUG_TRACE_CONFIGURE_COMPOSITOR_BIN return true ; } -bool Gstreamer::ConfigurePreviewBin() +bool Gstreamer::BuildPreviewBin() { - if (!AvCaster::GetIsPreviewEnabled()) return true ; - - // NOTE: x_window_handle must be attached before pipline is started - // so PreviewSink must never be FAUX_SINK_PLUGIN_ID if it is to be usable -#ifdef RESIZE_PREVIEW_BIN_INSTEAD_OF_RECREATE - bool is_enabled = AvCaster::GetIsPreviewEnabled() ; -#else // RESIZE_PREVIEW_BIN_INSTEAD_OF_RECREATE - bool is_enabled = AvCaster::GetIsPreviewEnabled() && AvCaster::GetIsPreviewActive() ; -#endif // RESIZE_PREVIEW_BIN_INSTEAD_OF_RECREATE - String plugin_id = (is_enabled) ? GST::PREVIEW_PLUGIN_ID : GST::FAUX_SINK_PLUGIN_ID ; - -#ifndef RESIZE_PREVIEW_BIN_INSTEAD_OF_RECREATE -# ifdef DETACH_PREVIEW_BIN_INSTEAD_OF_RECREATE -UNUSED(is_enabled) ; is_enabled = true ; plugin_id = GST::PREVIEW_PLUGIN_ID ; // FIXME: no fake sink needed ? -# endif // DETACH_PREVIEW_BIN_INSTEAD_OF_RECREATE -#endif // RESIZE_PREVIEW_BIN_INSTEAD_OF_RECREATE - -DEBUG_TRACE_CONFIGURE_PREVIEW_BIN + GstElement* preview_sink ; // instantiate elements - if (!(PreviewSink = NewElement(plugin_id , "preview-real-sink")) ) + if (!(PreviewQueue = NewElement("queue" , "preview-queue" )) || + !(PreviewRealSink = NewElement(GST::PREVIEW_PLUGIN_ID , GST::PREVIEW_SINK_ID )) || + !(PreviewFauxSink = NewElement(GST::FAUXSINK_PLUGIN_ID , GST::PREVIEW_FAUXSINK_ID)) ) { AvCaster::Error(GUI::PREVIEW_INIT_ERROR_MSG) ; return false ; } // configure elements - if (is_enabled) - { - guintptr x_window_handle = (guintptr)AvCaster::GetGuiXwinHandle() ; - gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(PreviewSink) , x_window_handle) ; - - if (!ConfigureVideoSink(PreviewSink)) - { AvCaster::Error(GUI::GST_XWIN_ERROR_MSG) ; return false ; } - } + ConfigureQueue(PreviewQueue , 0 , 0 , 0) ; + preview_sink = ConfigurePreview() ; if (preview_sink == nullptr) return false ; // link elements - if (!AddElement (PreviewBin , PreviewSink ) || - !NewGhostSinkPad(PreviewBin , PreviewSink , "preview-sink") || - !LinkElements (CompositorBin , PreviewBin) ) + if (!AddElement (PreviewBin , PreviewQueue ) || + !AddElement (PreviewBin , preview_sink ) || + !NewGhostSinkPad(PreviewBin , PreviewQueue , GST::PREVIEW_SINKPAD_ID) || + !LinkElements (PreviewQueue , preview_sink) || + !LinkElements (CompositorBin , PreviewBin ) ) { AvCaster::Error(GUI::PREVIEW_LINK_ERROR_MSG) ; return false ; } return true ; } -bool Gstreamer::ConfigureAudioBin() +bool Gstreamer::BuildAudioBin() { - if (!AvCaster::GetIsAudioEnabled()) return true ; - - GstElement *source , *capsfilter , *converter , *queue ; - GstCaps* caps ; - - bool is_enabled = bool(ConfigStore[CONFIG::IS_AUDIO_ACTIVE_ID]) ; - int audio_api = int (ConfigStore[CONFIG::AUDIO_API_ID ]) ; - int n_channels = int (ConfigStore[CONFIG::N_CHANNELS_ID ]) ; - int samplerate_n = int (ConfigStore[CONFIG::SAMPLERATE_ID ]) ; - int samplerate = CONFIG::AUDIO_SAMPLERATES[samplerate_n].getIntValue() ; - String audio16_caps_str = MakeAudioCapsString("S16LE" , samplerate , n_channels) ; - String audio32_caps_str = MakeAudioCapsString("F32LE" , samplerate , n_channels) ; - String plugin_id , caps_str ; - -UNUSED(is_enabled) ; is_enabled = true ; // TODO: GUI support -#ifdef FAUX_AUDIO -UNUSED(is_enabled) ; is_enabled = false ; -#endif // FAUX_AUDIO - - switch ((AvCasterStore::AudioApi)audio_api) - { - case AvCasterStore::ALSA_AUDIO: plugin_id = GST::ALSA_PLUGIN_ID ; - caps_str = audio16_caps_str ; break ; - case AvCasterStore::PULSE_AUDIO: plugin_id = GST::PULSE_PLUGIN_ID ; - caps_str = audio16_caps_str ; break ; - case AvCasterStore::JACK_AUDIO: plugin_id = GST::JACK_PLUGIN_ID ; - caps_str = audio32_caps_str ; break ; - default: plugin_id = GST::FAUX_AUDIO_PLUGIN_ID ; - caps_str = GST::FAUX_AUDIO_CAPS ; - is_enabled = false ; break ; - } - - if (!is_enabled) - { - plugin_id = GST::FAUX_AUDIO_PLUGIN_ID ; - caps_str = GST::FAUX_AUDIO_CAPS ; - } - -DEBUG_TRACE_CONFIGURE_AUDIO_BIN + GstElement *source , *converter , *queue ; // instantiate elements - if (!(source = NewElement(plugin_id , "audio-real-source")) || - !(capsfilter = NewElement("capsfilter" , "audio-capsfilter" )) || - !(converter = NewElement("audioconvert" , "audio-converter" )) || - !(queue = NewElement("queue" , "audio-queue" )) || - !(caps = NewCaps (caps_str) ) ) + if (!(AudioAlsaSource = NewElement(GST::ALSA_PLUGIN_ID , "audio-alsa-source" )) || + !(AudioPulseSource = NewElement(GST::PULSE_PLUGIN_ID , "audio-pulse-source")) || + !(AudioJackSource = NewElement(GST::JACK_PLUGIN_ID , "audio-jack-source" )) || + !(AudioTestSource = NewElement(GST::TESTAUDIO_PLUGIN_ID , "audio-test-source" )) || + !(AudioCaps = NewElement("capsfilter" , "audio-capsfilter" )) || + !(converter = NewElement("audioconvert" , "audio-converter" )) || + !(queue = NewElement("queue" , "audio-queue" )) ) { AvCaster::Error(GUI::AUDIO_INIT_ERROR_MSG) ; return false ; } // configure elements - if (!is_enabled) ConfigureFauxAudio(source) ; - ConfigureCaps (capsfilter , caps ) ; - ConfigureQueue(queue , 0 , 0 , 0) ; + source = ConfigureAudio() ; + ConfigureQueue(queue , 0 , 0 , 0) ; // link elements - if (!AddElement (AudioBin , source ) || - !AddElement (AudioBin , capsfilter) || - !AddElement (AudioBin , converter ) || - !AddElement (AudioBin , queue ) || - !LinkElements (source , capsfilter) || - !LinkElements (capsfilter , converter ) || - !LinkElements (converter , queue ) || - !NewGhostSrcPad(AudioBin , queue , "audio-source") || - !LinkElements (AudioBin , MuxerBin ) ) + if (!AddElement (AudioBin , source ) || + !AddElement (AudioBin , AudioCaps) || + !AddElement (AudioBin , converter) || + !AddElement (AudioBin , queue ) || + !LinkElements (source , AudioCaps) || + !LinkElements (AudioCaps , converter) || + !LinkElements (converter , queue ) || + !NewGhostSrcPad(AudioBin , queue , "audio-source") || + !LinkElements (AudioBin , MuxerBin ) ) { AvCaster::Error(GUI::AUDIO_LINK_ERROR_MSG) ; return false ; } return true ; } -bool Gstreamer::ConfigureMuxerBin() +bool Gstreamer::BuildMuxerBin() { GstElement *video_in_queue , *video_converter , *video_encoder , *video_parser , *video_enc_caps , *video_enc_queue ; @@ -761,7 +683,7 @@ DEBUG_TRACE_CONFIGURE_MUXER_BIN return true ; } -bool Gstreamer::ConfigureOutputBin() +bool Gstreamer::BuildOutputBin() { GstElement *queue , *sink ; @@ -784,24 +706,24 @@ UNUSED(is_enabled) ; is_enabled = true ; // FIXME: no fake sink needed ? #endif // DETACH_OUTPUT_BIN_INSTEAD_OF_RECREATE if (!is_enabled) sink_idx = -1 ; String plugin_id , output_url ; - switch (sink_idx) + switch ((CONFIG::OutputStream)sink_idx) { - case CONFIG::FILE_STREAM_IDX: plugin_id = GST::FILE_SINK_PLUGIN_ID ; output_url = file_url ; break ; - case CONFIG::RTMP_STREAM_IDX: plugin_id = GST::RTMP_SINK_PLUGIN_ID ; output_url = rtmp_url ; break ; - default: plugin_id = GST::FAUX_SINK_PLUGIN_ID ; is_enabled = false ; break ; + case CONFIG::FILE_OUTPUT_IDX: plugin_id = GST::FILESINK_PLUGIN_ID ; output_url = file_url ; break ; + case CONFIG::RTMP_OUTPUT_IDX: plugin_id = GST::RTMPSINK_PLUGIN_ID ; output_url = rtmp_url ; break ; + default: plugin_id = GST::FAUXSINK_PLUGIN_ID ; is_enabled = false ; break ; } DEBUG_TRACE_CONFIGURE_OUTPUT_BIN #ifdef DEBUG -if (sink_idx == CONFIG::RTMP_STREAM_IDX) +if (sink_idx == CONFIG::RTMP_OUTPUT_IDX) { String env_url = std::getenv("AVCASTER_RTMP_DEST") ; if (env_url.isNotEmpty()) output_url = (is_lctv) ? MakeLctvUrl(env_url) : env_url ; else { AvCaster::Error(DEBUG_RTMP_DEST_ERROR_MSG) ; - plugin_id = GST::FILE_SINK_PLUGIN_ID ; output_url = file_url ; + plugin_id = GST::FILESINK_PLUGIN_ID ; output_url = file_url ; } } #endif // DEBUG @@ -823,6 +745,13 @@ if (sink_idx == CONFIG::RTMP_STREAM_IDX) return true ; } +void Gstreamer::ConfigureFauxSource(GstElement* a_faux_source) +{ +DEBUG_TRACE_CONFIGURE_FAUX_SRC + + g_object_set(G_OBJECT(a_faux_source) , "is_live" , true , NULL) ; +} + void Gstreamer::ConfigureCaps(GstElement* a_capsfilter , GstCaps* a_caps) { DEBUG_TRACE_CONFIGURE_CAPS @@ -851,7 +780,7 @@ DEBUG_TRACE_CONFIGURE_SCREEN g_object_set(G_OBJECT(a_screen_source) , "endy" , capture_h - 1 , NULL) ; g_object_set(G_OBJECT(a_screen_source) , "use-damage" , false , NULL) ; } - else ConfigureFauxVideo(a_screen_source , pattern_n) ; + else ConfigureTestVideo(a_screen_source , pattern_n) ; } void Gstreamer::ConfigureCamera(GstElement* a_camera_source , String device_path , @@ -861,15 +790,15 @@ DEBUG_TRACE_CONFIGURE_CAMERA if (is_active) g_object_set(G_OBJECT(a_camera_source) , "device" , CHARSTAR(device_path) , NULL) ; - else ConfigureFauxVideo(a_camera_source , pattern_n) ; + else ConfigureTestVideo(a_camera_source , pattern_n) ; } -void Gstreamer::ConfigureFauxVideo(GstElement* a_faux_source , guint pattern_n) +void Gstreamer::ConfigureTestVideo(GstElement* a_test_source , guint pattern_n) { -DEBUG_TRACE_CONFIGURE_FAUX_VIDEO +DEBUG_TRACE_CONFIGURE_TEST_VIDEO - g_object_set(G_OBJECT(a_faux_source) , "is_live" , true , NULL) ; - g_object_set(G_OBJECT(a_faux_source) , "pattern" , pattern_n , NULL) ; + ConfigureFauxSource(a_test_source) ; + g_object_set(G_OBJECT(a_test_source) , "pattern" , pattern_n , NULL) ; } void Gstreamer::ConfigureText(GstElement* a_text_source , String font_desc) @@ -910,6 +839,7 @@ DEBUG_TRACE_CONFIGURE_PREVIEW if (!AvCaster::GetIsPreviewEnabled()) return true ; +#ifdef RESIZE_PREVIEW_BIN_INSTEAD_OF_RECREATE bool is_active = AvCaster::GetIsPreviewActive() ; Rectangle preview_bounds = AvCaster::GetPreviewBounds() ; gint preview_x = (is_active) ? preview_bounds.getX() : -1 ; @@ -923,18 +853,23 @@ preview_w = (is_active) ? preview_bounds.getWidth() : 160 ; preview_h = (is_active) ? preview_bounds.getHeight() : 120 ; #endif // SHOW_DISABLED_PREVIEW_TINY +#else // RESIZE_PREVIEW_BIN_INSTEAD_OF_RECREATE + + Rectangle preview_bounds = AvCaster::GetPreviewBounds() ; + gint preview_x = preview_bounds.getX() ; + gint preview_y = preview_bounds.getY() ; + gint preview_w = preview_bounds.getWidth() ; + gint preview_h = preview_bounds.getHeight() ; + +#endif // RESIZE_PREVIEW_BIN_INSTEAD_OF_RECREATE + +// g_object_set (app->video_sink, "async-handling", TRUE, NULL); + return gst_video_overlay_set_render_rectangle(GST_VIDEO_OVERLAY(a_video_sink) , preview_x , preview_y , preview_w , preview_h ) ; } -void Gstreamer::ConfigureFauxAudio(GstElement* a_faux_source) -{ -DEBUG_TRACE_CONFIGURE_FAUX_AUDIO - - g_object_set(G_OBJECT(a_faux_source) , "is_live" , true , NULL) ; -} - void Gstreamer::ConfigureX264Encoder(GstElement* an_x264_encoder , guint bitrate) { DEBUG_TRACE_CONFIGURE_X264ENC @@ -962,9 +897,15 @@ DEBUG_TRACE_CONFIGURE_FLVMUX bool Gstreamer::Reconfigure(const Identifier& config_key , bool is_config_pending) { -DEBUG_TRACE_RECONFIGURE +DEBUG_TRACE_RECONFIGURE_IN -/* FIXME: most of these are not guarded against !Is*Enabled +// FIXME: it should be possible to handle all toggles consistently +// perhaps using RecreateBin()/DestroyBin() as below (currently leaky) +// or ReconfigureBin() +// or simply detaching/re-attaching bins + +/* recreate then reconfigure bin + * FIXME: most of these are not guarded against !Is*Enabled if (config_key == CONFIG::PRESET_ID ) { if (!ConfigurePipeline()) return false ; } else if (config_key == CONFIG::IS_PENDING_ID ) @@ -985,10 +926,8 @@ DEBUG_TRACE_RECONFIGURE { AudioBin = RecreateBin(AudioBin , GST::AUDIO_BIN_ID ) ; if (!ConfigureAudio() ) { DestroyBin(AudioBin ) ; return false ; } } */ -// FIXME: it should be possible to handle all toggles consistently -// perhaps using RecreateBin()/DestroyBin() as below (currently leaky) -// or ReconfigureBin() -// or simply detaching/re-attaching bins + +/* experiments if (config_key == CONFIG::IS_PENDING_ID || config_key == CONFIG::IS_PREVIEW_ACTIVE_ID ) #ifdef RESIZE_PREVIEW_BIN_INSTEAD_OF_RECREATE @@ -1020,46 +959,136 @@ DBG("detachingOutputBin") ; OutputBin = RecreateBin(OutputBin , GST::OUTPUT_BIN_ID ) ; if (!ConfigureOutputBin() ) { DestroyBin(OutputBin ) ; return false ; } } #endif // DETACH_OUTPUT_BIN_INSTEAD_OF_RECREATE +*/ + +/* recreate then reconfigure bin +// TODO: refactor with fn_pointer? + return (config_key == CONFIG::IS_SCREENCAP_ACTIVE_ID) ? RecreateBin(&ScreencapBin , nullptr) : + (config_key == CONFIG::IS_CAMERA_ACTIVE_ID ) ? RecreateBin(&CameraBin , nullptr) : + (config_key == CONFIG::IS_TEXT_ACTIVE_ID ) ? RecreateBin(&TextBin , nullptr) : + (config_key == CONFIG::IS_IMAGE_ACTIVE_ID ) ? RecreateBin(&ImageBin , nullptr) : + (config_key == CONFIG::IS_PREVIEW_ACTIVE_ID ) ? RecreateBin(&PreviewBin , nullptr) : + (config_key == CONFIG::IS_AUDIO_ACTIVE_ID ) ? RecreateBin(&AudioBin , nullptr) : + (config_key == CONFIG::IS_OUTPUT_ACTIVE_ID ) ? RecreateBin(&OutputBin , nullptr) : + true ; +*/ +//* reconfigure internal elements only (keeping bins in place) + + ReloadConfig() ; + + SetState(Pipeline , GST_STATE_READY) ; + bool is_error =/*(config_key == CONFIG::IS_SCREENCAP_ACTIVE_ID) ? ConfigureScreen() : + (config_key == CONFIG::IS_CAMERA_ACTIVE_ID ) ? ConfigureCamera() : + (config_key == CONFIG::IS_TEXT_ACTIVE_ID ) ? ConfigureText() : + (config_key == CONFIG::IS_IMAGE_ACTIVE_ID ) ? ConfigureImage() :*/ + (config_key == CONFIG::IS_PREVIEW_ACTIVE_ID ) ? ConfigurePreview() == nullptr : + (config_key == CONFIG::IS_AUDIO_ACTIVE_ID ) ? ConfigureAudio() == nullptr : + // (config_key == CONFIG::IS_OUTPUT_ACTIVE_ID ) ? ConfigureOutput() : + false ; + +DEBUG_TRACE_RECONFIGURE_OUT + + is_error = !SetState(Pipeline , GST_STATE_PLAYING) || is_error ; // DEBUG_MAKE_GRAPHVIZ - return true ; + return !is_error ; } +/* +bool Gstreamer::ConfigureScreen() +{ -void Gstreamer::DestroyBin(GstElement* a_bin) { RemoveBin(a_bin) ; DeleteElement(a_bin) ; } -/* recreate then reconfigure bin - * TODO: refactor with fn_pointer ? - if (config_key == CONFIG::IS_SCREENCAP_ACTIVE_ID ) - return ReconfigureBin(GST::SCREENCAP_BIN_ID , ScreencapBin , fn_pointer) ; - else if (config_key == CONFIG::IS_CAMERA_ACTIVE_ID ) - return ReconfigureBin(GST::CAMERA_BIN_ID , CameraBin , fn_pointer) ; - else if (config_key == CONFIG::IS_TEXT_ACTIVE_ID ) - return ReconfigureBin(GST::TEXT_BIN_ID , TextBin , fn_pointer) ; - else if (config_key == CONFIG::IS_IMAGE_ACTIVE_ID ) - return ReconfigureBin(GST::IMAGE_BIN_ID , ImageBin , fn_pointer) ; - else if (config_key == CONFIG::IS_PREVIEW_ACTIVE_ID ) - return ReconfigureBin(GST::PREVIEW_BIN_ID , PreviewBin , fn_pointer) ; - else if (config_key == CONFIG::IS_AUDIO_ACTIVE_ID ) - return ReconfigureBin(GST::AUDIO_BIN_ID , AudioBin , fn_pointer) ; - else if (config_key == CONFIG::IS_OUTPUT_ACTIVE_ID ) - return ReconfigureBin(GST::OUTPUT_BIN_ID , OutputBin , fn_pointer) ; - else return false ; -bool Gstreamer::ReconfigureBin(String bin_id , GstElement* a_bin) -{ -DEBUG_TRACE_RECONFIGURE_BIN - - a_bin = RecreateBin(a_bin , bin_id) ; - bool is_err = (bin_id == GST::SCREENCAP_BIN_ID && !ConfigureScreencap (a_bin)) || - (bin_id == GST::CAMERA_BIN_ID && !ConfigureCamera (a_bin)) || - (bin_id == GST::TEXT_BIN_ID && !ConfigureText (a_bin)) || - (bin_id == GST::IMAGE_BIN_ID && !ConfigureImage (a_bin)) || - (bin_id == GST::AUDIO_BIN_ID && !ConfigureAudio (a_bin)) || - (bin_id == GST::PREVIEW_BIN_ID && !ConfigurePreviewBin(a_bin)) || - (bin_id == GST::OUTPUT_BIN_ID && !ConfigureOutput (a_bin)) ; - - if (is_err) { RemoveBin(a_bin) ; DeleteElement(a_bin) ; } +} + +bool Gstreamer::ConfigureCamera() +{ + +} + +bool Gstreamer::ConfigureText() {} + +bool Gstreamer::ConfigureImage() {} +*/ +GstElement* Gstreamer::ConfigurePreview() +{ + GstElement *current_sink , *next_sink ; + + bool is_enabled = AvCaster::GetIsPreviewEnabled() && AvCaster::GetIsPreviewActive() ; + current_sink = (IsInBin(PreviewBin , PreviewRealSink)) ? PreviewRealSink : + (IsInBin(PreviewBin , PreviewFauxSink)) ? PreviewFauxSink : nullptr ; + next_sink = (is_enabled) ? PreviewRealSink : PreviewFauxSink ; + +DEBUG_TRACE_CONFIGURE_PREVIEW_BIN + + // configure elements + if (next_sink == PreviewRealSink) + { + gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(PreviewRealSink) , PreviewXwin) ; + if (!ConfigureVideoSink(PreviewRealSink)) + { AvCaster::Error(GUI::GST_XWIN_ERROR_MSG) ; return nullptr ; } + } + + // re-link elements + if (current_sink != nullptr) + { + if (!RemoveElement(PreviewBin , current_sink) || + !AddElement (PreviewBin , next_sink) || + !LinkElements (PreviewQueue , next_sink) ) + { AvCaster::Error(GUI::PREVIEW_LINK_ERROR_MSG) ; return nullptr ; } + } + + return next_sink ; +} + +GstElement* Gstreamer::ConfigureAudio() +{ + GstElement *current_source , *next_source ; + String caps_str ; + + bool is_enabled = AvCaster::GetIsAudioEnabled() && + bool(ConfigStore[CONFIG::IS_AUDIO_ACTIVE_ID]) ; + int audio_api_idx = int (ConfigStore[CONFIG::AUDIO_API_ID ]) ; + int n_channels = int (ConfigStore[CONFIG::N_CHANNELS_ID ]) ; + int samplerate_n = int (ConfigStore[CONFIG::SAMPLERATE_ID ]) ; + int samplerate = CONFIG::AUDIO_SAMPLERATES[samplerate_n].getIntValue() ; + String audio16_caps_str = MakeAudioCapsString("S16LE" , samplerate , n_channels) ; + String audio32_caps_str = MakeAudioCapsString("F32LE" , samplerate , n_channels) ; + + current_source = (IsInBin(AudioBin , AudioAlsaSource )) ? AudioAlsaSource : + (IsInBin(AudioBin , AudioPulseSource)) ? AudioPulseSource : + (IsInBin(AudioBin , AudioJackSource )) ? AudioJackSource : + (IsInBin(AudioBin , AudioTestSource )) ? AudioTestSource : nullptr ; + + if (!is_enabled) audio_api_idx = CONFIG::CONFIG_IDX_INVALID ; + switch ((CONFIG::AudioApi)audio_api_idx) + { + case CONFIG::ALSA_AUDIO_IDX: next_source = AudioAlsaSource ; caps_str = audio16_caps_str ; break ; + case CONFIG::PULSE_AUDIO_IDX: next_source = AudioPulseSource ; caps_str = audio16_caps_str ; break ; + case CONFIG::JACK_AUDIO_IDX: next_source = AudioJackSource ; caps_str = audio32_caps_str ; break ; + default: next_source = AudioTestSource ; caps_str = audio16_caps_str ; break ; + } + +DEBUG_TRACE_CONFIGURE_AUDIO_BIN + + // configure elements + if (next_source == AudioTestSource) ConfigureFauxSource(AudioTestSource) ; + ConfigureCaps(AudioCaps , NewCaps(caps_str)) ; + + // re-link elements + if (current_source != nullptr) + { + if (!RemoveElement(AudioBin , current_source) || + !AddElement (AudioBin , next_source) || + !LinkElements (next_source , AudioCaps) ) + { AvCaster::Error(GUI::AUDIO_LINK_ERROR_MSG) ; return nullptr ; } + } + + return next_source ; +} +/* +bool Gstreamer::ConfigureOutput() +{ - return !is_err ; } */ @@ -1075,6 +1104,82 @@ DEBUG_TRACE_SET_GST_STATE return !is_err ; } + +GstBusSyncReply Gstreamer::HandleMessage(GstBus* message_bus , GstMessage* message , GstPipeline* pipeline) +{ + switch (GST_MESSAGE_TYPE(message)) + { + case GST_MESSAGE_ERROR: HandleErrorMessage(message) ; break ; + case GST_MESSAGE_EOS: DBG("GST_MESSAGE_EOS") ; break ; + case GST_MESSAGE_STATE_CHANGED: break ; + case GST_MESSAGE_STREAM_STATUS: /* DEBUG_TRACE_DUMP_MESSAGE_STRUCT */ break ; + default: DEBUG_TRACE_UNHANDLED_MESSAGE break ; +/* GST_MESSAGE_TYPE types +GST_MESSAGE_UNKNOWN = 0, +GST_MESSAGE_EOS = (1 << 0), +GST_MESSAGE_ERROR = (1 << 1), +GST_MESSAGE_WARNING = (1 << 2), +GST_MESSAGE_INFO = (1 << 3), +GST_MESSAGE_TAG = (1 << 4), +GST_MESSAGE_BUFFERING = (1 << 5), +GST_MESSAGE_STATE_CHANGED = (1 << 6), +GST_MESSAGE_STATE_DIRTY = (1 << 7), +GST_MESSAGE_STEP_DONE = (1 << 8), +GST_MESSAGE_CLOCK_PROVIDE = (1 << 9), +GST_MESSAGE_CLOCK_LOST = (1 << 10), +GST_MESSAGE_NEW_CLOCK = (1 << 11), +GST_MESSAGE_STRUCTURE_CHANGE = (1 << 12), +GST_MESSAGE_STREAM_STATUS = (1 << 13), +GST_MESSAGE_APPLICATION = (1 << 14), +GST_MESSAGE_ELEMENT = (1 << 15), +GST_MESSAGE_SEGMENT_START = (1 << 16), +GST_MESSAGE_SEGMENT_DONE = (1 << 17), +GST_MESSAGE_DURATION = (1 << 18), +GST_MESSAGE_LATENCY = (1 << 19), +GST_MESSAGE_ASYNC_START = (1 << 20), +GST_MESSAGE_ASYNC_DONE = (1 << 21), +GST_MESSAGE_ANY = ~0 +*/ + } +/* The result values for a GstBusSyncHandler. +GST_BUS_DROP drop the message +GST_BUS_PASS pass the message to the async queue +GST_BUS_ASYNC pass message to async queue, continue if message is handled +*/ + return GST_BUS_PASS ; +} + +void Gstreamer::HandleErrorMessage(GstMessage* message) +{ + GError *error ; + gchar *debug ; + + gst_message_parse_error(message , &error , &debug) ; + String error_message = String(error->message) ; + bool is_alsa_init_error = error_message == GST::ALSA_INIT_ERROR ; + bool is_pulse_init_error = error_message == GST::PULSE_INIT_ERROR ; + bool is_jack_init_error = error_message == GST::JACK_INIT_ERROR ; + +DEBUG_TRACE_GST_ERROR + + if (is_alsa_init_error || is_pulse_init_error || is_jack_init_error) + { + // deactivate audio (reconfigures asynchronously once initialized) + AvCaster::SetConfig(CONFIG::IS_AUDIO_ACTIVE_ID , var(false)) ; + + // reconfigure synchronously if not yet initialized + if (!AvCaster::GetIsInitialized()) { ReloadConfig() ; ConfigureAudio() ; } + + // alert user + String warning_msg = (is_alsa_init_error ) ? GUI::ALSA_INIT_ERROR_MSG : + (is_pulse_init_error) ? GUI::PULSE_INIT_ERROR_MSG : + (is_jack_init_error ) ? GUI::JACK_INIT_ERROR_MSG : String::empty ; + AvCaster::Warning(warning_msg + error_message) ; + } + + g_error_free(error) ; g_free(debug) ; +} + GstElement* Gstreamer::NewPipeline(String pipeline_id) { return gst_pipeline_new(CHARSTAR(pipeline_id)) ; } GstElement* Gstreamer::NewBin(String bin_id) { return gst_bin_new(CHARSTAR(bin_id)) ; } @@ -1097,6 +1202,14 @@ DEBUG_TRACE_MAKE_CAPS return new_caps ; } +void Gstreamer::SetMessageHandler(GstPipeline* pipeline , GstBusSyncHandler on_message_cb) +{ + GstBus* message_bus = gst_pipeline_get_bus(pipeline) ; + + gst_bus_set_sync_handler(message_bus , on_message_cb , pipeline , NULL) ; + gst_object_unref(message_bus) ; +} + bool Gstreamer::AddElement(GstElement* a_bin , GstElement* an_element) { bool is_err = !gst_bin_add(GST_BIN(a_bin) , an_element) || @@ -1107,19 +1220,35 @@ DEBUG_TRACE_ADD_ELEMENT return !is_err ; } -void Gstreamer::DeleteElement(GstElement* an_element) +bool Gstreamer::RemoveElement(GstElement* a_bin , GstElement* an_element) { +DEBUG_TRACE_REMOVE_ELEMENT_IN +// bool is_err = !IsInBin(a_bin , an_element) || !SetState(an_element , GST_STATE_NULL) || +// !gst_bin_remove(GST_BIN(a_bin) , an_element) ; + bool is_err = !IsInBin(a_bin , an_element) || !gst_bin_remove(GST_BIN(a_bin) , an_element) ; + +DEBUG_TRACE_REMOVE_ELEMENT_OUT + + return !is_err ; +} + +void Gstreamer::DestroyElement(GstElement* an_element) +{ +DEBUG_TRACE_DESTROY_ELEMENT + if (an_element != nullptr && SetState(an_element , GST_STATE_NULL)) gst_object_unref(an_element) ; } bool Gstreamer::AddBin(GstElement* a_bin) { - bool is_err = a_bin != nullptr && +DEBUG_TRACE_ADD_BIN_IN + + bool is_err = a_bin == nullptr || IsInPipeline(a_bin) || (!gst_bin_add(GST_BIN(Pipeline) , a_bin) || !gst_element_sync_state_with_parent(a_bin) ) ; -DEBUG_TRACE_ADD_BIN +DEBUG_TRACE_ADD_BIN_OUT return !is_err ; } @@ -1128,29 +1257,13 @@ bool Gstreamer::RemoveBin(GstElement* a_bin) { DEBUG_TRACE_REMOVE_BIN_IN - bool is_err = IsInPipeline(a_bin) && !gst_bin_remove(GST_BIN(Pipeline) , a_bin) ; + bool is_err = !IsInPipeline(a_bin) || !gst_bin_remove(GST_BIN(Pipeline) , a_bin) ; DEBUG_TRACE_REMOVE_BIN_OUT return !is_err ; } -GstElement* Gstreamer::RecreateBin(GstElement* a_bin , String bin_id) -{ -DEBUG_TRACE_RECREATE_BIN_IN - - GstElement* new_bin ; - - if (RemoveBin(a_bin) && (new_bin = NewBin(bin_id)) != nullptr) - if (AddBin(new_bin)) { DeleteElement(a_bin) ; a_bin = new_bin ; } - - if (!IsInPipeline(new_bin)) { AddBin(a_bin) ; DeleteElement(new_bin) ; } - -DEBUG_TRACE_RECREATE_BIN_OUT - - return a_bin ; -} - bool Gstreamer::LinkElements(GstElement* source , GstElement* sink) { bool is_err = !gst_element_link(source , sink) ; @@ -1294,6 +1407,7 @@ String Gstreamer::MakeAudioCapsString(String format , int samplerate , int n_cha String("format=(string)" ) + format + ", " + String("rate=(int)" ) + String(samplerate) + ", " + String("channels=(int)") + String(n_channels) ; +//"channel-mask=(bitmask)0x03" } String Gstreamer::MakeH264CapsString(int output_w , int output_h , int framerate) @@ -1332,6 +1446,24 @@ bool Gstreamer::IsSufficientVersion() minor_version >= GST::MIN_MINOR_VERSION ; } +String Gstreamer::GetElementId(GstElement* an_element) +{ + if (!an_element) return "nil" ; + + gchar* id = gst_element_get_name(an_element) ; String element_id = id ; g_free(id) ; + + return element_id ; +} + +String Gstreamer::GetPadId(GstPad* a_pad) +{ + if (!a_pad) return "nil" ; + + gchar* id = gst_pad_get_name(a_pad) ; String pad_id = id ; g_free(id) ; + + return pad_id ; +} + bool Gstreamer::IsInitialized() { return gst_is_initialized() ; } bool Gstreamer::IsPlaying() @@ -1341,5 +1473,11 @@ bool Gstreamer::IsPlaying() bool Gstreamer::IsInPipeline(GstElement* an_element) { - return !!an_element && GST_ELEMENT_PARENT(an_element) == Pipeline ; + return IsInBin(Pipeline , an_element) ; +} + +bool Gstreamer::IsInBin(GstElement* a_parent_element , GstElement* a_child_element) +{ + return !!a_child_element && !!a_parent_element && + GST_ELEMENT_PARENT(a_child_element) == a_parent_element ; } diff --git a/Source/Gstreamer.h b/Source/Gstreamer.h index a257f14..cd66193 100644 --- a/Source/Gstreamer.h +++ b/Source/Gstreamer.h @@ -36,21 +36,20 @@ class Gstreamer private: // setup - static bool Initialize() ; - static void Shutdown () ; + static bool Initialize (void* x_window_handle) ; + static void ReloadConfig() ; + static void Shutdown () ; // pipeline configuration - static bool InitializePipeline () ; -// static bool ConfigurePipeline () ; - static bool ConfigureScreencapBin (GstElement* link_bin) ; - static bool ConfigureCameraBin (GstElement* link_bin) ; - static bool ConfigureTextBin (GstElement* link_bin) ; - static bool ConfigureImageBin (GstElement* link_bin) ; - static bool ConfigureCompositorBin() ; - static bool ConfigurePreviewBin () ; - static bool ConfigureAudioBin () ; - static bool ConfigureMuxerBin () ; - static bool ConfigureOutputBin () ; + static bool BuildScreencapBin () ; + static bool BuildCameraBin () ; + static bool BuildTextBin () ; + static bool BuildImageBin () ; + static bool BuildCompositorBin() ; + static bool BuildPreviewBin () ; + static bool BuildAudioBin () ; + static bool BuildMuxerBin () ; + static bool BuildOutputBin () ; // element configuration static void ConfigureCaps (GstElement* a_capsfilter , GstCaps* a_caps) ; @@ -61,21 +60,32 @@ class Gstreamer guint pattern_n , bool is_active ) ; static void ConfigureCamera (GstElement* a_camera_source , String device_path , guint pattern_n , bool is_active ) ; - static void ConfigureFauxVideo (GstElement* a_faux_source , guint pattern_n) ; + static void ConfigureTestVideo (GstElement* a_test_source , guint pattern_n) ; static void ConfigureText (GstElement* a_text_source , String font_desc) ; static void ConfigureFile (GstElement* a_file_source , String file_path) ; static void ConfigureCompositor (GstElement* a_compositor , guint background_n) ; static void ConfigureCompositorSink(GstPad* sinkpad , gint w , gint h , gint x , gint y) ; static bool ConfigureVideoSink (GstElement* a_video_sink) ; - static void ConfigureFauxAudio (GstElement* faux_source) ; + static void ConfigureFauxSource (GstElement* a_faux_source) ; static void ConfigureX264Encoder (GstElement* an_x264_encoder , guint bitrate) ; static void ConfigureLameEncoder (GstElement* a_lame_encoder , guint bitrate) ; static void ConfigureFlvmux (GstElement* a_flvmuxer) ; static bool Reconfigure (const Identifier& config_key , bool is_config_pending) ; -// static bool ReconfigureBin (String bin_id , GstElement* a_bin) ; +// static bool ConfigureScreen() ; +// static bool ConfigureCamera() ; +// static bool ConfigureText() ; +// static bool ConfigureImage() ; + static GstElement* ConfigurePreview() ; + static GstElement* ConfigureAudio() ; +// static bool ConfigureOutput() ; // state - static bool SetState(GstElement* an_element , GstState next_state) ; + static bool SetState (GstElement* an_element , GstState next_state) ; + static void SetMessageHandler (GstPipeline* pipeline , + GstBusSyncHandler on_message_cb) ; + static GstBusSyncReply HandleMessage (GstBus* message_bus , GstMessage* message , + GstPipeline* pipeline ) ; + static void HandleErrorMessage(GstMessage* message) ; // element creation and destruction static GstElement* NewPipeline (String pipeline_id) ; @@ -83,11 +93,10 @@ class Gstreamer static GstElement* NewElement (String plugin_id , String element_id) ; static GstCaps* NewCaps (String caps_str) ; static bool AddElement (GstElement* a_bin , GstElement* an_element) ; - static void DeleteElement (GstElement* an_element) ; + static bool RemoveElement (GstElement* a_bin , GstElement* an_element) ; + static void DestroyElement (GstElement* an_element) ; static bool AddBin (GstElement* a_bin) ; static bool RemoveBin (GstElement* a_bin) ; - static void DestroyBin (GstElement* a_bin) ; - static GstElement* RecreateBin (GstElement* a_bin , String bin_id) ; static bool LinkElements (GstElement* source , GstElement* sink) ; static bool LinkPads (GstPad* srcpad , GstPad* sinkpad) ; static GstPad* NewGhostSrcPad (GstElement* a_bin , GstElement* an_element , @@ -113,14 +122,16 @@ class Gstreamer static String MakeMp3CapsString (int samplerate , int n_channels) ; static String MakeLctvUrl (String dest) ; - // state helpers - static unsigned int GetVersionMajor () ; - static unsigned int GetVersionMinor () ; - static bool IsSufficientVersion() ; - static bool IsInitialized () ; - static bool IsPlaying () ; - static bool IsInPipeline (GstElement* an_element) ; + // getters/setters + static String GetElementId(GstElement* an_element) ; + static String GetPadId (GstPad* a_pad) ; + // state helpers + static bool IsSufficientVersion() ; + static bool IsInitialized () ; + static bool IsPlaying () ; + static bool IsInPipeline (GstElement* an_element) ; + static bool IsInBin (GstElement* a_parent_element , GstElement* a_child_element) ; // pipeline static GstElement* Pipeline ; @@ -130,10 +141,18 @@ class Gstreamer static GstElement* ImageBin ; static GstElement* CompositorBin ; static GstElement* PreviewBin ; - static GstElement* PreviewSink ; + static GstElement* PreviewQueue ; + static GstElement* PreviewFauxSink ; + static GstElement* PreviewRealSink ; static GstElement* AudioBin ; + static GstElement* AudioAlsaSource ; + static GstElement* AudioPulseSource ; + static GstElement* AudioJackSource ; + static GstElement* AudioTestSource ; + static GstElement* AudioCaps ; static GstElement* MuxerBin ; static GstElement* OutputBin ; + static guintptr PreviewXwin ; // configuration static ValueTree ConfigStore ; diff --git a/Source/IrcClient.cpp b/Source/IrcClient.cpp index b8e5378..a7ab7a7 100644 --- a/Source/IrcClient.cpp +++ b/Source/IrcClient.cpp @@ -17,7 +17,7 @@ \*/ -#include +#include #include "AvCaster.h" #include "IrcClient.h" diff --git a/Source/IrcClient.h b/Source/IrcClient.h index 9b80142..55cf49b 100644 --- a/Source/IrcClient.h +++ b/Source/IrcClient.h @@ -21,7 +21,7 @@ #define _IRCCLIENT_H_ -#include +#include #include "Constants.h" diff --git a/Source/Main.cpp b/Source/Main.cpp index 87aba31..c704040 100644 --- a/Source/Main.cpp +++ b/Source/Main.cpp @@ -36,10 +36,9 @@ DEBUG_TRACE_INIT_VERSION if (AvCaster::Initialize(this->mainWindow->mainContent)) { - // start GUI update timers -// startTimer(APP::GUI_TIMER_HI_ID , APP::GUI_UPDATE_HI_IVL ) ; - startTimer(APP::GUI_TIMER_MED_ID , APP::GUI_UPDATE_MED_IVL) ; - startTimer(APP::GUI_TIMER_LO_ID , APP::GUI_UPDATE_LO_IVL ) ; + // start runtime timers + for (int timer_n = 0 ; timer_n < APP::N_TIMERS ; ++timer_n) + startTimer(APP::TIMER_IDS[timer_n] , APP::TIMER_IVLS[timer_n]) ; } else { setApplicationReturnValue(255) ; shutdown() ; quit() ; } } @@ -55,6 +54,9 @@ DEBUG_TRACE_INIT_VERSION { DEBUG_TRACE_SHUTDOWN_IN + for (int timer_n = 0 ; timer_n > APP::N_TIMERS ; ++timer_n) + stopTimer(APP::TIMER_IDS[timer_n]) ; + AvCaster::Shutdown() ; this->mainWindow = nullptr ; @@ -87,9 +89,9 @@ DEBUG_TRACE_SHUTDOWN_OUT setContentOwned(this->mainContent , true) ; // this main desktop window -#ifdef _MAC +#ifdef JUCE_MAC setTitleBarButtonsRequired(DocumentWindow::allButtons , true) ; -#endif // _MAC +#endif // JUCE_MAC setTitleBarHeight(GUI::TITLEBAR_H) ; // setIcon(const Image &imageToUse) ; centreWithSize(getWidth() , getHeight()) ; @@ -119,8 +121,8 @@ DEBUG_TRACE_SHUTDOWN_OUT #else // DEBUG_QUIT_IMMEDIATELY void timerCallback(int timer_id) override { - if (timer_id != APP::GUI_TIMER_LO_ID) AvCaster::HandleTimer(timer_id) ; - else { Trace::TraceEvent("forced quit") ; quit() ; } + if (timer_id != APP::TIMER_LO_ID) AvCaster::HandleTimer(timer_id) ; + else { Trace::TraceEvent("forced quit") ; quit() ; } } #endif // DEBUG_QUIT_IMMEDIATELY diff --git a/Source/MainContent.h b/Source/MainContent.h index d826f6b..ef0a311 100644 --- a/Source/MainContent.h +++ b/Source/MainContent.h @@ -16,8 +16,8 @@ |*| along with AvCaster. If not, see . \*/ -#ifndef __JUCE_HEADER_262A4C4094138A40__ -#define __JUCE_HEADER_262A4C4094138A40__ +#ifndef _MAINCONTENT_H_ +#define _MAINCONTENT_H_ //[Headers] -- You can add your own extra header files here -- @@ -89,4 +89,4 @@ class MainContent : public Component //[EndFile] You can add extra defines here... //[/EndFile] -#endif // __JUCE_HEADER_262A4C4094138A40__ +#endif // _MAINCONTENT_H_ diff --git a/Source/Preset.h b/Source/Preset.h index bb4711c..80252db 100644 --- a/Source/Preset.h +++ b/Source/Preset.h @@ -16,8 +16,8 @@ |*| along with AvCaster. If not, see . \*/ -#ifndef __JUCE_HEADER_E38720C00B5B6F26__ -#define __JUCE_HEADER_E38720C00B5B6F26__ +#ifndef _PRESET_H_ +#define _PRESET_H_ //[Headers] -- You can add your own extra header files here -- @@ -89,4 +89,4 @@ class Preset : public Component, //[EndFile] You can add extra defines here... //[/EndFile] -#endif // __JUCE_HEADER_E38720C00B5B6F26__ +#endif // _PRESET_H_ diff --git a/Source/PresetSeed.cpp b/Source/PresetSeed.cpp index 309fd45..b207674 100644 --- a/Source/PresetSeed.cpp +++ b/Source/PresetSeed.cpp @@ -68,7 +68,7 @@ void PresetSeed::createPreset() preset.setProperty(CONFIG::IS_SCREENCAP_ACTIVE_ID , var(isScreencapActive ) , nullptr) ; preset.setProperty(CONFIG::IS_CAMERA_ACTIVE_ID , var(isCameraActive ) , nullptr) ; preset.setProperty(CONFIG::IS_TEXT_ACTIVE_ID , var(isTextActive ) , nullptr) ; - preset.setProperty(CONFIG::IS_IMAGE_ACTIVE_ID , var(isImageActive) , nullptr) ; + preset.setProperty(CONFIG::IS_IMAGE_ACTIVE_ID , var(isImageActive ) , nullptr) ; preset.setProperty(CONFIG::IS_PREVIEW_ACTIVE_ID , var(isPreviewActive ) , nullptr) ; preset.setProperty(CONFIG::IS_AUDIO_ACTIVE_ID , var(isAudioActive ) , nullptr) ; preset.setProperty(CONFIG::IS_OUTPUT_ACTIVE_ID , var(isOutputActive ) , nullptr) ; @@ -103,7 +103,7 @@ FilePresetSeed::FilePresetSeed() { presetId = CONFIG::FilterId(CONFIG::FILE_PRESET_NAME , APP::VALID_ID_CHARS) ; presetName = CONFIG::FILE_PRESET_NAME ; - sinkIdx = CONFIG::FILE_STREAM_IDX ; + sinkIdx = CONFIG::FILE_OUTPUT_IDX ; outputDest = CONFIG::DEFAULT_OUTPUT_DEST ; createPreset() ; } @@ -112,7 +112,7 @@ RtmpPresetSeed::RtmpPresetSeed() { presetId = CONFIG::FilterId(CONFIG::RTMP_PRESET_NAME , APP::VALID_ID_CHARS) ; presetName = CONFIG::RTMP_PRESET_NAME ; - sinkIdx = CONFIG::RTMP_STREAM_IDX ; + sinkIdx = CONFIG::RTMP_OUTPUT_IDX ; outputDest = String::empty ; createPreset() ; } @@ -121,7 +121,7 @@ LctvPresetSeed::LctvPresetSeed() { presetId = CONFIG::FilterId(CONFIG::LCTV_PRESET_NAME , APP::VALID_ID_CHARS) ; presetName = CONFIG::LCTV_PRESET_NAME ; - sinkIdx = CONFIG::RTMP_STREAM_IDX ; + sinkIdx = CONFIG::RTMP_OUTPUT_IDX ; outputDest = String::empty ; createPreset() ; } diff --git a/Source/Presets.cpp b/Source/Presets.cpp index 814ca19..6a43333 100644 --- a/Source/Presets.cpp +++ b/Source/Presets.cpp @@ -1,504 +1,522 @@ -/*\ -|*| Copyright 2015 bill-auger -|*| -|*| This file is part of the AvCaster program. -|*| -|*| AvCaster is free software: you can redistribute it and/or modify -|*| it under the terms of the GNU Lesser General Public License version 3 -|*| as published by the Free Software Foundation. -|*| -|*| AvCaster 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 Lesser General Public License for more details. -|*| -|*| You should have received a copy of the GNU Lesser General Public License -|*| along with AvCaster. If not, see . -\*/ - -//[Headers] You can add your own extra header files here... - -#include "AvCaster.h" - -//[/Headers] - -#include "Presets.h" - - -//[MiscUserDefs] You can add your own user definitions and misc code here... -//[/MiscUserDefs] - -//============================================================================== -Presets::Presets () -{ - addAndMakeVisible (presetsGroup = new GroupComponent ("presetsGroup", - TRANS("Presets"))); - presetsGroup->setColour (GroupComponent::outlineColourId, Colours::white); - presetsGroup->setColour (GroupComponent::textColourId, Colours::white); - - addAndMakeVisible (saveButton = new TextButton ("saveButton")); - saveButton->setExplicitFocusOrder (1); - saveButton->setButtonText (TRANS("Save")); - saveButton->addListener (this); - - addAndMakeVisible (newButton = new TextButton ("newButton")); - newButton->setExplicitFocusOrder (2); - newButton->setButtonText (TRANS("New")); - newButton->addListener (this); - - addAndMakeVisible (deleteButton = new TextButton ("deleteButton")); - deleteButton->setExplicitFocusOrder (3); - deleteButton->setButtonText (TRANS("Delete")); - deleteButton->addListener (this); - - addAndMakeVisible (presetLabel = new Label ("presetLabel", - TRANS("Preset:"))); - presetLabel->setFont (Font (15.00f, Font::plain)); - presetLabel->setJustificationType (Justification::centredLeft); - presetLabel->setEditable (false, false, false); - presetLabel->setColour (Label::textColourId, Colours::white); - presetLabel->setColour (TextEditor::textColourId, Colours::black); - presetLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (presetsCombo = new ComboBox ("presetsCombo")); - presetsCombo->setExplicitFocusOrder (4); - presetsCombo->setEditableText (true); - presetsCombo->setJustificationType (Justification::centredLeft); - presetsCombo->setTextWhenNothingSelected (String::empty); - presetsCombo->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); - presetsCombo->addListener (this); - - addAndMakeVisible (configButton = new ImageButton ("configButton")); - configButton->setExplicitFocusOrder (5); - configButton->addListener (this); - - configButton->setImages (false, true, true, - ImageCache::getFromMemory (preferencessystem_png, preferencessystem_pngSize), 1.000f, Colour (0x00000000), - ImageCache::getFromMemory (confighover_png, confighover_pngSize), 1.000f, Colour (0x00000000), - ImageCache::getFromMemory (configpushed_png, configpushed_pngSize), 1.000f, Colour (0x00000000)); - - //[UserPreSize] - //[/UserPreSize] - - setSize (600, 400); - - - //[Constructor] You can add your own custom stuff here.. - - MainContent* main_content = static_cast(getParentComponent()) ; - main_content->configureCombobox(this->presetsCombo) ; - - //[/Constructor] -} - -Presets::~Presets() -{ - //[Destructor_pre]. You can add your own custom destruction code here.. - //[/Destructor_pre] - - presetsGroup = nullptr; - saveButton = nullptr; - newButton = nullptr; - deleteButton = nullptr; - presetLabel = nullptr; - presetsCombo = nullptr; - configButton = nullptr; - - - //[Destructor]. You can add your own custom destruction code here.. - //[/Destructor] -} - -//============================================================================== -void Presets::paint (Graphics& g) -{ - //[UserPrePaint] Add your own custom painting code here.. - //[/UserPrePaint] - - g.setColour (Colour (0xff303030)); - g.fillRoundedRectangle (20.0f, 22.0f, static_cast (getWidth() - 40), 52.0f, 4.000f); - - //[UserPaint] Add your own custom painting code here.. - //[/UserPaint] -} - -void Presets::resized() -{ - //[UserPreResize] Add your own custom resize code here.. - //[/UserPreResize] - - presetsGroup->setBounds (16, 12, getWidth() - 32, 64); - saveButton->setBounds (156, 35, 64, 24); - newButton->setBounds (244, 35, 64, 24); - deleteButton->setBounds (332, 35, 64, 24); - presetLabel->setBounds (412, 36, 80, 24); - presetsCombo->setBounds (512, 36, 176, 24); - configButton->setBounds (696, 36, 24, 24); - //[UserResized] Add your own custom resize handling here.. - //[/UserResized] -} - -void Presets::buttonClicked (Button* buttonThatWasClicked) -{ - //[UserbuttonClicked_Pre] - - Identifier key ; - var value = var(buttonThatWasClicked->getToggleState()) ; - - //[/UserbuttonClicked_Pre] - - if (buttonThatWasClicked == saveButton) - { - //[UserButtonCode_saveButton] -- add your button handler code here.. - - handleSaveButton() ; return ; - - //[/UserButtonCode_saveButton] - } - else if (buttonThatWasClicked == newButton) - { - //[UserButtonCode_newButton] -- add your button handler code here.. - - handleNewButton() ; return ; - - //[/UserButtonCode_newButton] - } - else if (buttonThatWasClicked == deleteButton) - { - //[UserButtonCode_deleteButton] -- add your button handler code here.. - - handleDeleteButton() ; return ; - - //[/UserButtonCode_deleteButton] - } - else if (buttonThatWasClicked == configButton) - { - //[UserButtonCode_configButton] -- add your button handler code here.. - - if (AvCaster::RejectPresetChange()) return ; - - key = CONFIG::IS_PENDING_ID ; - value = var(!AvCaster::GetIsConfigPending()) ; - - //[/UserButtonCode_configButton] - } - - //[UserbuttonClicked_Post] - - AvCaster::SetConfig(key , value) ; - - //[/UserbuttonClicked_Post] -} - -void Presets::comboBoxChanged (ComboBox* comboBoxThatHasChanged) -{ - //[UsercomboBoxChanged_Pre] - //[/UsercomboBoxChanged_Pre] - - if (comboBoxThatHasChanged == presetsCombo) - { - //[UserComboBoxCode_presetsCombo] -- add your combo box handling code here.. - //[/UserComboBoxCode_presetsCombo] - } - - //[UsercomboBoxChanged_Post] - //[/UsercomboBoxChanged_Post] -} - - - -//[MiscUserCode] You can add your own definitions of your custom methods or any other code here... - -void Presets::broughtToFront() -{ - toggleControls() ; - this->mainContent->loadPresetsCombo(this->presetsCombo) ; setCreatePresetMode(false) ; -} - -void Presets::handleSaveButton() -{ - String preset_name = this->presetsCombo->getText() ; - - if (preset_name.isEmpty()) AvCaster::Warning(GUI::PRESET_NAME_ERROR_MSG) ; - else - { - setCreatePresetMode(false) ; AvCaster::StorePreset(preset_name) ; - -#ifdef STATIC_PIPELINE - AvCaster::Warning("Changes will take effect after AvCaster is restarted.") ; -#endif // STATIC_PIPELINE - } -} - -void Presets::handleNewButton() -{ - this->presetsCombo->setText(String::empty , juce::dontSendNotification) ; - this->presetsCombo->grabKeyboardFocus() ; - setCreatePresetMode(true) ; -} - -void Presets::handleDeleteButton() -{ - if (isCreatePresetMode()) - { - setCreatePresetMode(false) ; - this->presetsCombo->setText(AvCaster::GetPresetName() , juce::dontSendNotification) ; - } - else if (AvCaster::IsStaticPreset()) AvCaster::ResetPreset() ; - else AvCaster::DeletePreset() ; -} - -void Presets::toggleControls() -{ - bool is_config_pending = AvCaster::GetIsConfigPending() ; - - this->presetsGroup->setVisible(is_config_pending) ; - this->saveButton ->setVisible(is_config_pending) ; - this->newButton ->setVisible(is_config_pending) ; - this->deleteButton->setVisible(is_config_pending) ; - this->presetLabel ->setVisible(is_config_pending) ; -} - -void Presets::setCreatePresetMode(bool is_pending_new_preset_name) -{ - bool is_static_preset = AvCaster::IsStaticPreset() ; - String button_text = (is_pending_new_preset_name) ? GUI::DELETE_BTN_CANCEL_TEXT : - (is_static_preset ) ? GUI::DELETE_BTN_RESET_TEXT : - GUI::DELETE_BTN_DELETE_TEXT ; - - this->presetsCombo->setEditableText(is_pending_new_preset_name || !is_static_preset) ; - this->deleteButton->setButtonText (button_text) ; -} - -bool Presets::isCreatePresetMode() -{ - return this->deleteButton->getButtonText() == GUI::DELETE_BTN_CANCEL_TEXT ; -} - -//[/MiscUserCode] - - -//============================================================================== -#if 0 -/* -- Introjucer information section -- - - This is where the Introjucer stores the metadata that describe this GUI layout, so - make changes in here at your peril! - -BEGIN_JUCER_METADATA - - - - - - - - - - - -END_JUCER_METADATA -*/ -#endif - -//============================================================================== -// Binary resources - be careful not to edit any of these sections! - -// JUCER_RESOURCE: configpushed_png, 4254, "../../../home/bill/img/config-pushed.png" -static const unsigned char resource_Presets_configpushed_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122,244,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187, -127,0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,223,10,28,2,22,54,175,101,0,252,0,0,16,43,73,68,65,84,88,9,1,32,16,223,239,1,0,0,0,0,0,0,0,0,0,0,0,0,181,181,181,88, -203,203,203,132,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,242, -53,53,53,120,75,75,75,151,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,168,168,168,154,216,216,216,231,0,0,0,170,128,128,128,213,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,8,0,0,0,99,40,40,40,54,88,88,88,95,0,0,0,0,0,0,0,0,0,168,168,168,132,128,128,128,120,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128, -49,168,168,168,161,0,0,0,0,1,181,181,181,49,203,203,203,154,0,0,0,55,128,128,128,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,103,103,100,61,3,5,3,162,0,0,2,9,0,0,0,221,254,252,251,169,248,248,252,154,160,160, -160,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,101,106,117,70,5,0,0,204,150,150,139,238,0,0,0,0,0,0,0,0,128,128,128,131,53,53,53,208,3,38,38,38,171,0,0,0,135,128, -128,128,216,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,102,102,13,0,1,254,218,24,24,25,16,48,47,50,12,19,19,19,29,248,250,249,65,253,255,252,95,47,45,47,168,207,207,207,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,108,119,117,0,0,255,162,0,3,3,90,48,51,57,174,207,204,198,241,0,0,0,0,64,64,64,241,230,230,230,145,2,0,0,0,42,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,154,154, -154,243,3,2,3,63,234,235,233,246,245,246,245,254,21,20,21,0,53,51,54,8,35,33,35,30,9,10,7,175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,127,127,3,104,110,120,158,5,6,5,127,40,43,43,0, -22,25,24,26,3,3,2,206,99,108,116,46,0,0,0,0,0,0,0,210,0,0,0,30,2,0,0,0,18,128,128,128,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,151,151,154,194,250,252,253,66,204,204,201,2,255,255,255,249,253, -253,253,0,34,33,35,3,8,8,8,45,101,104,98,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,102,117,13,231,239,249,190,10,10,11,86,36,38,39,11,4,5,5,0,20,21,21,3,20,21,21,18,2,255,1,209,114,114,114,5,128, -128,128,252,0,0,0,14,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,100,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,156,152,156,201,0,0,0,241,253,253,253,229,0,0,0,0,251,251,251,0,25,25,27,11,4,3,5,84,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,3,207,18,18,18,55,34,37,36,11,2,3,2,0,0,0,0,0,254,254,254,0,240,241,239,245,1,1,1,93,142,142,142,251,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,102,102,99,71,2,3,255,236,110, -110,108,85,0,0,0,0,0,0,0,0,0,0,0,0,101,105,101,49,0,0,0,15,3,3,3,245,3,3,3,0,2,2,2,0,9,9,9,1,3,3,3,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,0,19,28,27,24,7,252,252,251,0,252,251,251,0,253,252, -251,0,228,226,227,248,252,250,253,184,154,148,138,164,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,3,5,4,158,36,35,37,0,253,254,253,166,114,114,112,80,0,0,0,0,103,103,99,48,1,253,254,181,27,26,29, -126,8,8,8,33,6,6,6,0,6,6,6,0,250,250,250,255,0,0,0,231,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,102,114,15,254,255,253,16,253,253,253,0,251,250,250,0,254,253,252,0,241,240,240,255,243,241,240,240,0,250,253, -97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,237,21,21,23,26,24,24,25,4,196,197,194,175,102,103,99,0,255,0,0,0,33,34,34,147,46,45,48,122,255,255,255,8,253,253,253,0,3,3,3,0,236,236, -235,252,253,252,252,2,0,0,0,0,0,0,0,0,0,0,0,0,96,114,114,10,0,250,5,192,31,30,26,251,255,254,253,5,245,243,242,0,249,249,249,0,237,237,239,1,0,254,255,79,154,154,139,243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,4,0,0,0,0,0,0,0,0,0,0,0,0,253,253,252,179,235,235,233,42,36,36,38,3,74,73,77,0,0,0,0,0,0,0,0,0,0,0,0,109,249,249,249,0,247,247,247,0,255,255,255,0,4,4,4,0,38,38,39,5,202,202,238,89,104,106,102,177,152, -150,154,177,96,114,114,10,6,250,4,190,34,32,27,43,11,11,10,5,221,223,227,246,246,246,247,215,0,255,0,189,0,255,0,198,154,150,139,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,249, -247,252,146,226,228,227,108,33,33,35,14,2,2,2,0,254,254,254,0,1,1,1,0,1,1,1,0,255,255,255,0,10,10,10,0,243,243,243,0,217,217,217,0,16,16,16,0,54,53,57,8,202,202,199,168,102,105,102,78,255,250,4,123,36, -33,30,49,13,13,9,5,220,222,228,246,246,246,247,151,154,148,138,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,157,157,157,233,254,254,254,110,195,196,193, -248,244,244,243,0,9,9,9,0,8,8,8,0,7,7,7,0,2,2,2,0,245,246,244,0,255,255,255,0,12,12,12,0,255,255,255,0,247,247,247,0,54,54,56,8,1,3,12,183,35,32,27,58,16,16,12,6,225,226,231,247,243,243,245,155,154,148, -138,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,148,151,161,104,104,102,240,199,200,198,156,9,9,9,9,14,15,15,2,248,247,247,254,239, -240,239,4,253,252,252,7,56,56,58,255,12,12,12,1,0,0,0,0,0,0,0,0,214,218,226,0,32,30,30,3,18,17,15,3,222,225,229,249,238,239,241,158,154,149,139,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,152,154,177,20,19,22,24,242,241,239,57,227,228,225,78,236,235,235,68,1,255,3,17,2,1,0,47,204,205,203,245,6,7,6,255,2,2,2,0,224, -228,234,0,12,12,11,0,19,19,16,0,225,227,231,0,240,237,236,1,253,254,238,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,129,129,129,253,0,0,0,211,0,0,0,211,0,0,0,0,0,0,0,0,22,55,100,252,16,10,252,154,220,233,199,108,47,38,30,6,14,12,10,0,22,21,18,0,227,229,233,0,6,4,3,0,47,44,37,4,213,214,211,205,100,100, -100,43,156,156,156,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,56,101,98,6,4,4,202, -61,54,47,111,250,6,26,3,173,196,229,0,9,11,13,0,229,230,234,0,0,255,254,0,31,28,22,0,20,20,21,2,35,35,37,18,7,9,5,205,102,102,102,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,56,100,78,4,5,4,148,67,61,48,11,46,39,26,3,46,41,31,3,25,25,21,0,150,174,207,0,246,248,250,0,37,33,27,0,4,4,4,0,247,247, -247,0,31,30,32,3,31,29,32,25,6,8,4,199,96,96,96,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,55,100,55,2,2,2, -166,59,53,43,9,244,248,253,0,180,199,225,0,211,221,235,0,23,20,17,0,6,6,7,253,215,221,227,251,255,0,254,0,254,254,254,0,3,3,3,0,245,245,245,0,36,36,37,4,22,22,23,37,13,14,11,191,96,96,96,6,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,55,101,66,2,2,2,187,55,50,42,10,255,1,2,0,240,243,247,0,237,230,222,0,234,226,214,0,248,248,248, -0,247,249,251,245,241,248,252,113,201,202,201,248,255,0,255,0,254,254,254,0,2,2,2,0,246,246,246,0,44,42,45,4,16,16,16,48,14,15,12,180,127,127,127,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,55,100,103,4,4,2,179,61,55,45,13,6,7,6,1,236,240,245,0,244,236,226,0,249,248,244,0,21,21,22,0,229,232,240,250,250,251,251,208,195,176,157,149,255,253,253, -80,202,202,200,249,254,254,253,0,0,0,0,0,1,1,1,0,248,248,248,0,48,47,50,6,10,10,11,63,239,240,237,167,191,191,191,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,58,105, -20,25,56,102,180,7,9,8,141,65,59,48,10,254,2,3,0,252,252,251,0,247,239,228,0,244,244,242,0,20,19,20,0,241,246,2,250,234,237,239,219,0,249,0,78,0,0,0,0,151,151,154,185,254,0,254,84,201,203,200,250,250, -251,250,0,0,0,0,0,254,254,254,0,251,251,251,0,51,50,52,6,6,6,6,78,176,176,173,151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,24,55,100,110,253,0,252,223,19,20,16,69,66,60,48,11, -255,0,1,0,21,14,6,0,235,230,224,0,241,241,241,0,18,18,18,0,242,247,2,250,232,235,238,218,0,250,0,59,231,205,154,241,0,0,0,0,0,0,0,0,151,148,153,180,0,254,0,88,204,204,202,249,250,250,250,0,3,3,3,0,253, -253,253,0,251,251,251,0,49,48,51,7,2,3,3,96,108,111,105,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,25,55,102,62,5,6,5,131,37,33,31,12,52,47,38,6,9,7,3,0,36,26,13,0,216,216,217,0,235,237,239, -0,16,15,15,0,250,255,8,252,232,235,240,220,0,250,0,60,231,205,154,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,150,152,175,255,0,255,96,204,205,202,250,247,248,247,0,253,253,253,0,242,242,242,0,228,228,228, -0,45,44,47,7,253,251,254,126,101,101,101,17,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,255,0,255,66,17,16,15,13,51,44,30,0,33,23,11,0,27,19,9,0,195,203,214,0,232,233,235,0,10,9,9,0,2,6,15,0,226,229,236, -243,252,1,253,70,231,205,154,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,148,152,168,1,3,2,100,205,205,203,250,250,250,250,0,245,245,245,0,239,239,239,0,245,245,245,0,12,13,13,253,1,1,254, -52,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,254,224,6,4,1,247,10,6,3,0,233,238,245,0,181,197,217,0,232,231,229,0,3,4,5,0,16,20,26,0,223,227,234,247,250,247,241,86,235,199,157,238,0,0,0,4,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,7,148,145,149,172,251,250,250,114,208,208,205,250,12,13,12,0,32,32,32,0,9,9,9,0,244,244,243,2,250,250,253,217,0,0,0,0,0,0,0,0,0,0,0,0,3,60,60,60,112,255,255, -255,162,225,221,216,229,250,6,22,101,0,3,5,8,246,249,253,0,233,231,228,0,252,250,251,0,22,25,28,0,234,237,244,250,242,241,239,178,236,207,166,173,0,0,0,8,0,0,0,7,0,0,0,6,0,0,0,2,0,0,0,4,0,0,0,6,0,0,0, -10,0,0,0,10,0,0,0,11,0,0,0,11,205,205,207,218,37,37,36,234,237,239,238,61,239,239,237,250,227,228,226,252,244,244,245,124,162,161,163,200,0,0,0,3,82,82,82,12,22,22,22,105,4,32,32,32,126,236,236,236,102, -195,195,152,160,5,16,31,110,208,212,0,153,44,39,33,8,17,13,9,0,0,17,16,0,255,2,5,0,237,238,239,252,239,218,187,159,0,0,0,17,0,0,0,248,0,0,0,248,0,0,0,248,0,0,0,7,0,0,0,253,0,0,0,252,0,0,0,3,0,0,0,6,0, -0,0,6,0,0,0,5,0,0,0,6,165,165,168,189,15,15,15,190,35,35,35,18,228,228,228,229,234,234,234,242,0,0,0,6,0,0,0,1,34,34,34,107,46,46,46,116,3,178,178,178,215,95,95,95,98,4,4,4,231,210,198,182,208,3,11,23, -221,238,244,252,65,247,252,0,248,244,246,252,253,230,230,235,253,247,235,221,127,246,233,212,216,0,0,0,251,0,0,0,251,0,0,0,252,0,0,0,251,0,0,0,250,0,0,0,248,0,0,0,250,0,0,0,0,0,0,0,255,0,0,0,254,0,0,0, -252,0,0,0,251,0,0,0,247,249,249,249,245,231,231,231,235,245,245,245,246,0,0,0,251,0,0,0,250,110,110,110,42,52,52,52,70,87,87,87,125,1,0,0,0,1,0,0,0,5,155,155,155,158,209,209,209,228,223,223,223,183,190, -203,215,237,9,20,42,51,0,1,2,10,248,236,221,208,246,233,213,234,0,0,0,253,0,0,0,253,0,0,0,250,0,0,0,248,0,0,0,248,0,0,0,251,0,0,0,254,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,255, -0,0,0,255,0,0,0,254,119,119,119,13,9,9,9,101,40,40,40,44,88,88,88,96,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,181,181,181,87,202,202,202,134,0,0,0,34,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1, -1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,53,53,53,116,75,75,75,157,0,0,0,0,0,0,0,0,22,82,238,110,38,194,229,141,0,0, -0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* Presets::configpushed_png = (const char*) resource_Presets_configpushed_png; -const int Presets::configpushed_pngSize = 4254; - -// JUCER_RESOURCE: confighover_png, 4254, "../../../home/bill/img/config-hover.png" -static const unsigned char resource_Presets_confighover_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122,244,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187,127, -0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,223,10,28,2,20,3,203,224,166,93,0,0,16,43,73,68,65,84,88,9,1,32,16,223,239,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,88,255, -255,255,220,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,241,255,255,255,105,0,0, -0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,255,255,255,154,0,0,0,41,0,0,0,79,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,23,0,0,0,2,255,255,255,161,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,132,255,255,255,120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,49,255,255,255,161,0,0,0,0,4,255,255,255,49, -0,0,0,71,0,0,0,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,167,164,61,3,5,3,162,0,0,2,9,0,1,0,221,254,251,251,169,248,248,252,154,96,96,96,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,165,170,182,70,5,0,255,204,86,86,75,238,0,0,0,0,1,1,1,207,255,255,255,226,255,255,255,83,1,255,255,255,195,0,0,0,139,1,1,1,178,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,167,167,13, -255,0,253,242,26,26,27,0,38,37,38,0,244,245,245,0,223,224,222,248,241,241,240,231,250,248,252,57,92,92,92,233,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,172,183,117,254,255,255, -138,2,2,2,227,252,252,253,61,93,87,75,225,0,0,0,0,255,255,255,50,0,0,0,161,1,255,255,255,237,0,0,0,23,1,1,1,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,169,166,62,1,3,1,183,48,47,51,8,21,20,21,2,0, -0,0,0,221,222,220,253,224,224,223,202,84,83,86,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,191,191,3,233,239,250,155,3,5,3,86,34,35,36,11,240,240,241,253,234,231,230,241,253,255,253,65,92,84, -76,210,255,255,255,4,0,0,0,237,2,0,0,0,18,1,1,1,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,87,90,194,250,252,253,66,204,204,202,2,0,0,0,249,253,253,253,0,35,34,36,3,8,8,9,45,165,168,162,64, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,167,182,13,232,239,249,190,10,11,10,86,36,37,39,11,4,5,6,0,20,21,21,3,19,21,21,18,1,255,2,209,179,179,179,5,1,1,1,252,0,0,0,14,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,164,164,164,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,92,88,92,201,0,0,0,241,252,252,252,229,0,0,0,0,250,250,250,0,26,25,26,11,5,3,5,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,2,207,18,18,18,55,34,36, -36,11,2,3,3,0,0,0,0,0,254,255,253,0,240,240,240,245,1,1,0,93,77,77,77,251,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,166,166,164,71,2,3,0,236,174,174,172,85,0,0,0,0,0,0,0,0,0,0,0,0,165,170,165,49,0,0,0, -15,3,3,3,245,3,3,3,0,2,2,2,0,9,9,9,1,3,3,3,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,27,27,25,7,252,252,252,0,253,252,250,0,253,252,250,0,228,225,227,248,252,251,252,184,90,84,74,164,0,0,0,0, -0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,4,5,3,158,36,36,36,0,253,255,253,166,179,179,176,80,0,0,0,0,167,167,164,48,1,253,255,181,28,27,28,126,8,8,8,33,5,5,5,0,6,6,6,0,250,250,250,255,0,0,0,231,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,166,166,179,15,254,254,254,16,253,253,252,0,251,251,249,0,253,252,252,0,241,240,240,255,243,242,240,240,1,250,254,97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0, -3,4,4,237,22,21,23,26,24,23,25,4,196,197,195,175,166,167,164,0,255,0,0,0,33,33,33,147,46,45,48,122,255,255,255,8,253,253,253,0,3,3,3,0,235,236,235,252,252,252,253,2,0,0,0,0,0,0,0,0,0,0,0,0,160,179,179, -10,1,250,4,192,31,30,26,251,0,254,253,5,245,242,242,0,249,249,249,0,237,237,239,1,1,254,255,79,89,89,75,243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,255,255,255,1,1,1,1,0,0,0,0,170,172,167,133,32,31,33,119, -37,36,39,3,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,254,254,254,0,248,248,248,0,254,254,254,0,4,4,4,0,251,251,251,0,202,202,199,248,251,253,252,88,88,86,90,177,160,179,179,10,6,249,3,190,34,32,28,50,11,11,10,5, -221,223,227,246,246,246,247,215,0,255,0,189,0,255,0,198,90,86,74,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,164,164,164,23,9,10,7,218,63,62,65,14,4,4,4,0,254, -254,254,0,1,1,1,0,1,1,1,0,253,253,253,0,2,2,2,0,243,243,243,0,223,223,223,0,16,16,16,0,17,18,17,0,202,202,199,248,251,252,254,78,254,4,15,123,38,33,30,57,12,12,9,6,220,223,229,246,244,243,244,151,89,84, -74,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,0,0,0,0,170,173,169,95,4,3,4,152,54,52,54,8,20,20,21,0,255,255,255,0,0,0,0,0,248,248,248, -0,245,246,244,0,253,252,254,0,236,236,236,0,3,3,3,0,9,9,9,0,9,10,8,0,197,202,210,253,33,31,30,254,18,17,15,5,222,223,228,247,238,239,242,154,90,85,74,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,168,168,166,79,3,5,3,156,9,8,9,9,14,15,15,2,248,248,248,254,240,239,238,4,252,252,253,7,56,56,57,255,252,251,253,1,0, -0,0,0,255,255,255,0,223,227,234,0,15,15,14,0,19,18,15,0,222,225,229,249,238,237,241,156,90,85,74,108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255, -255,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,191,191,3,231,231,226,42,255,2,1,23,2,255,1,244,3,3,7,209,254,254,250,37,2,4,4,197,54,52,55,11,251,251,252,1,222,226,232,0,12,11,11,0,21,21,18,0,225,227, -232,0,237,235,233,250,251,255,242,36,93,86,93,227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,119,164,42,15,10,0,99,33,21,3,108,46,38,30,6,14,11,8,0,23,22,19,0,227,229,233,0,4,2,1,0,22,19,12,254,213,214,212,237,248,247,250,43,92,92,92,235,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90,120,165,98,6,4,4,202,62,54,47,111,249,5,25,3,174,195, -229,0,9,11,13,0,229,230,235,0,0,255,254,0,31,28,22,0,21,21,22,2,35,35,36,18,7,9,6,205,166,166,166,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,89,120,164,78,3,5,4,148,66,62,48,11,45,39,26,3,46,41,31,3,24,25,21,0,150,174,207,0,246,248,249,0,37,33,27,0,4,4,4,0,247,247,247,0,31,30,32,3,31,30,31,25,7, -8,4,199,160,160,160,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,120,164,55,2,2,3,166,60,54,43,9,244,247,253, -0,180,199,225,0,211,221,235,0,23,21,16,0,7,6,7,253,216,222,227,251,255,0,254,0,255,255,255,0,2,2,2,0,245,245,245,0,37,36,38,4,21,22,23,37,13,14,11,191,160,160,160,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,119,165,66,2,1,3,187,55,51,41,10,254,0,3,0,241,243,247,0,237,230,222,0,235,226,215,0,248,247,248,0,246,249,251,245,240, -247,253,113,201,203,201,248,254,255,254,0,254,254,254,0,2,2,2,0,245,245,245,0,45,43,46,4,16,17,17,48,14,15,12,180,191,191,191,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,90,120,164,103,4,4,2,179,61,55,45,13,6,6,7,1,237,240,244,0,243,237,226,0,250,248,244,0,20,21,21,0,229,233,240,250,251,251,252,208,131,112,92,149,255,252,253,80,202,203,200,249, -254,254,253,0,0,0,0,0,1,1,1,0,247,247,247,0,48,46,49,6,11,10,11,63,239,241,237,167,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,122,169,20,89,120,166,180, -7,8,8,141,65,59,48,10,255,2,2,0,252,252,250,0,247,239,228,0,245,243,243,0,19,19,20,0,242,246,2,250,235,236,239,219,0,249,255,78,0,0,0,0,87,87,90,185,255,255,254,84,201,203,200,250,251,251,251,0,1,1,1, -0,254,254,254,0,251,251,251,0,51,51,53,6,6,5,6,78,176,177,173,151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,88,120,164,110,253,0,252,223,19,20,16,69,66,60,49,11,255,0,1,0,20,14, -6,0,235,231,224,0,240,241,241,0,18,18,18,0,242,247,2,250,232,235,239,218,0,250,0,59,166,141,90,241,0,0,0,0,0,0,0,0,86,84,89,180,0,254,0,88,203,205,201,249,250,250,250,0,3,3,3,0,254,254,254,0,250,250,250, -0,50,49,52,7,2,3,4,96,173,175,170,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,255,255,255,1,1,1,1,89,120,166,62,4,5,4,179,33,31,26,14,35,32,25,0,12,7,2,0,18,13,6,0,195,201,208,0,232,233,235,0,17,16,15,0, -252,2,11,252,227,228,236,218,0,251,0,58,166,141,90,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,170,173,168,88,1,255,1,161,51,51,53,6,5,4,5,0,245,245,245,0,241,241,241,0,21,21,21,0,203,204,201,248,252, -251,254,26,91,91,91,239,0,0,0,0,255,255,255,255,2,0,0,0,0,0,0,0,0,255,0,255,66,18,16,14,13,51,43,30,0,32,22,10,0,26,19,10,0,195,203,214,0,232,232,235,0,11,9,10,0,2,7,15,0,226,229,237,243,251,1,253,70, -166,141,90,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,86,83,88,168,2,3,2,100,205,205,203,250,249,250,249,0,245,245,245,0,240,240,240,0,246,246,246,0,13,13,13,253,2,2,255,52,0,0,0,0,0,0,0,0,0, -0,0,0,2,0,0,0,0,0,0,0,0,0,0,255,224,6,4,1,247,10,7,3,0,233,238,246,0,181,197,217,0,232,231,229,0,3,4,5,0,15,20,25,0,223,226,234,247,251,247,240,86,235,199,157,238,64,64,64,4,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,64,64,64,1,64,64,64,4,64,64,64,7,147,145,149,172,251,250,251,114,208,208,206,250,13,13,13,0,31,31,31,0,8,9,8,0,244,244,243,2,249,249,252,217,0,0,0,0,0,0,0,0,0,0,0,0,1,250,250,250,239,161,161,161, -42,176,188,206,8,15,35,61,207,48,44,37,15,6,7,6,0,223,221,219,0,249,247,245,0,25,27,30,0,235,238,247,250,235,233,231,176,233,205,163,122,0,0,0,251,0,0,0,250,0,0,0,250,0,0,0,249,0,0,0,254,0,0,0,1,0,0,0, -5,0,0,0,4,0,0,0,5,0,0,0,3,0,0,0,2,92,92,89,88,11,13,13,130,7,7,7,254,250,250,249,1,244,244,245,124,164,162,165,158,0,0,0,251,123,123,123,6,67,67,67,224,1,225,225,225,109,251,251,251,18,100,100,100,160, -17,39,71,63,9,19,31,153,44,39,33,8,251,246,238,0,0,4,7,0,254,2,9,0,218,219,223,246,236,214,180,83,251,242,232,236,0,0,0,248,0,0,0,248,0,0,0,248,0,0,0,253,0,0,0,253,0,0,0,252,0,0,0,3,0,0,0,6,0,0,0,6,0, -0,0,5,0,0,0,6,0,0,0,6,15,15,15,1,35,35,35,18,229,229,229,229,233,233,233,242,0,0,0,250,0,0,0,251,174,174,174,107,8,8,8,233,1,0,0,0,13,228,228,228,155,208,208,208,162,140,140,140,218,17,40,74,70,8,16,26, -139,10,11,9,253,2,2,3,3,243,243,245,2,247,235,220,126,241,221,191,193,0,0,0,250,0,0,0,249,0,0,0,249,0,0,0,248,0,0,0,249,0,0,0,249,0,0,0,253,0,0,0,6,0,0,0,5,0,0,0,4,0,0,0,3,0,0,0,3,0,0,0,1,0,0,0,255,0, -0,0,254,0,0,0,253,0,0,0,252,0,0,0,250,164,164,164,43,24,24,24,103,4,4,4,95,1,0,0,0,1,0,0,0,5,239,239,239,158,242,242,242,228,207,207,207,183,153,166,179,237,9,20,42,51,0,2,1,10,248,235,222,208,246,233, -212,234,0,0,0,253,0,0,0,253,0,0,0,250,0,0,0,248,0,0,0,248,0,0,0,251,192,192,192,254,0,0,0,0,0,0,0,0,64,64,64,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,255,0,0,0,255,0,0,0,254,178,178,178,13,13,13,13,101, -0,0,0,44,1,1,1,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,87,254,254,254,221,254,254,254,255,253,253,253,255,252,252,252,255,252,252,252,255,252,252,252,255,253,253,253,255,254,254,254,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,239,255,255,255,99,0,0,0,0,0,0,0,0,0,0,0,0,142,119,220,132,34,208,196,92,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* Presets::confighover_png = (const char*) resource_Presets_confighover_png; -const int Presets::confighover_pngSize = 4254; - -// JUCER_RESOURCE: preferencessystem_png, 2129, "../../../home/bill/dl/tango-icon-theme-0.8.90/32x32/categories/preferences-system.png" -static const unsigned char resource_Presets_preferencessystem_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122,244,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100, -136,0,0,8,8,73,68,65,84,88,133,237,150,107,80,84,231,25,199,255,231,186,247,93,129,101,193,101,65,46,106,21,144,155,58,136,241,66,172,162,226,68,99,106,173,237,76,167,173,218,241,139,83,149,96,65,116, -82,167,41,176,98,117,180,214,100,72,140,153,100,58,109,194,180,90,13,70,136,134,161,157,198,154,78,210,40,226,133,5,21,185,45,236,194,194,46,44,123,238,167,31,194,102,86,5,177,147,15,253,210,103,230,153, -247,125,207,121,159,231,255,123,158,247,157,51,7,248,191,253,143,141,152,110,67,77,77,213,114,154,165,223,7,72,29,8,220,151,5,225,195,96,80,120,235,240,225,195,220,243,138,84,31,127,167,72,3,245,139,146, -146,157,190,255,10,224,200,145,35,38,149,144,2,105,169,179,145,151,187,16,254,64,0,173,183,91,56,239,160,215,205,5,133,130,131,7,15,14,76,39,126,228,196,187,251,21,85,169,161,40,170,91,16,164,229,135, -74,119,62,138,124,79,62,43,184,172,172,108,148,38,169,149,221,61,143,198,253,129,128,226,72,112,96,237,154,245,218,172,204,236,36,131,73,119,254,89,177,117,117,117,212,209,83,239,157,101,117,154,95,45, -46,40,64,98,74,138,157,97,168,127,87,158,120,59,235,185,1,0,160,180,180,252,239,156,40,173,250,228,202,101,82,85,85,94,146,36,100,45,200,166,12,122,195,130,234,163,175,23,78,90,245,145,119,76,15,7,198, -155,76,102,243,214,156,188,69,6,86,163,65,130,195,65,217,29,142,104,82,37,111,214,214,214,50,83,2,84,85,85,197,60,249,172,98,127,197,231,0,252,162,40,246,2,0,207,243,72,77,77,51,176,180,102,203,164,212, -58,234,171,248,248,248,252,172,220,28,3,69,83,0,0,89,145,225,245,122,130,4,65,252,120,215,174,93,226,164,0,78,103,229,90,146,86,7,79,157,58,241,253,200,231,213,199,170,115,1,88,104,154,14,210,52,13,146, -36,97,52,26,9,154,166,83,38,211,39,84,196,204,153,157,162,17,4,1,162,192,67,18,121,180,223,109,227,4,94,108,40,223,187,253,15,145,123,31,3,96,52,204,217,156,236,92,72,138,244,199,218,218,55,94,6,128,154, -154,202,28,66,82,46,205,73,155,251,154,193,96,72,209,104,52,208,106,181,224,56,78,5,224,126,82,220,233,172,181,200,138,60,67,146,68,8,124,8,178,40,96,208,227,81,125,67,222,17,130,147,127,246,228,126,250, -49,0,134,25,74,116,36,217,147,103,165,208,127,189,120,238,188,179,166,18,10,128,204,5,11,78,173,88,86,88,161,170,170,86,146,36,208,52,141,222,222,30,73,20,197,199,10,56,92,91,171,39,56,182,121,254,188, -52,81,149,37,198,239,243,33,20,26,71,95,159,135,32,20,101,83,89,217,206,209,167,186,21,185,56,126,162,166,50,125,126,102,89,110,206,66,138,36,31,191,30,178,44,35,24,12,66,81,20,48,12,3,94,224,209,208, -80,207,9,146,184,109,127,73,249,133,195,181,181,122,109,136,105,202,202,152,147,103,182,152,152,150,86,215,120,32,48,118,23,42,62,133,138,107,229,37,219,47,76,122,92,145,139,202,202,202,56,163,89,239, -218,242,202,86,51,203,178,144,101,25,36,73,130,32,8,72,146,4,138,162,224,243,249,208,218,218,10,155,205,6,91,156,13,13,13,245,28,47,202,27,21,38,246,96,94,230,188,130,168,40,35,123,227,86,251,248,240, -176,255,205,178,189,219,75,39,19,141,52,42,114,209,212,212,20,44,90,183,198,237,114,181,173,115,36,56,104,171,213,10,134,97,192,48,12,100,89,134,63,48,2,69,86,32,138,34,8,226,107,246,244,140,12,218,245, -112,224,71,89,233,223,113,196,217,162,217,214,59,29,33,239,224,200,219,229,251,182,151,76,39,254,84,7,194,118,244,168,115,19,205,210,103,140,6,163,46,198,106,37,131,193,160,226,241,12,208,162,40,106,54, -20,191,164,10,188,72,0,128,170,170,104,117,117,195,26,19,13,251,204,88,180,220,233,224,251,221,222,51,229,251,118,236,126,30,241,41,1,128,175,191,100,15,30,220,75,87,41,34,142,84,136,49,134,209,223,148, -229,208,28,138,97,63,91,91,180,222,32,240,34,113,235,94,39,44,22,11,18,29,241,184,211,246,16,238,158,46,129,87,134,102,31,122,245,80,247,183,6,152,204,146,214,87,165,199,154,177,35,35,129,218,189,98,225, -60,54,198,98,192,172,36,59,218,58,30,129,33,9,36,217,103,40,215,174,127,54,52,62,198,103,84,84,84,120,159,39,231,180,159,226,176,165,110,168,222,174,101,153,127,189,178,110,197,158,144,38,149,250,221, -249,14,24,45,209,232,184,223,13,40,50,210,231,38,33,33,33,145,204,206,202,141,214,25,53,95,58,157,78,203,243,228,165,166,223,2,164,108,168,218,200,178,236,217,31,110,46,212,23,46,76,38,181,122,3,57,60, -202,227,131,198,155,200,77,53,35,63,103,46,104,154,6,207,243,112,56,18,73,89,146,13,254,209,225,205,75,242,11,222,109,110,110,22,159,149,123,90,128,228,226,170,124,154,162,46,110,46,94,166,15,242,42,254, -113,203,141,78,247,48,236,54,11,6,60,126,89,30,119,203,75,114,231,80,0,1,138,162,192,113,28,146,147,83,72,127,192,31,37,138,252,218,252,252,130,247,155,155,155,229,169,242,63,243,8,102,173,175,94,69,145, -212,149,245,171,243,245,10,65,193,235,27,131,251,126,11,186,239,126,142,241,96,16,163,33,62,232,13,138,251,46,55,126,204,41,170,2,69,81,64,146,36,2,129,0,94,40,88,78,199,218,108,57,49,214,25,245,117,117, -117,83,22,58,37,64,90,113,213,46,134,165,62,218,92,188,204,164,213,233,136,62,143,31,195,125,247,16,10,142,32,193,145,136,142,78,175,192,243,194,141,243,167,15,158,86,68,233,229,134,198,75,188,44,75,0, -0,130,32,16,12,6,81,184,98,21,107,54,91,86,14,120,251,254,164,170,234,164,23,254,41,128,185,47,253,214,154,178,193,89,175,51,232,143,253,96,83,161,94,33,41,136,2,143,177,1,23,252,195,62,216,237,9,24,26, -37,133,238,190,129,118,132,212,141,0,80,90,90,222,168,168,202,150,203,141,151,4,94,224,65,16,4,100,89,6,207,243,88,253,221,34,86,171,209,110,60,253,198,201,55,167,5,72,46,174,250,133,4,241,161,221,110, -91,179,109,243,139,6,5,4,28,49,90,244,60,184,13,239,224,32,226,227,227,49,52,70,9,157,61,3,46,112,120,225,193,213,114,127,56,246,213,189,191,172,135,130,109,159,92,185,204,115,28,7,154,166,191,129,88, -245,226,26,13,69,51,63,61,249,251,99,7,158,4,248,166,45,41,197,206,21,172,134,249,40,115,126,154,57,43,35,5,51,244,20,102,70,105,113,238,227,102,116,118,245,32,46,214,10,129,178,72,109,237,189,46,240, -88,26,41,30,105,199,79,30,221,70,168,196,123,171,87,175,101,89,134,69,32,16,192,224,224,32,28,14,7,26,175,92,230,68,94,182,31,56,112,96,248,169,14,168,80,87,197,217,98,76,171,151,206,67,70,146,25,105, -51,77,56,215,120,29,157,143,122,96,54,154,64,234,172,184,215,209,55,42,16,82,209,84,226,0,80,178,103,255,7,36,77,237,188,122,181,81,8,113,33,248,253,126,120,60,30,4,2,1,68,69,69,201,36,169,44,154,226, -8,148,78,45,67,134,76,58,26,93,253,1,156,185,240,5,58,31,118,128,102,52,136,77,72,69,107,91,119,136,31,243,110,237,169,63,228,195,19,255,17,17,221,164,1,104,246,236,222,247,103,158,227,75,154,155,63,21, -162,162,163,144,158,158,14,131,209,128,145,145,97,50,20,18,219,34,131,40,0,44,0,189,42,140,121,57,173,227,231,160,52,218,81,78,66,215,131,54,8,188,128,164,148,185,232,118,251,5,159,183,255,98,79,147,243, -47,0,180,0,52,19,113,228,132,40,11,64,63,225,6,0,134,171,87,155,92,121,121,57,30,119,191,123,249,128,167,95,112,185,238,73,195,195,35,135,94,255,245,111,174,79,232,18,0,20,2,128,101,34,169,214,182,232, -39,43,77,51,231,215,46,93,156,169,229,3,253,0,163,135,66,25,240,229,87,183,199,251,254,249,214,247,120,95,231,32,0,46,194,229,9,151,34,138,97,1,48,225,185,213,106,37,178,179,179,163,219,219,219,123,187, -186,186,2,0,4,0,226,196,200,19,0,76,97,0,0,26,219,226,29,69,6,91,218,81,179,217,32,147,20,67,13,251,252,228,88,207,141,215,6,91,62,252,91,56,104,194,185,136,185,28,33,76,79,192,132,171,84,1,40,17,160, -225,28,66,184,3,68,4,177,14,0,99,76,204,138,54,38,44,89,8,146,212,7,123,91,110,140,62,186,230,137,168,86,136,232,128,56,145,60,242,30,144,19,99,216,213,8,136,240,252,177,128,201,46,83,120,140,124,175, -98,146,4,223,214,254,3,174,151,133,37,87,153,47,161,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* Presets::preferencessystem_png = (const char*) resource_Presets_preferencessystem_png; -const int Presets::preferencessystem_pngSize = 2129; - - -//[EndFile] You can add extra defines here... -//[/EndFile] +/*\ +|*| Copyright 2015 bill-auger +|*| +|*| This file is part of the AvCaster program. +|*| +|*| AvCaster is free software: you can redistribute it and/or modify +|*| it under the terms of the GNU Lesser General Public License version 3 +|*| as published by the Free Software Foundation. +|*| +|*| AvCaster 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 Lesser General Public License for more details. +|*| +|*| You should have received a copy of the GNU Lesser General Public License +|*| along with AvCaster. If not, see . +\*/ + + +//[Headers] You can add your own extra header files here... + +#include "AvCaster.h" + +//[/Headers] + +#include "Presets.h" + + +//[MiscUserDefs] You can add your own user definitions and misc code here... +//[/MiscUserDefs] + +//============================================================================== +Presets::Presets () +{ + addAndMakeVisible (presetsGroup = new GroupComponent ("presetsGroup", + TRANS("Presets"))); + presetsGroup->setColour (GroupComponent::outlineColourId, Colours::white); + presetsGroup->setColour (GroupComponent::textColourId, Colours::white); + + addAndMakeVisible (saveButton = new TextButton ("saveButton")); + saveButton->setExplicitFocusOrder (1); + saveButton->setButtonText (TRANS("Save")); + saveButton->addListener (this); + + addAndMakeVisible (newButton = new TextButton ("newButton")); + newButton->setExplicitFocusOrder (2); + newButton->setButtonText (TRANS("New")); + newButton->addListener (this); + + addAndMakeVisible (deleteButton = new TextButton ("deleteButton")); + deleteButton->setExplicitFocusOrder (3); + deleteButton->setButtonText (TRANS("Delete")); + deleteButton->addListener (this); + + addAndMakeVisible (presetLabel = new Label ("presetLabel", + TRANS("Preset:"))); + presetLabel->setFont (Font (15.00f, Font::plain)); + presetLabel->setJustificationType (Justification::centredLeft); + presetLabel->setEditable (false, false, false); + presetLabel->setColour (Label::textColourId, Colours::white); + presetLabel->setColour (TextEditor::textColourId, Colours::black); + presetLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (presetsCombo = new ComboBox ("presetsCombo")); + presetsCombo->setExplicitFocusOrder (4); + presetsCombo->setEditableText (true); + presetsCombo->setJustificationType (Justification::centredLeft); + presetsCombo->setTextWhenNothingSelected (String::empty); + presetsCombo->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); + presetsCombo->addListener (this); + + addAndMakeVisible (configButton = new ImageButton ("configButton")); + configButton->setExplicitFocusOrder (5); + configButton->addListener (this); + + configButton->setImages (false, true, true, + ImageCache::getFromMemory (preferencessystem_png, preferencessystem_pngSize), 1.000f, Colour (0x00000000), + ImageCache::getFromMemory (confighover_png, confighover_pngSize), 1.000f, Colour (0x00000000), + ImageCache::getFromMemory (configpushed_png, configpushed_pngSize), 1.000f, Colour (0x00000000)); + + //[UserPreSize] + //[/UserPreSize] + + setSize (600, 400); + + + //[Constructor] You can add your own custom stuff here.. + + MainContent* main_content = static_cast(getParentComponent()) ; + main_content->configureCombobox(this->presetsCombo) ; + + //[/Constructor] +} + +Presets::~Presets() +{ + //[Destructor_pre]. You can add your own custom destruction code here.. + //[/Destructor_pre] + + presetsGroup = nullptr; + saveButton = nullptr; + newButton = nullptr; + deleteButton = nullptr; + presetLabel = nullptr; + presetsCombo = nullptr; + configButton = nullptr; + + + //[Destructor]. You can add your own custom destruction code here.. + //[/Destructor] +} + +//============================================================================== +void Presets::paint (Graphics& g) +{ + //[UserPrePaint] Add your own custom painting code here.. + //[/UserPrePaint] + + g.setColour (Colour (0xff303030)); + g.fillRoundedRectangle (20.0f, 22.0f, static_cast (getWidth() - 40), 52.0f, 4.000f); + + //[UserPaint] Add your own custom painting code here.. + //[/UserPaint] +} + +void Presets::resized() +{ + //[UserPreResize] Add your own custom resize code here.. + //[/UserPreResize] + + presetsGroup->setBounds (16, 12, getWidth() - 32, 64); + saveButton->setBounds (244, 35, 64, 24); + newButton->setBounds (332, 35, 64, 24); + deleteButton->setBounds (420, 35, 64, 24); + presetLabel->setBounds (500, 36, 48, 24); + presetsCombo->setBounds (560, 36, 128, 24); + configButton->setBounds (696, 36, 24, 24); + //[UserResized] Add your own custom resize handling here.. + //[/UserResized] +} + +void Presets::buttonClicked (Button* buttonThatWasClicked) +{ + //[UserbuttonClicked_Pre] + + Identifier key ; + var value = var(buttonThatWasClicked->getToggleState()) ; + + //[/UserbuttonClicked_Pre] + + if (buttonThatWasClicked == saveButton) + { + //[UserButtonCode_saveButton] -- add your button handler code here.. + + handleSaveButton() ; return ; + + //[/UserButtonCode_saveButton] + } + else if (buttonThatWasClicked == newButton) + { + //[UserButtonCode_newButton] -- add your button handler code here.. + + handleNewButton() ; return ; + + //[/UserButtonCode_newButton] + } + else if (buttonThatWasClicked == deleteButton) + { + //[UserButtonCode_deleteButton] -- add your button handler code here.. + + handleDeleteButton() ; return ; + + //[/UserButtonCode_deleteButton] + } + else if (buttonThatWasClicked == configButton) + { + //[UserButtonCode_configButton] -- add your button handler code here.. + + if (AvCaster::RejectPresetChange()) return ; + + key = CONFIG::IS_PENDING_ID ; + value = var(!AvCaster::GetIsConfigPending()) ; + + //[/UserButtonCode_configButton] + } + + //[UserbuttonClicked_Post] + + AvCaster::SetConfig(key , value) ; + + //[/UserbuttonClicked_Post] +} + +void Presets::comboBoxChanged (ComboBox* comboBoxThatHasChanged) +{ + //[UsercomboBoxChanged_Pre] + //[/UsercomboBoxChanged_Pre] + + if (comboBoxThatHasChanged == presetsCombo) + { + //[UserComboBoxCode_presetsCombo] -- add your combo box handling code here.. + + String preset_name = this->presetsCombo->getText() ; + int option_n = this->presetsCombo->getSelectedItemIndex() ; + bool is_saving = this->saveButton ->isDown() ; // defer to handleSaveButton() + bool is_deleting = this->deleteButton->isDown() ; // defer to handleDeleteButton() + + if (is_deleting) return ; + + // create new preset + if (isCreatePresetMode()) AvCaster::StorePreset(preset_name) ; + else if (is_saving ) return ; + + // rename preset , restore selection , or commit preset change + if (AvCaster::SetPreset(preset_name , option_n)) setCreatePresetMode(false) ; + + return ; + + //[/UserComboBoxCode_presetsCombo] + } + + //[UsercomboBoxChanged_Post] + //[/UsercomboBoxChanged_Post] +} + + + +//[MiscUserCode] You can add your own definitions of your custom methods or any other code here... + +void Presets::broughtToFront() +{ + toggleControls() ; + this->mainContent->loadPresetsCombo(this->presetsCombo) ; setCreatePresetMode(false) ; +} + +void Presets::handleSaveButton() +{ + String preset_name = this->presetsCombo->getText() ; + + if (preset_name.isEmpty()) AvCaster::Warning(GUI::PRESET_NAME_ERROR_MSG) ; + else + { + setCreatePresetMode(false) ; AvCaster::StorePreset(preset_name) ; + +#ifdef STATIC_PIPELINE + AvCaster::Warning("Changes will take effect after AvCaster is restarted.") ; +#endif // STATIC_PIPELINE + } +} + +void Presets::handleNewButton() +{ + this->presetsCombo->setText(String::empty , juce::dontSendNotification) ; + this->presetsCombo->grabKeyboardFocus() ; + setCreatePresetMode(true) ; +} + +void Presets::handleDeleteButton() +{ + if (isCreatePresetMode()) + { + setCreatePresetMode(false) ; + this->presetsCombo->setText(AvCaster::GetPresetName() , juce::dontSendNotification) ; + } + else if (AvCaster::IsStaticPreset()) AvCaster::ResetPreset() ; + else AvCaster::DeletePreset() ; +} + +void Presets::toggleControls() +{ + bool is_config_pending = AvCaster::GetIsConfigPending() ; + + this->presetsGroup->setVisible(is_config_pending) ; + this->saveButton ->setVisible(is_config_pending) ; + this->newButton ->setVisible(is_config_pending) ; + this->deleteButton->setVisible(is_config_pending) ; + this->presetLabel ->setVisible(is_config_pending) ; +} + +void Presets::setCreatePresetMode(bool is_pending_new_preset_name) +{ + bool is_static_preset = AvCaster::IsStaticPreset() ; + String button_text = (is_pending_new_preset_name) ? GUI::DELETE_BTN_CANCEL_TEXT : + (is_static_preset ) ? GUI::DELETE_BTN_RESET_TEXT : + GUI::DELETE_BTN_DELETE_TEXT ; + + this->presetsCombo->setEditableText(is_pending_new_preset_name || !is_static_preset) ; + this->deleteButton->setButtonText (button_text) ; +} + +bool Presets::isCreatePresetMode() +{ + return this->deleteButton->getButtonText() == GUI::DELETE_BTN_CANCEL_TEXT ; +} + +//[/MiscUserCode] + + +//============================================================================== +#if 0 +/* -- Introjucer information section -- + + This is where the Introjucer stores the metadata that describe this GUI layout, so + make changes in here at your peril! + +BEGIN_JUCER_METADATA + + + + + + + + + + + +END_JUCER_METADATA +*/ +#endif + +//============================================================================== +// Binary resources - be careful not to edit any of these sections! + +// JUCER_RESOURCE: configpushed_png, 4254, "../../../home/bill/img/config-pushed.png" +static const unsigned char resource_Presets_configpushed_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122,244,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187, +127,0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,223,10,28,2,22,54,175,101,0,252,0,0,16,43,73,68,65,84,88,9,1,32,16,223,239,1,0,0,0,0,0,0,0,0,0,0,0,0,181,181,181,88, +203,203,203,132,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,242, +53,53,53,120,75,75,75,151,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,168,168,168,154,216,216,216,231,0,0,0,170,128,128,128,213,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,8,0,0,0,99,40,40,40,54,88,88,88,95,0,0,0,0,0,0,0,0,0,168,168,168,132,128,128,128,120,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128, +49,168,168,168,161,0,0,0,0,1,181,181,181,49,203,203,203,154,0,0,0,55,128,128,128,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,103,103,100,61,3,5,3,162,0,0,2,9,0,0,0,221,254,252,251,169,248,248,252,154,160,160, +160,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,101,106,117,70,5,0,0,204,150,150,139,238,0,0,0,0,0,0,0,0,128,128,128,131,53,53,53,208,3,38,38,38,171,0,0,0,135,128, +128,128,216,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,102,102,13,0,1,254,218,24,24,25,16,48,47,50,12,19,19,19,29,248,250,249,65,253,255,252,95,47,45,47,168,207,207,207,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,108,119,117,0,0,255,162,0,3,3,90,48,51,57,174,207,204,198,241,0,0,0,0,64,64,64,241,230,230,230,145,2,0,0,0,42,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,154,154, +154,243,3,2,3,63,234,235,233,246,245,246,245,254,21,20,21,0,53,51,54,8,35,33,35,30,9,10,7,175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,127,127,3,104,110,120,158,5,6,5,127,40,43,43,0, +22,25,24,26,3,3,2,206,99,108,116,46,0,0,0,0,0,0,0,210,0,0,0,30,2,0,0,0,18,128,128,128,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,151,151,154,194,250,252,253,66,204,204,201,2,255,255,255,249,253, +253,253,0,34,33,35,3,8,8,8,45,101,104,98,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,102,117,13,231,239,249,190,10,10,11,86,36,38,39,11,4,5,5,0,20,21,21,3,20,21,21,18,2,255,1,209,114,114,114,5,128, +128,128,252,0,0,0,14,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,100,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,156,152,156,201,0,0,0,241,253,253,253,229,0,0,0,0,251,251,251,0,25,25,27,11,4,3,5,84,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,3,207,18,18,18,55,34,37,36,11,2,3,2,0,0,0,0,0,254,254,254,0,240,241,239,245,1,1,1,93,142,142,142,251,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,102,102,99,71,2,3,255,236,110, +110,108,85,0,0,0,0,0,0,0,0,0,0,0,0,101,105,101,49,0,0,0,15,3,3,3,245,3,3,3,0,2,2,2,0,9,9,9,1,3,3,3,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,0,19,28,27,24,7,252,252,251,0,252,251,251,0,253,252, +251,0,228,226,227,248,252,250,253,184,154,148,138,164,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,3,5,4,158,36,35,37,0,253,254,253,166,114,114,112,80,0,0,0,0,103,103,99,48,1,253,254,181,27,26,29, +126,8,8,8,33,6,6,6,0,6,6,6,0,250,250,250,255,0,0,0,231,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,102,114,15,254,255,253,16,253,253,253,0,251,250,250,0,254,253,252,0,241,240,240,255,243,241,240,240,0,250,253, +97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,237,21,21,23,26,24,24,25,4,196,197,194,175,102,103,99,0,255,0,0,0,33,34,34,147,46,45,48,122,255,255,255,8,253,253,253,0,3,3,3,0,236,236, +235,252,253,252,252,2,0,0,0,0,0,0,0,0,0,0,0,0,96,114,114,10,0,250,5,192,31,30,26,251,255,254,253,5,245,243,242,0,249,249,249,0,237,237,239,1,0,254,255,79,154,154,139,243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,4,0,0,0,0,0,0,0,0,0,0,0,0,253,253,252,179,235,235,233,42,36,36,38,3,74,73,77,0,0,0,0,0,0,0,0,0,0,0,0,109,249,249,249,0,247,247,247,0,255,255,255,0,4,4,4,0,38,38,39,5,202,202,238,89,104,106,102,177,152, +150,154,177,96,114,114,10,6,250,4,190,34,32,27,43,11,11,10,5,221,223,227,246,246,246,247,215,0,255,0,189,0,255,0,198,154,150,139,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,249, +247,252,146,226,228,227,108,33,33,35,14,2,2,2,0,254,254,254,0,1,1,1,0,1,1,1,0,255,255,255,0,10,10,10,0,243,243,243,0,217,217,217,0,16,16,16,0,54,53,57,8,202,202,199,168,102,105,102,78,255,250,4,123,36, +33,30,49,13,13,9,5,220,222,228,246,246,246,247,151,154,148,138,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,157,157,157,233,254,254,254,110,195,196,193, +248,244,244,243,0,9,9,9,0,8,8,8,0,7,7,7,0,2,2,2,0,245,246,244,0,255,255,255,0,12,12,12,0,255,255,255,0,247,247,247,0,54,54,56,8,1,3,12,183,35,32,27,58,16,16,12,6,225,226,231,247,243,243,245,155,154,148, +138,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,148,151,161,104,104,102,240,199,200,198,156,9,9,9,9,14,15,15,2,248,247,247,254,239, +240,239,4,253,252,252,7,56,56,58,255,12,12,12,1,0,0,0,0,0,0,0,0,214,218,226,0,32,30,30,3,18,17,15,3,222,225,229,249,238,239,241,158,154,149,139,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,152,154,177,20,19,22,24,242,241,239,57,227,228,225,78,236,235,235,68,1,255,3,17,2,1,0,47,204,205,203,245,6,7,6,255,2,2,2,0,224, +228,234,0,12,12,11,0,19,19,16,0,225,227,231,0,240,237,236,1,253,254,238,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,129,129,129,253,0,0,0,211,0,0,0,211,0,0,0,0,0,0,0,0,22,55,100,252,16,10,252,154,220,233,199,108,47,38,30,6,14,12,10,0,22,21,18,0,227,229,233,0,6,4,3,0,47,44,37,4,213,214,211,205,100,100, +100,43,156,156,156,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,56,101,98,6,4,4,202, +61,54,47,111,250,6,26,3,173,196,229,0,9,11,13,0,229,230,234,0,0,255,254,0,31,28,22,0,20,20,21,2,35,35,37,18,7,9,5,205,102,102,102,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,56,100,78,4,5,4,148,67,61,48,11,46,39,26,3,46,41,31,3,25,25,21,0,150,174,207,0,246,248,250,0,37,33,27,0,4,4,4,0,247,247, +247,0,31,30,32,3,31,29,32,25,6,8,4,199,96,96,96,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,55,100,55,2,2,2, +166,59,53,43,9,244,248,253,0,180,199,225,0,211,221,235,0,23,20,17,0,6,6,7,253,215,221,227,251,255,0,254,0,254,254,254,0,3,3,3,0,245,245,245,0,36,36,37,4,22,22,23,37,13,14,11,191,96,96,96,6,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,55,101,66,2,2,2,187,55,50,42,10,255,1,2,0,240,243,247,0,237,230,222,0,234,226,214,0,248,248,248, +0,247,249,251,245,241,248,252,113,201,202,201,248,255,0,255,0,254,254,254,0,2,2,2,0,246,246,246,0,44,42,45,4,16,16,16,48,14,15,12,180,127,127,127,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,55,100,103,4,4,2,179,61,55,45,13,6,7,6,1,236,240,245,0,244,236,226,0,249,248,244,0,21,21,22,0,229,232,240,250,250,251,251,208,195,176,157,149,255,253,253, +80,202,202,200,249,254,254,253,0,0,0,0,0,1,1,1,0,248,248,248,0,48,47,50,6,10,10,11,63,239,240,237,167,191,191,191,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,58,105, +20,25,56,102,180,7,9,8,141,65,59,48,10,254,2,3,0,252,252,251,0,247,239,228,0,244,244,242,0,20,19,20,0,241,246,2,250,234,237,239,219,0,249,0,78,0,0,0,0,151,151,154,185,254,0,254,84,201,203,200,250,250, +251,250,0,0,0,0,0,254,254,254,0,251,251,251,0,51,50,52,6,6,6,6,78,176,176,173,151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,24,55,100,110,253,0,252,223,19,20,16,69,66,60,48,11, +255,0,1,0,21,14,6,0,235,230,224,0,241,241,241,0,18,18,18,0,242,247,2,250,232,235,238,218,0,250,0,59,231,205,154,241,0,0,0,0,0,0,0,0,151,148,153,180,0,254,0,88,204,204,202,249,250,250,250,0,3,3,3,0,253, +253,253,0,251,251,251,0,49,48,51,7,2,3,3,96,108,111,105,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,25,55,102,62,5,6,5,131,37,33,31,12,52,47,38,6,9,7,3,0,36,26,13,0,216,216,217,0,235,237,239, +0,16,15,15,0,250,255,8,252,232,235,240,220,0,250,0,60,231,205,154,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,150,152,175,255,0,255,96,204,205,202,250,247,248,247,0,253,253,253,0,242,242,242,0,228,228,228, +0,45,44,47,7,253,251,254,126,101,101,101,17,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,255,0,255,66,17,16,15,13,51,44,30,0,33,23,11,0,27,19,9,0,195,203,214,0,232,233,235,0,10,9,9,0,2,6,15,0,226,229,236, +243,252,1,253,70,231,205,154,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,148,152,168,1,3,2,100,205,205,203,250,250,250,250,0,245,245,245,0,239,239,239,0,245,245,245,0,12,13,13,253,1,1,254, +52,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,254,224,6,4,1,247,10,6,3,0,233,238,245,0,181,197,217,0,232,231,229,0,3,4,5,0,16,20,26,0,223,227,234,247,250,247,241,86,235,199,157,238,0,0,0,4,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,7,148,145,149,172,251,250,250,114,208,208,205,250,12,13,12,0,32,32,32,0,9,9,9,0,244,244,243,2,250,250,253,217,0,0,0,0,0,0,0,0,0,0,0,0,3,60,60,60,112,255,255, +255,162,225,221,216,229,250,6,22,101,0,3,5,8,246,249,253,0,233,231,228,0,252,250,251,0,22,25,28,0,234,237,244,250,242,241,239,178,236,207,166,173,0,0,0,8,0,0,0,7,0,0,0,6,0,0,0,2,0,0,0,4,0,0,0,6,0,0,0, +10,0,0,0,10,0,0,0,11,0,0,0,11,205,205,207,218,37,37,36,234,237,239,238,61,239,239,237,250,227,228,226,252,244,244,245,124,162,161,163,200,0,0,0,3,82,82,82,12,22,22,22,105,4,32,32,32,126,236,236,236,102, +195,195,152,160,5,16,31,110,208,212,0,153,44,39,33,8,17,13,9,0,0,17,16,0,255,2,5,0,237,238,239,252,239,218,187,159,0,0,0,17,0,0,0,248,0,0,0,248,0,0,0,248,0,0,0,7,0,0,0,253,0,0,0,252,0,0,0,3,0,0,0,6,0, +0,0,6,0,0,0,5,0,0,0,6,165,165,168,189,15,15,15,190,35,35,35,18,228,228,228,229,234,234,234,242,0,0,0,6,0,0,0,1,34,34,34,107,46,46,46,116,3,178,178,178,215,95,95,95,98,4,4,4,231,210,198,182,208,3,11,23, +221,238,244,252,65,247,252,0,248,244,246,252,253,230,230,235,253,247,235,221,127,246,233,212,216,0,0,0,251,0,0,0,251,0,0,0,252,0,0,0,251,0,0,0,250,0,0,0,248,0,0,0,250,0,0,0,0,0,0,0,255,0,0,0,254,0,0,0, +252,0,0,0,251,0,0,0,247,249,249,249,245,231,231,231,235,245,245,245,246,0,0,0,251,0,0,0,250,110,110,110,42,52,52,52,70,87,87,87,125,1,0,0,0,1,0,0,0,5,155,155,155,158,209,209,209,228,223,223,223,183,190, +203,215,237,9,20,42,51,0,1,2,10,248,236,221,208,246,233,213,234,0,0,0,253,0,0,0,253,0,0,0,250,0,0,0,248,0,0,0,248,0,0,0,251,0,0,0,254,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,255, +0,0,0,255,0,0,0,254,119,119,119,13,9,9,9,101,40,40,40,44,88,88,88,96,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,181,181,181,87,202,202,202,134,0,0,0,34,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1, +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,53,53,53,116,75,75,75,157,0,0,0,0,0,0,0,0,22,82,238,110,38,194,229,141,0,0, +0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* Presets::configpushed_png = (const char*) resource_Presets_configpushed_png; +const int Presets::configpushed_pngSize = 4254; + +// JUCER_RESOURCE: confighover_png, 4254, "../../../home/bill/img/config-hover.png" +static const unsigned char resource_Presets_confighover_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122,244,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187,127, +0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,223,10,28,2,20,3,203,224,166,93,0,0,16,43,73,68,65,84,88,9,1,32,16,223,239,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,88,255, +255,255,220,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,241,255,255,255,105,0,0, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,255,255,255,154,0,0,0,41,0,0,0,79,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,23,0,0,0,2,255,255,255,161,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,132,255,255,255,120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,49,255,255,255,161,0,0,0,0,4,255,255,255,49, +0,0,0,71,0,0,0,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,167,164,61,3,5,3,162,0,0,2,9,0,1,0,221,254,251,251,169,248,248,252,154,96,96,96,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,165,170,182,70,5,0,255,204,86,86,75,238,0,0,0,0,1,1,1,207,255,255,255,226,255,255,255,83,1,255,255,255,195,0,0,0,139,1,1,1,178,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,167,167,13, +255,0,253,242,26,26,27,0,38,37,38,0,244,245,245,0,223,224,222,248,241,241,240,231,250,248,252,57,92,92,92,233,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,172,183,117,254,255,255, +138,2,2,2,227,252,252,253,61,93,87,75,225,0,0,0,0,255,255,255,50,0,0,0,161,1,255,255,255,237,0,0,0,23,1,1,1,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,169,166,62,1,3,1,183,48,47,51,8,21,20,21,2,0, +0,0,0,221,222,220,253,224,224,223,202,84,83,86,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,191,191,3,233,239,250,155,3,5,3,86,34,35,36,11,240,240,241,253,234,231,230,241,253,255,253,65,92,84, +76,210,255,255,255,4,0,0,0,237,2,0,0,0,18,1,1,1,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,87,90,194,250,252,253,66,204,204,202,2,0,0,0,249,253,253,253,0,35,34,36,3,8,8,9,45,165,168,162,64, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167,167,182,13,232,239,249,190,10,11,10,86,36,37,39,11,4,5,6,0,20,21,21,3,19,21,21,18,1,255,2,209,179,179,179,5,1,1,1,252,0,0,0,14,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,164,164,164,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,92,88,92,201,0,0,0,241,252,252,252,229,0,0,0,0,250,250,250,0,26,25,26,11,5,3,5,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,2,207,18,18,18,55,34,36, +36,11,2,3,3,0,0,0,0,0,254,255,253,0,240,240,240,245,1,1,0,93,77,77,77,251,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,166,166,164,71,2,3,0,236,174,174,172,85,0,0,0,0,0,0,0,0,0,0,0,0,165,170,165,49,0,0,0, +15,3,3,3,245,3,3,3,0,2,2,2,0,9,9,9,1,3,3,3,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,27,27,25,7,252,252,252,0,253,252,250,0,253,252,250,0,228,225,227,248,252,251,252,184,90,84,74,164,0,0,0,0, +0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,4,5,3,158,36,36,36,0,253,255,253,166,179,179,176,80,0,0,0,0,167,167,164,48,1,253,255,181,28,27,28,126,8,8,8,33,5,5,5,0,6,6,6,0,250,250,250,255,0,0,0,231,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,166,166,179,15,254,254,254,16,253,253,252,0,251,251,249,0,253,252,252,0,241,240,240,255,243,242,240,240,1,250,254,97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0, +3,4,4,237,22,21,23,26,24,23,25,4,196,197,195,175,166,167,164,0,255,0,0,0,33,33,33,147,46,45,48,122,255,255,255,8,253,253,253,0,3,3,3,0,235,236,235,252,252,252,253,2,0,0,0,0,0,0,0,0,0,0,0,0,160,179,179, +10,1,250,4,192,31,30,26,251,0,254,253,5,245,242,242,0,249,249,249,0,237,237,239,1,1,254,255,79,89,89,75,243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,255,255,255,1,1,1,1,0,0,0,0,170,172,167,133,32,31,33,119, +37,36,39,3,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,254,254,254,0,248,248,248,0,254,254,254,0,4,4,4,0,251,251,251,0,202,202,199,248,251,253,252,88,88,86,90,177,160,179,179,10,6,249,3,190,34,32,28,50,11,11,10,5, +221,223,227,246,246,246,247,215,0,255,0,189,0,255,0,198,90,86,74,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,164,164,164,23,9,10,7,218,63,62,65,14,4,4,4,0,254, +254,254,0,1,1,1,0,1,1,1,0,253,253,253,0,2,2,2,0,243,243,243,0,223,223,223,0,16,16,16,0,17,18,17,0,202,202,199,248,251,252,254,78,254,4,15,123,38,33,30,57,12,12,9,6,220,223,229,246,244,243,244,151,89,84, +74,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,0,0,0,0,170,173,169,95,4,3,4,152,54,52,54,8,20,20,21,0,255,255,255,0,0,0,0,0,248,248,248, +0,245,246,244,0,253,252,254,0,236,236,236,0,3,3,3,0,9,9,9,0,9,10,8,0,197,202,210,253,33,31,30,254,18,17,15,5,222,223,228,247,238,239,242,154,90,85,74,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,168,168,166,79,3,5,3,156,9,8,9,9,14,15,15,2,248,248,248,254,240,239,238,4,252,252,253,7,56,56,57,255,252,251,253,1,0, +0,0,0,255,255,255,0,223,227,234,0,15,15,14,0,19,18,15,0,222,225,229,249,238,237,241,156,90,85,74,108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255, +255,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,191,191,3,231,231,226,42,255,2,1,23,2,255,1,244,3,3,7,209,254,254,250,37,2,4,4,197,54,52,55,11,251,251,252,1,222,226,232,0,12,11,11,0,21,21,18,0,225,227, +232,0,237,235,233,250,251,255,242,36,93,86,93,227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,255,255,255,255,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,119,164,42,15,10,0,99,33,21,3,108,46,38,30,6,14,11,8,0,23,22,19,0,227,229,233,0,4,2,1,0,22,19,12,254,213,214,212,237,248,247,250,43,92,92,92,235,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90,120,165,98,6,4,4,202,62,54,47,111,249,5,25,3,174,195, +229,0,9,11,13,0,229,230,235,0,0,255,254,0,31,28,22,0,21,21,22,2,35,35,36,18,7,9,6,205,166,166,166,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,89,120,164,78,3,5,4,148,66,62,48,11,45,39,26,3,46,41,31,3,24,25,21,0,150,174,207,0,246,248,249,0,37,33,27,0,4,4,4,0,247,247,247,0,31,30,32,3,31,30,31,25,7, +8,4,199,160,160,160,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,120,164,55,2,2,3,166,60,54,43,9,244,247,253, +0,180,199,225,0,211,221,235,0,23,21,16,0,7,6,7,253,216,222,227,251,255,0,254,0,255,255,255,0,2,2,2,0,245,245,245,0,37,36,38,4,21,22,23,37,13,14,11,191,160,160,160,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,119,165,66,2,1,3,187,55,51,41,10,254,0,3,0,241,243,247,0,237,230,222,0,235,226,215,0,248,247,248,0,246,249,251,245,240, +247,253,113,201,203,201,248,254,255,254,0,254,254,254,0,2,2,2,0,245,245,245,0,45,43,46,4,16,17,17,48,14,15,12,180,191,191,191,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,90,120,164,103,4,4,2,179,61,55,45,13,6,6,7,1,237,240,244,0,243,237,226,0,250,248,244,0,20,21,21,0,229,233,240,250,251,251,252,208,131,112,92,149,255,252,253,80,202,203,200,249, +254,254,253,0,0,0,0,0,1,1,1,0,247,247,247,0,48,46,49,6,11,10,11,63,239,241,237,167,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,122,169,20,89,120,166,180, +7,8,8,141,65,59,48,10,255,2,2,0,252,252,250,0,247,239,228,0,245,243,243,0,19,19,20,0,242,246,2,250,235,236,239,219,0,249,255,78,0,0,0,0,87,87,90,185,255,255,254,84,201,203,200,250,251,251,251,0,1,1,1, +0,254,254,254,0,251,251,251,0,51,51,53,6,6,5,6,78,176,177,173,151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,88,120,164,110,253,0,252,223,19,20,16,69,66,60,49,11,255,0,1,0,20,14, +6,0,235,231,224,0,240,241,241,0,18,18,18,0,242,247,2,250,232,235,239,218,0,250,0,59,166,141,90,241,0,0,0,0,0,0,0,0,86,84,89,180,0,254,0,88,203,205,201,249,250,250,250,0,3,3,3,0,254,254,254,0,250,250,250, +0,50,49,52,7,2,3,4,96,173,175,170,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,255,255,255,1,1,1,1,89,120,166,62,4,5,4,179,33,31,26,14,35,32,25,0,12,7,2,0,18,13,6,0,195,201,208,0,232,233,235,0,17,16,15,0, +252,2,11,252,227,228,236,218,0,251,0,58,166,141,90,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,170,173,168,88,1,255,1,161,51,51,53,6,5,4,5,0,245,245,245,0,241,241,241,0,21,21,21,0,203,204,201,248,252, +251,254,26,91,91,91,239,0,0,0,0,255,255,255,255,2,0,0,0,0,0,0,0,0,255,0,255,66,18,16,14,13,51,43,30,0,32,22,10,0,26,19,10,0,195,203,214,0,232,232,235,0,11,9,10,0,2,7,15,0,226,229,237,243,251,1,253,70, +166,141,90,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,86,83,88,168,2,3,2,100,205,205,203,250,249,250,249,0,245,245,245,0,240,240,240,0,246,246,246,0,13,13,13,253,2,2,255,52,0,0,0,0,0,0,0,0,0, +0,0,0,2,0,0,0,0,0,0,0,0,0,0,255,224,6,4,1,247,10,7,3,0,233,238,246,0,181,197,217,0,232,231,229,0,3,4,5,0,15,20,25,0,223,226,234,247,251,247,240,86,235,199,157,238,64,64,64,4,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,64,64,64,1,64,64,64,4,64,64,64,7,147,145,149,172,251,250,251,114,208,208,206,250,13,13,13,0,31,31,31,0,8,9,8,0,244,244,243,2,249,249,252,217,0,0,0,0,0,0,0,0,0,0,0,0,1,250,250,250,239,161,161,161, +42,176,188,206,8,15,35,61,207,48,44,37,15,6,7,6,0,223,221,219,0,249,247,245,0,25,27,30,0,235,238,247,250,235,233,231,176,233,205,163,122,0,0,0,251,0,0,0,250,0,0,0,250,0,0,0,249,0,0,0,254,0,0,0,1,0,0,0, +5,0,0,0,4,0,0,0,5,0,0,0,3,0,0,0,2,92,92,89,88,11,13,13,130,7,7,7,254,250,250,249,1,244,244,245,124,164,162,165,158,0,0,0,251,123,123,123,6,67,67,67,224,1,225,225,225,109,251,251,251,18,100,100,100,160, +17,39,71,63,9,19,31,153,44,39,33,8,251,246,238,0,0,4,7,0,254,2,9,0,218,219,223,246,236,214,180,83,251,242,232,236,0,0,0,248,0,0,0,248,0,0,0,248,0,0,0,253,0,0,0,253,0,0,0,252,0,0,0,3,0,0,0,6,0,0,0,6,0, +0,0,5,0,0,0,6,0,0,0,6,15,15,15,1,35,35,35,18,229,229,229,229,233,233,233,242,0,0,0,250,0,0,0,251,174,174,174,107,8,8,8,233,1,0,0,0,13,228,228,228,155,208,208,208,162,140,140,140,218,17,40,74,70,8,16,26, +139,10,11,9,253,2,2,3,3,243,243,245,2,247,235,220,126,241,221,191,193,0,0,0,250,0,0,0,249,0,0,0,249,0,0,0,248,0,0,0,249,0,0,0,249,0,0,0,253,0,0,0,6,0,0,0,5,0,0,0,4,0,0,0,3,0,0,0,3,0,0,0,1,0,0,0,255,0, +0,0,254,0,0,0,253,0,0,0,252,0,0,0,250,164,164,164,43,24,24,24,103,4,4,4,95,1,0,0,0,1,0,0,0,5,239,239,239,158,242,242,242,228,207,207,207,183,153,166,179,237,9,20,42,51,0,2,1,10,248,235,222,208,246,233, +212,234,0,0,0,253,0,0,0,253,0,0,0,250,0,0,0,248,0,0,0,248,0,0,0,251,192,192,192,254,0,0,0,0,0,0,0,0,64,64,64,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,255,0,0,0,255,0,0,0,254,178,178,178,13,13,13,13,101, +0,0,0,44,1,1,1,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,87,254,254,254,221,254,254,254,255,253,253,253,255,252,252,252,255,252,252,252,255,252,252,252,255,253,253,253,255,254,254,254,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,239,255,255,255,99,0,0,0,0,0,0,0,0,0,0,0,0,142,119,220,132,34,208,196,92,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* Presets::confighover_png = (const char*) resource_Presets_confighover_png; +const int Presets::confighover_pngSize = 4254; + +// JUCER_RESOURCE: preferencessystem_png, 2129, "../../../home/bill/dl/tango-icon-theme-0.8.90/32x32/categories/preferences-system.png" +static const unsigned char resource_Presets_preferencessystem_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122,244,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100, +136,0,0,8,8,73,68,65,84,88,133,237,150,107,80,84,231,25,199,255,231,186,247,93,129,101,193,101,65,46,106,21,144,155,58,136,241,66,172,162,226,68,99,106,173,237,76,167,173,218,241,139,83,149,96,65,116, +82,167,41,176,98,117,180,214,100,72,140,153,100,58,109,194,180,90,13,70,136,134,161,157,198,154,78,210,40,226,133,5,21,185,45,236,194,194,46,44,123,238,167,31,194,102,86,5,177,147,15,253,210,103,230,153, +247,125,207,121,159,231,255,123,158,247,157,51,7,248,191,253,143,141,152,110,67,77,77,213,114,154,165,223,7,72,29,8,220,151,5,225,195,96,80,120,235,240,225,195,220,243,138,84,31,127,167,72,3,245,139,146, +146,157,190,255,10,224,200,145,35,38,149,144,2,105,169,179,145,151,187,16,254,64,0,173,183,91,56,239,160,215,205,5,133,130,131,7,15,14,76,39,126,228,196,187,251,21,85,169,161,40,170,91,16,164,229,135, +74,119,62,138,124,79,62,43,184,172,172,108,148,38,169,149,221,61,143,198,253,129,128,226,72,112,96,237,154,245,218,172,204,236,36,131,73,119,254,89,177,117,117,117,212,209,83,239,157,101,117,154,95,45, +46,40,64,98,74,138,157,97,168,127,87,158,120,59,235,185,1,0,160,180,180,252,239,156,40,173,250,228,202,101,82,85,85,94,146,36,100,45,200,166,12,122,195,130,234,163,175,23,78,90,245,145,119,76,15,7,198, +155,76,102,243,214,156,188,69,6,86,163,65,130,195,65,217,29,142,104,82,37,111,214,214,214,50,83,2,84,85,85,197,60,249,172,98,127,197,231,0,252,162,40,246,2,0,207,243,72,77,77,51,176,180,102,203,164,212, +58,234,171,248,248,248,252,172,220,28,3,69,83,0,0,89,145,225,245,122,130,4,65,252,120,215,174,93,226,164,0,78,103,229,90,146,86,7,79,157,58,241,253,200,231,213,199,170,115,1,88,104,154,14,210,52,13,146, +36,97,52,26,9,154,166,83,38,211,39,84,196,204,153,157,162,17,4,1,162,192,67,18,121,180,223,109,227,4,94,108,40,223,187,253,15,145,123,31,3,96,52,204,217,156,236,92,72,138,244,199,218,218,55,94,6,128,154, +154,202,28,66,82,46,205,73,155,251,154,193,96,72,209,104,52,208,106,181,224,56,78,5,224,126,82,220,233,172,181,200,138,60,67,146,68,8,124,8,178,40,96,208,227,81,125,67,222,17,130,147,127,246,228,126,250, +49,0,134,25,74,116,36,217,147,103,165,208,127,189,120,238,188,179,166,18,10,128,204,5,11,78,173,88,86,88,161,170,170,86,146,36,208,52,141,222,222,30,73,20,197,199,10,56,92,91,171,39,56,182,121,254,188, +52,81,149,37,198,239,243,33,20,26,71,95,159,135,32,20,101,83,89,217,206,209,167,186,21,185,56,126,162,166,50,125,126,102,89,110,206,66,138,36,31,191,30,178,44,35,24,12,66,81,20,48,12,3,94,224,209,208, +80,207,9,146,184,109,127,73,249,133,195,181,181,122,109,136,105,202,202,152,147,103,182,152,152,150,86,215,120,32,48,118,23,42,62,133,138,107,229,37,219,47,76,122,92,145,139,202,202,202,56,163,89,239, +218,242,202,86,51,203,178,144,101,25,36,73,130,32,8,72,146,4,138,162,224,243,249,208,218,218,10,155,205,6,91,156,13,13,13,245,28,47,202,27,21,38,246,96,94,230,188,130,168,40,35,123,227,86,251,248,240, +176,255,205,178,189,219,75,39,19,141,52,42,114,209,212,212,20,44,90,183,198,237,114,181,173,115,36,56,104,171,213,10,134,97,192,48,12,100,89,134,63,48,2,69,86,32,138,34,8,226,107,246,244,140,12,218,245, +112,224,71,89,233,223,113,196,217,162,217,214,59,29,33,239,224,200,219,229,251,182,151,76,39,254,84,7,194,118,244,168,115,19,205,210,103,140,6,163,46,198,106,37,131,193,160,226,241,12,208,162,40,106,54, +20,191,164,10,188,72,0,128,170,170,104,117,117,195,26,19,13,251,204,88,180,220,233,224,251,221,222,51,229,251,118,236,126,30,241,41,1,128,175,191,100,15,30,220,75,87,41,34,142,84,136,49,134,209,223,148, +229,208,28,138,97,63,91,91,180,222,32,240,34,113,235,94,39,44,22,11,18,29,241,184,211,246,16,238,158,46,129,87,134,102,31,122,245,80,247,183,6,152,204,146,214,87,165,199,154,177,35,35,129,218,189,98,225, +60,54,198,98,192,172,36,59,218,58,30,129,33,9,36,217,103,40,215,174,127,54,52,62,198,103,84,84,84,120,159,39,231,180,159,226,176,165,110,168,222,174,101,153,127,189,178,110,197,158,144,38,149,250,221, +249,14,24,45,209,232,184,223,13,40,50,210,231,38,33,33,33,145,204,206,202,141,214,25,53,95,58,157,78,203,243,228,165,166,223,2,164,108,168,218,200,178,236,217,31,110,46,212,23,46,76,38,181,122,3,57,60, +202,227,131,198,155,200,77,53,35,63,103,46,104,154,6,207,243,112,56,18,73,89,146,13,254,209,225,205,75,242,11,222,109,110,110,22,159,149,123,90,128,228,226,170,124,154,162,46,110,46,94,166,15,242,42,254, +113,203,141,78,247,48,236,54,11,6,60,126,89,30,119,203,75,114,231,80,0,1,138,162,192,113,28,146,147,83,72,127,192,31,37,138,252,218,252,252,130,247,155,155,155,229,169,242,63,243,8,102,173,175,94,69,145, +212,149,245,171,243,245,10,65,193,235,27,131,251,126,11,186,239,126,142,241,96,16,163,33,62,232,13,138,251,46,55,126,204,41,170,2,69,81,64,146,36,2,129,0,94,40,88,78,199,218,108,57,49,214,25,245,117,117, +117,83,22,58,37,64,90,113,213,46,134,165,62,218,92,188,204,164,213,233,136,62,143,31,195,125,247,16,10,142,32,193,145,136,142,78,175,192,243,194,141,243,167,15,158,86,68,233,229,134,198,75,188,44,75,0, +0,130,32,16,12,6,81,184,98,21,107,54,91,86,14,120,251,254,164,170,234,164,23,254,41,128,185,47,253,214,154,178,193,89,175,51,232,143,253,96,83,161,94,33,41,136,2,143,177,1,23,252,195,62,216,237,9,24,26, +37,133,238,190,129,118,132,212,141,0,80,90,90,222,168,168,202,150,203,141,151,4,94,224,65,16,4,100,89,6,207,243,88,253,221,34,86,171,209,110,60,253,198,201,55,167,5,72,46,174,250,133,4,241,161,221,110, +91,179,109,243,139,6,5,4,28,49,90,244,60,184,13,239,224,32,226,227,227,49,52,70,9,157,61,3,46,112,120,225,193,213,114,127,56,246,213,189,191,172,135,130,109,159,92,185,204,115,28,7,154,166,191,129,88, +245,226,26,13,69,51,63,61,249,251,99,7,158,4,248,166,45,41,197,206,21,172,134,249,40,115,126,154,57,43,35,5,51,244,20,102,70,105,113,238,227,102,116,118,245,32,46,214,10,129,178,72,109,237,189,46,240, +88,26,41,30,105,199,79,30,221,70,168,196,123,171,87,175,101,89,134,69,32,16,192,224,224,32,28,14,7,26,175,92,230,68,94,182,31,56,112,96,248,169,14,168,80,87,197,217,98,76,171,151,206,67,70,146,25,105, +51,77,56,215,120,29,157,143,122,96,54,154,64,234,172,184,215,209,55,42,16,82,209,84,226,0,80,178,103,255,7,36,77,237,188,122,181,81,8,113,33,248,253,126,120,60,30,4,2,1,68,69,69,201,36,169,44,154,226, +8,148,78,45,67,134,76,58,26,93,253,1,156,185,240,5,58,31,118,128,102,52,136,77,72,69,107,91,119,136,31,243,110,237,169,63,228,195,19,255,17,17,221,164,1,104,246,236,222,247,103,158,227,75,154,155,63,21, +162,162,163,144,158,158,14,131,209,128,145,145,97,50,20,18,219,34,131,40,0,44,0,189,42,140,121,57,173,227,231,160,52,218,81,78,66,215,131,54,8,188,128,164,148,185,232,118,251,5,159,183,255,98,79,147,243, +47,0,180,0,52,19,113,228,132,40,11,64,63,225,6,0,134,171,87,155,92,121,121,57,30,119,191,123,249,128,167,95,112,185,238,73,195,195,35,135,94,255,245,111,174,79,232,18,0,20,2,128,101,34,169,214,182,232, +39,43,77,51,231,215,46,93,156,169,229,3,253,0,163,135,66,25,240,229,87,183,199,251,254,249,214,247,120,95,231,32,0,46,194,229,9,151,34,138,97,1,48,225,185,213,106,37,178,179,179,163,219,219,219,123,187, +186,186,2,0,4,0,226,196,200,19,0,76,97,0,0,26,219,226,29,69,6,91,218,81,179,217,32,147,20,67,13,251,252,228,88,207,141,215,6,91,62,252,91,56,104,194,185,136,185,28,33,76,79,192,132,171,84,1,40,17,160, +225,28,66,184,3,68,4,177,14,0,99,76,204,138,54,38,44,89,8,146,212,7,123,91,110,140,62,186,230,137,168,86,136,232,128,56,145,60,242,30,144,19,99,216,213,8,136,240,252,177,128,201,46,83,120,140,124,175, +98,146,4,223,214,254,3,174,151,133,37,87,153,47,161,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* Presets::preferencessystem_png = (const char*) resource_Presets_preferencessystem_png; +const int Presets::preferencessystem_pngSize = 2129; + + +//[EndFile] You can add extra defines here... +//[/EndFile] diff --git a/Source/Presets.h b/Source/Presets.h index 7f97337..112a603 100644 --- a/Source/Presets.h +++ b/Source/Presets.h @@ -1,102 +1,103 @@ -/*\ -|*| Copyright 2015 bill-auger -|*| -|*| This file is part of the AvCaster program. -|*| -|*| AvCaster is free software: you can redistribute it and/or modify -|*| it under the terms of the GNU Lesser General Public License version 3 -|*| as published by the Free Software Foundation. -|*| -|*| AvCaster 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 Lesser General Public License for more details. -|*| -|*| You should have received a copy of the GNU Lesser General Public License -|*| along with AvCaster. If not, see . -\*/ - -#ifndef __JUCE_HEADER_27B35F6AAB5C16AC__ -#define __JUCE_HEADER_27B35F6AAB5C16AC__ - -//[Headers] -- You can add your own extra header files here -- - -#include "JuceHeader.h" - -class MainContent ; - -//[/Headers] - - - -//============================================================================== -/** - //[Comments] - An auto-generated component, created by the Introjucer. - - Describe your class and how it works here! - //[/Comments] -*/ -class Presets : public Component, - public ButtonListener, - public ComboBoxListener -{ -public: - //============================================================================== - Presets (); - ~Presets(); - - //============================================================================== - //[UserMethods] -- You can add your own custom methods in this section. - //[/UserMethods] - - void paint (Graphics& g); - void resized(); - void buttonClicked (Button* buttonThatWasClicked); - void comboBoxChanged (ComboBox* comboBoxThatHasChanged); - - // Binary resources: - static const char* configpushed_png; - static const int configpushed_pngSize; - static const char* confighover_png; - static const int confighover_pngSize; - static const char* preferencessystem_png; - static const int preferencessystem_pngSize; - - -private: - //[UserVariables] -- You can add your own custom variables in this section. - - void broughtToFront () override ; - - void handleSaveButton () ; - void handleNewButton () ; - void handleDeleteButton () ; - void handlePresetCombo () ; - void toggleControls () ; - void setCreatePresetMode(bool is_pending_new_preset_name) ; - bool isCreatePresetMode () ; - - - MainContent* mainContent ; - - //[/UserVariables] - - //============================================================================== - ScopedPointer presetsGroup; - ScopedPointer saveButton; - ScopedPointer newButton; - ScopedPointer deleteButton; - ScopedPointer