mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +08:00
Ref T609, mixer utility functions
This commit is contained in:
committed by
Mat Sutcliffe
parent
429c63d220
commit
2bd766ceb1
@@ -12,4 +12,25 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
IAudioMixer::IAudioMixer(QObject *parent) : QObject(parent)
|
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
|
//! Audio mixer output ports
|
||||||
enum OutputPort
|
enum OutputPort
|
||||||
{
|
{
|
||||||
OutputOutputDevice1,
|
OutputDevice1,
|
||||||
OutputVoiceChannel1,
|
OutputVoiceChannel1,
|
||||||
OutputVoiceChannel2,
|
OutputVoiceChannel2,
|
||||||
};
|
};
|
||||||
@@ -53,6 +53,14 @@ namespace BlackCore
|
|||||||
|
|
||||||
//! Returns true if input port and output port are connected
|
//! Returns true if input port and output port are connected
|
||||||
virtual bool hasMixerConnection(InputPort inputPort, OutputPort outputPort) = 0;
|
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
|
} // ns
|
||||||
|
|||||||
Reference in New Issue
Block a user