mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 04:39:51 +02:00
Code style fixes
This commit is contained in:
parent
4290eb21ea
commit
bd6ac7a39e
5 changed files with 20 additions and 19 deletions
|
@ -204,7 +204,7 @@ Rectangle {
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
visible: devicemode === 1
|
visible: devicemode === 1
|
||||||
height: visible ? 36 : 0
|
height: visible ? 36 : 0
|
||||||
AudioCheckbox {
|
AudioCheckbox {
|
||||||
id: cbout
|
id: cbout
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
|
@ -43,7 +43,7 @@ AudioDeviceScriptingInterface::AudioDeviceScriptingInterface(): QAbstractListMod
|
||||||
//fill up model
|
//fill up model
|
||||||
onDeviceChanged();
|
onDeviceChanged();
|
||||||
//set up previously saved device
|
//set up previously saved device
|
||||||
SettingsScriptingInterface *settings = SettingsScriptingInterface::getInstance();
|
SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance();
|
||||||
const QString inDevice = settings->getValue("audio_input_device").toString();
|
const QString inDevice = settings->getValue("audio_input_device").toString();
|
||||||
if (inDevice != _currentInputDevice) {
|
if (inDevice != _currentInputDevice) {
|
||||||
setInputDeviceAsync(inDevice);
|
setInputDeviceAsync(inDevice);
|
||||||
|
@ -72,7 +72,7 @@ bool AudioDeviceScriptingInterface::setOutputDevice(const QString& deviceName) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AudioDeviceScriptingInterface::setDeviceFromMenu(const QString &deviceMenuName) {
|
bool AudioDeviceScriptingInterface::setDeviceFromMenu(const QString& deviceMenuName) {
|
||||||
QAudio::Mode mode;
|
QAudio::Mode mode;
|
||||||
|
|
||||||
if (deviceMenuName.indexOf("for Output") != -1) {
|
if (deviceMenuName.indexOf("for Output") != -1) {
|
||||||
|
@ -229,33 +229,34 @@ void AudioDeviceScriptingInterface::onDeviceChanged()
|
||||||
emit deviceChanged();
|
emit deviceChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioDeviceScriptingInterface::onCurrentInputDeviceChanged(const QString &name)
|
void AudioDeviceScriptingInterface::onCurrentInputDeviceChanged(const QString& name)
|
||||||
{
|
{
|
||||||
currentDeviceUpdate(name, QAudio::AudioInput);
|
currentDeviceUpdate(name, QAudio::AudioInput);
|
||||||
//we got a signal that device changed. Save it now
|
//we got a signal that device changed. Save it now
|
||||||
SettingsScriptingInterface *settings = SettingsScriptingInterface::getInstance();
|
SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance();
|
||||||
settings->setValue("audio_input_device", name);
|
settings->setValue("audio_input_device", name);
|
||||||
emit currentInputDeviceChanged(name);
|
emit currentInputDeviceChanged(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioDeviceScriptingInterface::onCurrentOutputDeviceChanged(const QString &name)
|
void AudioDeviceScriptingInterface::onCurrentOutputDeviceChanged(const QString& name)
|
||||||
{
|
{
|
||||||
currentDeviceUpdate(name, QAudio::AudioOutput);
|
currentDeviceUpdate(name, QAudio::AudioOutput);
|
||||||
//we got a signal that device changed. Save it now
|
//we got a signal that device changed. Save it now
|
||||||
SettingsScriptingInterface *settings = SettingsScriptingInterface::getInstance();
|
SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance();
|
||||||
settings->setValue("audio_output_device", name);
|
settings->setValue("audio_output_device", name);
|
||||||
emit currentOutputDeviceChanged(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;
|
QVector<int> role;
|
||||||
role.append(SelectedRole);
|
role.append(SelectedRole);
|
||||||
|
|
||||||
for (int i = 0; i < _devices.size(); i++) {
|
for (int i = 0; i < _devices.size(); i++) {
|
||||||
ScriptingAudioDeviceInfo di = _devices.at(i);
|
ScriptingAudioDeviceInfo di = _devices.at(i);
|
||||||
if (di.mode != mode)
|
if (di.mode != mode) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
if (di.selected && di.name != name ) {
|
if (di.selected && di.name != name ) {
|
||||||
di.selected = false;
|
di.selected = false;
|
||||||
_devices[i] = di;
|
_devices[i] = di;
|
||||||
|
|
|
@ -52,9 +52,9 @@ public:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onDeviceChanged();
|
void onDeviceChanged();
|
||||||
void onCurrentInputDeviceChanged(const QString &name);
|
void onCurrentInputDeviceChanged(const QString& name);
|
||||||
void onCurrentOutputDeviceChanged(const QString &name);
|
void onCurrentOutputDeviceChanged(const QString& name);
|
||||||
void currentDeviceUpdate(const QString &name, QAudio::Mode mode);
|
void currentDeviceUpdate(const QString& name, QAudio::Mode mode);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
bool setInputDevice(const QString& deviceName);
|
bool setInputDevice(const QString& deviceName);
|
||||||
|
@ -80,16 +80,16 @@ public slots:
|
||||||
|
|
||||||
void setMuted(bool muted);
|
void setMuted(bool muted);
|
||||||
|
|
||||||
void setInputDeviceAsync(const QString &deviceName);
|
void setInputDeviceAsync(const QString& deviceName);
|
||||||
void setOutputDeviceAsync(const QString &deviceName);
|
void setOutputDeviceAsync(const QString& deviceName);
|
||||||
private:
|
private:
|
||||||
AudioDeviceScriptingInterface();
|
AudioDeviceScriptingInterface();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void muteToggled();
|
void muteToggled();
|
||||||
void deviceChanged();
|
void deviceChanged();
|
||||||
void currentInputDeviceChanged(const QString &name);
|
void currentInputDeviceChanged(const QString& name);
|
||||||
void currentOutputDeviceChanged(const QString &name);
|
void currentOutputDeviceChanged(const QString& name);
|
||||||
void mutedChanged(bool muted);
|
void mutedChanged(bool muted);
|
||||||
void inputAudioDevicesChanged(QStringList inputAudioDevices);
|
void inputAudioDevicesChanged(QStringList inputAudioDevices);
|
||||||
void outputAudioDevicesChanged(QStringList outputAudioDevices);
|
void outputAudioDevicesChanged(QStringList outputAudioDevices);
|
||||||
|
|
|
@ -24,7 +24,7 @@ class AudioScriptingInterface : public QObject, public Dependency {
|
||||||
SINGLETON_DEPENDENCY
|
SINGLETON_DEPENDENCY
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~AudioScriptingInterface() {}
|
virtual ~AudioScriptingInterface() {}
|
||||||
void setLocalAudioInterface(AbstractAudioInterface* audioInterface) { _localAudioInterface = audioInterface; }
|
void setLocalAudioInterface(AbstractAudioInterface* audioInterface) { _localAudioInterface = audioInterface; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
const INPUT = "Input";
|
const INPUT = "Input";
|
||||||
const OUTPUT = "Output";
|
const OUTPUT = "Output";
|
||||||
|
const SELECT_AUDIO_SCRIPT_STARTUP_TIMEOUT = 300;
|
||||||
//
|
//
|
||||||
// VAR DEFINITIONS
|
// VAR DEFINITIONS
|
||||||
//
|
//
|
||||||
|
@ -195,7 +195,7 @@ Script.setTimeout(function () {
|
||||||
setupAudioMenus();
|
setupAudioMenus();
|
||||||
debug("Checking HMD audio status...")
|
debug("Checking HMD audio status...")
|
||||||
checkHMDAudio();
|
checkHMDAudio();
|
||||||
}, 300);
|
}, SELECT_AUDIO_SCRIPT_STARTUP_TIMEOUT);
|
||||||
|
|
||||||
debug("Connecting scriptEnding()");
|
debug("Connecting scriptEnding()");
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
|
|
Loading…
Reference in a new issue