diff options
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/ardour.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/audio_buffer.h | 23 | ||||
-rw-r--r-- | libs/ardour/ardour/audio_port.h | 6 | ||||
-rw-r--r-- | libs/ardour/ardour/audio_track.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/automatable.h | 7 | ||||
-rw-r--r-- | libs/ardour/ardour/buffer.h | 6 | ||||
-rw-r--r-- | libs/ardour/ardour/buffer_set.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/io.h | 29 | ||||
-rw-r--r-- | libs/ardour/ardour/io_processor.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/port.h | 10 | ||||
-rw-r--r-- | libs/ardour/ardour/processor.h | 7 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/types.h | 5 |
13 files changed, 71 insertions, 37 deletions
diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h index 635e8a31ca..7321daf097 100644 --- a/libs/ardour/ardour/ardour.h +++ b/libs/ardour/ardour/ardour.h @@ -42,9 +42,6 @@ namespace MIDI { namespace ARDOUR { class AudioEngine; - class OSC; - - extern OSC* osc; static const nframes_t max_frames = JACK_MAX_FRAMES; extern sigc::signal<void,std::string> BootMessage; diff --git a/libs/ardour/ardour/audio_buffer.h b/libs/ardour/ardour/audio_buffer.h index 9a41e8e093..829288a7af 100644 --- a/libs/ardour/ardour/audio_buffer.h +++ b/libs/ardour/ardour/audio_buffer.h @@ -68,9 +68,14 @@ public: /** Accumulate (add) @a len frames FROM THE START OF @a src into self at @a offset * scaling by @a gain_coeff */ void accumulate_with_gain_from(const AudioBuffer& src, nframes_t len, nframes_t offset, gain_t gain_coeff) { + assert(_capacity > 0); assert(offset + len <= _capacity); + if (src.silent()) { + return; + } + Sample* const dst_raw = _data + offset; const Sample* const src_raw = src.data(); @@ -82,6 +87,7 @@ public: /** Accumulate (add) @a len frames FROM THE START OF @a src into self at @a offset * scaling by @a gain_coeff */ void accumulate_with_gain_from(const Sample* src_raw, nframes_t len, nframes_t offset, gain_t gain_coeff) { + assert(_capacity > 0); assert(offset + len <= _capacity); @@ -123,7 +129,22 @@ public: Sample* data (nframes_t nframes, nframes_t offset) { assert(offset + nframes <= _capacity); return _data + offset; } -private: + void replace_data (size_t nframes); + + void drop_data () { + assert (_owns_data); + assert (_data); + + free (_data); + _data = 0; + _size = 0; + _capacity = 0; + _silent = false; + } + + void copy_to_internal (Sample* p, nframes_t cnt, nframes_t offset); + + private: bool _owns_data; Sample* _data; ///< Actual buffer contents }; diff --git a/libs/ardour/ardour/audio_port.h b/libs/ardour/ardour/audio_port.h index 339165da0f..304902bccb 100644 --- a/libs/ardour/ardour/audio_port.h +++ b/libs/ardour/ardour/audio_port.h @@ -51,12 +51,16 @@ class AudioPort : public Port AudioPort (std::string const &, Flags, bool, nframes_t); + bool using_internal_data() const; + void use_internal_data (); + void use_external_data (); + private: void mixdown (nframes_t, nframes_t, bool); bool _has_been_mixed_down; AudioBuffer* _buffer; - bool _own_buffer; + bool _internal_buffer; }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h index fe7dcb58ff..48609271d7 100644 --- a/libs/ardour/ardour/audio_track.h +++ b/libs/ardour/ardour/audio_track.h @@ -73,6 +73,10 @@ class AudioTrack : public Track int deprecated_use_diskstream_connections (); void set_state_part_two (); void set_state_part_three (); + + void catch_up_on_busses (ARDOUR::RouteList&); + void add_internal_send (boost::shared_ptr<ARDOUR::Route>); + }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/automatable.h b/libs/ardour/ardour/automatable.h index fc61e2200d..d99960334d 100644 --- a/libs/ardour/ardour/automatable.h +++ b/libs/ardour/ardour/automatable.h @@ -94,15 +94,16 @@ public: Evoral::ControlSet& data() { return *this; } const Evoral::ControlSet& data() const { return *this; } -protected: + int set_automation_state (const XMLNode&, Evoral::Parameter default_param); + XMLNode& get_automation_state(); + + protected: Session& _a_session; void can_automate(Evoral::Parameter); virtual void auto_state_changed (Evoral::Parameter which) {} - int set_automation_state(const XMLNode&, Evoral::Parameter default_param); - XMLNode& get_automation_state(); int load_automation (const std::string& path); int old_set_automation_state(const XMLNode&); diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h index e03489568c..02d6975fad 100644 --- a/libs/ardour/ardour/buffer.h +++ b/libs/ardour/ardour/buffer.h @@ -68,7 +68,7 @@ public: * passed to the constructor must have been non-zero. */ virtual void resize(size_t) = 0; - + /** Clear (eg zero, or empty) buffer starting at TIME @a offset */ virtual void silence(nframes_t len, nframes_t offset=0) = 0; @@ -77,9 +77,9 @@ public: virtual void read_from(const Buffer& src, nframes_t offset, nframes_t len) = 0; -protected: + protected: Buffer(DataType type, size_t capacity) - : _type(type), _capacity(capacity), _size(0), _silent(true) + : _type(type), _capacity(capacity), _size(0), _silent(true) {} DataType _type; diff --git a/libs/ardour/ardour/buffer_set.h b/libs/ardour/ardour/buffer_set.h index c750615798..3f7a6e7665 100644 --- a/libs/ardour/ardour/buffer_set.h +++ b/libs/ardour/ardour/buffer_set.h @@ -23,6 +23,7 @@ #include <vector> #include <ardour/chan_count.h> #include <ardour/data_type.h> +#include <ardour/types.h> namespace ARDOUR { @@ -53,7 +54,7 @@ public: void clear(); - void attach_buffers(PortSet& ports); + void attach_buffers(PortSet& ports, nframes_t nframes, nframes_t offset); void ensure_buffers(const ChanCount& count, size_t buffer_capacity); void ensure_buffers(DataType type, size_t num_buffers, size_t buffer_capacity); diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h index 2d5b55c502..32962fef0d 100644 --- a/libs/ardour/ardour/io.h +++ b/libs/ardour/ardour/io.h @@ -109,6 +109,8 @@ class IO : public SessionObject, public AutomatableControls, public Latent void just_meter_input (nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset); + BufferSet& output_buffers() { return *_output_buffers; } + gain_t gain () const { return _desired_gain; } virtual gain_t effective_gain () const; @@ -121,6 +123,7 @@ class IO : public SessionObject, public AutomatableControls, public Latent Panner& panner() { return *_panner; } PeakMeter& peak_meter() { return *_meter; } const Panner& panner() const { return *_panner; } + void reset_panner (); int ensure_io (ChanCount in, ChanCount out, bool clear, void *src); @@ -196,15 +199,10 @@ class IO : public SessionObject, public AutomatableControls, public Latent int set_state (const XMLNode&); static int disable_connecting (void); - static int enable_connecting (void); - static int disable_ports (void); - static int enable_ports (void); - static int disable_panners (void); - static int reset_panners (void); static sigc::signal<int> PortsLegal; @@ -214,16 +212,16 @@ class IO : public SessionObject, public AutomatableControls, public Latent static sigc::signal<void,ChanCount> PortCountChanged; static sigc::signal<int> PortsCreated; - static void update_meters(); + static void update_meters(); private: - - static sigc::signal<void> Meter; - static Glib::StaticMutex m_meter_signal_lock; - sigc::connection m_meter_connection; + + static sigc::signal<void> Meter; + static Glib::StaticMutex m_meter_signal_lock; + sigc::connection m_meter_connection; public: - + /* automation */ struct GainControl : public AutomationControl { @@ -292,8 +290,6 @@ class IO : public SessionObject, public AutomatableControls, public Latent virtual void set_deferred_state() {} - void reset_panner (); - virtual uint32_t pans_required() const { return _inputs.count().n_audio(); } @@ -314,14 +310,11 @@ class IO : public SessionObject, public AutomatableControls, public Latent static bool connecting_legal; static bool ports_legal; - BufferSet& output_buffers() { return *_output_buffers; } - private: + static bool panners_legal; - friend class Send; + void copy_to_outputs (BufferSet& bufs, DataType type, nframes_t nframes, nframes_t offset); - static bool panners_legal; - int connecting_became_legal (); int panners_became_legal (); sigc::connection connection_legal_c; diff --git a/libs/ardour/ardour/io_processor.h b/libs/ardour/ardour/io_processor.h index d2bd210516..3739c496c5 100644 --- a/libs/ardour/ardour/io_processor.h +++ b/libs/ardour/ardour/io_processor.h @@ -53,7 +53,9 @@ class IOProcessor : public Processor { public: IOProcessor (Session&, const string& name, Placement, - int input_min = -1, int input_max = -1, int output_min = -1, int output_max = -1); + int input_min = -1, int input_max = -1, int output_min = -1, int output_max = -1, + ARDOUR::DataType default_type = DataType::AUDIO, + bool public_ports = true); IOProcessor (const IOProcessor&); virtual ~IOProcessor (); diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h index 7539aac9d5..759d532e82 100644 --- a/libs/ardour/ardour/port.h +++ b/libs/ardour/ardour/port.h @@ -71,6 +71,7 @@ public: } bool connected () const; + bool externally_connected () const; int disconnect_all (); int get_connections (std::vector<std::string> &) const; @@ -81,7 +82,7 @@ public: /* connection by Port* */ bool connected_to (Port *) const; - int connect (Port *); + virtual int connect (Port *); int disconnect (Port *); void ensure_monitor_input (bool); @@ -113,6 +114,12 @@ protected: std::set<Port*> _connections; ///< internal Ports that we are connected to static AudioEngine* _engine; ///< the AudioEngine + + virtual bool using_internal_data() const { return false; } + virtual void use_internal_data () {} + virtual void use_external_data () {} + + void check_buffer_status (); private: friend class AudioEngine; @@ -130,6 +137,7 @@ private: /// list of JACK ports that we are connected to; we only keep this around /// so that we can implement ::reconnect () std::set<std::string> _named_connections; + }; } diff --git a/libs/ardour/ardour/processor.h b/libs/ardour/ardour/processor.h index 4b236d159e..da00c77dab 100644 --- a/libs/ardour/ardour/processor.h +++ b/libs/ardour/ardour/processor.h @@ -39,6 +39,7 @@ class XMLNode; namespace ARDOUR { class Session; +class Route; /* A mixer strip element - plugin, send, meter, etc. */ @@ -60,7 +61,6 @@ class Processor : public SessionObject, public AutomatableControls, public Laten void set_placement (Placement); bool active () const { return _active; } - void set_active (bool yn); bool get_next_ab_is_active () const { return _next_ab_is_active; } void set_next_ab_is_active (bool yn) { _next_ab_is_active = yn; } @@ -77,8 +77,8 @@ class Processor : public SessionObject, public AutomatableControls, public Laten virtual void silence (nframes_t nframes, nframes_t offset) {} - virtual void activate () { _active = true; ActiveChanged.emit(); } - virtual void deactivate () { _active = false; ActiveChanged.emit(); } + void activate () { _active = true; ActiveChanged(); } + void deactivate () { _active = false; ActiveChanged(); } virtual bool configure_io (ChanCount in, ChanCount out); @@ -108,6 +108,7 @@ class Processor : public SessionObject, public AutomatableControls, public Laten sigc::signal<void> PlacementChanged; protected: + int _pending_active; bool _active; bool _next_ab_is_active; bool _configured; diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 1a88882eb6..7cdc11a054 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -306,7 +306,6 @@ class Session : public PBD::StatefulDestructible uint32_t n_diskstreams() const; typedef std::list<boost::shared_ptr<Diskstream> > DiskstreamList; - typedef std::list<boost::shared_ptr<Route> > RouteList; int load_routes (const XMLNode&); boost::shared_ptr<RouteList> get_routes() const { diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index cb058254bf..125c8569a8 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -51,6 +51,7 @@ namespace ARDOUR { class Source; class AudioSource; + class Route; typedef jack_default_audio_sample_t Sample; typedef float pan_t; @@ -419,9 +420,11 @@ namespace ARDOUR { typedef std::list<nframes64_t> AnalysisFeatureList; + typedef std::list<boost::shared_ptr<Route> > RouteList; + class Bundle; typedef std::vector<boost::shared_ptr<Bundle> > BundleList; - + } // namespace ARDOUR std::istream& operator>>(std::istream& o, ARDOUR::SampleFormat& sf); |