diff options
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/audioengine.h | 34 | ||||
-rw-r--r-- | libs/ardour/ardour/sndfile_helpers.h | 2 |
2 files changed, 23 insertions, 13 deletions
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 6ba141248c..2d2acfed27 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -76,26 +76,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 *); @@ -172,7 +177,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; @@ -201,9 +206,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; @@ -252,10 +262,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/sndfile_helpers.h b/libs/ardour/ardour/sndfile_helpers.h index cf6b15f3a4..26a93ad124 100644 --- a/libs/ardour/ardour/sndfile_helpers.h +++ b/libs/ardour/ardour/sndfile_helpers.h @@ -28,7 +28,7 @@ using std::string; // Use this define when initializing arrarys for use in sndfile_*_format() #define SNDFILE_STR_LENGTH 32 -#define SNDFILE_HEADER_FORMATS 5 +#define SNDFILE_HEADER_FORMATS 7 extern const char * const sndfile_header_formats_strings[SNDFILE_HEADER_FORMATS+1]; extern const char * const sndfile_file_endings_strings[SNDFILE_HEADER_FORMATS+1]; |