Showing the changes to interface/src/scripting/AudioDeviceScriptingInterface.cpp (1 of 28 files). Show all
Unified · Split
| @@ -19,13 +19,13 @@ AudioDeviceScriptingInterface* AudioDeviceScriptingInterface::getInstance() { · 18 unmodified lines | |||
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | AudioDeviceScriptingInterface::AudioDeviceScriptingInterface() { | 21 | AudioDeviceScriptingInterface::AudioDeviceScriptingInterface() { |
| 22 | connect(DependencyManager::get<Audio>().data(), &Audio::muteToggled, | 22 | connect(DependencyManager::get<AudioClient>().data(), &AudioClient::muteToggled, |
| 23 | this, &AudioDeviceScriptingInterface::muteToggled); | 23 | this, &AudioDeviceScriptingInterface::muteToggled); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | bool AudioDeviceScriptingInterface::setInputDevice(const QString& deviceName) { | 26 | bool AudioDeviceScriptingInterface::setInputDevice(const QString& deviceName) { |
| 27 | bool result; | 27 | bool result; |
| 28 | QMetaObject::invokeMethod(DependencyManager::get<Audio>().data(), "switchInputToAudioDevice", | 28 | QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), "switchInputToAudioDevice", |
| 29 | Qt::BlockingQueuedConnection, | 29 | Qt::BlockingQueuedConnection, |
| 30 | Q_RETURN_ARG(bool, result), | 30 | Q_RETURN_ARG(bool, result), |
| 31 | Q_ARG(const QString&, deviceName)); | 31 | Q_ARG(const QString&, deviceName)); |
| @@ -35,7 +35,7 @@ bool AudioDeviceScriptingInterface::setInputDevice(const QString& deviceName) { · 3 unmodified lines | |||
| 35 | 35 | ||
| 36 | bool AudioDeviceScriptingInterface::setOutputDevice(const QString& deviceName) { | 36 | bool AudioDeviceScriptingInterface::setOutputDevice(const QString& deviceName) { |
| 37 | bool result; | 37 | bool result; |
| 38 | QMetaObject::invokeMethod(DependencyManager::get<Audio>().data(), "switchOutputToAudioDevice", | 38 | QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), "switchOutputToAudioDevice", |
| 39 | Qt::BlockingQueuedConnection, | 39 | Qt::BlockingQueuedConnection, |
| 40 | Q_RETURN_ARG(bool, result), | 40 | Q_RETURN_ARG(bool, result), |
| 41 | Q_ARG(const QString&, deviceName)); | 41 | Q_ARG(const QString&, deviceName)); |
| @@ -44,50 +44,50 @@ bool AudioDeviceScriptingInterface::setOutputDevice(const QString& deviceName) { · 2 unmodified lines | |||
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | QString AudioDeviceScriptingInterface::getInputDevice() { | 46 | QString AudioDeviceScriptingInterface::getInputDevice() { |
| 47 | return DependencyManager::get<Audio>()->getDeviceName(QAudio::AudioInput); | 47 | return DependencyManager::get<AudioClient>()->getDeviceName(QAudio::AudioInput); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | QString AudioDeviceScriptingInterface::getOutputDevice() { | 50 | QString AudioDeviceScriptingInterface::getOutputDevice() { |
| 51 | return DependencyManager::get<Audio>()->getDeviceName(QAudio::AudioOutput); | 51 | return DependencyManager::get<AudioClient>()->getDeviceName(QAudio::AudioOutput); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | QString AudioDeviceScriptingInterface::getDefaultInputDevice() { | 54 | QString AudioDeviceScriptingInterface::getDefaultInputDevice() { |
| 55 | return DependencyManager::get<Audio>()->getDefaultDeviceName(QAudio::AudioInput); | 55 | return DependencyManager::get<AudioClient>()->getDefaultDeviceName(QAudio::AudioInput); |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | QString AudioDeviceScriptingInterface::getDefaultOutputDevice() { | 58 | QString AudioDeviceScriptingInterface::getDefaultOutputDevice() { |
| 59 | return DependencyManager::get<Audio>()->getDefaultDeviceName(QAudio::AudioOutput); | 59 | return DependencyManager::get<AudioClient>()->getDefaultDeviceName(QAudio::AudioOutput); |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | QVector<QString> AudioDeviceScriptingInterface::getInputDevices() { | 62 | QVector<QString> AudioDeviceScriptingInterface::getInputDevices() { |
| 63 | return DependencyManager::get<Audio>()->getDeviceNames(QAudio::AudioInput); | 63 | return DependencyManager::get<AudioClient>()->getDeviceNames(QAudio::AudioInput); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | QVector<QString> AudioDeviceScriptingInterface::getOutputDevices() { | 66 | QVector<QString> AudioDeviceScriptingInterface::getOutputDevices() { |
| 67 | return DependencyManager::get<Audio>()->getDeviceNames(QAudio::AudioOutput); | 67 | return DependencyManager::get<AudioClient>()->getDeviceNames(QAudio::AudioOutput); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | 70 | ||
| 71 | float AudioDeviceScriptingInterface::getInputVolume() { | 71 | float AudioDeviceScriptingInterface::getInputVolume() { |
| 72 | return DependencyManager::get<Audio>()->getInputVolume(); | 72 | return DependencyManager::get<AudioClient>()->getInputVolume(); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | void AudioDeviceScriptingInterface::setInputVolume(float volume) { | 75 | void AudioDeviceScriptingInterface::setInputVolume(float volume) { |
| 76 | DependencyManager::get<Audio>()->setInputVolume(volume); | 76 | DependencyManager::get<AudioClient>()->setInputVolume(volume); |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | void AudioDeviceScriptingInterface::setReverb(bool reverb) { | 79 | void AudioDeviceScriptingInterface::setReverb(bool reverb) { |
| 80 | DependencyManager::get<Audio>()->setReverb(reverb); | 80 | DependencyManager::get<AudioClient>()->setReverb(reverb); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | void AudioDeviceScriptingInterface::setReverbOptions(const AudioEffectOptions* options) { | 83 | void AudioDeviceScriptingInterface::setReverbOptions(const AudioEffectOptions* options) { |
| 84 | DependencyManager::get<Audio>()->setReverbOptions(options); | 84 | DependencyManager::get<AudioClient>()->setReverbOptions(options); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | void AudioDeviceScriptingInterface::toggleMute() { | 87 | void AudioDeviceScriptingInterface::toggleMute() { |
| 88 | DependencyManager::get<Audio>()->toggleMute(); | 88 | DependencyManager::get<AudioClient>()->toggleMute(); |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | bool AudioDeviceScriptingInterface::getMuted() { | 91 | bool AudioDeviceScriptingInterface::getMuted() { |
| 92 | return DependencyManager::get<Audio>()->isMuted(); | 92 | return DependencyManager::get<AudioClient>()->isMuted(); |
| 93 | } | 93 | } |