summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muse/ChangeLog3
-rw-r--r--muse/muse/conf.cpp8
-rw-r--r--muse/muse/driver/jack.cpp5
-rw-r--r--muse/muse/song.cpp3
-rw-r--r--muse/muse/sync.cpp5
-rw-r--r--muse/muse/sync.h5
-rw-r--r--muse/muse/widgets/midisync.ui27
-rw-r--r--muse/muse/widgets/midisyncimpl.cpp14
8 files changed, 56 insertions, 14 deletions
diff --git a/muse/ChangeLog b/muse/ChangeLog
index b555dc38..8fcf6fd1 100644
--- a/muse/ChangeLog
+++ b/muse/ChangeLog
@@ -1,3 +1,6 @@
+24.01.2010
+ * Added: Midi sync: Added 'Jack timebase master' checkbox, removed requirement of MusE being tempo map master. (T356)
+ * Added: While on external sync and Jack timebase master, reports correct MusE BBT info to Jack. (Tempo not correct yet). (T356)
23.01.2010
* Fixed: External midi sync in: MusE transport not rewinding upon reception of start. (T356)
* Added: Midi sync: MusE now transmits and receives some MMC commands, and displays some MTC and SMTPE info. (T356)
diff --git a/muse/muse/conf.cpp b/muse/muse/conf.cpp
index efcad4dc..7096edfb 100644
--- a/muse/muse/conf.cpp
+++ b/muse/muse/conf.cpp
@@ -663,6 +663,12 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
extSyncFlag.setValue(xml.parseInt());
else if (tag == "useJackTransport")
useJackTransport = xml.parseInt();
+ else if (tag == "jackTransportMaster")
+ {
+ jackTransportMaster = xml.parseInt();
+ if(audioDevice)
+ audioDevice->setMaster(jackTransportMaster);
+ }
else if (tag == "syncgentype") {
// for compatibility
//int syncGenType= xml.parseInt();
@@ -1084,6 +1090,7 @@ void MusE::writeGlobalConfiguration(int level, Xml& xml) const
mtcOffset.h(), mtcOffset.m(), mtcOffset.s(),
mtcOffset.f(), mtcOffset.sf());
//xml.intTag(level, "useJackTransport", useJackTransport);
+ //xml.intTag(level, "jackTransportMaster", jackTransportMaster);
extSyncFlag.save(level, xml);
// xml.intTag(level, "genMTCSync", genMTCSync);
@@ -1193,6 +1200,7 @@ void MusE::writeConfiguration(int level, Xml& xml) const
mtcOffset.h(), mtcOffset.m(), mtcOffset.s(),
mtcOffset.f(), mtcOffset.sf());
xml.intTag(level, "useJackTransport", useJackTransport);
+ xml.intTag(level, "jackTransportMaster", jackTransportMaster);
extSyncFlag.save(level, xml);
// xml.intTag(level, "genMTCSync", genMTCSync);
diff --git a/muse/muse/driver/jack.cpp b/muse/muse/driver/jack.cpp
index 859cab91..67146cca 100644
--- a/muse/muse/driver/jack.cpp
+++ b/muse/muse/driver/jack.cpp
@@ -187,7 +187,10 @@ static void timebase_callback(jack_transport_state_t /* state */,
int /* new_pos */,
void*)
{
- Pos p(pos->frame, false);
+ // P3.3.27
+ //Pos p(pos->frame, false);
+ Pos p(extSyncFlag.value() ? audio->tickPos() : pos->frame, extSyncFlag.value() ? true : false);
+
pos->valid = JackPositionBBT;
p.mbt(&pos->bar, &pos->beat, &pos->tick);
pos->bar++;
diff --git a/muse/muse/song.cpp b/muse/muse/song.cpp
index 9d0c6ee5..3cfb4af7 100644
--- a/muse/muse/song.cpp
+++ b/muse/muse/song.cpp
@@ -1110,7 +1110,8 @@ void Song::setMasterFlag(bool val)
//audioDevice->setMaster(val);
emit songChanged(SC_MASTER);
}
- audioDevice->setMaster(val);
+ // Removed. p3.3.26
+ //audioDevice->setMaster(val);
}
//---------------------------------------------------------
diff --git a/muse/muse/sync.cpp b/muse/muse/sync.cpp
index 141674dc..f4759e21 100644
--- a/muse/muse/sync.cpp
+++ b/muse/muse/sync.cpp
@@ -24,7 +24,7 @@
//int rxDeviceId = 0x7f; // any device
//int txDeviceId = 0x7f; // any device
//MidiSyncPort midiSyncPorts[MIDI_PORTS];
-int curMidiSyncInPort = -1;
+int volatile curMidiSyncInPort = -1;
// P3.3.26
bool debugSync = false;
@@ -38,7 +38,8 @@ BValue extSyncFlag(0, "extSync"); // false - MASTER, true - SLAVE
//bool acceptMTC = false;
//bool acceptMC = true;
//bool acceptMMC = true;
-bool useJackTransport = true;
+bool volatile useJackTransport = true;
+bool volatile jackTransportMaster = true;
static MTC mtcCurTime;
static int mtcState; // 0-7 next expected quarter message
diff --git a/muse/muse/sync.h b/muse/muse/sync.h
index b5a75fb8..36148ee5 100644
--- a/muse/muse/sync.h
+++ b/muse/muse/sync.h
@@ -123,8 +123,9 @@ extern BValue extSyncFlag;
//extern bool acceptMTC;
//extern bool acceptMC;
//extern bool acceptMMC;
-extern int curMidiSyncInPort;
-extern bool useJackTransport;
+extern int volatile curMidiSyncInPort;
+extern bool volatile useJackTransport;
+extern bool volatile jackTransportMaster;
#endif
diff --git a/muse/muse/widgets/midisync.ui b/muse/muse/widgets/midisync.ui
index 2032e574..464d1e21 100644
--- a/muse/muse/widgets/midisync.ui
+++ b/muse/muse/widgets/midisync.ui
@@ -323,6 +323,31 @@ configuration dialog</comment>
</widget>
<widget class="QCheckBox" row="1" column="0">
<property name="name">
+ <cstring>jackTransportMasterCheckbox</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Jack transport Timebase Master</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Make MusE the Jack transport Timebase Master</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Make MusE the Jack transport Timebase Master.
+Allows Jack to show time as
+ MusE Bars, Beats, and Ticks.
+MusE will try to become master, but other
+ Jack clients can also take over later.
+You can always click here again for Master.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
<cstring>extSyncCheckbox</cstring>
</property>
<property name="enabled">
@@ -345,7 +370,7 @@ Enabled inputs in the list will
be in effect (RMC, RMMC, RMTC).</string>
</property>
</widget>
- <widget class="QListView" row="2" column="0">
+ <widget class="QListView" row="3" column="0">
<property name="name">
<cstring>devicesListView</cstring>
</property>
diff --git a/muse/muse/widgets/midisyncimpl.cpp b/muse/muse/widgets/midisyncimpl.cpp
index cbae9cb2..205da2cf 100644
--- a/muse/muse/widgets/midisyncimpl.cpp
+++ b/muse/muse/widgets/midisyncimpl.cpp
@@ -319,7 +319,7 @@ MidiSyncConfig::MidiSyncConfig(QWidget* parent, const char* name)
connect(extSyncCheckbox, SIGNAL(clicked()), SLOT(syncChanged()));
connect(mtcSyncType, SIGNAL(activated(int)), SLOT(syncChanged()));
connect(useJackTransportCheckbox, SIGNAL(clicked()), SLOT(syncChanged()));
- //connect(jackTransportMasterCheckbox, SIGNAL(clicked()), SLOT(syncChanged()));
+ connect(jackTransportMasterCheckbox, SIGNAL(clicked()), SLOT(syncChanged()));
connect(&extSyncFlag, SIGNAL(valueChanged(bool)), SLOT(extSyncChanged(bool)));
@@ -358,12 +358,12 @@ void MidiSyncConfig::songChanged(int flags)
extSyncCheckbox->blockSignals(true);
useJackTransportCheckbox->blockSignals(true);
- //jackTransportMasterCheckbox->blockSignals(true);
+ jackTransportMasterCheckbox->blockSignals(true);
extSyncCheckbox->setChecked(extSyncFlag.value());
useJackTransportCheckbox->setChecked(useJackTransport);
- //jackTransportMasterCheckbox->setChecked(jackTransportMaster);
+ jackTransportMasterCheckbox->setChecked(jackTransportMaster);
//jackTransportMasterCheckbox->setEnabled(useJackTransport);
- //jackTransportMasterCheckbox->blockSignals(false);
+ jackTransportMasterCheckbox->blockSignals(false);
useJackTransportCheckbox->blockSignals(false);
extSyncCheckbox->blockSignals(false);
@@ -710,12 +710,12 @@ void MidiSyncConfig::apply()
//extSyncFlag.blockSignals(false);
useJackTransport = useJackTransportCheckbox->isChecked();
// if(useJackTransport)
-// jackTransportMaster = jackTransportMasterCheckbox->isChecked();
+ jackTransportMaster = jackTransportMasterCheckbox->isChecked();
// else
// jackTransportMaster = false;
// jackTransportMasterCheckbox->setEnabled(useJackTransport);
-// if(audioDevice)
-// audioDevice->setMaster(jackTransportMaster);
+ if(audioDevice)
+ audioDevice->setMaster(jackTransportMaster);
mtcOffset.setH(mtcOffH->value());
mtcOffset.setM(mtcOffM->value());