X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fsession_option_editor.cc;h=1815db10567e21f60c288ae81011e5fe0f59c1e1;hb=0013feddbf260f0b57ee74786c316739806ea47a;hp=e5cd7780f19a378f6b097e181f4adf933cf26435;hpb=508c5eb5bd7e31d721c3a29fc734aab3a44aa8a9;p=ardour.git diff --git a/gtk2_ardour/session_option_editor.cc b/gtk2_ardour/session_option_editor.cc index e5cd7780f1..1815db1056 100644 --- a/gtk2_ardour/session_option_editor.cc +++ b/gtk2_ardour/session_option_editor.cc @@ -18,10 +18,6 @@ */ #include "ardour/session.h" -#include "ardour/io.h" -#include "ardour/auditioner.h" -#include "ardour/audioengine.h" -#include "ardour/port.h" #include "gui_thread.h" #include "session_option_editor.h" @@ -30,6 +26,7 @@ using namespace std; using namespace ARDOUR; +using namespace Timecode; SessionOptionEditor::SessionOptionEditor (Session* s) : OptionEditor (&(s->config), _("Session Properties")) @@ -41,18 +38,6 @@ SessionOptionEditor::SessionOptionEditor (Session* s) /* TIMECODE*/ - _sync_source = new ComboOption ( - "sync-source", - _("External timecode source"), - sigc::mem_fun (*_session_config, &SessionConfiguration::get_sync_source), - sigc::mem_fun (*_session_config, &SessionConfiguration::set_sync_source) - ); - - populate_sync_options (); - parameter_changed (string ("external-sync")); - - add_option (_("Timecode"), _sync_source); - add_option (_("Timecode"), new OptionEditorHeading (_("Timecode Settings"))); ComboOption* smf = new ComboOption ( @@ -64,7 +49,7 @@ SessionOptionEditor::SessionOptionEditor (Session* s) 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")); @@ -75,93 +60,89 @@ SessionOptionEditor::SessionOptionEditor (Session* s) add_option (_("Timecode"), smf); - ComboOption* spf = new ComboOption ( - "subframes-per-frame", - _("Subframes per frame"), - sigc::mem_fun (*_session_config, &SessionConfiguration::get_subframes_per_frame), - sigc::mem_fun (*_session_config, &SessionConfiguration::set_subframes_per_frame) - ); - - spf->add (80, _("80")); - spf->add (100, _("100")); - - add_option (_("Timecode"), spf); - - add_option (_("Timecode"), new BoolOption ( - "timecode-source-is-synced", - _("Timecode source shares sample clock with audio interface"), - sigc::mem_fun (*_session_config, &SessionConfiguration::get_timecode_source_is_synced), - sigc::mem_fun (*_session_config, &SessionConfiguration::set_timecode_source_is_synced) - )); - - ComboOption* vpu = new ComboOption ( + _vpu = new ComboOption ( "video-pullup", _("Pull-up / pull-down"), 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%")); - - add_option (_("Timecode"), vpu); - - ClockOption* co = new ClockOption ( - "timecode-offset", - _("Timecode Offset"), - sigc::mem_fun (*_session_config, &SessionConfiguration::get_timecode_offset), - sigc::mem_fun (*_session_config, &SessionConfiguration::set_timecode_offset) + _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 (_("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 in JACK-sync)."), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_videotimeline_pullup), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_videotimeline_pullup) + )); + + 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) ); - co->set_session (_session); + 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).")); - add_option (_("Timecode"), co); + add_option (_("Timecode"), sco); - add_option (_("Timecode"), new BoolOption ( - "timecode-offset-negative", - _("Timecode Offset Negative"), - sigc::mem_fun (*_session_config, &SessionConfiguration::get_timecode_offset_negative), - sigc::mem_fun (*_session_config, &SessionConfiguration::set_timecode_offset_negative) - )); + 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) + ); + + 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 (_("Timecode"), gco); add_option (_("Timecode"), new OptionEditorHeading (_("JACK Transport/Time Settings"))); add_option (_("Timecode"), new BoolOption ( "jack-time-master", - _("Ardour is JACK Time Master (provides Bar|Beat|Tick and other information to JACK)"), + 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) )); /* FADES */ - ComboOption* cfm = new ComboOption ( - "xfade-model", - _("Crossfades are created"), - sigc::mem_fun (*_session_config, &SessionConfiguration::get_xfade_model), - sigc::mem_fun (*_session_config, &SessionConfiguration::set_xfade_model) + ComboOption* cfc = new ComboOption ( + "xfade-choice", + _("Default crossfade type"), + sigc::mem_fun (*_session_config, &SessionConfiguration::get_xfade_choice), + sigc::mem_fun (*_session_config, &SessionConfiguration::set_xfade_choice) ); - cfm->add (FullCrossfade, _("to span entire overlap")); - cfm->add (ShortCrossfade, _("short")); + cfc->add (ConstantPowerMinus3dB, _("Constant power (-3dB) crossfade")); + cfc->add (ConstantPowerMinus6dB, _("Linear (-6dB) crossfade")); - add_option (_("Fades"), cfm); - - add_option (_("Fades"), new SpinOption ( - _("short-xfade-seconds"), - _("Short crossfade length"), - sigc::mem_fun (*_session_config, &SessionConfiguration::get_short_xfade_seconds), - sigc::mem_fun (*_session_config, &SessionConfiguration::set_short_xfade_seconds), - 0, 1000, 1, 10, - _("ms"), 0.001 - )); + add_option (_("Fades"), cfc); add_option (_("Fades"), new SpinOption ( _("destructive-xfade-seconds"), @@ -172,27 +153,6 @@ SessionOptionEditor::SessionOptionEditor (Session* s) _("ms") )); - add_option (_("Fades"), new BoolOption ( - "auto-xfade", - _("Create crossfades automatically"), - sigc::mem_fun (*_session_config, &SessionConfiguration::get_auto_xfade), - sigc::mem_fun (*_session_config, &SessionConfiguration::set_auto_xfade) - )); - - add_option (_("Fades"), new BoolOption ( - "xfades-active", - _("Crossfades active"), - sigc::mem_fun (*_session_config, &SessionConfiguration::get_xfades_active), - sigc::mem_fun (*_session_config, &SessionConfiguration::set_xfades_active) - )); - - add_option (_("Fades"), new BoolOption ( - "xfades-visible", - _("Crossfades visible"), - sigc::mem_fun (*_session_config, &SessionConfiguration::get_xfades_visible), - sigc::mem_fun (*_session_config, &SessionConfiguration::set_xfades_visible) - )); - add_option (_("Fades"), new BoolOption ( "use-region-fades", _("Region fades active"), @@ -241,11 +201,13 @@ SessionOptionEditor::SessionOptionEditor (Session* s) add_option (_("Media"), 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 (_("Media"), 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)); @@ -255,7 +217,7 @@ SessionOptionEditor::SessionOptionEditor (Session* s) add_option (_("Monitoring"), new BoolOption ( "auto-input", - _("Monitoring automatically follows transport state (\"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) )); @@ -280,7 +242,7 @@ SessionOptionEditor::SessionOptionEditor (Session* s) ComboOption* li = new ComboOption ( "insert-merge-policy", - _("Policy for handling same note\nand channel overlaps"), + _("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) ); @@ -294,22 +256,6 @@ SessionOptionEditor::SessionOptionEditor (Session* s) add_option (_("Misc"), li); - add_option (_("Misc"), new OptionEditorHeading (_("Broadcast WAVE metadata"))); - - add_option (_("Misc"), new EntryOption ( - "bwf-country-code", - _("Country code"), - sigc::mem_fun (*_session_config, &SessionConfiguration::get_bwf_country_code), - sigc::mem_fun (*_session_config, &SessionConfiguration::set_bwf_country_code) - )); - - add_option (_("Misc"), new EntryOption ( - "bwf-organization-code", - _("Organization code"), - sigc::mem_fun (*_session_config, &SessionConfiguration::get_bwf_organization_code), - sigc::mem_fun (*_session_config, &SessionConfiguration::set_bwf_organization_code) - )); - add_option (_("Misc"), new OptionEditorHeading (_("Glue to bars and beats"))); add_option (_("Misc"), new BoolOption ( @@ -325,27 +271,79 @@ SessionOptionEditor::SessionOptionEditor (Session* s) 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) )); -} -void -SessionOptionEditor::populate_sync_options () -{ - vector sync_opts = _session->get_available_sync_options (); + add_option (_("Meterbridge"), new OptionEditorHeading (_("Route Display"))); - _sync_source->clear (); + 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 (_("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 (_("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) + )); + + add_option (_("Meterbridge"), new OptionEditorHeading (_("Button Area"))); + + 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) + )); + + 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) + )); + + 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 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) + )); - for (vector::iterator i = sync_opts.begin(); i != sync_opts.end(); ++i) { - _sync_source->add (*i, sync_source_to_string (*i)); - } } void SessionOptionEditor::parameter_changed (std::string const & p) { OptionEditor::parameter_changed (p); - if (p == "external-sync") { - _sync_source->set_sensitive (!_session->config.get_external_sync ()); + if (Config->get_sync_source() == JACK) { + _vpu->set_sensitive(!_session_config->get_external_sync()); + } else { + _vpu->set_sensitive(true); + } + } + if (p == "timecode-format") { + /* update offset clocks */ + parameter_changed("timecode-generator-offset"); + parameter_changed("slave-timecode-offset"); } } @@ -364,6 +362,10 @@ SessionOptionEditor::set_use_monitor_section (bool yn) _session->remove_monitor_section (); } + /* store this choice for any new sessions */ + + Config->set_use_monitor_bus (yn); + return had_monitor_section != yn; }