summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-10-11 03:10:18 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-10-11 03:10:18 +0000
commit9707a0e8271a54dd21e49d6ca9ae98378ac4f8a5 (patch)
tree3db9d9cab869d2bfab9f68b1afca56b1da5811fe
parent1a530550196050dfe4a67732965ae3ddc3e1b077 (diff)
move the external sync source selection tobe a global config parameter, not per-session, since this is likely a reflection of studio setup, h/w etc.; starting using real tooltips in the RC option editor
git-svn-id: svn://localhost/ardour2/branches/3.0@13237 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/ardour_ui.cc4
-rw-r--r--gtk2_ardour/ardour_ui_options.cc6
-rw-r--r--gtk2_ardour/audio_clock.cc2
-rw-r--r--gtk2_ardour/editor_ops.cc2
-rw-r--r--gtk2_ardour/rc_option_editor.cc51
-rw-r--r--gtk2_ardour/rc_option_editor.h3
-rw-r--r--gtk2_ardour/session_option_editor.cc28
-rw-r--r--gtk2_ardour/session_option_editor.h2
-rw-r--r--libs/ardour/ardour/ardour.h2
-rw-r--r--libs/ardour/ardour/rc_configuration_vars.h6
-rw-r--r--libs/ardour/ardour/session.h3
-rw-r--r--libs/ardour/ardour/session_configuration_vars.h1
-rw-r--r--libs/ardour/globals.cc12
-rw-r--r--libs/ardour/session.cc12
-rw-r--r--libs/ardour/session_state.cc2
15 files changed, 76 insertions, 60 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 6968c6b78a..b02bfd61c4 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -1601,7 +1601,7 @@ ARDOUR_UI::transport_roll ()
#if 0
if (_session->config.get_external_sync()) {
- switch (_session->config.get_sync_source()) {
+ switch (Config->get_sync_source()) {
case JACK:
break;
default:
@@ -1648,7 +1648,7 @@ ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode)
}
if (_session->config.get_external_sync()) {
- switch (_session->config.get_sync_source()) {
+ switch (Config->get_sync_source()) {
case JACK:
break;
default:
diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc
index 232c41b0c7..5da10c7ea3 100644
--- a/gtk2_ardour/ardour_ui_options.cc
+++ b/gtk2_ardour/ardour_ui_options.cc
@@ -60,7 +60,7 @@ ARDOUR_UI::toggle_external_sync()
{
if (_session) {
if (_session->config.get_video_pullup() != 0.0f) {
- if (_session->config.get_sync_source() == JACK) {
+ if (Config->get_sync_source() == JACK) {
MessageDialog msg (
_("It is not possible to use JACK as the the sync source\n\
when the pull up/down setting is non-zero."));
@@ -311,7 +311,7 @@ ARDOUR_UI::parameter_changed (std::string p)
ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (true);
ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (true);
} else {
- sync_button.set_text (sync_source_to_string (_session->config.get_sync_source(), true));
+ sync_button.set_text (sync_source_to_string (Config->get_sync_source(), true));
/* XXX need to make auto-play is off as well as insensitive */
ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (false);
ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (false);
@@ -439,7 +439,7 @@ ARDOUR_UI::synchronize_sync_source_and_video_pullup ()
act->set_sensitive (true);
} else {
/* can't sync to JACK if video pullup != 0.0 */
- if (_session->config.get_sync_source() == JACK) {
+ if (Config->get_sync_source() == JACK) {
act->set_sensitive (false);
} else {
act->set_sensitive (true);
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc
index 3a2bf0cee1..776903ae1f 100644
--- a/gtk2_ardour/audio_clock.cc
+++ b/gtk2_ardour/audio_clock.cc
@@ -1083,7 +1083,7 @@ AudioClock::set_timecode (framepos_t when, bool /*force*/)
if (_left_layout) {
if (_session->config.get_external_sync()) {
- switch (_session->config.get_sync_source()) {
+ switch (Config->get_sync_source()) {
case JACK:
_left_layout->set_text ("JACK");
break;
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index d891db6651..0aac921afd 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -2106,7 +2106,7 @@ Editor::transition_to_rolling (bool fwd)
}
if (_session->config.get_external_sync()) {
- switch (_session->config.get_sync_source()) {
+ switch (Config->get_sync_source()) {
case JACK:
break;
default:
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc
index 9365f8eedd..0af11adae0 100644
--- a/gtk2_ardour/rc_option_editor.cc
+++ b/gtk2_ardour/rc_option_editor.cc
@@ -1019,24 +1019,45 @@ RCOptionEditor::RCOptionEditor ()
BoolOption* tsf = new BoolOption (
"timecode-sync-frame-rate",
- _("Force Ardour's timecode rate to match an external timecode source"),
+ _("Match session video frame rate to external timecode (when slaved to timecode)"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_timecode_sync_frame_rate),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_timecode_sync_frame_rate)
);
- tsf->set_note (_("If off, slaving to timecode will cause Ardour to chase the external timecode\nsource but it will use its own timecode frame rate"));
+ Gtkmm2ext::UI::instance()->set_tip
+ (tsf->tip_widget(),
+ _("This option controls the value of the video frame rate <i>while chasing</i> an external timecode source.\n\n"
+ "When enabled, the session video frame rate will be changed to match that of the selected external timecode source.\n\n"
+ "When not enabled, the session video frame rate will not be changed to match that of the selected external timecode source."
+ "Instead the frame rate indication in the main clock will flash red and Ardour will convert between the external "
+ "timecode standard and the session standard"));
+
add_option (_("Transport"), tsf);
tsf = new BoolOption (
"timecode-source-is-synced",
- _("Timecode source shares sample clock with audio interface"),
+ _("External timecode is sync locked"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_timecode_source_is_synced),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_timecode_source_is_synced)
);
- Gtkmm2ext::UI::instance()->set_tip (tsf->tip_widget(),
- _("If on, Ardour will assume that the timecode source shares an external sync\nsource (Blackburst, Word Clock, etc.) with your audio interface."
- "\nThis is a preferable configuration but may not match your equipment"));
+ Gtkmm2ext::UI::instance()->set_tip
+ (tsf->tip_widget(),
+ _("When enabled, indicates that the selected external timecode source shares sync (Black &amp; Burst, Wordclock, etc) with the audio interface"));
+
add_option (_("Transport"), tsf);
+ _sync_source = new ComboOption<SyncSource> (
+ "sync-source",
+ _("External timecode source"),
+ sigc::mem_fun (*_rc_config, &RCConfiguration::get_sync_source),
+ sigc::mem_fun (*_rc_config, &RCConfiguration::set_sync_source)
+ );
+
+ populate_sync_options ();
+ parameter_changed (string ("external-sync"));
+
+ add_option (_("Timecode"), _sync_source);
+
+
/* EDITOR */
add_option (_("Editor"),
@@ -1674,5 +1695,23 @@ RCOptionEditor::parameter_changed (string const & p)
}
_solo_control_is_listen_control->set_sensitive (s);
_listen_position->set_sensitive (s);
+ } else if (p == "external-sync") {
+ if (_session) {
+ _sync_source->set_sensitive (!_session->config.get_external_sync ());
+ } else {
+ _sync_source->set_sensitive (false);
+ }
+ }
+}
+
+void
+RCOptionEditor::populate_sync_options ()
+{
+ vector<SyncSource> sync_opts = ARDOUR::get_available_sync_options ();
+
+ _sync_source->clear ();
+
+ for (vector<SyncSource>::iterator i = sync_opts.begin(); i != sync_opts.end(); ++i) {
+ _sync_source->add (*i, sync_source_to_string (*i));
}
}
diff --git a/gtk2_ardour/rc_option_editor.h b/gtk2_ardour/rc_option_editor.h
index a5711919a9..6789594e8a 100644
--- a/gtk2_ardour/rc_option_editor.h
+++ b/gtk2_ardour/rc_option_editor.h
@@ -34,10 +34,13 @@ class RCOptionEditor : public OptionEditor
public:
RCOptionEditor ();
+ void populate_sync_options ();
+
private:
void parameter_changed (std::string const &);
ARDOUR::RCConfiguration* _rc_config;
BoolOption* _solo_control_is_listen_control;
ComboOption<ARDOUR::ListenPosition>* _listen_position;
VisibilityGroup _mixer_strip_visibility;
+ ComboOption<ARDOUR::SyncSource>* _sync_source;
};
diff --git a/gtk2_ardour/session_option_editor.cc b/gtk2_ardour/session_option_editor.cc
index 6834a9ddea..c0c8bc07cd 100644
--- a/gtk2_ardour/session_option_editor.cc
+++ b/gtk2_ardour/session_option_editor.cc
@@ -37,18 +37,6 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
/* TIMECODE*/
- _sync_source = new ComboOption<SyncSource> (
- "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<TimecodeFormat>* smf = new ComboOption<TimecodeFormat> (
@@ -300,25 +288,9 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
}
void
-SessionOptionEditor::populate_sync_options ()
-{
- vector<SyncSource> sync_opts = _session->get_available_sync_options ();
-
- _sync_source->clear ();
-
- for (vector<SyncSource>::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 ());
- }
}
/* the presence of absence of a monitor section is not really a regular session
diff --git a/gtk2_ardour/session_option_editor.h b/gtk2_ardour/session_option_editor.h
index 55d49a1e3a..3914ec8a8d 100644
--- a/gtk2_ardour/session_option_editor.h
+++ b/gtk2_ardour/session_option_editor.h
@@ -31,10 +31,8 @@ public:
private:
void parameter_changed (std::string const &);
- void populate_sync_options ();
ARDOUR::SessionConfiguration* _session_config;
- ComboOption<ARDOUR::SyncSource>* _sync_source;
bool set_use_monitor_section (bool);
bool get_use_monitor_section ();
diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h
index 5ce29d7580..c19d4332e8 100644
--- a/libs/ardour/ardour/ardour.h
+++ b/libs/ardour/ardour/ardour.h
@@ -22,6 +22,7 @@
#include <map>
#include <string>
+#include <vector>
#include <limits.h>
#include <signal.h>
@@ -68,6 +69,7 @@ namespace ARDOUR {
}
void setup_fpu ();
+ std::vector<SyncSource> get_available_sync_options();
}
#endif /* __ardour_ardour_h__ */
diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h
index 95f1b74189..adcc00ec87 100644
--- a/libs/ardour/ardour/rc_configuration_vars.h
+++ b/libs/ardour/ardour/rc_configuration_vars.h
@@ -43,10 +43,14 @@ CONFIG_VARIABLE (bool, midi_feedback, "midi-feedback", false)
CONFIG_VARIABLE (int32_t, mmc_receive_device_id, "mmc-receive-device-id", 0x7f)
CONFIG_VARIABLE (int32_t, mmc_send_device_id, "mmc-send-device-id", 0)
CONFIG_VARIABLE (int32_t, initial_program_change, "initial-program-change", -1)
+CONFIG_VARIABLE (bool, first_midi_bank_is_zero, "diplay-first-midi-bank-as-zero", false)
+
+/* Timecode and related */
+
CONFIG_VARIABLE (int, mtc_qf_speed_tolerance, "mtc-qf-speed-tolerance", 5)
CONFIG_VARIABLE (bool, timecode_sync_frame_rate, "timecode-sync-frame-rate", true)
CONFIG_VARIABLE (bool, timecode_source_is_synced, "timecode-source-is-synced", true)
-CONFIG_VARIABLE (bool, first_midi_bank_is_zero, "diplay-first-midi-bank-as-zero", false)
+CONFIG_VARIABLE (SyncSource, sync_source, "sync-source", JACK)
/* control surfaces */
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 5f20df029c..499c431c8b 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -503,9 +503,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
static PBD::Signal1<void, framepos_t> StartTimeChanged;
static PBD::Signal1<void, framepos_t> EndTimeChanged;
- std::vector<SyncSource> get_available_sync_options() const;
void request_sync_source (Slave*);
- bool synced_to_jack() const { return config.get_external_sync() && config.get_sync_source() == JACK; }
+ bool synced_to_jack() const { return config.get_external_sync() && Config->get_sync_source() == JACK; }
double transport_speed() const { return _transport_speed; }
bool transport_stopped() const { return _transport_speed == 0.0f; }
diff --git a/libs/ardour/ardour/session_configuration_vars.h b/libs/ardour/ardour/session_configuration_vars.h
index 5ae20a45a4..5b7064196f 100644
--- a/libs/ardour/ardour/session_configuration_vars.h
+++ b/libs/ardour/ardour/session_configuration_vars.h
@@ -52,7 +52,6 @@ CONFIG_VARIABLE (float, video_pullup, "video-pullup", 0.0f)
CONFIG_VARIABLE (bool, show_summary, "show-summary", true)
CONFIG_VARIABLE (bool, show_group_tabs, "show-group-tabs", true)
CONFIG_VARIABLE (bool, external_sync, "external-sync", false)
-CONFIG_VARIABLE (SyncSource, sync_source, "sync-source", JACK)
CONFIG_VARIABLE (InsertMergePolicy, insert_merge_policy, "insert-merge-policy", InsertMergeRelax)
CONFIG_VARIABLE (framecnt_t, timecode_offset, "timecode-offset", 0)
CONFIG_VARIABLE (bool, timecode_offset_negative, "timecode-offset-negative", true)
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc
index f336142075..78ed2ff472 100644
--- a/libs/ardour/globals.cc
+++ b/libs/ardour/globals.cc
@@ -476,3 +476,15 @@ ARDOUR::translations_are_disabled ()
/* if file does not exist, we don't translate (bundled ardour only) */
return Glib::file_test (translation_kill_path(), Glib::FILE_TEST_EXISTS) == false;
}
+
+vector<SyncSource>
+ARDOUR::get_available_sync_options ()
+{
+ vector<SyncSource> ret;
+
+ ret.push_back (JACK);
+ ret.push_back (MTC);
+ ret.push_back (MIDIClock);
+
+ return ret;
+}
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 3d7535d5e5..43fb4b6b5d 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -4189,18 +4189,6 @@ Session::route_removed_from_route_group (RouteGroup* rg, boost::weak_ptr<Route>
RouteRemovedFromRouteGroup (rg, r);
}
-vector<SyncSource>
-Session::get_available_sync_options () const
-{
- vector<SyncSource> ret;
-
- ret.push_back (JACK);
- ret.push_back (MTC);
- ret.push_back (MIDIClock);
-
- return ret;
-}
-
boost::shared_ptr<RouteList>
Session::get_routes_with_regions_at (framepos_t const p) const
{
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 3ef2e0d521..950f3a1ecb 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -3500,7 +3500,7 @@ Session::config_changed (std::string p, bool ours)
if (!config.get_external_sync()) {
drop_sync_source ();
} else {
- switch_to_sync_source (config.get_sync_source());
+ switch_to_sync_source (Config->get_sync_source());
}
} else if (p == "denormal-model") {
setup_fpu ();