if (connect_to_jack (client_name)) {
throw NoBackendAvailable ();
}
-
- start_metering_thread();
-
}
AudioEngine::~AudioEngine ()
} else {
// error << _("cannot activate JACK client") << endmsg;
}
+
+ start_metering_thread();
}
return _running ? 0 : -1;
{
if (_running) {
_running = false;
+ stop_metering_thread ();
if (forever) {
jack_client_t* foo = _jack;
_jack = 0;
jack_client_close (foo);
- stop_metering_thread ();
} else {
jack_deactivate (_jack);
}
AudioEngine::start_metering_thread ()
{
if (m_meter_thread == 0) {
+ g_atomic_int_set (&m_meter_exit, 0);
m_meter_thread = Glib::Thread::create (sigc::mem_fun(this, &AudioEngine::meter_thread),
- 500000, true, true, Glib::THREAD_PRIORITY_NORMAL);
+ 500000, true, true, Glib::THREAD_PRIORITY_NORMAL);
}
}
AudioEngine* ae = static_cast<AudioEngine *> (arg);
bool was_running = ae->_running;
+ ae->stop_metering_thread ();
+
ae->_running = false;
ae->_buffer_size = 0;
ae->_frame_rate = 0;
_frame_rate = 0;
if (_running) {
+ stop_metering_thread ();
_running = false;
Stopped(); /* EMIT SIGNAL */
}
Running (); /* EMIT SIGNAL*/
+ start_metering_thread ();
+
return 0;
}