mirror of
https://github.com/lubosz/overte.git
synced 2025-04-10 20:43:39 +02:00
Merge pull request #12578 from druiz17/use-correct-audio-api
use correct scripting api for audio in Audio.qml
This commit is contained in:
commit
42a686ad93
5 changed files with 18 additions and 6 deletions
|
@ -128,10 +128,10 @@ Rectangle {
|
|||
AudioControls.CheckBox {
|
||||
id: stereoMic
|
||||
spacing: muteMic.spacing;
|
||||
text: qsTr("use stereo for stereo devices");
|
||||
checked: false;
|
||||
text: qsTr("Enable stereo input");
|
||||
checked: AudioScriptingInterface.isStereoInput();
|
||||
onClicked: {
|
||||
var success = Audio.setIsStereoInput(checked);
|
||||
var success = AudioScriptingInterface.setStereoInput(checked);
|
||||
if (!success) {
|
||||
checked = !checked;
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ Rectangle {
|
|||
onPressed: {
|
||||
if (!checked) {
|
||||
stereoMic.checked = false;
|
||||
Audio.setIsStereoInput(false); // the next selected audio device might not support stereo
|
||||
AudioScriptingInterface.setStereoInput(false); // the next selected audio device might not support stereo
|
||||
AudioScriptingInterface.setInputDevice(info, bar.currentIndex === 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -193,6 +193,7 @@ public slots:
|
|||
bool isMuted() { return _muted; }
|
||||
|
||||
virtual bool setIsStereoInput(bool stereo) override;
|
||||
virtual bool isStereoInput() override { return _isStereoInput; }
|
||||
|
||||
void setNoiseReduction(bool isNoiseGateEnabled);
|
||||
bool isNoiseReductionEnabled() const { return _isNoiseGateEnabled; }
|
||||
|
|
|
@ -28,7 +28,7 @@ class AbstractAudioInterface : public QObject {
|
|||
Q_OBJECT
|
||||
public:
|
||||
AbstractAudioInterface(QObject* parent = 0) : QObject(parent) {};
|
||||
|
||||
|
||||
static void emitAudioPacket(const void* audioData, size_t bytes, quint16& sequenceNumber, bool isStereo,
|
||||
const Transform& transform, glm::vec3 avatarBoundingBoxCorner, glm::vec3 avatarBoundingBoxScale,
|
||||
PacketType packetType, QString codecName = QString(""));
|
||||
|
@ -40,8 +40,10 @@ public:
|
|||
|
||||
public slots:
|
||||
virtual bool shouldLoopbackInjectors() { return false; }
|
||||
|
||||
|
||||
virtual bool setIsStereoInput(bool stereo) = 0;
|
||||
|
||||
virtual bool isStereoInput() = 0;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(AbstractAudioInterface*)
|
||||
|
|
|
@ -67,3 +67,11 @@ bool AudioScriptingInterface::setStereoInput(bool stereo) {
|
|||
}
|
||||
return stereoInputChanged;
|
||||
}
|
||||
|
||||
bool AudioScriptingInterface::isStereoInput() {
|
||||
bool stereoEnabled = false;
|
||||
if (_localAudioInterface) {
|
||||
stereoEnabled = _localAudioInterface->isStereoInput();
|
||||
}
|
||||
return stereoEnabled;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ protected:
|
|||
Q_INVOKABLE ScriptAudioInjector* playSystemSound(SharedSoundPointer sound, const QVector3D& position);
|
||||
|
||||
Q_INVOKABLE bool setStereoInput(bool stereo);
|
||||
Q_INVOKABLE bool isStereoInput();
|
||||
|
||||
signals:
|
||||
void mutedByMixer(); /// the client has been muted by the mixer
|
||||
|
|
Loading…
Reference in a new issue