diff options
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/audioengine.h | 34 | ||||
-rw-r--r-- | libs/ardour/ardour/delivery.h | 5 | ||||
-rw-r--r-- | libs/ardour/ardour/midi_port.h | 7 | ||||
-rw-r--r-- | libs/ardour/ardour/midi_state_tracker.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/midi_track.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/port.h | 3 |
6 files changed, 34 insertions, 20 deletions
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 9d3bfdb719..a9c414e566 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -82,26 +82,31 @@ class AudioEngine : public sigc::trackable bool get_sync_offset (nframes_t& offset) const; nframes_t frames_since_cycle_start () { - if (!_running || !_jack) return 0; - return jack_frames_since_cycle_start (_jack); + jack_client_t* _priv_jack = _jack; + if (!_running || !_priv_jack) return 0; + return jack_frames_since_cycle_start (_priv_jack); } nframes_t frame_time () { - if (!_running || !_jack) return 0; - return jack_frame_time (_jack); + jack_client_t* _priv_jack = _jack; + if (!_running || !_priv_jack) return 0; + return jack_frame_time (_priv_jack); } nframes_t transport_frame () const { - if (!_running || !_jack) return 0; - return jack_get_current_transport_frame (_jack); + const jack_client_t* _priv_jack = _jack; + if (!_running || !_priv_jack) return 0; + return jack_get_current_transport_frame (_priv_jack); } int request_buffer_size (nframes_t); nframes_t set_monitor_check_interval (nframes_t); + nframes_t processed_frames() const { return _processed_frames; } float get_cpu_load() { - if (!_running || !_jack) return 0; - return jack_cpu_load (_jack); + jack_client_t* _priv_jack = _jack; + if (!_running || !_priv_jack) return 0; + return jack_cpu_load (_priv_jack); } void set_session (Session *); @@ -177,7 +182,7 @@ class AudioEngine : public sigc::trackable bool freewheeling() const { return _freewheeling; } /* this signal is sent for every process() cycle while freewheeling. - the regular process() call to session->process() is not made. +_ the regular process() call to session->process() is not made. */ sigc::signal<int,nframes_t> Freewheel; @@ -210,9 +215,14 @@ class AudioEngine : public sigc::trackable std::string make_port_name_relative (std::string); std::string make_port_name_non_relative (std::string); + static AudioEngine* instance() { return _instance; } + void died (); + private: + static AudioEngine* _instance; + ARDOUR::Session* session; - jack_client_t* _jack; + jack_client_t* volatile _jack; /* could be reset to null by SIGPIPE or another thread */ std::string jack_client_name; Glib::Mutex _process_lock; Glib::Cond session_removed; @@ -261,10 +271,10 @@ class AudioEngine : public sigc::trackable int jack_bufsize_callback (nframes_t); int jack_sample_rate_callback (nframes_t); - static void halted (void *); - int connect_to_jack (std::string client_name); + static void halted (void *); + void meter_thread (); void start_metering_thread (); void stop_metering_thread (); diff --git a/libs/ardour/ardour/delivery.h b/libs/ardour/ardour/delivery.h index d2991a2d04..9224d2755c 100644 --- a/libs/ardour/ardour/delivery.h +++ b/libs/ardour/ardour/delivery.h @@ -68,9 +68,10 @@ public: void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes); - /* supplemental method use with MIDI */ + /* supplemental method used with MIDI */ - void flush (nframes_t nframes); + void flush (nframes_t nframes, nframes64_t time); + void transport_stopped (); void no_outs_cuz_we_no_monitor(bool); diff --git a/libs/ardour/ardour/midi_port.h b/libs/ardour/ardour/midi_port.h index 749829b7ea..10d8c7b6ca 100644 --- a/libs/ardour/ardour/midi_port.h +++ b/libs/ardour/ardour/midi_port.h @@ -23,6 +23,7 @@ #include "ardour/port.h" #include "ardour/midi_buffer.h" +#include "ardour/midi_state_tracker.h" namespace ARDOUR { @@ -39,7 +40,9 @@ class MidiPort : public Port { void cycle_start (nframes_t nframes); void cycle_end (nframes_t nframes); void cycle_split (); - void flush_buffers (nframes_t nframes, nframes_t offset = 0); + + void flush_buffers (nframes_t nframes, nframes64_t time, nframes_t offset = 0); + void transport_stopped (); size_t raw_buffer_size(jack_nframes_t nframes) const; @@ -57,7 +60,9 @@ class MidiPort : public Port { private: MidiBuffer* _buffer; bool _has_been_mixed_down; + bool _resolve_in_process; + MidiStateTracker _midi_state_tracker; }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/midi_state_tracker.h b/libs/ardour/ardour/midi_state_tracker.h index f5a44788db..a058121da8 100644 --- a/libs/ardour/ardour/midi_state_tracker.h +++ b/libs/ardour/ardour/midi_state_tracker.h @@ -36,7 +36,7 @@ public: MidiStateTracker(); void track (const MidiBuffer::iterator& from, const MidiBuffer::iterator& to, bool& looped); - void resolve_notes (MidiBuffer& buffer, nframes_t time); + void resolve_notes (MidiBuffer& buffer, nframes64_t time); void dump (std::ostream&); void reset (); diff --git a/libs/ardour/ardour/midi_track.h b/libs/ardour/ardour/midi_track.h index 85941cd0ef..a4054e6b00 100644 --- a/libs/ardour/ardour/midi_track.h +++ b/libs/ardour/ardour/midi_track.h @@ -22,7 +22,6 @@ #include "ardour/track.h" #include "ardour/midi_ring_buffer.h" -#include "ardour/midi_state_tracker.h" namespace ARDOUR { @@ -105,8 +104,6 @@ private: void set_state_part_two (); void set_state_part_three (); - MidiStateTracker _midi_state_tracker; - MidiRingBuffer<nframes_t> _immediate_events; MidiRingBuffer<nframes_t> _step_edit_ring_buffer; NoteMode _note_mode; diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h index 75215e148d..5567b2170e 100644 --- a/libs/ardour/ardour/port.h +++ b/libs/ardour/ardour/port.h @@ -110,9 +110,10 @@ public: virtual void cycle_end (nframes_t) = 0; virtual void cycle_split () = 0; virtual Buffer& get_buffer (nframes_t nframes, nframes_t offset = 0) = 0; - virtual void flush_buffers (nframes_t, nframes_t offset = 0) { + virtual void flush_buffers (nframes_t nframes, nframes64_t /*time*/, nframes_t offset = 0) { (void) offset; } + virtual void transport_stopped () {} static void set_engine (AudioEngine *); |