#include <pbd/undo.h>
#include <pbd/error.h>
-#include <pbd/lockmonitor.h>
+#include <glibmm/thread.h>
#include <pbd/pthread_utils.h>
#include <midi++/mmc.h>
void
Session::butler_transport_work ()
{
- RWLockMonitor rm (route_lock, false, __LINE__, __FILE__);
- RWLockMonitor dsm (diskstream_lock, false, __LINE__, __FILE__);
-
+ Glib::RWLock::ReaderLock rm (route_lock);
+ Glib::RWLock::ReaderLock dsm (diskstream_lock);
+
if (post_transport_work & PostTransportCurveRealloc) {
for (RouteList::iterator i = routes.begin(); i != routes.end(); ++i) {
(*i)->curve_reallocate();
non_realtime_set_audition ();
}
- atomic_dec (&butler_should_do_transport_work);
+ g_atomic_int_dec_and_test (&butler_should_do_transport_work);
}
void
Session::non_realtime_set_speed ()
{
- RWLockMonitor lm (diskstream_lock, false, __LINE__, __FILE__);
+ Glib::RWLock::ReaderLock lm (diskstream_lock);
for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
(*i)->non_realtime_set_speed ();
void
Session::non_realtime_overwrite ()
{
- RWLockMonitor lm (diskstream_lock, false, __LINE__, __FILE__);
+ Glib::RWLock::ReaderLock lm (diskstream_lock);
for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
if ((*i)->pending_overwrite) {
}
}
- deliver_mmc (MIDI::MachineControl::cmdLocate, _transport_frame);
+ //FIXME
+ //deliver_mmc (MIDI::MachineControl::cmdLocate, _transport_frame);
#ifdef LEAVE_TRANSPORT_UNADJUSTED
}
last_stop_frame = _transport_frame;
- send_full_time_code ();
+ /* FIXME
+ send_full_time_code();
deliver_mmc (MIDI::MachineControl::cmdStop, 0);
deliver_mmc (MIDI::MachineControl::cmdLocate, _transport_frame);
+ */
if (did_record) {
*/
if (!Config->get_latched_record_enable()) {
- atomic_set (&_record_status, Disabled);
+ g_atomic_int_set (&_record_status, Disabled);
} else {
- atomic_set (&_record_status, Enabled);
+ g_atomic_int_set (&_record_status, Enabled);
}
RecordStateChanged (); /* emit signal */
}
return;
}
+ // Update SMPTE time
+ // [DR] FIXME: find out exactly where this should go below
_transport_frame = target_frame;
+ smpte_time(_transport_frame, transmitting_smpte_time);
+ outbound_mtc_smpte_frame = _transport_frame;
+ next_quarter_frame_to_send = 0;
if (_transport_speed && (!with_loop || loop_changing)) {
/* schedule a declick. we'll be called again when its done */
/* this is functionally what clear_clicks() does but with a tentative lock */
- TentativeRWLockMonitor clickm (click_lock, true, __LINE__, __FILE__);
+ Glib::RWLock::WriterLock clickm (click_lock, Glib::TRY_LOCK);
if (clickm.locked()) {
a non-tentative rwlock here, because the action must occur.
The rarity and short potential lock duration makes this "OK"
*/
- RWLockMonitor dsm (diskstream_lock, false, __LINE__, __FILE__);
+ Glib::RWLock::ReaderLock dsm (diskstream_lock);
for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
if ((*i)->record_enabled ()) {
//cerr << "switching from input" << __FILE__ << __LINE__ << endl << endl;
a non-tentative rwlock here, because the action must occur.
The rarity and short potential lock duration makes this "OK"
*/
- RWLockMonitor dsm (diskstream_lock, false, __LINE__, __FILE__);
+ Glib::RWLock::ReaderLock dsm (diskstream_lock);
for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
if ((*i)->record_enabled ()) {
//cerr << "switching to input" << __FILE__ << __LINE__ << endl << endl;
}
loop_changing = false;
+
+ _send_smpte_update = true;
}
void
a non-tentative rwlock here, because the action must occur.
The rarity and short potential lock duration makes this "OK"
*/
- RWLockMonitor dsm (diskstream_lock, false, __LINE__, __FILE__);
+ Glib::RWLock::ReaderLock dsm (diskstream_lock);
for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
if ((*i)->record_enabled ()) {
//cerr << "switching to input" << __FILE__ << __LINE__ << endl << endl;
a non-tentative rwlock here, because the action must occur.
The rarity and short potential lock duration makes this "OK"
*/
- RWLockMonitor dsm (diskstream_lock, false, __LINE__, __FILE__);
+ Glib::RWLock::ReaderLock dsm (diskstream_lock);
for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
if (auto_input && (*i)->record_enabled ()) {
//cerr << "switching from input" << __FILE__ << __LINE__ << endl << endl;
(*i)->realtime_set_speed ((*i)->speed(), true);
}
+ /* FIXME
send_mmc_in_another_thread (MIDI::MachineControl::cmdDeferredPlay, 0);
-
+ */
+
TransportStateChange (); /* EMIT SIGNAL */
}
+/** Do any transport work in the audio thread that needs to be done after the
+ * transport thread is finished. Audio thread, realtime safe.
+ */
void
Session::post_transport ()
{
the picture.
*/
- atomic_set (&butler_should_do_transport_work, 0);
+ g_atomic_int_set (&butler_should_do_transport_work, 0);
post_transport_work = PostTransportWork (0);
stop_butler ();
return;
}
- RWLockMonitor lm (route_lock, false, __LINE__, __FILE__);
- RWLockMonitor lm2 (diskstream_lock, false, __LINE__, __FILE__);
+ Glib::RWLock::ReaderLock lm (route_lock);
+ Glib::RWLock::ReaderLock lm2 (diskstream_lock);
_worst_track_latency = 0;
for (RouteList::iterator i = routes.begin(); i != routes.end(); ++i) {