mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-16 02:01:30 +02:00
Merge pull request #18 from wayne-chen/pushToTalk
connecting pushingToTalkChanged with handlePushedToTalk
This commit is contained in:
commit
a794da83da
3 changed files with 11 additions and 13 deletions
|
@ -1435,8 +1435,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
});
|
||||
connect(this, &Application::activeDisplayPluginChanged,
|
||||
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
|
||||
|
@ -1609,13 +1607,12 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
bool navAxis = false;
|
||||
switch (actionEnum) {
|
||||
case Action::TOGGLE_PUSHTOTALK:
|
||||
if (audioScriptingInterface->getPTT()) {
|
||||
if (state > 0.0f) {
|
||||
audioScriptingInterface->setPushingToTalk(false);
|
||||
} else if (state < 0.0f) {
|
||||
audioScriptingInterface->setPushingToTalk(true);
|
||||
}
|
||||
if (state > 0.0f) {
|
||||
audioScriptingInterface->setPushingToTalk(false);
|
||||
} else if (state < 0.0f) {
|
||||
audioScriptingInterface->setPushingToTalk(true);
|
||||
}
|
||||
break;
|
||||
|
||||
case Action::UI_NAV_VERTICAL:
|
||||
navAxis = true;
|
||||
|
@ -4218,7 +4215,8 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
|||
break;
|
||||
|
||||
case Qt::Key_T:
|
||||
emit pushedToTalk(true);
|
||||
auto audioScriptingInterface = reinterpret_cast<scripting::Audio*>(DependencyManager::get<AudioScriptingInterface>().data());
|
||||
audioScriptingInterface->setPushingToTalk(true);
|
||||
break;
|
||||
|
||||
case Qt::Key_P: {
|
||||
|
@ -4329,7 +4327,8 @@ void Application::keyReleaseEvent(QKeyEvent* event) {
|
|||
|
||||
switch (event->key()) {
|
||||
case Qt::Key_T:
|
||||
emit pushedToTalk(false);
|
||||
auto audioScriptingInterface = reinterpret_cast<scripting::Audio*>(DependencyManager::get<AudioScriptingInterface>().data());
|
||||
audioScriptingInterface->setPushingToTalk(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -358,8 +358,6 @@ signals:
|
|||
|
||||
void miniTabletEnabledChanged(bool enabled);
|
||||
|
||||
void pushedToTalk(bool enabled);
|
||||
|
||||
public slots:
|
||||
QVector<EntityItemID> pasteEntities(float x, float y, float z);
|
||||
bool exportEntities(const QString& filename, const QVector<QUuid>& entityIDs, const glm::vec3* givenOffset = nullptr);
|
||||
|
|
|
@ -40,6 +40,8 @@ Audio::Audio() : _devices(_contextIsHMD) {
|
|||
connect(client, &AudioClient::inputLoudnessChanged, this, &Audio::onInputLoudnessChanged);
|
||||
connect(client, &AudioClient::inputVolumeChanged, this, &Audio::setInputVolume);
|
||||
connect(this, &Audio::contextChanged, &_devices, &AudioDevices::onContextChanged);
|
||||
// when pushing to talk changed, handle it.
|
||||
connect(this, &Audio::pushingToTalkChanged, this, &Audio::handlePushedToTalk);
|
||||
enableNoiseReduction(enableNoiseReductionSetting.get());
|
||||
onContextChanged();
|
||||
}
|
||||
|
@ -344,7 +346,6 @@ void Audio::handlePushedToTalk(bool enabled) {
|
|||
} else {
|
||||
setMuted(true);
|
||||
}
|
||||
setPushingToTalk(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue