diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-11-09 20:38:39 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-11-09 20:38:39 +0000 |
commit | 0c4c6e031a3624cfc74c2eef6e79527b7c49eca8 (patch) | |
tree | f2f9e7c1184723073075ff1ad4a3f023b1c51399 /libs/ardour/ardour | |
parent | f7ccc404b38946c89d74e9776226b8ab4f0f6a05 (diff) |
first pass on track mode switch; fixes to dangling region refs after capture; destroy region menu item removed; small fix to SConstruct for missing C++ case; playlist selection mechanism modified ; new Selection operation added (Add); handle crashing situation with align style change handling caused by recursion
git-svn-id: svn://localhost/ardour2/trunk@1099 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/audio_diskstream.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/audio_track.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/audioregion.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/diskstream.h | 5 | ||||
-rw-r--r-- | libs/ardour/ardour/playlist.h | 17 | ||||
-rw-r--r-- | libs/ardour/ardour/region.h | 5 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 5 | ||||
-rw-r--r-- | libs/ardour/ardour/source.h | 12 | ||||
-rw-r--r-- | libs/ardour/ardour/track.h | 8 |
9 files changed, 38 insertions, 21 deletions
diff --git a/libs/ardour/ardour/audio_diskstream.h b/libs/ardour/ardour/audio_diskstream.h index 4dee5e9b00..74c804e5bb 100644 --- a/libs/ardour/ardour/audio_diskstream.h +++ b/libs/ardour/ardour/audio_diskstream.h @@ -77,6 +77,7 @@ class AudioDiskstream : public Diskstream } void set_record_enabled (bool yn); + int set_destructive (bool yn); float peak_power(uint32_t n=0) { float x = channels[n].peak_power; @@ -251,6 +252,8 @@ class AudioDiskstream : public Diskstream typedef vector<ChannelInfo> ChannelList; ChannelList channels; + + bool can_become_destructive () const; }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h index 66fcd16a56..ae299dae4a 100644 --- a/libs/ardour/ardour/audio_track.h +++ b/libs/ardour/ardour/audio_track.h @@ -37,6 +37,8 @@ class AudioTrack : public Track AudioTrack (Session&, const XMLNode&); ~AudioTrack (); + int set_mode (TrackMode m); + int roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, nframes_t offset, int declick, bool can_record, bool rec_monitors_input); diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h index 4be5d27a6b..b739935d96 100644 --- a/libs/ardour/ardour/audioregion.h +++ b/libs/ardour/ardour/audioregion.h @@ -136,6 +136,8 @@ class AudioRegion : public Region void resume_fade_in (); void resume_fade_out (); + void set_playlist (Playlist *); + private: friend class RegionFactory; diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h index 0afed75348..4cee6d1268 100644 --- a/libs/ardour/ardour/diskstream.h +++ b/libs/ardour/ardour/diskstream.h @@ -90,7 +90,7 @@ class IO; virtual void set_record_enabled (bool yn) = 0; bool destructive() const { return _flags & Destructive; } - virtual void set_destructive (bool yn); + virtual int set_destructive (bool yn) { return -1; } bool hidden() const { return _flags & Hidden; } bool recordable() const { return _flags & Recordable; } @@ -138,6 +138,8 @@ class IO; void handle_input_change (IOChange, void *src); + void remove_region_from_last_capture (boost::weak_ptr<Region> wregion); + sigc::signal<void> RecordEnableChanged; sigc::signal<void> SpeedChanged; sigc::signal<void> ReverseChanged; @@ -224,6 +226,7 @@ class IO; virtual bool realtime_set_speed (double, bool global_change); std::list<boost::shared_ptr<Region> > _last_capture_regions; + virtual int use_pending_capture_data (XMLNode& node) = 0; virtual void get_input_sources () = 0; diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index 9cc3f86f0b..7b9ae718bc 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -62,14 +62,15 @@ class Playlist : public PBD::StatefulDestructible { void unref(); uint32_t refcnt() const { return _refcnt; } - const string& name() const { return _name; } - void set_name (const string& str); + std::string name() const { return _name; } + void set_name (std::string str); bool frozen() const { return _frozen; } void set_frozen (bool yn); bool hidden() const { return _hidden; } bool empty() const; + uint32_t n_regions() const; nframes_t get_maximum_extent () const; layer_t top_layer() const; @@ -88,19 +89,15 @@ class Playlist : public PBD::StatefulDestructible { void duplicate (boost::shared_ptr<Region>, nframes_t position, float times); void nudge_after (nframes_t start, nframes_t distance, bool forwards); - boost::shared_ptr<Region> find_region (const PBD::ID&) const; - Playlist* cut (list<AudioRange>&, bool result_is_hidden = true); Playlist* copy (list<AudioRange>&, bool result_is_hidden = true); int paste (Playlist&, nframes_t position, float times); - uint32_t read_data_count() { return _read_data_count; } - - RegionList* regions_at (nframes_t frame); - RegionList* regions_touched (nframes_t start, nframes_t end); + RegionList* regions_at (nframes_t frame); + RegionList* regions_touched (nframes_t start, nframes_t end); + boost::shared_ptr<Region> find_region (const PBD::ID&) const; boost::shared_ptr<Region> top_region_at (nframes_t frame); - - boost::shared_ptr<Region> find_next_region (nframes_t frame, RegionPoint point, int dir); + boost::shared_ptr<Region> find_next_region (nframes_t frame, RegionPoint point, int dir); template<class T> void foreach_region (T *t, void (T::*func)(boost::shared_ptr<Region>, void *), void *arg); template<class T> void foreach_region (T *t, void (T::*func)(boost::shared_ptr<Region>)); diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 67e00d0ee8..7f511c4dd4 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -163,10 +163,7 @@ class Region : public PBD::StatefulDestructible, public boost::enable_shared_fro ARDOUR::Playlist* playlist() const { return _playlist; } - void set_playlist (ARDOUR::Playlist*); - - virtual void lock_sources () {} - virtual void unlock_sources () {} + virtual void set_playlist (ARDOUR::Playlist*); /* serialization */ diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 85c0ef508c..93c093ec85 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -542,8 +542,8 @@ class Session : public PBD::StatefulDestructible /* region info */ - sigc::signal<void,boost::shared_ptr<AudioRegion> > AudioRegionAdded; - sigc::signal<void,boost::shared_ptr<AudioRegion> > AudioRegionRemoved; + sigc::signal<void,boost::weak_ptr<AudioRegion> > AudioRegionAdded; + sigc::signal<void,boost::weak_ptr<AudioRegion> > AudioRegionRemoved; int region_name (string& result, string base = string(""), bool newlevel = false) const; string new_region_name (string); @@ -630,6 +630,7 @@ class Session : public PBD::StatefulDestructible uint32_t n_playlists() const; template<class T> void foreach_playlist (T *obj, void (T::*func)(Playlist *)); + void get_playlists (std::vector<Playlist*>&); /* named selections */ diff --git a/libs/ardour/ardour/source.h b/libs/ardour/ardour/source.h index 7e05e628ac..15e814e946 100644 --- a/libs/ardour/ardour/source.h +++ b/libs/ardour/ardour/source.h @@ -22,6 +22,7 @@ #define __ardour_source_h__ #include <string> +#include <set> #include <sigc++/signal.h> @@ -32,6 +33,7 @@ namespace ARDOUR { class Session; +class Playlist; class Source : public PBD::StatefulDestructible { @@ -49,13 +51,23 @@ class Source : public PBD::StatefulDestructible XMLNode& get_state (); int set_state (const XMLNode&); + void use () { _in_use++; } + void disuse () { if (_in_use) { _in_use--; } } + + void add_playlist (ARDOUR::Playlist*); + void remove_playlist (ARDOUR::Playlist*); + + uint32_t used() const; protected: Session& _session; string _name; time_t _timestamp; + std::set<ARDOUR::Playlist*> _playlists; + private: + uint32_t _in_use; }; } diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index cf380de153..a24b614157 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -39,6 +39,10 @@ class Track : public Route int set_name (string str, void *src); + TrackMode mode () const { return _mode; } + virtual int set_mode (TrackMode m) { return false; } + sigc::signal<void> TrackModeChanged; + virtual int roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, nframes_t offset, int declick, bool can_record, bool rec_monitors_input) = 0; @@ -57,9 +61,6 @@ class Track : public Route virtual int use_diskstream (string name) = 0; virtual int use_diskstream (const PBD::ID& id) = 0; - TrackMode mode() const { return _mode; } - void set_mode (TrackMode m); - nframes_t update_total_latency(); void set_latency_delay (nframes_t); @@ -88,7 +89,6 @@ class Track : public Route void set_meter_point (MeterPoint, void* src); - sigc::signal<void> ModeChanged; sigc::signal<void> DiskstreamChanged; sigc::signal<void> FreezeChange; |