--- gigedit/trunk/src/gigedit/Settings.h 2016/04/26 17:42:26 2891 +++ gigedit/trunk/src/gigedit/Settings.h 2020/01/10 14:22:25 3711 @@ -1,6 +1,6 @@ /* - Copyright (c) 2014-2016 Christian Schoenebeck - + Copyright (c) 2014-2020 Christian Schoenebeck + This file is part of "gigedit" and released under the terms of the GNU General Public License version 2. */ @@ -12,6 +12,7 @@ #include #include #include +#include "global.h" /** * Reflects, saves and restores all settings for the gigedit application. @@ -36,7 +37,20 @@ * All settings are grouped into these settings groups. */ enum Group_t { - GLOBAL + GLOBAL, + MAIN_WINDOW, + SCRIPT_EDITOR, + DIMENSION_MANAGER, + SCRIPT_SLOTS, + COMBINE_INSTRUMENTS, + MIDI_RULES, + FILE_PROPS, + INSTR_PROPS, + SAMPLE_PROPS, + SAMPLE_REFS, + MACRO_EDITOR, + MACROS_SETUP, + MACROS, }; /** @@ -59,7 +73,7 @@ sigc::bind( sigc::bind( sigc::bind( - sigc::mem_fun(m_settings, &Settings::onPropertyChanged), + sigc::mem_fun(*m_settings, &Settings::onPropertyChanged), m_group ), type @@ -79,7 +93,7 @@ sigc::bind( sigc::bind( sigc::bind( - sigc::mem_fun(m_settings, &Settings::onPropertyChanged), + sigc::mem_fun(*m_settings, &Settings::onPropertyChanged), m_group ), type @@ -108,13 +122,93 @@ Group_t m_group; }; + // settings of "Global" group Property warnUserOnExtensions; ///< if enabled, the user shall he be warned if he is trying to use a gig format extension that will not work with Gigasampler/GigaStudio Property syncSamplerInstrumentSelection; ///< if enabled, the sampler's current instrument will automatically be switched whenever another instrument was selected in gigedit Property moveRootNoteWithRegionMoved; ///< if enabled, the root note(s) of regions are automatically moving when the user drags a region around at the virtual keyboard + Property autoRestoreWindowDimension; + Property saveWithTemporaryFile; ///< If enabled and the user selects "Save" from the main menu, then the file is first saved as separate temporary file and after the save operation completed the temporary file is moved over the original file. + Property showTooltips; ///< Whether tooltips specifically intended for newbies should be displayed throughout the application (default: yes). + Property instrumentDoubleClickOpensProps; ///< If enabled then double clicking on an instrument of the instruments list view will show the selected instrument's properties dialog. + + // settings of "MainWindow" group + Property mainWindowX; + Property mainWindowY; + Property mainWindowW; + Property mainWindowH; + + // settings of "ScriptEditor" group + Property scriptEditorWindowX; + Property scriptEditorWindowY; + Property scriptEditorWindowW; + Property scriptEditorWindowH; + Property scriptEditorFontSize; + + // settings of "DimensionManager" group + Property dimensionManagerWindowX; + Property dimensionManagerWindowY; + Property dimensionManagerWindowW; + Property dimensionManagerWindowH; + + // settings of "ScriptSlots" group + Property scriptSlotsWindowX; + Property scriptSlotsWindowY; + Property scriptSlotsWindowW; + Property scriptSlotsWindowH; + + // settings of "CombineInstruments" group + Property combineInstrumentsWindowX; + Property combineInstrumentsWindowY; + Property combineInstrumentsWindowW; + Property combineInstrumentsWindowH; + + // settings of "MidiRules" group + Property midiRulesWindowX; + Property midiRulesWindowY; + Property midiRulesWindowW; + Property midiRulesWindowH; + + // settings of "FileProps" group + Property filePropsWindowX; + Property filePropsWindowY; + Property filePropsWindowW; + Property filePropsWindowH; + + // settings of "InstrProps" group + Property instrPropsWindowX; + Property instrPropsWindowY; + Property instrPropsWindowW; + Property instrPropsWindowH; + + // settings of "SampleProps" group + Property samplePropsWindowX; + Property samplePropsWindowY; + Property samplePropsWindowW; + Property samplePropsWindowH; + + // settings of "SampleRefs" group + Property sampleRefsWindowX; + Property sampleRefsWindowY; + Property sampleRefsWindowW; + Property sampleRefsWindowH; + + // settings of "MacroEditor" group + Property macroEditorWindowX; + Property macroEditorWindowY; + Property macroEditorWindowW; + Property macroEditorWindowH; + + // settings of "MacrosSetup" group + Property macrosSetupWindowX; + Property macrosSetupWindowY; + Property macrosSetupWindowW; + Property macrosSetupWindowH; static Settings* singleton(); Settings(); void load(); + void loadMacros(std::vector& macros); + void saveMacros(const std::vector& macros); protected: void onPropertyChanged(Glib::PropertyBase* pProperty, RawValueType_t type, Group_t group);