mirror of
https://github.com/overte-org/overte.git
synced 2025-06-16 03:00:40 +02:00
Initial implementation (deadlocks still occurring in Audio.cpp)
This commit is contained in:
parent
c3b8f6ed93
commit
15d49fd9a9
7 changed files with 302 additions and 12 deletions
|
@ -148,6 +148,25 @@ Rectangle {
|
||||||
checked = Qt.binding(function() { return AudioScriptingInterface.noiseReduction; }); // restore binding
|
checked = Qt.binding(function() { return AudioScriptingInterface.noiseReduction; }); // restore binding
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
AudioControls.CheckBox {
|
||||||
|
spacing: muteMic.spacing
|
||||||
|
text: qsTr("Push To Talk");
|
||||||
|
checked: isVR ? AudioScriptingInterface.pushToTalkHMD : AudioScriptingInterface.pushToTalkDesktop;
|
||||||
|
onClicked: {
|
||||||
|
if (isVR) {
|
||||||
|
AudioScriptingInterface.pushToTalkHMD = checked;
|
||||||
|
} else {
|
||||||
|
AudioScriptingInterface.pushToTalkDesktop = checked;
|
||||||
|
}
|
||||||
|
checked = Qt.binding(function() {
|
||||||
|
if (isVR) {
|
||||||
|
return AudioScriptingInterface.pushToTalkHMD;
|
||||||
|
} else {
|
||||||
|
return AudioScriptingInterface.pushToTalkDesktop;
|
||||||
|
}
|
||||||
|
}); // restore binding
|
||||||
|
}
|
||||||
|
}
|
||||||
AudioControls.CheckBox {
|
AudioControls.CheckBox {
|
||||||
spacing: muteMic.spacing
|
spacing: muteMic.spacing
|
||||||
text: qsTr("Show audio level meter");
|
text: qsTr("Show audio level meter");
|
||||||
|
|
|
@ -11,10 +11,13 @@
|
||||||
|
|
||||||
import QtQuick 2.5
|
import QtQuick 2.5
|
||||||
import QtGraphicalEffects 1.0
|
import QtGraphicalEffects 1.0
|
||||||
|
import stylesUit 1.0
|
||||||
|
|
||||||
import TabletScriptingInterface 1.0
|
import TabletScriptingInterface 1.0
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
HifiConstants { id: hifi; }
|
||||||
|
|
||||||
readonly property var level: AudioScriptingInterface.inputLevel;
|
readonly property var level: AudioScriptingInterface.inputLevel;
|
||||||
|
|
||||||
property bool gated: false;
|
property bool gated: false;
|
||||||
|
@ -131,9 +134,9 @@ Rectangle {
|
||||||
Item {
|
Item {
|
||||||
id: status;
|
id: status;
|
||||||
|
|
||||||
readonly property string color: AudioScriptingInterface.muted ? colors.muted : colors.unmuted;
|
readonly property string color: (AudioScriptingInterface.pushingToTalk && AudioScriptingInterface.muted) ? hifi.colors.blueHighlight : AudioScriptingInterface.muted ? colors.muted : colors.unmuted;
|
||||||
|
|
||||||
visible: AudioScriptingInterface.muted;
|
visible: AudioScriptingInterface.pushingToTalk || AudioScriptingInterface.muted;
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left;
|
left: parent.left;
|
||||||
|
@ -152,7 +155,7 @@ Rectangle {
|
||||||
|
|
||||||
color: parent.color;
|
color: parent.color;
|
||||||
|
|
||||||
text: AudioScriptingInterface.muted ? "MUTED" : "MUTE";
|
text: AudioScriptingInterface.pushToTalk ? (AudioScriptingInterface.pushingToTalk ? "SPEAKING" : "PUSH TO TALK") : (AudioScriptingInterface.muted ? "MUTED" : "MUTE");
|
||||||
font.pointSize: 12;
|
font.pointSize: 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1435,6 +1435,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
});
|
});
|
||||||
connect(this, &Application::activeDisplayPluginChanged,
|
connect(this, &Application::activeDisplayPluginChanged,
|
||||||
reinterpret_cast<scripting::Audio*>(audioScriptingInterface.data()), &scripting::Audio::onContextChanged);
|
reinterpret_cast<scripting::Audio*>(audioScriptingInterface.data()), &scripting::Audio::onContextChanged);
|
||||||
|
connect(this, &Application::pushedToTalk,
|
||||||
|
reinterpret_cast<scripting::Audio*>(audioScriptingInterface.data()), &scripting::Audio::handlePushedToTalk);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the rendering engine. This can be slow on some machines due to lots of
|
// Create the rendering engine. This can be slow on some machines due to lots of
|
||||||
|
@ -4205,6 +4207,10 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Qt::Key_T:
|
||||||
|
emit pushedToTalk(true);
|
||||||
|
break;
|
||||||
|
|
||||||
case Qt::Key_P: {
|
case Qt::Key_P: {
|
||||||
if (!isShifted && !isMeta && !isOption && !event->isAutoRepeat()) {
|
if (!isShifted && !isMeta && !isOption && !event->isAutoRepeat()) {
|
||||||
AudioInjectorOptions options;
|
AudioInjectorOptions options;
|
||||||
|
@ -4310,6 +4316,12 @@ void Application::keyReleaseEvent(QKeyEvent* event) {
|
||||||
if (_keyboardMouseDevice->isActive()) {
|
if (_keyboardMouseDevice->isActive()) {
|
||||||
_keyboardMouseDevice->keyReleaseEvent(event);
|
_keyboardMouseDevice->keyReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (event->key()) {
|
||||||
|
case Qt::Key_T:
|
||||||
|
emit pushedToTalk(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::focusOutEvent(QFocusEvent* event) {
|
void Application::focusOutEvent(QFocusEvent* event) {
|
||||||
|
@ -5241,6 +5253,9 @@ void Application::loadSettings() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto audioScriptingInterface = reinterpret_cast<scripting::Audio*>(DependencyManager::get<AudioScriptingInterface>().data());
|
||||||
|
audioScriptingInterface->loadData();
|
||||||
|
|
||||||
getMyAvatar()->loadData();
|
getMyAvatar()->loadData();
|
||||||
_settingsLoaded = true;
|
_settingsLoaded = true;
|
||||||
}
|
}
|
||||||
|
@ -5250,6 +5265,9 @@ void Application::saveSettings() const {
|
||||||
DependencyManager::get<AudioClient>()->saveSettings();
|
DependencyManager::get<AudioClient>()->saveSettings();
|
||||||
DependencyManager::get<LODManager>()->saveSettings();
|
DependencyManager::get<LODManager>()->saveSettings();
|
||||||
|
|
||||||
|
auto audioScriptingInterface = reinterpret_cast<scripting::Audio*>(DependencyManager::get<AudioScriptingInterface>().data());
|
||||||
|
audioScriptingInterface->saveData();
|
||||||
|
|
||||||
Menu::getInstance()->saveSettings();
|
Menu::getInstance()->saveSettings();
|
||||||
getMyAvatar()->saveData();
|
getMyAvatar()->saveData();
|
||||||
PluginManager::getInstance()->saveSettings();
|
PluginManager::getInstance()->saveSettings();
|
||||||
|
|
|
@ -358,6 +358,8 @@ signals:
|
||||||
|
|
||||||
void miniTabletEnabledChanged(bool enabled);
|
void miniTabletEnabledChanged(bool enabled);
|
||||||
|
|
||||||
|
void pushedToTalk(bool enabled);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
QVector<EntityItemID> pasteEntities(float x, float y, float z);
|
QVector<EntityItemID> pasteEntities(float x, float y, float z);
|
||||||
bool exportEntities(const QString& filename, const QVector<QUuid>& entityIDs, const glm::vec3* givenOffset = nullptr);
|
bool exportEntities(const QString& filename, const QVector<QUuid>& entityIDs, const glm::vec3* givenOffset = nullptr);
|
||||||
|
|
|
@ -63,26 +63,163 @@ void Audio::stopRecording() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Audio::isMuted() const {
|
bool Audio::isMuted() const {
|
||||||
return resultWithReadLock<bool>([&] {
|
bool isHMD = qApp->isHMDMode();
|
||||||
return _isMuted;
|
if (isHMD) {
|
||||||
});
|
return getMutedHMD();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return getMutedDesktop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Audio::setMuted(bool isMuted) {
|
void Audio::setMuted(bool isMuted) {
|
||||||
|
withWriteLock([&] {
|
||||||
|
bool isHMD = qApp->isHMDMode();
|
||||||
|
if (isHMD) {
|
||||||
|
setMutedHMD(isMuted);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setMutedDesktop(isMuted);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void Audio::setMutedDesktop(bool isMuted) {
|
||||||
|
bool changed = false;
|
||||||
|
if (_desktopMuted != isMuted) {
|
||||||
|
changed = true;
|
||||||
|
_desktopMuted = isMuted;
|
||||||
|
auto client = DependencyManager::get<AudioClient>().data();
|
||||||
|
QMetaObject::invokeMethod(client, "setMuted", Q_ARG(bool, isMuted), Q_ARG(bool, false));
|
||||||
|
}
|
||||||
|
if (changed) {
|
||||||
|
emit mutedChanged(isMuted);
|
||||||
|
emit desktopMutedChanged(isMuted);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Audio::getMutedDesktop() const {
|
||||||
|
return resultWithReadLock<bool>([&] {
|
||||||
|
return _desktopMuted;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void Audio::setMutedHMD(bool isMuted) {
|
||||||
|
bool changed = false;
|
||||||
|
if (_hmdMuted != isMuted) {
|
||||||
|
changed = true;
|
||||||
|
_hmdMuted = isMuted;
|
||||||
|
auto client = DependencyManager::get<AudioClient>().data();
|
||||||
|
QMetaObject::invokeMethod(client, "setMuted", Q_ARG(bool, isMuted), Q_ARG(bool, false));
|
||||||
|
}
|
||||||
|
if (changed) {
|
||||||
|
emit mutedChanged(isMuted);
|
||||||
|
emit hmdMutedChanged(isMuted);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Audio::getMutedHMD() const {
|
||||||
|
return resultWithReadLock<bool>([&] {
|
||||||
|
return _hmdMuted;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Audio::getPTT() {
|
||||||
|
bool isHMD = qApp->isHMDMode();
|
||||||
|
if (isHMD) {
|
||||||
|
return getPTTHMD();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return getPTTDesktop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Audio::getPushingToTalk() const {
|
||||||
|
return resultWithReadLock<bool>([&] {
|
||||||
|
return _pushingToTalk;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void Audio::setPTT(bool enabled) {
|
||||||
|
bool isHMD = qApp->isHMDMode();
|
||||||
|
if (isHMD) {
|
||||||
|
setPTTHMD(enabled);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setPTTDesktop(enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Audio::setPTTDesktop(bool enabled) {
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
if (_isMuted != isMuted) {
|
if (_pttDesktop != enabled) {
|
||||||
_isMuted = isMuted;
|
|
||||||
auto client = DependencyManager::get<AudioClient>().data();
|
|
||||||
QMetaObject::invokeMethod(client, "setMuted", Q_ARG(bool, isMuted), Q_ARG(bool, false));
|
|
||||||
changed = true;
|
changed = true;
|
||||||
|
_pttDesktop = enabled;
|
||||||
|
if (!enabled) {
|
||||||
|
// Set to default behavior (unmuted for Desktop) on Push-To-Talk disable.
|
||||||
|
setMutedDesktop(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Should be muted when not pushing to talk while PTT is enabled.
|
||||||
|
setMutedDesktop(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (changed) {
|
if (changed) {
|
||||||
emit mutedChanged(isMuted);
|
emit pushToTalkChanged(enabled);
|
||||||
|
emit pushToTalkDesktopChanged(enabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Audio::getPTTDesktop() const {
|
||||||
|
return resultWithReadLock<bool>([&] {
|
||||||
|
return _pttDesktop;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void Audio::setPTTHMD(bool enabled) {
|
||||||
|
bool changed = false;
|
||||||
|
withWriteLock([&] {
|
||||||
|
if (_pttHMD != enabled) {
|
||||||
|
changed = true;
|
||||||
|
_pttHMD = enabled;
|
||||||
|
if (!enabled) {
|
||||||
|
// Set to default behavior (unmuted for HMD) on Push-To-Talk disable.
|
||||||
|
setMutedHMD(false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Should be muted when not pushing to talk while PTT is enabled.
|
||||||
|
setMutedHMD(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (changed) {
|
||||||
|
emit pushToTalkChanged(enabled);
|
||||||
|
emit pushToTalkHMDChanged(enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Audio::getPTTHMD() const {
|
||||||
|
return resultWithReadLock<bool>([&] {
|
||||||
|
return _pttHMD;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void Audio::saveData() {
|
||||||
|
_desktopMutedSetting.set(getMutedDesktop());
|
||||||
|
_hmdMutedSetting.set(getMutedHMD());
|
||||||
|
_pttDesktopSetting.set(getPTTDesktop());
|
||||||
|
_pttHMDSetting.set(getPTTHMD());
|
||||||
|
}
|
||||||
|
|
||||||
|
void Audio::loadData() {
|
||||||
|
_desktopMuted = _desktopMutedSetting.get();
|
||||||
|
_hmdMuted = _hmdMutedSetting.get();
|
||||||
|
_pttDesktop = _pttDesktopSetting.get();
|
||||||
|
_pttHMD = _pttHMDSetting.get();
|
||||||
|
}
|
||||||
|
|
||||||
bool Audio::noiseReductionEnabled() const {
|
bool Audio::noiseReductionEnabled() const {
|
||||||
return resultWithReadLock<bool>([&] {
|
return resultWithReadLock<bool>([&] {
|
||||||
return _enableNoiseReduction;
|
return _enableNoiseReduction;
|
||||||
|
@ -179,11 +316,32 @@ void Audio::onContextChanged() {
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (isHMD) {
|
||||||
|
setMuted(getMutedHMD());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setMuted(getMutedDesktop());
|
||||||
|
}
|
||||||
if (changed) {
|
if (changed) {
|
||||||
emit contextChanged(isHMD ? Audio::HMD : Audio::DESKTOP);
|
emit contextChanged(isHMD ? Audio::HMD : Audio::DESKTOP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Audio::handlePushedToTalk(bool enabled) {
|
||||||
|
if (getPTT()) {
|
||||||
|
if (enabled) {
|
||||||
|
setMuted(false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setMuted(true);
|
||||||
|
}
|
||||||
|
if (_pushingToTalk != enabled) {
|
||||||
|
_pushingToTalk = enabled;
|
||||||
|
emit pushingToTalkChanged(enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Audio::setReverb(bool enable) {
|
void Audio::setReverb(bool enable) {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
DependencyManager::get<AudioClient>()->setReverb(enable);
|
DependencyManager::get<AudioClient>()->setReverb(enable);
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#ifndef hifi_scripting_Audio_h
|
#ifndef hifi_scripting_Audio_h
|
||||||
#define hifi_scripting_Audio_h
|
#define hifi_scripting_Audio_h
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
#include "AudioScriptingInterface.h"
|
#include "AudioScriptingInterface.h"
|
||||||
#include "AudioDevices.h"
|
#include "AudioDevices.h"
|
||||||
#include "AudioEffectOptions.h"
|
#include "AudioEffectOptions.h"
|
||||||
|
@ -19,6 +20,9 @@
|
||||||
#include "AudioFileWav.h"
|
#include "AudioFileWav.h"
|
||||||
#include <shared/ReadWriteLockable.h>
|
#include <shared/ReadWriteLockable.h>
|
||||||
|
|
||||||
|
using MutedGetter = std::function<bool()>;
|
||||||
|
using MutedSetter = std::function<void(bool)>;
|
||||||
|
|
||||||
namespace scripting {
|
namespace scripting {
|
||||||
|
|
||||||
class Audio : public AudioScriptingInterface, protected ReadWriteLockable {
|
class Audio : public AudioScriptingInterface, protected ReadWriteLockable {
|
||||||
|
@ -63,6 +67,12 @@ class Audio : public AudioScriptingInterface, protected ReadWriteLockable {
|
||||||
Q_PROPERTY(bool clipping READ isClipping NOTIFY clippingChanged)
|
Q_PROPERTY(bool clipping READ isClipping NOTIFY clippingChanged)
|
||||||
Q_PROPERTY(QString context READ getContext NOTIFY contextChanged)
|
Q_PROPERTY(QString context READ getContext NOTIFY contextChanged)
|
||||||
Q_PROPERTY(AudioDevices* devices READ getDevices NOTIFY nop)
|
Q_PROPERTY(AudioDevices* devices READ getDevices NOTIFY nop)
|
||||||
|
Q_PROPERTY(bool desktopMuted READ getMutedDesktop WRITE setMutedDesktop NOTIFY desktopMutedChanged)
|
||||||
|
Q_PROPERTY(bool hmdMuted READ getMutedHMD WRITE setMutedHMD NOTIFY hmdMutedChanged)
|
||||||
|
Q_PROPERTY(bool pushToTalk READ getPTT WRITE setPTT NOTIFY pushToTalkChanged);
|
||||||
|
Q_PROPERTY(bool pushToTalkDesktop READ getPTTDesktop WRITE setPTTDesktop NOTIFY pushToTalkDesktopChanged)
|
||||||
|
Q_PROPERTY(bool pushToTalkHMD READ getPTTHMD WRITE setPTTHMD NOTIFY pushToTalkHMDChanged)
|
||||||
|
Q_PROPERTY(bool pushingToTalk READ getPushingToTalk NOTIFY pushingToTalkChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QString AUDIO;
|
static QString AUDIO;
|
||||||
|
@ -82,6 +92,25 @@ public:
|
||||||
|
|
||||||
void showMicMeter(bool show);
|
void showMicMeter(bool show);
|
||||||
|
|
||||||
|
// Mute setting setters and getters
|
||||||
|
void setMutedDesktop(bool isMuted);
|
||||||
|
bool getMutedDesktop() const;
|
||||||
|
void setMutedHMD(bool isMuted);
|
||||||
|
bool getMutedHMD() const;
|
||||||
|
void setPTT(bool enabled);
|
||||||
|
bool getPTT();
|
||||||
|
bool getPushingToTalk() const;
|
||||||
|
|
||||||
|
// Push-To-Talk setters and getters
|
||||||
|
void setPTTDesktop(bool enabled);
|
||||||
|
bool getPTTDesktop() const;
|
||||||
|
void setPTTHMD(bool enabled);
|
||||||
|
bool getPTTHMD() const;
|
||||||
|
|
||||||
|
// Settings handlers
|
||||||
|
void saveData();
|
||||||
|
void loadData();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* @function Audio.setInputDevice
|
* @function Audio.setInputDevice
|
||||||
* @param {object} device
|
* @param {object} device
|
||||||
|
@ -193,6 +222,46 @@ signals:
|
||||||
*/
|
*/
|
||||||
void mutedChanged(bool isMuted);
|
void mutedChanged(bool isMuted);
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when desktop audio input is muted or unmuted.
|
||||||
|
* @function Audio.desktopMutedChanged
|
||||||
|
* @param {boolean} isMuted - <code>true</code> if the audio input is muted for desktop mode, otherwise <code>false</code>.
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void desktopMutedChanged(bool isMuted);
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when HMD audio input is muted or unmuted.
|
||||||
|
* @function Audio.hmdMutedChanged
|
||||||
|
* @param {boolean} isMuted - <code>true</code> if the audio input is muted for HMD mode, otherwise <code>false</code>.
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void hmdMutedChanged(bool isMuted);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Triggered when Push-to-Talk has been enabled or disabled.
|
||||||
|
* @function Audio.pushToTalkChanged
|
||||||
|
* @param {boolean} enabled - <code>true</code> if Push-to-Talk is enabled, otherwise <code>false</code>.
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void pushToTalkChanged(bool enabled);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Triggered when Push-to-Talk has been enabled or disabled for desktop mode.
|
||||||
|
* @function Audio.pushToTalkDesktopChanged
|
||||||
|
* @param {boolean} enabled - <code>true</code> if Push-to-Talk is emabled for Desktop mode, otherwise <code>false</code>.
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void pushToTalkDesktopChanged(bool enabled);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Triggered when Push-to-Talk has been enabled or disabled for HMD mode.
|
||||||
|
* @function Audio.pushToTalkHMDChanged
|
||||||
|
* @param {boolean} enabled - <code>true</code> if Push-to-Talk is emabled for HMD mode, otherwise <code>false</code>.
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void pushToTalkHMDChanged(bool enabled);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Triggered when the audio input noise reduction is enabled or disabled.
|
* Triggered when the audio input noise reduction is enabled or disabled.
|
||||||
* @function Audio.noiseReductionChanged
|
* @function Audio.noiseReductionChanged
|
||||||
|
@ -237,6 +306,14 @@ signals:
|
||||||
*/
|
*/
|
||||||
void contextChanged(const QString& context);
|
void contextChanged(const QString& context);
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when pushing to talk.
|
||||||
|
* @function Audio.pushingToTalkChanged
|
||||||
|
* @param {boolean} talking - <code>true</code> if broadcasting with PTT, <code>false</code> otherwise.
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void pushingToTalkChanged(bool talking);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
@ -245,6 +322,8 @@ public slots:
|
||||||
*/
|
*/
|
||||||
void onContextChanged();
|
void onContextChanged();
|
||||||
|
|
||||||
|
void handlePushedToTalk(bool enabled);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void setMuted(bool muted);
|
void setMuted(bool muted);
|
||||||
void enableNoiseReduction(bool enable);
|
void enableNoiseReduction(bool enable);
|
||||||
|
@ -260,11 +339,19 @@ private:
|
||||||
float _inputVolume { 1.0f };
|
float _inputVolume { 1.0f };
|
||||||
float _inputLevel { 0.0f };
|
float _inputLevel { 0.0f };
|
||||||
bool _isClipping { false };
|
bool _isClipping { false };
|
||||||
bool _isMuted { false };
|
|
||||||
bool _enableNoiseReduction { true }; // Match default value of AudioClient::_isNoiseGateEnabled.
|
bool _enableNoiseReduction { true }; // Match default value of AudioClient::_isNoiseGateEnabled.
|
||||||
bool _contextIsHMD { false };
|
bool _contextIsHMD { false };
|
||||||
AudioDevices* getDevices() { return &_devices; }
|
AudioDevices* getDevices() { return &_devices; }
|
||||||
AudioDevices _devices;
|
AudioDevices _devices;
|
||||||
|
Setting::Handle<bool> _desktopMutedSetting{ QStringList { Audio::AUDIO, "desktopMuted" }, true };
|
||||||
|
Setting::Handle<bool> _hmdMutedSetting{ QStringList { Audio::AUDIO, "hmdMuted" }, true };
|
||||||
|
Setting::Handle<bool> _pttDesktopSetting{ QStringList { Audio::AUDIO, "pushToTalkDesktop" }, false };
|
||||||
|
Setting::Handle<bool> _pttHMDSetting{ QStringList { Audio::AUDIO, "pushToTalkHMD" }, false };
|
||||||
|
bool _desktopMuted{ true };
|
||||||
|
bool _hmdMuted{ false };
|
||||||
|
bool _pttDesktop{ false };
|
||||||
|
bool _pttHMD{ false };
|
||||||
|
bool _pushingToTalk{ false };
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -28,6 +28,9 @@ var UNMUTE_ICONS = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function onMuteToggled() {
|
function onMuteToggled() {
|
||||||
|
if (Audio.pushingToTalk) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (Audio.muted) {
|
if (Audio.muted) {
|
||||||
button.editProperties(MUTE_ICONS);
|
button.editProperties(MUTE_ICONS);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue