X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Frc_option_editor.cc;h=a6e76bda2a181448d61d2d1e78e07a2f63d3fb17;hb=f3a1ac21cbe0793f830143ccbad77a0cf7ef16fe;hp=77da1509d3945b6a2f288adaa15e7c856ba775a3;hpb=74d13efd8d07d6e0687f1a56a6759a96bb886d11;p=ardour.git diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 77da1509d3..a6e76bda2a 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -21,6 +21,10 @@ #include "gtk2ardour-config.h" #endif +#if !defined USE_CAIRO_IMAGE_SURFACE && !defined NDEBUG +#define OPTIONAL_CAIRO_IMAGE_SURFACE +#endif + #include #include @@ -46,7 +50,6 @@ #include "canvas/wave_view.h" -#include "ardour_ui.h" #include "ardour_window.h" #include "ardour_dialog.h" #include "gui_thread.h" @@ -68,148 +71,49 @@ using namespace PBD; using namespace ARDOUR; using namespace ARDOUR_UI_UTILS; -class AutoReturnTargetOptions : public OptionEditorBox -{ - public: - AutoReturnTargetOptions (RCConfiguration* c, Gtk::Window* p) - : _rc_config (c) - , range_selection_button (_("Play Range Selection")) - , last_roll_button (_("Play from Last Roll")) - , loop_button (_("Play Loop")) - , region_selection_button (_("Play Region Selection")) - , toggle_button (_("Enable/Disable all options")) - { - _box->pack_start (range_selection_button, false, false); - range_selection_button.signal_toggled().connect (sigc::mem_fun (*this, &AutoReturnTargetOptions::range_selection_toggled)); - - _box->pack_start (loop_button, false, false); - loop_button.signal_toggled().connect (sigc::mem_fun (*this, &AutoReturnTargetOptions::loop_toggled)); - - _box->pack_start (region_selection_button, false, false); - region_selection_button.signal_toggled().connect (sigc::mem_fun (*this, &AutoReturnTargetOptions::region_selection_toggled)); - - _box->pack_start (last_roll_button, false, false); - last_roll_button.signal_toggled().connect (sigc::mem_fun (*this, &AutoReturnTargetOptions::last_roll_toggled)); - - HBox* hbox = manage (new HBox); - /* keep the toggle button small */ - hbox->pack_start (toggle_button, false, false); - _box->pack_start (*hbox, false, false); - - toggle_button.signal_clicked().connect (sigc::mem_fun (*this, &AutoReturnTargetOptions::toggle)); - - Gtkmm2ext::UI::instance()->set_tip (range_selection_button, - _("If enabled, playhead will always start from the beginning of the current range selection.\n\nIf disabled or no range selection, see the next choice in this list")); - Gtkmm2ext::UI::instance()->set_tip (loop_button, - _("If enabled, playhead will always start from the beginning of the loop range.\n\nIf disabled or no loop range, see the next choice in this list")); - Gtkmm2ext::UI::instance()->set_tip (region_selection_button, - _("If enabled, playhead will always start from the beginning of the first selected region.\n\nIf disabled or no region selection, see the next choice in this list")); - Gtkmm2ext::UI::instance()->set_tip (last_roll_button, - _("If enabled, playhead will always start from the last position where it was started.\n\nIf disabled it will start from wherever it is currently located")); - - Gtkmm2ext::UI::instance()->set_tip (toggle_button, - _("Change status of all buttons above to all enabled or all disabled")); - } - - void parameter_changed (string const & p) - { - if (p == "auto-return-target-list") { - AutoReturnTarget art = _rc_config->get_auto_return_target_list(); - range_selection_button.set_active (art & RangeSelectionStart); - loop_button.set_active (art & Loop); - region_selection_button.set_active (art & RegionSelectionStart); - last_roll_button.set_active (art & LastLocate); - } - } - - void set_state_from_config () - { - parameter_changed ("auto-return-target-list"); - } - - private: - - void range_selection_toggled () { - AutoReturnTarget art = _rc_config->get_auto_return_target_list (); - if (range_selection_button.get_active ()) { - _rc_config->set_auto_return_target_list (AutoReturnTarget (art | RangeSelectionStart)); - } else { - _rc_config->set_auto_return_target_list (AutoReturnTarget (art & ~RangeSelectionStart)); - } - } - void last_roll_toggled () { - AutoReturnTarget art = _rc_config->get_auto_return_target_list (); - if (last_roll_button.get_active ()) { - _rc_config->set_auto_return_target_list (AutoReturnTarget (art | LastLocate)); - } else { - _rc_config->set_auto_return_target_list (AutoReturnTarget (art & ~LastLocate)); - } - } - void region_selection_toggled () { - AutoReturnTarget art = _rc_config->get_auto_return_target_list (); - if (region_selection_button.get_active ()) { - _rc_config->set_auto_return_target_list (AutoReturnTarget (art | RegionSelectionStart)); - } else { - _rc_config->set_auto_return_target_list (AutoReturnTarget (art & ~RegionSelectionStart)); - } - } - void loop_toggled () { - AutoReturnTarget art = _rc_config->get_auto_return_target_list (); - if (loop_button.get_active ()) { - _rc_config->set_auto_return_target_list (AutoReturnTarget (art | Loop)); - } else { - _rc_config->set_auto_return_target_list (AutoReturnTarget (art & ~Loop)); - } - } - - void toggle () { - AutoReturnTarget art = _rc_config->get_auto_return_target_list (); - if (art) { - _rc_config->set_auto_return_target_list (AutoReturnTarget (0)); - } else { - _rc_config->set_auto_return_target_list (AutoReturnTarget (RangeSelectionStart| - RegionSelectionStart| - Loop| - LastLocate)); - } - } - - RCConfiguration* _rc_config; - - Gtk::CheckButton range_selection_button; - Gtk::CheckButton last_roll_button; - Gtk::CheckButton loop_button; - Gtk::CheckButton region_selection_button; - Gtk::Button toggle_button; -}; - class ClickOptions : public OptionEditorBox { public: ClickOptions (RCConfiguration* c, Gtk::Window* p) : _rc_config (c) + , _click_browse_button (_("Browse...")) + , _click_emphasis_browse_button (_("Browse...")) { - Table* t = manage (new Table (2, 3)); + Table* t = manage (new Table (3, 3)); t->set_spacings (4); - Label* l = manage (left_aligned_label (_("Click audio file:"))); + Label* l = manage (left_aligned_label (_("Use default Click:"))); t->attach (*l, 0, 1, 0, 1, FILL); - t->attach (_click_path_entry, 1, 2, 0, 1, FILL); - Button* b = manage (new Button (_("Browse..."))); - b->signal_clicked().connect (sigc::mem_fun (*this, &ClickOptions::click_browse_clicked)); - t->attach (*b, 2, 3, 0, 1, FILL); + t->attach (_use_default_click_check_button, 1, 2, 0, 1, FILL); + _use_default_click_check_button.signal_toggled().connect ( + sigc::mem_fun (*this, &ClickOptions::use_default_click_toggled)); - l = manage (left_aligned_label (_("Click emphasis audio file:"))); + l = manage (left_aligned_label (_("Click audio file:"))); t->attach (*l, 0, 1, 1, 2, FILL); - t->attach (_click_emphasis_path_entry, 1, 2, 1, 2, FILL); - b = manage (new Button (_("Browse..."))); - b->signal_clicked().connect (sigc::mem_fun (*this, &ClickOptions::click_emphasis_browse_clicked)); - t->attach (*b, 2, 3, 1, 2, FILL); + t->attach (_click_path_entry, 1, 2, 1, 2, FILL); + _click_browse_button.signal_clicked ().connect ( + sigc::mem_fun (*this, &ClickOptions::click_browse_clicked)); + t->attach (_click_browse_button, 2, 3, 1, 2, FILL); + + l = manage (left_aligned_label (_("Click emphasis audio file:"))); + t->attach (*l, 0, 1, 2, 3, FILL); + t->attach (_click_emphasis_path_entry, 1, 2, 2, 3, FILL); + _click_emphasis_browse_button.signal_clicked ().connect ( + sigc::mem_fun (*this, &ClickOptions::click_emphasis_browse_clicked)); + t->attach (_click_emphasis_browse_button, 2, 3, 2, 3, FILL); _box->pack_start (*t, false, false); _click_path_entry.signal_activate().connect (sigc::mem_fun (*this, &ClickOptions::click_changed)); _click_emphasis_path_entry.signal_activate().connect (sigc::mem_fun (*this, &ClickOptions::click_emphasis_changed)); + + if (_rc_config->get_click_sound ().empty() && + _rc_config->get_click_emphasis_sound().empty()) { + _use_default_click_check_button.set_active (true); + + } else { + _use_default_click_check_button.set_active (false); + } } void parameter_changed (string const & p) @@ -275,9 +179,29 @@ private: click_emphasis_chosen (_click_emphasis_path_entry.get_text ()); } + void use_default_click_toggled () + { + if (_use_default_click_check_button.get_active ()) { + _rc_config->set_click_sound (""); + _rc_config->set_click_emphasis_sound (""); + _click_path_entry.set_sensitive (false); + _click_emphasis_path_entry.set_sensitive (false); + _click_browse_button.set_sensitive (false); + _click_emphasis_browse_button.set_sensitive (false); + } else { + _click_path_entry.set_sensitive (true); + _click_emphasis_path_entry.set_sensitive (true); + _click_browse_button.set_sensitive (true); + _click_emphasis_browse_button.set_sensitive (true); + } + } + RCConfiguration* _rc_config; + CheckButton _use_default_click_check_button; Entry _click_path_entry; Entry _click_emphasis_path_entry; + Button _click_browse_button; + Button _click_emphasis_browse_button; }; class UndoOptions : public OptionEditorBox @@ -747,7 +671,7 @@ public: } } - l = manage (left_aligned_label (_("Resize overlaped regions using:"))); + l = manage (left_aligned_label (_("Resize overlapped regions using:"))); l->set_name ("OptionsLabel"); t->attach (*l, col, col + 1, row, row + 1, FILL | EXPAND, FILL); @@ -1027,12 +951,11 @@ private: class FontScalingOptions : public OptionEditorBox { public: - FontScalingOptions (UIConfiguration* uic) : - _ui_config (uic), + FontScalingOptions () : _dpi_adjustment (100, 50, 250, 1, 5), _dpi_slider (_dpi_adjustment) { - _dpi_adjustment.set_value (_ui_config->get_font_scale() / 1024.); + _dpi_adjustment.set_value (UIConfiguration::instance().get_font_scale() / 1024.); Label* l = manage (new Label (_("GUI and Font scaling:"))); l->set_name ("OptionsLabel"); @@ -1071,7 +994,7 @@ public: void parameter_changed (string const & p) { if (p == "font-scale") { - _dpi_adjustment.set_value (_ui_config->get_font_scale() / 1024.); + _dpi_adjustment.set_value (UIConfiguration::instance().get_font_scale() / 1024.); } } @@ -1084,12 +1007,11 @@ private: void dpi_changed () { - _ui_config->set_font_scale ((long) floor (_dpi_adjustment.get_value() * 1024.)); + UIConfiguration::instance().set_font_scale ((long) floor (_dpi_adjustment.get_value() * 1024.)); /* XXX: should be triggered from the parameter changed signal */ - reset_dpi (); + UIConfiguration::instance().reset_dpi (); } - UIConfiguration* _ui_config; Adjustment _dpi_adjustment; HScale _dpi_slider; }; @@ -1097,12 +1019,11 @@ private: class ClipLevelOptions : public OptionEditorBox { public: - ClipLevelOptions (UIConfiguration* c) - : _ui_config (c) - , _clip_level_adjustment (-.5, -50.0, 0.0, 0.1, 1.0) /* units of dB */ + ClipLevelOptions () + : _clip_level_adjustment (-.5, -50.0, 0.0, 0.1, 1.0) /* units of dB */ , _clip_level_slider (_clip_level_adjustment) { - _clip_level_adjustment.set_value (_ui_config->get_waveform_clip_level ()); + _clip_level_adjustment.set_value (UIConfiguration::instance().get_waveform_clip_level ()); Label* l = manage (new Label (_("Waveform Clip Level (dBFS):"))); l->set_name ("OptionsLabel"); @@ -1121,7 +1042,7 @@ public: void parameter_changed (string const & p) { if (p == "waveform-clip-level") { - _clip_level_adjustment.set_value (_ui_config->get_waveform_clip_level()); + _clip_level_adjustment.set_value (UIConfiguration::instance().get_waveform_clip_level()); } } @@ -1134,12 +1055,11 @@ private: void clip_level_changed () { - _ui_config->set_waveform_clip_level (_clip_level_adjustment.get_value()); + UIConfiguration::instance().set_waveform_clip_level (_clip_level_adjustment.get_value()); /* XXX: should be triggered from the parameter changed signal */ ArdourCanvas::WaveView::set_clip_level (_clip_level_adjustment.get_value()); } - UIConfiguration* _ui_config; Adjustment _clip_level_adjustment; HScale _clip_level_slider; }; @@ -1154,13 +1074,34 @@ public: , _playback_slider (_playback_adjustment) , _capture_slider (_capture_adjustment) { + vector presets; + + /* these must match the order of the enums for BufferingPreset */ + + presets.push_back (_("Small sessions (4-16 tracks)")); + presets.push_back (_("Medium sessions (16-64 tracks)")); + presets.push_back (_("Large sessions (64+ tracks)")); + presets.push_back (_("Custom (set by sliders below)")); + + set_popdown_strings (_buffering_presets_combo, presets); + + Label* l = manage (new Label (_("Preset:"))); + l->set_name ("OptionsLabel"); + HBox* h = manage (new HBox); + h->set_spacing (12); + h->pack_start (*l, false, false); + h->pack_start (_buffering_presets_combo, true, true); + _box->pack_start (*h, false, false); + + _buffering_presets_combo.signal_changed().connect (sigc::mem_fun (*this, &BufferingOptions::preset_changed)); + _playback_adjustment.set_value (_rc_config->get_audio_playback_buffer_seconds()); - Label* l = manage (new Label (_("Playback (seconds of buffering):"))); + l = manage (new Label (_("Playback (seconds of buffering):"))); l->set_name ("OptionsLabel"); _playback_slider.set_update_policy (UPDATE_DISCONTINUOUS); - HBox* h = manage (new HBox); + h = manage (new HBox); h->set_spacing (4); h->pack_start (*l, false, false); h->pack_start (_playback_slider, true, true); @@ -1186,6 +1127,31 @@ public: void parameter_changed (string const & p) { + if (p == "buffering-preset") { + switch (_rc_config->get_buffering_preset()) { + case Small: + _playback_slider.set_sensitive (false); + _capture_slider.set_sensitive (false); + _buffering_presets_combo.set_active (0); + break; + case Medium: + _playback_slider.set_sensitive (false); + _capture_slider.set_sensitive (false); + _buffering_presets_combo.set_active (1); + break; + case Large: + _playback_slider.set_sensitive (false); + _capture_slider.set_sensitive (false); + _buffering_presets_combo.set_active (2); + break; + case Custom: + _playback_slider.set_sensitive (true); + _capture_slider.set_sensitive (true); + _buffering_presets_combo.set_active (3); + break; + } + } + if (p == "playback-buffer-seconds") { _playback_adjustment.set_value (_rc_config->get_audio_playback_buffer_seconds()); } else if (p == "capture-buffer-seconds") { @@ -1195,12 +1161,38 @@ public: void set_state_from_config () { + parameter_changed ("buffering-preset"); parameter_changed ("playback-buffer-seconds"); parameter_changed ("capture-buffer-seconds"); } private: + void preset_changed () + { + int index = _buffering_presets_combo.get_active_row_number (); + if (index < 0) { + return; + } + switch (index) { + case 0: + _rc_config->set_buffering_preset (Small); + break; + case 1: + _rc_config->set_buffering_preset (Medium); + break; + case 2: + _rc_config->set_buffering_preset (Large); + break; + case 3: + _rc_config->set_buffering_preset (Custom); + break; + default: + error << string_compose (_("programming error: unknown buffering preset string, index = %1"), index) << endmsg; + break; + } + } + void playback_changed () { _rc_config->set_audio_playback_buffer_seconds ((long) _playback_adjustment.get_value()); @@ -1216,6 +1208,7 @@ private: Adjustment _capture_adjustment; HScale _playback_slider; HScale _capture_slider; + ComboBoxText _buffering_presets_combo; }; class ControlSurfacesOptions : public OptionEditorBox @@ -1509,12 +1502,12 @@ private: class PluginOptions : public OptionEditorBox { public: - PluginOptions (RCConfiguration* c, UIConfiguration* uic) + PluginOptions (RCConfiguration* c) : _rc_config (c) - , _ui_config (uic) , _display_plugin_scan_progress (_("Always Display Plugin Scan Progress")) , _discover_vst_on_start (_("Scan for [new] VST Plugins on Application Start")) , _discover_au_on_start (_("Scan for AudioUnit Plugins on Application Start")) + , _verbose_plugin_scan (_("Verbose Plugin Scan")) , _timeout_adjustment (0, 0, 3000, 50, 50) , _timeout_slider (_timeout_adjustment) { @@ -1576,17 +1569,23 @@ public: _("When enabled new VST plugins are searched, tested and added to the cache index on application start. When disabled new plugins will only be available after triggering a 'Scan' manually")); #ifdef LXVST_SUPPORT - t->attach (*manage (left_aligned_label (_("Linux VST Path:"))), 0, 1, n, n+1); + t->attach (*manage (right_aligned_label (_("Linux VST Path:"))), 0, 1, n, n+1); b = manage (new Button (_("Edit"))); b->signal_clicked().connect (sigc::mem_fun (*this, &PluginOptions::edit_lxvst_path_clicked)); t->attach (*b, 1, 2, n, n+1, FILL); ++n; #endif #ifdef WINDOWS_VST_SUPPORT - t->attach (*manage (left_aligned_label (_("Windows VST Path:"))), 0, 1, n, n+1); + t->attach (*manage (right_aligned_label (_("Windows VST Path:"))), 0, 1, n, n+1); b = manage (new Button (_("Edit"))); b->signal_clicked().connect (sigc::mem_fun (*this, &PluginOptions::edit_vst_path_clicked)); t->attach (*b, 1, 2, n, n+1, FILL); ++n; + + // currently verbose logging is only implemented for Windows VST. + t->attach (_verbose_plugin_scan, 0, 2, n, n+1); ++n; + _verbose_plugin_scan.signal_toggled().connect (sigc::mem_fun (*this, &PluginOptions::verbose_plugin_scan_toggled)); + Gtkmm2ext::UI::instance()->set_tip (_verbose_plugin_scan, + _("When enabled additional information for every plugin is added to the Log Window.")); #endif #endif // any VST @@ -1619,7 +1618,7 @@ public: void parameter_changed (string const & p) { if (p == "show-plugin-scan-window") { - bool const x = _ui_config->get_show_plugin_scan_window(); + bool const x = UIConfiguration::instance().get_show_plugin_scan_window(); _display_plugin_scan_progress.set_active (x); } else if (p == "discover-vst-on-start") { @@ -1634,6 +1633,10 @@ public: bool const x = _rc_config->get_discover_audio_units(); _discover_au_on_start.set_active (x); } + else if (p == "verbose-plugin-scan") { + bool const x = _rc_config->get_verbose_plugin_scan(); + _verbose_plugin_scan.set_active (x); + } } void set_state_from_config () { @@ -1641,20 +1644,21 @@ public: parameter_changed ("discover-vst-on-start"); parameter_changed ("vst-scan-timeout"); parameter_changed ("discover-audio-units"); + parameter_changed ("verbose-plugin-scan"); } private: RCConfiguration* _rc_config; - UIConfiguration* _ui_config; CheckButton _display_plugin_scan_progress; CheckButton _discover_vst_on_start; CheckButton _discover_au_on_start; + CheckButton _verbose_plugin_scan; Adjustment _timeout_adjustment; HScale _timeout_slider; void display_plugin_scan_progress_toggled () { bool const x = _display_plugin_scan_progress.get_active(); - _ui_config->set_show_plugin_scan_window(x); + UIConfiguration::instance().set_show_plugin_scan_window(x); } void discover_vst_on_start_toggled () { @@ -1667,6 +1671,11 @@ private: _rc_config->set_discover_audio_units(x); } + void verbose_plugin_scan_toggled () { + bool const x = _verbose_plugin_scan.get_active(); + _rc_config->set_verbose_plugin_scan(x); + } + void timeout_changed () { int x = floor(_timeout_adjustment.get_value()); _rc_config->set_vst_scan_timeout(x); @@ -1789,7 +1798,6 @@ private: RCOptionEditor::RCOptionEditor () : OptionEditor (Config, string_compose (_("%1 Preferences"), PROGRAM_NAME)) , _rc_config (Config) - , _ui_config (ARDOUR_UI::config()) , _mixer_strip_visibility ("mixer-element-visibility") { /* MISC */ @@ -1846,8 +1854,8 @@ RCOptionEditor::RCOptionEditor () new BoolOption ( "only-copy-imported-files", _("Always copy imported files"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_only_copy_imported_files), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_only_copy_imported_files) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_only_copy_imported_files), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_only_copy_imported_files) )); add_option (_("Misc"), new DirectoryOption ( @@ -1900,8 +1908,6 @@ RCOptionEditor::RCOptionEditor () /* TRANSPORT */ - add_option (_("Transport"), new OptionEditorHeading (S_("Playhead Behaviour"))); - add_option (_("Transport"), new AutoReturnTargetOptions (_rc_config, this)); add_option (_("Transport"), new OptionEditorHeading (S_("Transport Options"))); BoolOption* tsf; @@ -2117,8 +2123,8 @@ RCOptionEditor::RCOptionEditor () new BoolOption ( "draggable-playhead", _("Allow dragging of playhead"), - sigc::mem_fun (*ARDOUR_UI::config(), &UIConfiguration::get_draggable_playhead), - sigc::mem_fun (*ARDOUR_UI::config(), &UIConfiguration::set_draggable_playhead) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_draggable_playhead), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_draggable_playhead) )); add_option (_("Editor"), @@ -2133,16 +2139,16 @@ RCOptionEditor::RCOptionEditor () new BoolOption ( "show-track-meters", _("Show meters on tracks in the editor"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_show_track_meters), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_show_track_meters) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_track_meters), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_track_meters) )); add_option (_("Editor"), new BoolOption ( "show-editor-meter", _("Display master-meter in the toolbar"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_show_editor_meter), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_show_editor_meter) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_editor_meter), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_editor_meter) )); ComboOption* fadeshape = new ComboOption ( @@ -2190,16 +2196,16 @@ RCOptionEditor::RCOptionEditor () new BoolOption ( "rubberbanding-snaps-to-grid", _("Make rubberband selection rectangle snap to the grid"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_rubberbanding_snaps_to_grid), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_rubberbanding_snaps_to_grid) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_rubberbanding_snaps_to_grid), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_rubberbanding_snaps_to_grid) )); add_option (_("Editor"), new BoolOption ( "show-waveforms", _("Show waveforms in regions"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_show_waveforms), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_show_waveforms) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_waveforms), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_waveforms) )); add_option (_("Editor"), @@ -2208,15 +2214,15 @@ RCOptionEditor::RCOptionEditor () _("Show gain envelopes in audio regions"), _("in all modes"), _("only in Draw and Internal Edit modes"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_show_region_gain), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_show_region_gain) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_region_gain), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_region_gain) )); ComboOption* wfs = new ComboOption ( "waveform-scale", _("Waveform scale"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_waveform_scale), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_waveform_scale) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_waveform_scale), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_waveform_scale) ); wfs->add (Linear, _("linear")); @@ -2227,8 +2233,8 @@ RCOptionEditor::RCOptionEditor () ComboOption* wfsh = new ComboOption ( "waveform-shape", _("Waveform shape"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_waveform_shape), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_waveform_shape) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_waveform_shape), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_waveform_shape) ); wfsh->add (Traditional, _("traditional")); @@ -2236,37 +2242,37 @@ RCOptionEditor::RCOptionEditor () add_option (_("Editor"), wfsh); - add_option (_("Editor"), new ClipLevelOptions (_ui_config)); + add_option (_("Editor"), new ClipLevelOptions ()); add_option (_("Editor"), new BoolOption ( "show-waveforms-while-recording", _("Show waveforms for audio while it is being recorded"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_show_waveforms_while_recording), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_show_waveforms_while_recording) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_waveforms_while_recording), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_waveforms_while_recording) )); add_option (_("Editor"), new BoolOption ( "show-zoom-tools", _("Show zoom toolbar"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_show_zoom_tools), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_show_zoom_tools) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_zoom_tools), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_zoom_tools) )); add_option (_("Editor"), new BoolOption ( "update-editor-during-summary-drag", _("Update editor window during drags of the summary"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_update_editor_during_summary_drag), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_update_editor_during_summary_drag) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_update_editor_during_summary_drag), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_update_editor_during_summary_drag) )); bo = new BoolOption ( "name-new-markers", _("Name new markers"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_name_new_markers), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_name_new_markers) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_name_new_markers), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_name_new_markers) ); add_option (_("Editor"), bo); @@ -2277,8 +2283,8 @@ RCOptionEditor::RCOptionEditor () new BoolOption ( "autoscroll-editor", _("Auto-scroll editor window when dragging near its edges"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_autoscroll_editor), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_autoscroll_editor) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_autoscroll_editor), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_autoscroll_editor) )); ComboOption *rsas = new ComboOption ( @@ -2389,23 +2395,23 @@ RCOptionEditor::RCOptionEditor () int dmsize = 1; dm->add (DenormalNone, _("no processor handling")); - FPU fpu; + FPU* fpu = FPU::instance(); - if (fpu.has_flush_to_zero()) { + if (fpu->has_flush_to_zero()) { ++dmsize; dm->add (DenormalFTZ, _("use FlushToZero")); } else if (_rc_config->get_denormal_model() == DenormalFTZ) { _rc_config->set_denormal_model(DenormalNone); } - if (fpu.has_denormals_are_zero()) { + if (fpu->has_denormals_are_zero()) { ++dmsize; dm->add (DenormalDAZ, _("use DenormalsAreZero")); } else if (_rc_config->get_denormal_model() == DenormalDAZ) { _rc_config->set_denormal_model(DenormalNone); } - if (fpu.has_flush_to_zero() && fpu.has_denormals_are_zero()) { + if (fpu->has_flush_to_zero() && fpu->has_denormals_are_zero()) { ++dmsize; dm->add (DenormalFTZDAZ, _("use FlushToZero and DenormalsAreZero")); } else if (_rc_config->get_denormal_model() == DenormalFTZDAZ) { @@ -2679,16 +2685,16 @@ RCOptionEditor::RCOptionEditor () new BoolOption ( "never-display-periodic-midi", _("Never display periodic MIDI messages (MTC, MIDI Clock)"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_never_display_periodic_midi), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_never_display_periodic_midi) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_never_display_periodic_midi), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_never_display_periodic_midi) )); add_option (_("MIDI"), new BoolOption ( "sound-midi-notes", _("Sound MIDI notes as they are selected"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_sound_midi_notes), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_sound_midi_notes) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_sound_midi_notes), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_sound_midi_notes) )); add_option (_("MIDI"), new OptionEditorHeading (_("Midi Audition"))); @@ -2761,29 +2767,42 @@ RCOptionEditor::RCOptionEditor () #if (defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT || defined AUDIOUNIT_SUPPORT) /* Plugin options (currrently VST only) */ - add_option (_("Plugins"), new PluginOptions (_rc_config, _ui_config)); + add_option (_("Plugins"), new PluginOptions (_rc_config)); #endif /* INTERFACE */ +#ifdef OPTIONAL_CAIRO_IMAGE_SURFACE + BoolOption* bgc = new BoolOption ( + "cairo-image-surface", + _("Disable Graphics Hardware Acceleration (requires restart)"), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_cairo_image_surface), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_cairo_image_surface) + ); + + Gtkmm2ext::UI::instance()->set_tip (bgc->tip_widget(), string_compose ( + _("Render large parts of the application user-interface in software, instead of using 2D-graphics acceleration.\nThis requires restarting %1 before having an effect"), PROGRAM_NAME)); + add_option (S_("Preferences|GUI"), bgc); +#endif + #ifdef CAIRO_SUPPORTS_FORCE_BUGGY_GRADIENTS_ENVIRONMENT_VARIABLE BoolOption* bgo = new BoolOption ( "buggy-gradients", - _("Possibly improve slow graphical performance"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_buggy_gradients), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_buggy_gradients) + _("Possibly improve slow graphical performance (requires restart)"), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_buggy_gradients), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_buggy_gradients) ); - Gtkmm2ext::UI::instance()->set_tip (bgo->tip_widget(), string_compose (_("This requires restarting %1 before having an effect"), PROGRAM_NAME)); + Gtkmm2ext::UI::instance()->set_tip (bgo->tip_widget(), string_compose (_("Disables hardware gradient rendering on buggy video drivers (\"buggy gradients patch\").\nThis requires restarting %1 before having an effect"), PROGRAM_NAME)); add_option (S_("Preferences|GUI"), bgo); #endif - + add_option (S_("Preferences|GUI"), new BoolOption ( "widget-prelight", _("Graphically indicate mouse pointer hovering over various widgets"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_widget_prelight), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_widget_prelight) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_widget_prelight), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_widget_prelight) )); #ifdef TOOLTIPS_GOT_FIXED @@ -2791,8 +2810,8 @@ RCOptionEditor::RCOptionEditor () new BoolOption ( "use-tooltips", _("Show tooltips if mouse hovers over a control"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_use_tooltips), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_use_tooltips) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_use_tooltips), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_use_tooltips) )); #endif @@ -2800,21 +2819,21 @@ RCOptionEditor::RCOptionEditor () new BoolOption ( "show-name-highlight", _("Use name highlight bars in region displays (requires a restart)"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_show_name_highlight), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_show_name_highlight) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_name_highlight), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_name_highlight) )); #ifndef GTKOSX /* font scaling does nothing with GDK/Quartz */ - add_option (S_("Preferences|GUI"), new FontScalingOptions (_ui_config)); + add_option (S_("Preferences|GUI"), new FontScalingOptions ()); #endif add_option (S_("GUI"), new BoolOption ( "super-rapid-clock-update", _("update transport clock display at FPS instead of every 100ms"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_super_rapid_clock_update), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_super_rapid_clock_update) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_super_rapid_clock_update), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_super_rapid_clock_update) )); @@ -2824,8 +2843,8 @@ RCOptionEditor::RCOptionEditor () HSliderOption *sics = new HSliderOption("waveform-cache-size", _("Waveform image cache size (megabytes)"), ics, - sigc::mem_fun (*ARDOUR_UI::config(), &UIConfiguration::get_waveform_cache_size), - sigc::mem_fun (*ARDOUR_UI::config(), &UIConfiguration::set_waveform_cache_size) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_waveform_cache_size), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_waveform_cache_size) ); sics->scale().set_digits (0); Gtkmm2ext::UI::instance()->set_tip @@ -2839,8 +2858,8 @@ RCOptionEditor::RCOptionEditor () HSliderOption *slts = new HSliderOption("lock-gui-after-seconds", _("Lock timeout (seconds)"), lts, - sigc::mem_fun (*ARDOUR_UI::config(), &UIConfiguration::get_lock_gui_after_seconds), - sigc::mem_fun (*ARDOUR_UI::config(), &UIConfiguration::set_lock_gui_after_seconds) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_lock_gui_after_seconds), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_lock_gui_after_seconds) ); slts->scale().set_digits (0); Gtkmm2ext::UI::instance()->set_tip @@ -2863,8 +2882,8 @@ RCOptionEditor::RCOptionEditor () new VisibilityOption ( _("Mixer Strip"), &_mixer_strip_visibility, - sigc::mem_fun (*_ui_config, &UIConfiguration::get_mixer_strip_visibility), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_mixer_strip_visibility) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_mixer_strip_visibility), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_mixer_strip_visibility) ) ); @@ -2872,8 +2891,8 @@ RCOptionEditor::RCOptionEditor () new BoolOption ( "default-narrow_ms", _("Use narrow strips in the mixer by default"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_default_narrow_ms), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_default_narrow_ms) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_default_narrow_ms), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_default_narrow_ms) )); add_option (S_("Preferences|Metering"), new OptionEditorHeading (_("Metering"))); @@ -2881,8 +2900,8 @@ RCOptionEditor::RCOptionEditor () ComboOption* mht = new ComboOption ( "meter-hold", _("Peak hold time"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_meter_hold), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_meter_hold) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_meter_hold), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_meter_hold) ); mht->add (MeterHoldOff, _("off")); @@ -2902,20 +2921,18 @@ RCOptionEditor::RCOptionEditor () mfo->add (METER_FALLOFF_OFF, _("off")); mfo->add (METER_FALLOFF_SLOWEST, _("slowest [6.6dB/sec]")); mfo->add (METER_FALLOFF_SLOW, _("slow [8.6dB/sec] (BBC PPM, EBU PPM)")); - mfo->add (METER_FALLOFF_SLOWISH, _("slowish [12.0dB/sec] (DIN)")); - mfo->add (METER_FALLOFF_MODERATE, _("moderate [13.3dB/sec] (EBU Digi PPM, IRT Digi PPM)")); - mfo->add (METER_FALLOFF_MEDIUM, _("medium [20dB/sec]")); - mfo->add (METER_FALLOFF_FAST, _("fast [32dB/sec]")); - mfo->add (METER_FALLOFF_FASTER, _("faster [46dB/sec]")); - mfo->add (METER_FALLOFF_FASTEST, _("fastest [70dB/sec]")); + mfo->add (METER_FALLOFF_SLOWISH, _("moderate [12.0dB/sec] (DIN)")); + mfo->add (METER_FALLOFF_MODERATE, _("medium [13.3dB/sec] (EBU Digi PPM, IRT Digi PPM)")); + mfo->add (METER_FALLOFF_MEDIUM, _("fast [20dB/sec]")); + mfo->add (METER_FALLOFF_FAST, _("very fast [32dB/sec]")); add_option (S_("Preferences|Metering"), mfo); ComboOption* mlu = new ComboOption ( "meter-line-up-level", _("Meter line-up level; 0dBu"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_meter_line_up_level), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_meter_line_up_level) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_meter_line_up_level), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_meter_line_up_level) ); mlu->add (MeteringLineUp24, _("-24dBFS (SMPTE US: 4dBu = -20dBFS)")); @@ -2930,8 +2947,8 @@ RCOptionEditor::RCOptionEditor () ComboOption* mld = new ComboOption ( "meter-line-up-din", _("IEC1/DIN Meter line-up level; 0dBu"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_meter_line_up_din), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_meter_line_up_din) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_meter_line_up_din), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_meter_line_up_din) ); mld->add (MeteringLineUp24, _("-24dBFS (SMPTE US: 4dBu = -20dBFS)")); @@ -2946,8 +2963,8 @@ RCOptionEditor::RCOptionEditor () ComboOption* mvu = new ComboOption ( "meter-vu-standard", _("VU Meter standard"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_meter_vu_standard), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_meter_vu_standard) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_meter_vu_standard), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_meter_vu_standard) ); mvu->add (MeteringVUfrench, _("0VU = -2dBu (France)")); @@ -2961,8 +2978,8 @@ RCOptionEditor::RCOptionEditor () HSliderOption *mpks = new HSliderOption("meter-peak", _("Peak threshold [dBFS]"), mpk, - sigc::mem_fun (*_ui_config, &UIConfiguration::get_meter_peak), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_meter_peak) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_meter_peak), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_meter_peak) ); @@ -3023,8 +3040,8 @@ RCOptionEditor::RCOptionEditor () new BoolOption ( "meter-style-led", _("LED meter style"), - sigc::mem_fun (*_ui_config, &UIConfiguration::get_meter_style_led), - sigc::mem_fun (*_ui_config, &UIConfiguration::set_meter_style_led) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_meter_style_led), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_meter_style_led) )); /* and now the theme manager */