Audio: rename physical -> volume.
Fix issue with settings not being propagated. Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
8fc3747229
commit
ced20877c2
6 changed files with 16 additions and 19 deletions
|
@ -37,7 +37,7 @@ AudioGenerator::AudioGenerator()
|
|||
myDevice = nullptr;
|
||||
myInitialSilence = 200;
|
||||
mySilenceDelay = 10000;
|
||||
myPhysicalReference = 0x0fff;
|
||||
myVolume = 0x0fff;
|
||||
|
||||
QAudioFormat audioFormat;
|
||||
audioFormat.setSampleRate(44100);
|
||||
|
@ -56,18 +56,18 @@ QAudioOutput * AudioGenerator::getAudioOutput()
|
|||
return myAudioOutput.get();
|
||||
}
|
||||
|
||||
void AudioGenerator::getOptions(qint32 & initialSilence, qint32 & silenceDelay, qint32 & physical) const
|
||||
void AudioGenerator::getOptions(qint32 & initialSilence, qint32 & silenceDelay, qint32 & volume) const
|
||||
{
|
||||
initialSilence = myInitialSilence;
|
||||
silenceDelay = mySilenceDelay;
|
||||
physical = myPhysicalReference;
|
||||
volume = myVolume;
|
||||
}
|
||||
|
||||
void AudioGenerator::setOptions(const qint32 initialSilence, const qint32 silenceDelay, const qint32 physical)
|
||||
void AudioGenerator::setOptions(const qint32 initialSilence, const qint32 silenceDelay, const qint32 volume)
|
||||
{
|
||||
myInitialSilence = std::max(0, initialSilence);
|
||||
mySilenceDelay = std::max(0, silenceDelay);
|
||||
myPhysicalReference = std::max(0, physical);
|
||||
myVolume = std::max(0, volume);
|
||||
}
|
||||
|
||||
void AudioGenerator::stateChanged(QAudio::State state)
|
||||
|
@ -128,7 +128,7 @@ void AudioGenerator::start()
|
|||
mySilence = 0;
|
||||
myMaximum = 0;
|
||||
myValue = 0;
|
||||
myPhysical = myPhysicalReference;
|
||||
myPhysical = myVolume;
|
||||
myTicks = std::queue<qint64>();
|
||||
|
||||
writeEnoughSilence(myInitialSilence); // ms
|
||||
|
|
|
@ -21,8 +21,8 @@ public:
|
|||
void writeAudio();
|
||||
void stateChanged(QAudio::State state);
|
||||
|
||||
void getOptions(qint32 & initialSilence, qint32 & silenceDelay, qint32 & physical) const;
|
||||
void setOptions(const qint32 initialSilence, const qint32 silenceDelay, const qint32 physical);
|
||||
void getOptions(qint32 & initialSilence, qint32 & silenceDelay, qint32 & volume) const;
|
||||
void setOptions(const qint32 initialSilence, const qint32 silenceDelay, const qint32 volume);
|
||||
|
||||
private:
|
||||
typedef short int audio_t;
|
||||
|
@ -37,7 +37,7 @@ private:
|
|||
// options
|
||||
qint32 myInitialSilence;
|
||||
qint32 mySilenceDelay;
|
||||
qint16 myPhysicalReference;
|
||||
qint16 myVolume;
|
||||
|
||||
qint64 myStartCPUCycles;
|
||||
qint64 myPreviousFrameTime;
|
||||
|
|
|
@ -176,7 +176,7 @@ Preferences::Data getCurrentOptions(const std::shared_ptr<QGamepad> & gamepad)
|
|||
|
||||
currentOptions.screenshotTemplate = getScreenshotTemplate();
|
||||
|
||||
AudioGenerator::instance().getOptions(currentOptions.audioLatency, currentOptions.silenceDelay, currentOptions.physical);
|
||||
AudioGenerator::instance().getOptions(currentOptions.audioLatency, currentOptions.silenceDelay, currentOptions.volume);
|
||||
|
||||
return currentOptions;
|
||||
}
|
||||
|
@ -264,9 +264,6 @@ void setNewOptions(const Preferences::Data & currentOptions, const Preferences::
|
|||
setScreenshotTemplate(newOptions.screenshotTemplate);
|
||||
}
|
||||
|
||||
if (currentOptions.audioLatency != newOptions.audioLatency)
|
||||
{
|
||||
AudioGenerator::instance().setOptions(newOptions.audioLatency, newOptions.silenceDelay, newOptions.physical);
|
||||
}
|
||||
AudioGenerator::instance().setOptions(newOptions.audioLatency, newOptions.silenceDelay, newOptions.volume);
|
||||
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ void Preferences::setData(const Data & data)
|
|||
|
||||
audio_latency->setValue(data.audioLatency);
|
||||
silence_delay->setValue(data.silenceDelay);
|
||||
physical->setValue(data.physical);
|
||||
volume->setValue(data.volume);
|
||||
}
|
||||
|
||||
Preferences::Data Preferences::getData() const
|
||||
|
@ -226,7 +226,7 @@ Preferences::Data Preferences::getData() const
|
|||
|
||||
data.audioLatency = audio_latency->value();
|
||||
data.silenceDelay = silence_delay->value();
|
||||
data.physical = physical->value();
|
||||
data.volume = volume->value();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
int audioLatency;
|
||||
int silenceDelay;
|
||||
int physical;
|
||||
int volume;
|
||||
|
||||
std::vector<QString> disks;
|
||||
std::vector<QString> hds;
|
||||
|
|
|
@ -427,12 +427,12 @@
|
|||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string>Physical</string>
|
||||
<string>Volume</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="physical">
|
||||
<widget class="QSpinBox" name="volume">
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
|
|
Loading…
Add table
Reference in a new issue