Code style fixes

This commit is contained in:
Vladyslav Stelmakhovskyi 2017-05-11 20:38:09 +02:00
parent 4290eb21ea
commit bd6ac7a39e
5 changed files with 20 additions and 19 deletions

View file

@ -204,7 +204,7 @@ Rectangle {
delegate: Item {
width: parent.width
visible: devicemode === 1
height: visible ? 36 : 0
height: visible ? 36 : 0
AudioCheckbox {
id: cbout
width: parent.width

View file

@ -43,7 +43,7 @@ AudioDeviceScriptingInterface::AudioDeviceScriptingInterface(): QAbstractListMod
//fill up model
onDeviceChanged();
//set up previously saved device
SettingsScriptingInterface *settings = SettingsScriptingInterface::getInstance();
SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance();
const QString inDevice = settings->getValue("audio_input_device").toString();
if (inDevice != _currentInputDevice) {
setInputDeviceAsync(inDevice);
@ -72,7 +72,7 @@ bool AudioDeviceScriptingInterface::setOutputDevice(const QString& deviceName) {
return result;
}
bool AudioDeviceScriptingInterface::setDeviceFromMenu(const QString &deviceMenuName) {
bool AudioDeviceScriptingInterface::setDeviceFromMenu(const QString& deviceMenuName) {
QAudio::Mode mode;
if (deviceMenuName.indexOf("for Output") != -1) {
@ -229,33 +229,34 @@ void AudioDeviceScriptingInterface::onDeviceChanged()
emit deviceChanged();
}
void AudioDeviceScriptingInterface::onCurrentInputDeviceChanged(const QString &name)
void AudioDeviceScriptingInterface::onCurrentInputDeviceChanged(const QString& name)
{
currentDeviceUpdate(name, QAudio::AudioInput);
//we got a signal that device changed. Save it now
SettingsScriptingInterface *settings = SettingsScriptingInterface::getInstance();
SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance();
settings->setValue("audio_input_device", name);
emit currentInputDeviceChanged(name);
}
void AudioDeviceScriptingInterface::onCurrentOutputDeviceChanged(const QString &name)
void AudioDeviceScriptingInterface::onCurrentOutputDeviceChanged(const QString& name)
{
currentDeviceUpdate(name, QAudio::AudioOutput);
//we got a signal that device changed. Save it now
SettingsScriptingInterface *settings = SettingsScriptingInterface::getInstance();
SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance();
settings->setValue("audio_output_device", name);
emit currentOutputDeviceChanged(name);
}
void AudioDeviceScriptingInterface::currentDeviceUpdate(const QString &name, QAudio::Mode mode)
void AudioDeviceScriptingInterface::currentDeviceUpdate(const QString& name, QAudio::Mode mode)
{
QVector<int> role;
role.append(SelectedRole);
for (int i = 0; i < _devices.size(); i++) {
ScriptingAudioDeviceInfo di = _devices.at(i);
if (di.mode != mode)
if (di.mode != mode) {
continue;
}
if (di.selected && di.name != name ) {
di.selected = false;
_devices[i] = di;

View file

@ -52,9 +52,9 @@ public:
private slots:
void onDeviceChanged();
void onCurrentInputDeviceChanged(const QString &name);
void onCurrentOutputDeviceChanged(const QString &name);
void currentDeviceUpdate(const QString &name, QAudio::Mode mode);
void onCurrentInputDeviceChanged(const QString& name);
void onCurrentOutputDeviceChanged(const QString& name);
void currentDeviceUpdate(const QString& name, QAudio::Mode mode);
public slots:
bool setInputDevice(const QString& deviceName);
@ -80,16 +80,16 @@ public slots:
void setMuted(bool muted);
void setInputDeviceAsync(const QString &deviceName);
void setOutputDeviceAsync(const QString &deviceName);
void setInputDeviceAsync(const QString& deviceName);
void setOutputDeviceAsync(const QString& deviceName);
private:
AudioDeviceScriptingInterface();
signals:
void muteToggled();
void deviceChanged();
void currentInputDeviceChanged(const QString &name);
void currentOutputDeviceChanged(const QString &name);
void currentInputDeviceChanged(const QString& name);
void currentOutputDeviceChanged(const QString& name);
void mutedChanged(bool muted);
void inputAudioDevicesChanged(QStringList inputAudioDevices);
void outputAudioDevicesChanged(QStringList outputAudioDevices);

View file

@ -24,7 +24,7 @@ class AudioScriptingInterface : public QObject, public Dependency {
SINGLETON_DEPENDENCY
public:
virtual ~AudioScriptingInterface() {}
virtual ~AudioScriptingInterface() {}
void setLocalAudioInterface(AbstractAudioInterface* audioInterface) { _localAudioInterface = audioInterface; }
protected:

View file

@ -17,7 +17,7 @@
const INPUT = "Input";
const OUTPUT = "Output";
const SELECT_AUDIO_SCRIPT_STARTUP_TIMEOUT = 300;
//
// VAR DEFINITIONS
//
@ -195,7 +195,7 @@ Script.setTimeout(function () {
setupAudioMenus();
debug("Checking HMD audio status...")
checkHMDAudio();
}, 300);
}, SELECT_AUDIO_SCRIPT_STARTUP_TIMEOUT);
debug("Connecting scriptEnding()");
Script.scriptEnding.connect(function () {