diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-06-16 08:44:03 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-06-16 08:44:03 -0400 |
commit | 90220998af4f9683d696b511a09b34034e799093 (patch) | |
tree | e974251993f9bf8b33c26bdeb117a8759b476d77 /libs/ardour/ardour | |
parent | d65f03d07455c4ea38084af71a38c383bd2b3e19 (diff) |
add Record-Safe feature to libardour (from Nikolay Polyanovskii)
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/audio_diskstream.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/diskstream.h | 8 | ||||
-rw-r--r-- | libs/ardour/ardour/midi_diskstream.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/midi_track.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/track.h | 4 |
7 files changed, 18 insertions, 1 deletions
diff --git a/libs/ardour/ardour/audio_diskstream.h b/libs/ardour/ardour/audio_diskstream.h index f93c949a38..f48204d7ab 100644 --- a/libs/ardour/ardour/audio_diskstream.h +++ b/libs/ardour/ardour/audio_diskstream.h @@ -73,6 +73,7 @@ class LIBARDOUR_API AudioDiskstream : public Diskstream } void set_record_enabled (bool yn); + void set_record_safe (bool yn); int set_destructive (bool yn); int set_non_layered (bool yn); bool can_become_destructive (bool& requires_bounce) const; diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h index cde21b209f..fc41d10160 100644 --- a/libs/ardour/ardour/diskstream.h +++ b/libs/ardour/ardour/diskstream.h @@ -104,7 +104,9 @@ class LIBARDOUR_API Diskstream : public SessionObject, public PublicDiskstream void set_roll_delay (framecnt_t); bool record_enabled() const { return g_atomic_int_get (&_record_enabled); } + bool record_safe () const { return g_atomic_int_get (&_record_safe); } virtual void set_record_enabled (bool yn) = 0; + virtual void set_record_safe (bool yn) = 0; bool destructive() const { return _flags & Destructive; } virtual int set_destructive (bool /*yn*/) { return -1; } @@ -176,6 +178,7 @@ class LIBARDOUR_API Diskstream : public SessionObject, public PublicDiskstream } PBD::Signal0<void> RecordEnableChanged; + PBD::Signal0<void> RecordSafeChanged; PBD::Signal0<void> SpeedChanged; PBD::Signal0<void> ReverseChanged; /* Emitted when this diskstream is set to use a different playlist */ @@ -263,6 +266,8 @@ class LIBARDOUR_API Diskstream : public SessionObject, public PublicDiskstream void engage_record_enable (); void disengage_record_enable (); + void engage_record_safe (); + void disengage_record_safe (); virtual bool prep_record_enable () = 0; virtual bool prep_record_disable () = 0; @@ -286,7 +291,8 @@ class LIBARDOUR_API Diskstream : public SessionObject, public PublicDiskstream boost::shared_ptr<Playlist> _playlist; - mutable gint _record_enabled; + gint _record_enabled; + gint _record_safe; double _visible_speed; double _actual_speed; /* items needed for speed change logic */ diff --git a/libs/ardour/ardour/midi_diskstream.h b/libs/ardour/ardour/midi_diskstream.h index 58b74bd54f..6610708581 100644 --- a/libs/ardour/ardour/midi_diskstream.h +++ b/libs/ardour/ardour/midi_diskstream.h @@ -70,6 +70,7 @@ class LIBARDOUR_API MidiDiskstream : public Diskstream void flush_playback (framepos_t, framepos_t); void set_record_enabled (bool yn); + void set_record_safe (bool yn); void reset_tracker (); void resolve_tracker (Evoral::EventSink<framepos_t>& buffer, framepos_t time); diff --git a/libs/ardour/ardour/midi_track.h b/libs/ardour/ardour/midi_track.h index f2542f0f6b..2ba57e4e01 100644 --- a/libs/ardour/ardour/midi_track.h +++ b/libs/ardour/ardour/midi_track.h @@ -51,6 +51,7 @@ public: boost::shared_ptr<Diskstream> create_diskstream (); void set_diskstream (boost::shared_ptr<Diskstream>); void set_record_enabled (bool yn, void *src); + void set_record_safe (bool yn, void *src); DataType data_type () const { return DataType::MIDI; diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 8237219020..cce1e152a2 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -129,6 +129,8 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou virtual void set_record_enabled (bool /*yn*/, void * /*src*/) {} virtual bool record_enabled() const { return false; } + virtual void set_record_safe (bool yn, void *src) {} + virtual bool record_safe () const {return false; } virtual void nonrealtime_handle_transport_stopped (bool abort, bool did_locate, bool flush_processors); virtual void realtime_handle_transport_stopped () {} virtual void realtime_locate () {} diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 8379ed7ae5..bbc82939c7 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -700,6 +700,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop void set_mute (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false); void set_listen (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false); void set_record_enabled (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false); + void set_record_safe (boost::shared_ptr<RouteList>, bool yn, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false); void set_solo_isolated (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false); void set_monitoring (boost::shared_ptr<RouteList>, MonitorChoice, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false); void set_exclusive_input_active (boost::shared_ptr<RouteList> rt, bool onoff, bool flip_others=false); @@ -1699,6 +1700,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop void rt_set_listen (boost::shared_ptr<RouteList>, bool yn, bool group_override); void rt_set_solo_isolated (boost::shared_ptr<RouteList>, bool yn, bool group_override); void rt_set_record_enabled (boost::shared_ptr<RouteList>, bool yn, bool group_override); + void rt_set_record_safe (boost::shared_ptr<RouteList>, bool yn, bool group_override); void rt_set_monitoring (boost::shared_ptr<RouteList>, MonitorChoice, bool group_override); /** temporary list of Diskstreams used only during load of 2.X sessions */ diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index 5e05ec373c..f699b5d5d3 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -107,7 +107,9 @@ class LIBARDOUR_API Track : public Route, public PublicDiskstream boost::shared_ptr<AutomationControl> rec_enable_control() { return _rec_enable_control; } bool record_enabled() const; + bool record_safe () const; void set_record_enabled (bool yn, void *src); + void set_record_safe (bool yn, void *src); void prep_record_enabled (bool yn, void *src); bool using_diskstream_id (PBD::ID) const; @@ -165,6 +167,7 @@ class LIBARDOUR_API Track : public Route, public PublicDiskstream /* Emitted when our diskstream is set to use a different playlist */ PBD::Signal0<void> PlaylistChanged; PBD::Signal0<void> RecordEnableChanged; + PBD::Signal0<void> RecordSafeChanged; PBD::Signal0<void> SpeedChanged; PBD::Signal0<void> AlignmentStyleChanged; @@ -227,6 +230,7 @@ private: void diskstream_playlist_changed (); void diskstream_record_enable_changed (); + void diskstream_record_safe_changed (); void diskstream_speed_changed (); void diskstream_alignment_style_changed (); void parameter_changed (std::string const & p); |