X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fsession_option_editor.cc;h=a2f0227d3f4bdfa4403bc724a0d20a5f44f162ba;hb=154f9825ff72d691ba550de573948424b81a09a6;hp=240c6f5db4ec2df2a21b632f663c9efeb64f7b9c;hpb=abd80d0f64a4b32c3a8cce01c9aa1d6bc7ee64bb;p=ardour.git diff --git a/gtk2_ardour/session_option_editor.cc b/gtk2_ardour/session_option_editor.cc index 240c6f5db4..a2f0227d3f 100644 --- a/gtk2_ardour/session_option_editor.cc +++ b/gtk2_ardour/session_option_editor.cc @@ -1,185 +1,57 @@ -#include "ardour/session.h" -#include "ardour/io.h" -#include "ardour/auditioner.h" -#include "ardour/audioengine.h" -#include "ardour/port.h" -#include "session_option_editor.h" -#include "port_matrix.h" -#include "i18n.h" - -using namespace std; -using namespace sigc; -using namespace ARDOUR; - -class OptionsPortMatrix : public PortMatrix -{ -public: - OptionsPortMatrix (Gtk::Window* parent, ARDOUR::Session* session) - : PortMatrix (parent, session, DataType::AUDIO) - { - _port_group.reset (new PortGroup ("")); - _ports[OURS].add_group (_port_group); - - setup_all_ports (); - init (); - } - - void setup_ports (int dim) - { - if (dim == OURS) { - _port_group->clear (); - _port_group->add_bundle (_session->click_io()->bundle()); - _port_group->add_bundle (_session->the_auditioner()->output()->bundle()); - } else { - _ports[OTHER].gather (_session, true, false); - } - } - - void set_state (ARDOUR::BundleChannel c[2], bool s) - { - Bundle::PortList const & our_ports = c[OURS].bundle->channel_ports (c[OURS].channel); - Bundle::PortList const & other_ports = c[OTHER].bundle->channel_ports (c[OTHER].channel); - - if (c[OURS].bundle == _session->click_io()->bundle()) { - - for (ARDOUR::Bundle::PortList::const_iterator i = our_ports.begin(); i != our_ports.end(); ++i) { - for (ARDOUR::Bundle::PortList::const_iterator j = other_ports.begin(); j != other_ports.end(); ++j) { +/* + Copyright (C) 2000-2010 Paul Davis - Port* f = _session->engine().get_port_by_name (*i); - assert (f); + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. - if (s) { - _session->click_io()->connect (f, *j, 0); - } else { - _session->click_io()->disconnect (f, *j, 0); - } - } - } - } - } - - PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const - { - Bundle::PortList const & our_ports = c[OURS].bundle->channel_ports (c[OURS].channel); - Bundle::PortList const & other_ports = c[OTHER].bundle->channel_ports (c[OTHER].channel); + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - if (c[OURS].bundle == _session->click_io()->bundle()) { + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - for (ARDOUR::Bundle::PortList::const_iterator i = our_ports.begin(); i != our_ports.end(); ++i) { - for (ARDOUR::Bundle::PortList::const_iterator j = other_ports.begin(); j != other_ports.end(); ++j) { - Port* f = _session->engine().get_port_by_name (*i); - assert (f); - - if (f->connected_to (*j)) { - return PortMatrixNode::ASSOCIATED; - } else { - return PortMatrixNode::NOT_ASSOCIATED; - } - } - } - - } else { - - /* XXX */ - - } - - return PortMatrixNode::NOT_ASSOCIATED; - } - - bool list_is_global (int dim) const { - return (dim == OTHER); - } +*/ - bool can_remove_channels (boost::shared_ptr) const { - return false; - } - - void remove_channel (ARDOUR::BundleChannel) {} - - std::string disassociation_verb () const { - return _("Disassociate"); - } - -private: - /* see PortMatrix: signal flow from 0 to 1 (out to in) */ - enum { - OURS = 0, - OTHER = 1, - }; - - boost::shared_ptr _port_group; - -}; - - -class ConnectionOptions : public OptionEditorBox -{ -public: - ConnectionOptions (Gtk::Window* parent, ARDOUR::Session* s) - : _port_matrix (parent, s) - { - _box->pack_start (_port_matrix); - } - - void parameter_changed (string const &) - { - - } - - void set_state_from_config () - { +#include "ardour/session.h" +#include "ardour/transport_master_manager.h" - } +#include "actions.h" +#include "gui_thread.h" +#include "session_option_editor.h" +#include "search_path_option.h" +#include "pbd/i18n.h" -private: - OptionsPortMatrix _port_matrix; -}; +using namespace std; +using namespace ARDOUR; +using namespace Timecode; SessionOptionEditor::SessionOptionEditor (Session* s) - : OptionEditor (&(s->config), _("Session Preferences")) + : OptionEditorWindow (&(s->config), _("Session Properties")) , _session_config (&(s->config)) { - /* SYNC */ - - ComboOption* spf = new ComboOption ( - "subframes-per-frame", - _("Subframes per frame"), - mem_fun (*_session_config, &SessionConfiguration::get_subframes_per_frame), - mem_fun (*_session_config, &SessionConfiguration::set_subframes_per_frame) - ); + set_session (s); - spf->add (80, _("80")); - spf->add (100, _("100")); + set_name ("SessionProperties"); - add_option (_("Sync"), spf); + /* TIMECODE*/ - ComboOption* ssrc = new ComboOption ( - "sync-source", - _("External sync source"), - mem_fun (*_session_config, &SessionConfiguration::get_sync_source), - mem_fun (*_session_config, &SessionConfiguration::set_sync_source) - ); - - s->MTC_PortChanged.connect (bind (mem_fun (*this, &SessionOptionEditor::populate_sync_options), s, ssrc)); - s->MIDIClock_PortChanged.connect (bind (mem_fun (*this, &SessionOptionEditor::populate_sync_options), s, ssrc)); - s->config.ParameterChanged.connect (bind (mem_fun (*this, &SessionOptionEditor::follow_sync_state), s, ssrc)); - - populate_sync_options (s, ssrc); - follow_sync_state (string ("external-sync"), s, ssrc); - - add_option (_("Sync"), ssrc); + add_option (_("Timecode"), new OptionEditorHeading (_("Timecode Settings"))); ComboOption* smf = new ComboOption ( "timecode-format", - _("Timecode frames-per-second"), - mem_fun (*_session_config, &SessionConfiguration::get_timecode_format), - mem_fun (*_session_config, &SessionConfiguration::set_timecode_format) + _("Timecode samples-per-second"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_timecode_format), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_timecode_format) ); smf->add (timecode_23976, _("23.976")); smf->add (timecode_24, _("24")); - smf->add (timecode_24976, _("24.976")); + smf->add (timecode_24976, _("24.975")); smf->add (timecode_25, _("25")); smf->add (timecode_2997, _("29.97")); smf->add (timecode_2997drop, _("29.97 drop")); @@ -188,189 +60,396 @@ SessionOptionEditor::SessionOptionEditor (Session* s) smf->add (timecode_5994, _("59.94")); smf->add (timecode_60, _("60")); - add_option (_("Sync"), smf); + add_option (_("Timecode"), smf); - add_option (_("Sync"), new BoolOption ( - "timecode-source-is-synced", - _("Timecode source shares sample clock with audio interface"), - mem_fun (*_session_config, &SessionConfiguration::get_timecode_source_is_synced), - mem_fun (*_session_config, &SessionConfiguration::set_timecode_source_is_synced) - )); - - ComboOption* vpu = new ComboOption ( + _vpu = new ComboOption ( "video-pullup", _("Pull-up / pull-down"), - mem_fun (*_session_config, &SessionConfiguration::get_video_pullup), - mem_fun (*_session_config, &SessionConfiguration::set_video_pullup) + sigc::mem_fun (*_session_config, &SessionConfiguration::get_video_pullup), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_video_pullup) ); - vpu->add (4.1667 + 0.1, _("4.1667 + 0.1%")); - vpu->add (4.1667, _("4.1667")); - vpu->add (4.1667 - 0.1, _("4.1667 - 0.1%")); - vpu->add (0.1, _("0.1")); - vpu->add (0, _("none")); - vpu->add (-0.1, _("-0.1")); - vpu->add (-4.1667 + 0.1, _("-4.1667 + 0.1%")); - vpu->add (-4.1667, _("-4.1667")); - vpu->add (-4.1667 - 0.1, _("-4.1667 - 0.1%")); + _vpu->add (4.1667 + 0.1, _("4.1667 + 0.1%")); + _vpu->add (4.1667, _("4.1667")); + _vpu->add (4.1667 - 0.1, _("4.1667 - 0.1%")); + _vpu->add (0.1, _("0.1")); + _vpu->add (0, _("none")); + _vpu->add (-0.1, _("-0.1")); + _vpu->add (-4.1667 + 0.1, _("-4.1667 + 0.1%")); + _vpu->add (-4.1667, _("-4.1667")); + _vpu->add (-4.1667 - 0.1, _("-4.1667 - 0.1%")); + + add_option (_("Timecode"), _vpu); + add_option (_("Timecode"), new OptionEditorHeading (_("Ext Timecode Offsets"))); + + ClockOption* sco = new ClockOption ( + "slave-timecode-offset", + _("Slave Timecode offset"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_slave_timecode_offset), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_slave_timecode_offset) + ); - add_option (_("Sync"), vpu); + sco->set_session (_session); + sco->clock().set_negative_allowed (true); + Gtkmm2ext::UI::instance()->set_tip (sco->tip_widget(), _("The specified offset is added to the received timecode (MTC or LTC).")); - /* FADES */ + add_option (_("Timecode"), sco); - ComboOption* cfm = new ComboOption ( - "xfade-model", - _("Crossfades are created"), - mem_fun (*_session_config, &SessionConfiguration::get_xfade_model), - mem_fun (*_session_config, &SessionConfiguration::set_xfade_model) + ClockOption* gco = new ClockOption ( + "timecode-generator-offset", + _("Timecode Generator offset"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_timecode_generator_offset), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_timecode_generator_offset) ); - cfm->add (FullCrossfade, _("to span entire overlap")); - cfm->add (ShortCrossfade, _("short")); + gco->set_session (_session); + gco->clock().set_negative_allowed (true); + Gtkmm2ext::UI::instance()->set_tip (gco->tip_widget(), _("Specify an offset which is added to the generated timecode (so far only LTC).")); - add_option (_("Fades"), cfm); + add_option (_("Timecode"), gco); - add_option (_("Fades"), new SpinOption ( - _("short-xfade-seconds"), - _("Short crossfade length"), - mem_fun (*_session_config, &SessionConfiguration::get_short_xfade_seconds), - mem_fun (*_session_config, &SessionConfiguration::set_short_xfade_seconds), - 0, 1000, 1, 10, - _("ms"), 0.001 + add_option (_("Timecode"), new OptionEditorHeading (_("JACK Transport/Time Settings"))); + + add_option (_("Timecode"), new BoolOption ( + "jack-time-master", + string_compose (_("%1 is JACK Time Master (provides Bar|Beat|Tick and other information to JACK)"), PROGRAM_NAME), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_jack_time_master), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_jack_time_master) + )); + + /* Sync */ + + add_option (_("Sync"), new OptionEditorHeading (_("A/V Synchronization"))); + add_option (_("Sync"), new BoolOption ( + "use-video-file-fps", + _("Use Video File's FPS Instead of Timecode Value for Timeline and Video Monitor."), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_use_video_file_fps), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_use_video_file_fps) )); + add_option (_("Sync"), new BoolOption ( + "videotimeline-pullup", + _("Apply Pull-Up/Down to Video Timeline and Video Monitor (Unless using JACK-sync)."), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_videotimeline_pullup), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_videotimeline_pullup) + )); + + add_option (_("Sync"), new OptionEditorBlank ()); + + /* FADES */ + + add_option (_("Fades"), new OptionEditorHeading (_("Audio Fades"))); add_option (_("Fades"), new SpinOption ( _("destructive-xfade-seconds"), _("Destructive crossfade length"), - mem_fun (*_session_config, &SessionConfiguration::get_destructive_xfade_msecs), - mem_fun (*_session_config, &SessionConfiguration::set_destructive_xfade_msecs), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_destructive_xfade_msecs), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_destructive_xfade_msecs), 0, 1000, 1, 10, _("ms") )); add_option (_("Fades"), new BoolOption ( - "auto-xfade", - _("Create crossfades automatically"), - mem_fun (*_session_config, &SessionConfiguration::get_auto_xfade), - mem_fun (*_session_config, &SessionConfiguration::set_auto_xfade) - )); - - add_option (_("Fades"), new BoolOption ( - "xfades-active", - _("Crossfades active"), - mem_fun (*_session_config, &SessionConfiguration::get_xfades_active), - mem_fun (*_session_config, &SessionConfiguration::set_xfades_active) + "use-transport-fades", + _("Declick when transport starts and stops"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_use_transport_fades), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_use_transport_fades) )); add_option (_("Fades"), new BoolOption ( - "xfades-visible", - _("Crossfades visible"), - mem_fun (*_session_config, &SessionConfiguration::get_xfades_visible), - mem_fun (*_session_config, &SessionConfiguration::set_xfades_visible) + "use-monitor-fades", + _("Declick when monitor state changes"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_use_monitor_fades), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_use_monitor_fades) )); add_option (_("Fades"), new BoolOption ( "use-region-fades", _("Region fades active"), - mem_fun (*_session_config, &SessionConfiguration::get_use_region_fades), - mem_fun (*_session_config, &SessionConfiguration::set_use_region_fades) + sigc::mem_fun (*_session_config, &SessionConfiguration::get_use_region_fades), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_use_region_fades) )); add_option (_("Fades"), new BoolOption ( "show-region-fades", _("Region fades visible"), - mem_fun (*_session_config, &SessionConfiguration::get_show_region_fades), - mem_fun (*_session_config, &SessionConfiguration::set_show_region_fades) + sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_region_fades), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_region_fades) )); - /* MISC */ + /* Media */ - add_option (_("Misc"), new OptionEditorHeading (_("Audio file format"))); + add_option (_("Media"), new OptionEditorHeading (_("Audio File Format"))); - ComboOption* sf = new ComboOption ( + _sf = new ComboOption ( "native-file-data-format", _("Sample format"), - mem_fun (*_session_config, &SessionConfiguration::get_native_file_data_format), - mem_fun (*_session_config, &SessionConfiguration::set_native_file_data_format) + sigc::mem_fun (*_session_config, &SessionConfiguration::get_native_file_data_format), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_native_file_data_format) ); - - sf->add (FormatFloat, _("32-bit floating point")); - sf->add (FormatInt24, _("24-bit integer")); - sf->add (FormatInt16, _("16-bit integer")); - - add_option (_("Misc"), sf); + add_option (_("Media"), _sf); + /* refill available sample-formats, depening on file-format */ + parameter_changed ("native-file-header-format"); ComboOption* hf = new ComboOption ( "native-file-header-format", _("File type"), - mem_fun (*_session_config, &SessionConfiguration::get_native_file_header_format), - mem_fun (*_session_config, &SessionConfiguration::set_native_file_header_format) + sigc::mem_fun (*_session_config, &SessionConfiguration::get_native_file_header_format), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_native_file_header_format) ); - hf->add (BWF, _("Broadcast WAVE")); - hf->add (WAVE, _("WAVE")); + hf->add (BWF, _("Broadcast WAVE (4GB size limit)")); +#ifdef HAVE_RF64_RIFF + hf->add (MBWF, _("Broadcast RF64")); +#endif + hf->add (WAVE, _("WAVE (4GB size limit)")); hf->add (WAVE64, _("WAVE-64")); hf->add (CAF, _("CAF")); + hf->add (RF64, _("RF64")); +#ifdef HAVE_RF64_RIFF + hf->add (RF64_WAV, _("RF64 (WAV compatible)")); +#endif + hf->add (FLAC, _("FLAC")); + + add_option (_("Media"), hf); + + add_option (S_("Files|Locations"), new OptionEditorHeading (_("File Locations"))); + + SearchPathOption* spo = new SearchPathOption ("audio-search-path", _("Search for audio files in:"), + _session->path(), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_audio_search_path), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_audio_search_path)); + add_option (S_("Files|Locations"), spo); + + spo = new SearchPathOption ("midi-search-path", _("Search for MIDI files in:"), + _session->path(), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_midi_search_path), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_midi_search_path)); + + add_option (S_("Files|Locations"), spo); + + /* File Naming */ + + add_option (_("Filenames"), new OptionEditorHeading (_("File Naming"))); + + BoolOption *bo; + + bo = new RouteDisplayBoolOption ( + "track-name-number", + _("Prefix Track number"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_track_name_number), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_track_name_number) + ); + Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget(), + _("Adds the current track number to the beginning of the recorded file name.")); + add_option (_("Filenames"), bo); + + bo = new BoolOption ( + "track-name-take", + _("Prefix Take Name"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_track_name_take), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_track_name_take) + ); + Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget(), + _("Adds the Take Name to the beginning of the recorded file name.")); + add_option (_("Filenames"), bo); + + _take_name = new EntryOption ( + "take-name", + _("Take Name"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_take_name), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_take_name) + ); + _take_name->set_invalid_chars("."); + _take_name->set_sensitive(_session_config->get_track_name_take()); - add_option (_("Misc"), hf); + add_option (_("Filenames"), _take_name); - add_option (_("Misc"), new OptionEditorHeading (_("Layering"))); + /* Monitoring */ - ComboOption* lm = new ComboOption ( - "layer-model", - _("Layering model in overlaid mode"), - mem_fun (*_session_config, &SessionConfiguration::get_layer_model), - mem_fun (*_session_config, &SessionConfiguration::set_layer_model) - ); + add_option (_("Monitoring"), new OptionEditorHeading (_("Monitoring"))); + add_option (_("Monitoring"), new BoolOption ( + "auto-input", + _("Track Input Monitoring automatically follows transport state (\"auto-input\")"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_auto_input), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_auto_input) + )); - lm->add (LaterHigher, _("later is higher")); - lm->add (MoveAddHigher, _("most recently moved or added is higher")); - lm->add (AddHigher, _("most recently added is higher")); + add_option (_("Monitoring"), new CheckOption ( + "have-monitor-section", + _("Use monitor section in this session"), + ActionManager::get_action(X_("Monitor"), "UseMonitorSection") + )); - add_option (_("Misc"), lm); + add_option (_("Monitoring"), new OptionEditorBlank ()); - add_option (_("Misc"), new OptionEditorHeading (_("Broadcast WAVE metadata"))); + /* Meterbridge */ + add_option (_("Meterbridge"), new OptionEditorHeading (_("Route Display"))); - add_option (_("Misc"), new EntryOption ( - "bwf-country-code", - _("Country code"), - mem_fun (*_session_config, &SessionConfiguration::get_bwf_country_code), - mem_fun (*_session_config, &SessionConfiguration::set_bwf_country_code) + add_option (_("Meterbridge"), new BoolOption ( + "show-midi-on-meterbridge", + _("Show Midi Tracks"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_midi_on_meterbridge), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_midi_on_meterbridge) )); - add_option (_("Misc"), new EntryOption ( - "bwf-organization-code", - _("Organization code"), - mem_fun (*_session_config, &SessionConfiguration::get_bwf_organization_code), - mem_fun (*_session_config, &SessionConfiguration::set_bwf_organization_code) + add_option (_("Meterbridge"), new BoolOption ( + "show-busses-on-meterbridge", + _("Show Busses"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_busses_on_meterbridge), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_busses_on_meterbridge) )); - add_option (_("Connections"), new ConnectionOptions (this, s)); -} + add_option (_("Meterbridge"), new BoolOption ( + "show-master-on-meterbridge", + _("Include Master Bus"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_master_on_meterbridge), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_master_on_meterbridge) + )); -void -SessionOptionEditor::populate_sync_options (Session* s, Option* opt) -{ - ComboOption* sync_opt = dynamic_cast* > (opt); + add_option (_("Meterbridge"), new OptionEditorHeading (_("Button Area"))); - vector sync_opts = s->get_available_sync_options (); + add_option (_("Meterbridge"), new BoolOption ( + "show-rec-on-meterbridge", + _("Rec-enable Button"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_rec_on_meterbridge), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_rec_on_meterbridge) + )); - sync_opt->clear (); + add_option (_("Meterbridge"), new BoolOption ( + "show-mute-on-meterbridge", + _("Mute Button"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_mute_on_meterbridge), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_mute_on_meterbridge) + )); - for (vector::iterator i = sync_opts.begin(); i != sync_opts.end(); ++i) { - sync_opt->add (*i, sync_source_to_string (*i)); - } + add_option (_("Meterbridge"), new BoolOption ( + "show-solo-on-meterbridge", + _("Solo Button"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_solo_on_meterbridge), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_solo_on_meterbridge) + )); + + add_option (_("Meterbridge"), new BoolOption ( + "show-monitor-on-meterbridge", + _("Monitor Buttons"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_monitor_on_meterbridge), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_monitor_on_meterbridge) + )); + + add_option (_("Meterbridge"), new OptionEditorHeading (_("Name Labels"))); + + add_option (_("Meterbridge"), new BoolOption ( + "show-name-on-meterbridge", + _("Track Name"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_name_on_meterbridge), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_name_on_meterbridge) + )); + + add_option (_("Meterbridge"), new OptionEditorBlank ()); + + /* Misc */ + + add_option (_("Misc"), new OptionEditorHeading (_("MIDI Options"))); + + add_option (_("Misc"), new BoolOption ( + "midi-copy-is-fork", + _("MIDI region copies are independent"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_midi_copy_is_fork), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_midi_copy_is_fork) + )); + + ComboOption* li = new ComboOption ( + "insert-merge-policy", + _("Policy for handling overlapping notes\n on the same MIDI channel"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_insert_merge_policy), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_insert_merge_policy) + ); + + li->add (InsertMergeReject, _("never allow them")); + li->add (InsertMergeRelax, _("don't do anything in particular")); + li->add (InsertMergeReplace, _("replace any overlapped existing note")); + li->add (InsertMergeTruncateExisting, _("shorten the overlapped existing note")); + li->add (InsertMergeTruncateAddition, _("shorten the overlapping new note")); + li->add (InsertMergeExtend, _("replace both overlapping notes with a single note")); + + add_option (_("Misc"), li); + + add_option (_("Misc"), new OptionEditorHeading (_("Glue to Bars and Beats"))); + + add_option (_("Misc"), new BoolOption ( + "glue-new-markers-to-bars-and-beats", + _("Glue new markers to bars and beats"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_glue_new_markers_to_bars_and_beats), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_glue_new_markers_to_bars_and_beats) + )); + + add_option (_("Misc"), new BoolOption ( + "glue-new-regions-to-bars-and-beats", + _("Glue new regions to bars and beats"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_glue_new_regions_to_bars_and_beats), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_glue_new_regions_to_bars_and_beats) + )); + + add_option (_("Misc"), new OptionEditorHeading (_("Metronome"))); + + add_option (_("Misc"), new BoolOption ( + "count-in", + _("Always count-in when recording"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_count_in), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_count_in) + )); + + add_option (_("Misc"), new OptionEditorHeading (_("Defaults"))); + + Gtk::Button* btn = Gtk::manage (new Gtk::Button (_("Use these settings as defaults"))); + btn->signal_clicked().connect (sigc::mem_fun (*this, &SessionOptionEditor::save_defaults)); + add_option (_("Misc"), new FooOption (btn)); + + set_current_page (_("Timecode")); } void -SessionOptionEditor::follow_sync_state (std::string p, Session* s, Option* opt) +SessionOptionEditor::parameter_changed (std::string const & p) { - ComboOption* sync_opt = dynamic_cast* > (opt); + OptionEditor::parameter_changed (p); if (p == "external-sync") { - if (s->config.get_external_sync()) { - sync_opt->set_sensitive (false); + if (TransportMasterManager::instance().current()->type() == Engine) { + _vpu->set_sensitive(!_session_config->get_external_sync()); + } else { + _vpu->set_sensitive(true); + } + } + else if (p == "timecode-format") { + /* update offset clocks */ + parameter_changed("timecode-generator-offset"); + parameter_changed("slave-timecode-offset"); + } + else if (p == "track-name-take") { + _take_name->set_sensitive(_session_config->get_track_name_take()); + } + else if (p == "native-file-header-format") { + bool need_refill = true; + _sf->clear (); + if (_session_config->get_native_file_header_format() == FLAC) { + _sf->add (FormatInt24, _("24-bit integer")); + _sf->add (FormatInt16, _("16-bit integer")); + if (_session_config->get_native_file_data_format() == FormatFloat) { + _session_config->set_native_file_data_format (FormatInt24); + need_refill = false; + } } else { - sync_opt->set_sensitive (true); + _sf->add (FormatFloat, _("32-bit floating point")); + _sf->add (FormatInt24, _("24-bit integer")); + _sf->add (FormatInt16, _("16-bit integer")); + } + if (need_refill) { + parameter_changed ("native-file-data-format"); } } } + +void +SessionOptionEditor::save_defaults () +{ + _session->save_default_options(); +}