Showing the changes to interface/src/scripting/AudioDeviceScriptingInterface.cpp (1 of 5 files). Show all
Unified · Split
| @@ -43,7 +43,7 @@ AudioDeviceScriptingInterface::AudioDeviceScriptingInterface(): QAbstractListMod · 42 unmodified lines | |||
| 43 | //fill up model | 43 | //fill up model |
| 44 | onDeviceChanged(); | 44 | onDeviceChanged(); |
| 45 | //set up previously saved device | 45 | //set up previously saved device |
| 46 | SettingsScriptingInterface *settings = SettingsScriptingInterface::getInstance(); | 46 | SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance(); |
| 47 | const QString inDevice = settings->getValue("audio_input_device").toString(); | 47 | const QString inDevice = settings->getValue("audio_input_device").toString(); |
| 48 | if (inDevice != _currentInputDevice) { | 48 | if (inDevice != _currentInputDevice) { |
| 49 | setInputDeviceAsync(inDevice); | 49 | setInputDeviceAsync(inDevice); |
| @@ -72,7 +72,7 @@ bool AudioDeviceScriptingInterface::setOutputDevice(const QString& deviceName) { · 22 unmodified lines | |||
| 72 | return result; | 72 | return result; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | bool AudioDeviceScriptingInterface::setDeviceFromMenu(const QString &deviceMenuName) { | 75 | bool AudioDeviceScriptingInterface::setDeviceFromMenu(const QString& deviceMenuName) { |
| 76 | QAudio::Mode mode; | 76 | QAudio::Mode mode; |
| 77 | 77 | ||
| 78 | if (deviceMenuName.indexOf("for Output") != -1) { | 78 | if (deviceMenuName.indexOf("for Output") != -1) { |
| @@ -229,33 +229,34 @@ void AudioDeviceScriptingInterface::onDeviceChanged() · 150 unmodified lines | |||
| 229 | emit deviceChanged(); | 229 | emit deviceChanged(); |
| 230 | } | 230 | } |
| 231 | 231 | ||
| 232 | void AudioDeviceScriptingInterface::onCurrentInputDeviceChanged(const QString &name) | 232 | void AudioDeviceScriptingInterface::onCurrentInputDeviceChanged(const QString& name) |
| 233 | { | 233 | { |
| 234 | currentDeviceUpdate(name, QAudio::AudioInput); | 234 | currentDeviceUpdate(name, QAudio::AudioInput); |
| 235 | //we got a signal that device changed. Save it now | 235 | //we got a signal that device changed. Save it now |
| 236 | SettingsScriptingInterface *settings = SettingsScriptingInterface::getInstance(); | 236 | SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance(); |
| 237 | settings->setValue("audio_input_device", name); | 237 | settings->setValue("audio_input_device", name); |
| 238 | emit currentInputDeviceChanged(name); | 238 | emit currentInputDeviceChanged(name); |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | void AudioDeviceScriptingInterface::onCurrentOutputDeviceChanged(const QString &name) | 241 | void AudioDeviceScriptingInterface::onCurrentOutputDeviceChanged(const QString& name) |
| 242 | { | 242 | { |
| 243 | currentDeviceUpdate(name, QAudio::AudioOutput); | 243 | currentDeviceUpdate(name, QAudio::AudioOutput); |
| 244 | //we got a signal that device changed. Save it now | 244 | //we got a signal that device changed. Save it now |
| 245 | SettingsScriptingInterface *settings = SettingsScriptingInterface::getInstance(); | 245 | SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance(); |
| 246 | settings->setValue("audio_output_device", name); | 246 | settings->setValue("audio_output_device", name); |
| 247 | emit currentOutputDeviceChanged(name); | 247 | emit currentOutputDeviceChanged(name); |
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | void AudioDeviceScriptingInterface::currentDeviceUpdate(const QString &name, QAudio::Mode mode) | 250 | void AudioDeviceScriptingInterface::currentDeviceUpdate(const QString& name, QAudio::Mode mode) |
| 251 | { | 251 | { |
| 252 | QVector<int> role; | 252 | QVector<int> role; |
| 253 | role.append(SelectedRole); | 253 | role.append(SelectedRole); |
| 254 | 254 | ||
| 255 | for (int i = 0; i < _devices.size(); i++) { | 255 | for (int i = 0; i < _devices.size(); i++) { |
| 256 | ScriptingAudioDeviceInfo di = _devices.at(i); | 256 | ScriptingAudioDeviceInfo di = _devices.at(i); |
| 257 | if (di.mode != mode) | 257 | if (di.mode != mode) { |
| 258 | continue; | 258 | continue; |
| 259 | } | ||
| 259 | if (di.selected && di.name != name ) { | 260 | if (di.selected && di.name != name ) { |
| 260 | di.selected = false; | 261 | di.selected = false; |
| 261 | _devices[i] = di; | 262 | _devices[i] = di; |