#include <string>
#include <sigc++/signal.h>
-#include <pthread.h>
+
+#include <glibmm/thread.h>
+
#include <ardour/ardour.h>
#include <jack/jack.h>
#include <jack/transport.h>
int start ();
bool running() const { return _running; }
- PBD::NonBlockingLock& process_lock() { return _process_lock; }
+ Glib::Mutex& process_lock() { return _process_lock; }
jack_nframes_t frame_rate();
jack_nframes_t frames_per_cycle();
virtual const char *what() const throw() { return "could not connect to engine backend"; }
};
- Port *register_audio_input_port (const string& portname);
- Port *register_audio_output_port (const string& portname);
+ Port *register_audio_input_port (const std::string& portname);
+ Port *register_audio_output_port (const std::string& portname);
int unregister_port (Port *);
- int connect (const string& source, const string& destination);
- int disconnect (const string& source, const string& destination);
+ int connect (const std::string& source, const std::string& destination);
+ int disconnect (const std::string& source, const std::string& destination);
int disconnect (Port *);
- const char ** get_ports (const string& port_name_pattern, const string& type_name_pattern, uint32_t flags);
+ const char ** get_ports (const std::string& port_name_pattern, const std::string& type_name_pattern, uint32_t flags);
uint32_t n_physical_outputs () const;
uint32_t n_physical_inputs () const;
- string get_nth_physical_output (uint32_t n) {
+ std::string get_nth_physical_output (uint32_t n) {
return get_nth_physical (n, JackPortIsInput);
}
- string get_nth_physical_input (uint32_t n) {
+ std::string get_nth_physical_input (uint32_t n) {
return get_nth_physical (n, JackPortIsOutput);
}
the return value
*/
- Port *get_port_by_name (const string& name, bool keep = true);
+ Port *get_port_by_name (const std::string& name, bool keep = true);
enum TransportState {
TransportStopped = JackTransportStopped,
ARDOUR::Session *session;
jack_client_t *_jack;
std::string jack_client_name;
- PBD::NonBlockingLock port_lock;
- PBD::NonBlockingLock _process_lock;
- PBD::Lock session_remove_lock;
- pthread_cond_t session_removed;
+ Glib::Mutex port_lock;
+ Glib::Mutex _process_lock;
+ Glib::Mutex session_remove_lock;
+ Glib::Cond session_removed;
bool session_remove_pending;
bool _running;
bool _has_run;
PortConnections port_connections;
void remove_connections_for (Port*);
- string get_nth_physical (uint32_t which, int flags);
+ std::string get_nth_physical (uint32_t which, int flags);
static int _xrun_callback (void *arg);
static int _graph_order_callback (void *arg);
int jack_sample_rate_callback (jack_nframes_t);
static void halted (void *);
- static void meter (Port *port, jack_nframes_t nframes);
int connect_to_jack (std::string client_name);
+
+ void meter_thread ();
+ void start_metering_thread ();
+ Glib::Thread* m_meter_thread;
+ mutable gint m_meter_exit;
};
}; /* namespace ARDOUR */