summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_diskstream.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-12-07 15:48:38 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-12-07 15:48:38 +0000
commit8ca9061b308238ba80d82b6960e79fa1ea5cda92 (patch)
tree299b123786e43f41bbfa6659b7efbd050dafab06 /libs/ardour/audio_diskstream.cc
parenteacba74649e961508fb85eddb1e8dd51d8c61be5 (diff)
fix issues with rec-enabling being done in RT context by splitting it into two parts, an RT-safe and RT-unsafe part. along the way, remove "do not record plugins" option which is just so 1999 and creates problems for various (all?) plugin APIs
git-svn-id: svn://localhost/ardour2/branches/3.0@13613 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audio_diskstream.cc')
-rw-r--r--libs/ardour/audio_diskstream.cc24
1 files changed, 18 insertions, 6 deletions
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc
index 2d2d3d252f..8378fa210c 100644
--- a/libs/ardour/audio_diskstream.cc
+++ b/libs/ardour/audio_diskstream.cc
@@ -1664,13 +1664,22 @@ AudioDiskstream::set_record_enabled (bool yn)
}
}
-void
-AudioDiskstream::engage_record_enable ()
+bool
+AudioDiskstream::prep_record_enable ()
{
+ if (!recordable() || !_session.record_enabling_legal() || _io->n_ports().n_audio() == 0) {
+ return false;
+ }
+
+ /* can't rec-enable in destructive mode if transport is before start */
+
+ if (destructive() && _session.transport_frame() < _session.current_start_frame()) {
+ return false;
+ }
+
bool rolling = _session.transport_speed() != 0.0f;
boost::shared_ptr<ChannelList> c = channels.reader();
- g_atomic_int_set (&_record_enabled, 1);
capturing_sources.clear ();
if (Config->get_monitoring_model() == HardwareMonitoring) {
@@ -1689,12 +1698,13 @@ AudioDiskstream::engage_record_enable ()
}
RecordEnableChanged (); /* EMIT SIGNAL */
+
+ return true;
}
-void
-AudioDiskstream::disengage_record_enable ()
+bool
+AudioDiskstream::prep_record_disable ()
{
- g_atomic_int_set (&_record_enabled, 0);
boost::shared_ptr<ChannelList> c = channels.reader();
if (Config->get_monitoring_model() == HardwareMonitoring) {
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
@@ -1703,6 +1713,8 @@ AudioDiskstream::disengage_record_enable ()
}
capturing_sources.clear ();
RecordEnableChanged (); /* EMIT SIGNAL */
+
+ return true;
}
XMLNode&