Added logic for mastervolume. And a coresponding event.
(sources need to be updated for it to be fully working)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// Created by Adam on 2015-09-24.
|
||||
//
|
||||
|
||||
#ifndef EVENTS_EMASTERVOLUME_H__
|
||||
#define EVENTS_EMASTERVOLUME_H__
|
||||
|
||||
#include "Core/EventBroker.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Events
|
||||
{
|
||||
|
||||
struct MasterVolume : public Event
|
||||
{
|
||||
float gain = 1;
|
||||
//To determine what channel group to apply the change to.
|
||||
bool isAmbient = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -14,7 +14,7 @@ struct PlaySound : Event
|
||||
std::string path;
|
||||
float volume = 1.f;
|
||||
float pitch = 1.f;
|
||||
bool loop = false;
|
||||
bool isAmbient = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "Sound.h"
|
||||
#include "Sound/EPlaySound.h"
|
||||
#include "Sound/EStopSound.h"
|
||||
#include "Sound/EMasterVolume.h"
|
||||
#include "Physics/EContact.h"
|
||||
#include "Game/CBall.h"
|
||||
#include "Game/CBrick.h"
|
||||
@@ -38,9 +39,11 @@ private:
|
||||
dd::EventRelay<SoundSystem, dd::Events::PlaySound> m_EPlaySFX;
|
||||
dd::EventRelay<SoundSystem, dd::Events::Contact> m_EContact;
|
||||
dd::EventRelay<SoundSystem, dd::Events::StopSound> m_EStopSound;
|
||||
dd::EventRelay<SoundSystem, dd::Events::MasterVolume> m_EMasterVolume;
|
||||
bool OnPlaySound(const dd::Events::PlaySound &event);
|
||||
bool OnContact(const dd::Events::Contact &event);
|
||||
bool OnStopSound(const dd::Events::StopSound &event);
|
||||
bool OnMasterVolume(const dd::Events::MasterVolume &event);
|
||||
|
||||
ALuint CreateSource();
|
||||
|
||||
@@ -48,7 +51,7 @@ private:
|
||||
|
||||
ALCdevice* m_Device;
|
||||
|
||||
//Temp
|
||||
float m_BGMMasterVolume, m_SFXMasterVolume;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user