mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 04:06:26 +01:00
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
2 changed files with 18 additions and 4 deletions
|
|
@ -433,16 +433,27 @@ static void * pthread_process (void *arg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
PortAudioBackend::engine_halted ()
|
||||||
|
{
|
||||||
|
return !_active && _run;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
PortAudioBackend::running ()
|
||||||
|
{
|
||||||
|
return _active || _run;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
PortAudioBackend::_start (bool for_latency_measurement)
|
PortAudioBackend::_start (bool for_latency_measurement)
|
||||||
{
|
{
|
||||||
if (!_active && _run) {
|
if (engine_halted()) {
|
||||||
// recover from 'halted', reap threads
|
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_active || _run) {
|
if (running()) {
|
||||||
DEBUG_AUDIO("Already active.\n");
|
DEBUG_AUDIO("Already started.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -330,6 +330,9 @@ class PortAudioBackend : public AudioBackend {
|
||||||
void process_incoming_midi ();
|
void process_incoming_midi ();
|
||||||
void process_outgoing_midi ();
|
void process_outgoing_midi ();
|
||||||
|
|
||||||
|
bool engine_halted ();
|
||||||
|
bool running ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string _instance_name;
|
std::string _instance_name;
|
||||||
PortAudioIO *_pcmio;
|
PortAudioIO *_pcmio;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue