class MidiPort;
class Port;
class Session;
+class ProcessThread;
class AudioEngine : public SessionHandlePtr
{
bool is_realtime () const;
+ ProcessThread* main_thread() const { return _main_thread; }
+
std::string client_name() const { return jack_client_name; }
int reconnect_to_jack ();
/* this signal is sent if JACK ever disconnects us */
- PBD::Signal0<void> Halted;
+ PBD::Signal1<void,const char*> Halted;
/* these two are emitted when the engine itself is
started and stopped
static AudioEngine* instance() { return _instance; }
void died ();
+ pthread_t create_process_thread (boost::function<void()>, size_t stacksize);
+
private:
static AudioEngine* _instance;
Port *register_port (DataType type, const std::string& portname, bool input);
int process_callback (nframes_t nframes);
+ void* process_thread ();
+ void finish_process_cycle (int status);
void remove_all_ports ();
std::string get_nth_physical (DataType type, uint32_t n, int flags);
#endif
static int _graph_order_callback (void *arg);
static int _process_callback (nframes_t nframes, void *arg);
+ static void* _process_thread (void *arg);
static int _sample_rate_callback (nframes_t nframes, void *arg);
static int _bufsize_callback (nframes_t nframes, void *arg);
static void _jack_timebase_callback (jack_transport_state_t, nframes_t, jack_position_t*, int, void*);
int connect_to_jack (std::string client_name, std::string session_uuid);
static void halted (void *);
+ static void halted_info (jack_status_t,const char*,void *);
void meter_thread ();
void start_metering_thread ();
Glib::Thread* m_meter_thread;
static gint m_meter_exit;
+
+ ProcessThread* _main_thread;
+
+ struct ThreadData {
+ AudioEngine* engine;
+ boost::function<void()> f;
+ size_t stacksize;
+
+ ThreadData (AudioEngine* ae, boost::function<void()> fp, size_t stacksz)
+ : engine (ae) , f (fp) , stacksize (stacksz) {}
+ };
+
+ static void* _start_process_thread (void*);
};
} // namespace ARDOUR