mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Ref T609, mixer utility functions
This commit is contained in:
committed by
Mat Sutcliffe
parent
e53833856a
commit
90deceae6b
@@ -12,4 +12,25 @@ namespace BlackCore
|
||||
{
|
||||
IAudioMixer::IAudioMixer(QObject *parent) : QObject(parent)
|
||||
{ }
|
||||
|
||||
bool IAudioMixer::makeOrRemoveConnection(IAudioMixer::InputPort inputPort, IAudioMixer::OutputPort outputPort, bool make)
|
||||
{
|
||||
return make ?
|
||||
this->makeMixerConnectionIfNotExisting(inputPort, outputPort) :
|
||||
this->removeMixerConnectionIfExisting(inputPort, outputPort);
|
||||
}
|
||||
|
||||
bool IAudioMixer::makeMixerConnectionIfNotExisting(IAudioMixer::InputPort inputPort, IAudioMixer::OutputPort outputPort)
|
||||
{
|
||||
if (this->hasMixerConnection(inputPort, outputPort)) { return false; }
|
||||
this->makeMixerConnection(inputPort, outputPort);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IAudioMixer::removeMixerConnectionIfExisting(IAudioMixer::InputPort inputPort, IAudioMixer::OutputPort outputPort)
|
||||
{
|
||||
if (!this->hasMixerConnection(inputPort, outputPort)) { return false; }
|
||||
this->removeMixerConnection(inputPort, outputPort);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace BlackCore
|
||||
//! Audio mixer output ports
|
||||
enum OutputPort
|
||||
{
|
||||
OutputOutputDevice1,
|
||||
OutputDevice1,
|
||||
OutputVoiceChannel1,
|
||||
OutputVoiceChannel2,
|
||||
};
|
||||
@@ -53,6 +53,14 @@ namespace BlackCore
|
||||
|
||||
//! Returns true if input port and output port are connected
|
||||
virtual bool hasMixerConnection(InputPort inputPort, OutputPort outputPort) = 0;
|
||||
|
||||
//! Make or remove connection
|
||||
bool makeOrRemoveConnection(InputPort inputPort, OutputPort outputPort, bool make);
|
||||
|
||||
//! Safe versions of make/remove @{
|
||||
bool makeMixerConnectionIfNotExisting(InputPort inputPort, OutputPort outputPort);
|
||||
bool removeMixerConnectionIfExisting(InputPort inputPort, OutputPort outputPort);
|
||||
//! @}
|
||||
};
|
||||
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user