summaryrefslogtreecommitdiff
path: root/libs/ardour/transport_master.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2018-10-05 12:35:10 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2018-10-05 14:15:02 -0400
commit4c7e5dbc74981dfe1c1d277a633cb2cce0d6036b (patch)
tree2acece91467a6dcdaa95e159993a181b359914ae /libs/ardour/transport_master.cc
parent1b71e4db2c71dac551b0b88e98a6fc2f533723a7 (diff)
move away from "sync source" concepts
Diffstat (limited to 'libs/ardour/transport_master.cc')
-rw-r--r--libs/ardour/transport_master.cc53
1 files changed, 50 insertions, 3 deletions
diff --git a/libs/ardour/transport_master.cc b/libs/ardour/transport_master.cc
index 5a53976dcb..7e797a3715 100644
--- a/libs/ardour/transport_master.cc
+++ b/libs/ardour/transport_master.cc
@@ -364,13 +364,13 @@ TransportMaster::factory (SyncSource type, std::string const& name, bool removea
switch (type) {
case MTC:
- tm.reset (new MTC_TransportMaster (sync_source_to_string (type)));
+ tm.reset (new MTC_TransportMaster (name));
break;
case LTC:
- tm.reset (new LTC_TransportMaster (sync_source_to_string (type)));
+ tm.reset (new LTC_TransportMaster (name));
break;
case MIDIClock:
- tm.reset (new MIDIClock_TransportMaster (sync_source_to_string (type)));
+ tm.reset (new MIDIClock_TransportMaster (name));
break;
case Engine:
tm.reset (new Engine_TransportMaster (*AudioEngine::instance()));
@@ -386,6 +386,52 @@ TransportMaster::factory (SyncSource type, std::string const& name, bool removea
return tm;
}
+/** @param sh Return a short version of the string */
+std::string
+TransportMaster::display_name (bool sh) const
+{
+
+ switch (_type) {
+ case Engine:
+ /* no other backends offer sync for now ... deal with this if we
+ * ever have to.
+ */
+ return S_("SyncSource|JACK");
+
+ case MTC:
+ if (sh) {
+ if (name().length() <= 4) {
+ return name();
+ }
+ return S_("SyncSource|MTC");
+ } else {
+ return name();
+ }
+
+ case MIDIClock:
+ if (sh) {
+ if (name().length() <= 4) {
+ return name();
+ }
+ return S_("SyncSource|M-Clk");
+ } else {
+ return name();
+ }
+
+ case LTC:
+ if (sh) {
+ if (name().length() <= 4) {
+ return name();
+ }
+ return S_("SyncSource|LTC");
+ } else {
+ return name();
+ }
+ }
+ /* GRRRR .... stupid, stupid gcc - you can't get here from there, all enum values are handled */
+ return S_("SyncSource|JACK");
+}
+
boost::shared_ptr<Port>
TransportMasterViaMIDI::create_midi_port (std::string const & port_name)
{
@@ -437,3 +483,4 @@ TimecodeTransportMaster::set_fr2997 (bool yn)
PropertyChanged (Properties::fr2997);
}
}
+