summaryrefslogtreecommitdiff
path: root/libs/ardour/session.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-01-19 00:03:55 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-01-19 00:03:55 +0000
commitcd87dceb0fda44d7c8fcc2b7844f65def25edb23 (patch)
tree36ca3ef004a12e9edb3f41e708128188d54613c0 /libs/ardour/session.cc
parent2a25079173c9614049457ec28cd2ed260f503b3f (diff)
latched rec-enable
git-svn-id: svn://localhost/trunk/ardour2@277 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r--libs/ardour/session.cc25
1 files changed, 16 insertions, 9 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index bcc7c13bb5..90458fa2fd 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -1249,21 +1249,30 @@ Session::enable_record ()
for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
if ((*i)->record_enabled ()) {
- //cerr << "switching to input" << __FILE__ << __LINE__ << endl << endl;
(*i)->monitor_input (true);
}
}
}
- RecordEnabled ();
+ RecordStateChanged ();
}
}
void
-Session::disable_record ()
+Session::disable_record (bool force)
{
- if (atomic_read (&_record_status) != Disabled) {
- atomic_set (&_record_status, Disabled);
+ RecordState rs;
+
+ if ((rs = (RecordState) atomic_read (&_record_status)) != Disabled) {
+
+ if (!Config->get_latched_record_enable () || force) {
+ atomic_set (&_record_status, Disabled);
+ } else {
+ if (rs == Recording) {
+ atomic_set (&_record_status, Enabled);
+ }
+ }
+
send_mmc_in_another_thread (MIDI::MachineControl::cmdRecordExit);
if (Config->get_use_hardware_monitoring() && auto_input) {
@@ -1275,15 +1284,13 @@ Session::disable_record ()
for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
if ((*i)->record_enabled ()) {
- //cerr << "switching from input" << __FILE__ << __LINE__ << endl << endl;
(*i)->monitor_input (false);
}
}
}
- RecordDisabled ();
+ RecordStateChanged (); /* emit signal */
remove_pending_capture_state ();
-
}
}
@@ -1321,7 +1328,7 @@ Session::maybe_enable_record ()
}
} else {
send_mmc_in_another_thread (MIDI::MachineControl::cmdRecordPause);
- RecordEnabled (); /* EMIT SIGNAL */
+ RecordStateChanged (); /* EMIT SIGNAL */
}
set_dirty();