mirror of
https://github.com/isledecomp/SIEdit.git
synced 2024-11-27 01:25:45 -05:00
app: use audio volume
This commit is contained in:
parent
16d4646972
commit
ec5c08ef95
2 changed files with 7 additions and 0 deletions
|
@ -292,6 +292,7 @@ void MediaPanel::StartAudioPlayback()
|
||||||
if (m->codec_type() == AVMEDIA_TYPE_AUDIO) {
|
if (m->codec_type() == AVMEDIA_TYPE_AUDIO) {
|
||||||
if (m->StartPlayingAudio(output_dev, fmt)) {
|
if (m->StartPlayingAudio(output_dev, fmt)) {
|
||||||
auto out = new QAudioOutput(output_dev, fmt, this);
|
auto out = new QAudioOutput(output_dev, fmt, this);
|
||||||
|
out->setVolume(m->GetVolume());
|
||||||
out->start(m);
|
out->start(m);
|
||||||
connect(out, &QAudioOutput::stateChanged, this, [this]{
|
connect(out, &QAudioOutput::stateChanged, this, [this]{
|
||||||
auto out = static_cast<QAudioOutput*>(sender());
|
auto out = static_cast<QAudioOutput*>(sender());
|
||||||
|
@ -355,6 +356,7 @@ void MediaPanel::OpenMediaInstance(si::Object *o)
|
||||||
|
|
||||||
m->Open(o->ExtractToMemory());
|
m->Open(o->ExtractToMemory());
|
||||||
m->SetStartOffset(float(o->time_offset_) * 0.001f);
|
m->SetStartOffset(float(o->time_offset_) * 0.001f);
|
||||||
|
m->SetVolume(float(o->volume_) / 79.0f);
|
||||||
m->SetVirtualTime(0);
|
m->SetVirtualTime(0);
|
||||||
|
|
||||||
m_mediaInstances.push_back(m);
|
m_mediaInstances.push_back(m);
|
||||||
|
|
|
@ -74,6 +74,9 @@ public:
|
||||||
|
|
||||||
void SetVirtualTime(float f);
|
void SetVirtualTime(float f);
|
||||||
|
|
||||||
|
float GetVolume() const { return m_volume; }
|
||||||
|
void SetVolume(float v) { m_volume = v; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void EndOfFile();
|
void EndOfFile();
|
||||||
|
|
||||||
|
@ -114,6 +117,8 @@ private:
|
||||||
|
|
||||||
float m_virtualPosition;
|
float m_virtualPosition;
|
||||||
|
|
||||||
|
float m_volume;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class MediaPanel : public Panel
|
class MediaPanel : public Panel
|
||||||
|
|
Loading…
Reference in a new issue