Add two utility methods to abstract PortAudioBackend state
These may change as support for callback API is added
This commit is contained in:
parent
f143d76523
commit
23a490c906
@ -433,16 +433,27 @@ static void * pthread_process (void *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
PortAudioBackend::engine_halted ()
|
||||
{
|
||||
return !_active && _run;
|
||||
}
|
||||
|
||||
bool
|
||||
PortAudioBackend::running ()
|
||||
{
|
||||
return _active || _run;
|
||||
}
|
||||
|
||||
int
|
||||
PortAudioBackend::_start (bool for_latency_measurement)
|
||||
{
|
||||
if (!_active && _run) {
|
||||
// recover from 'halted', reap threads
|
||||
if (engine_halted()) {
|
||||
stop();
|
||||
}
|
||||
|
||||
if (_active || _run) {
|
||||
DEBUG_AUDIO("Already active.\n");
|
||||
if (running()) {
|
||||
DEBUG_AUDIO("Already started.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -330,6 +330,9 @@ class PortAudioBackend : public AudioBackend {
|
||||
void process_incoming_midi ();
|
||||
void process_outgoing_midi ();
|
||||
|
||||
bool engine_halted ();
|
||||
bool running ();
|
||||
|
||||
private:
|
||||
std::string _instance_name;
|
||||
PortAudioIO *_pcmio;
|
||||
|
Loading…
Reference in New Issue
Block a user