Enable soundservice in datamodelinstance
This commit is contained in:
@@ -22,9 +22,9 @@ namespace B3D{
|
|||||||
// Functions
|
// Functions
|
||||||
void play();
|
void play();
|
||||||
private:
|
private:
|
||||||
float soundVolume;
|
Reflection::ReflectionProperty<float> soundVolume;
|
||||||
std::string soundId;
|
Reflection::ReflectionProperty<std::string> soundId;
|
||||||
bool playOnRemove;
|
Reflection::ReflectionProperty<bool> playOnRemove;
|
||||||
bool looped;
|
Reflection::ReflectionProperty<bool> looped;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -2,15 +2,16 @@
|
|||||||
#include "DataModelV3/DataModelInstance.h"
|
#include "DataModelV3/DataModelInstance.h"
|
||||||
|
|
||||||
using namespace B3D;
|
using namespace B3D;
|
||||||
|
using namespace Reflection;
|
||||||
|
|
||||||
SoundInstance::SoundInstance()
|
SoundInstance::SoundInstance()
|
||||||
{
|
{
|
||||||
|
Instance::Instance("Sound");
|
||||||
name = "Sound";
|
name = "Sound";
|
||||||
|
soundVolume = Reflection::ReflectionProperty<float>("SoundVolume", 0.5F, TYPE_FLOAT, this->dataTable);
|
||||||
soundVolume = 0.5;
|
soundId = Reflection::ReflectionProperty<std::string>("SoundID", "", TYPE_STRING, this->dataTable);
|
||||||
soundId = "";
|
playOnRemove = Reflection::ReflectionProperty<bool>("PlayOnRemove", false, TYPE_BOOLEAN, this->dataTable);
|
||||||
playOnRemove = false;
|
looped = Reflection::ReflectionProperty<bool>("Looped", false, TYPE_BOOLEAN, this->dataTable);
|
||||||
looped = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SoundInstance::~SoundInstance(void)
|
SoundInstance::~SoundInstance(void)
|
||||||
@@ -28,22 +29,22 @@ void SoundInstance::play()
|
|||||||
// Getters
|
// Getters
|
||||||
float SoundInstance::getSoundVolume()
|
float SoundInstance::getSoundVolume()
|
||||||
{
|
{
|
||||||
return soundVolume;
|
return soundVolume.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SoundInstance::isPlayedOnRemove()
|
bool SoundInstance::isPlayedOnRemove()
|
||||||
{
|
{
|
||||||
return playOnRemove;
|
return playOnRemove.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string SoundInstance::getSoundId()
|
std::string SoundInstance::getSoundId()
|
||||||
{
|
{
|
||||||
return soundId;
|
return soundId.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SoundInstance::isLooped()
|
bool SoundInstance::isLooped()
|
||||||
{
|
{
|
||||||
return looped;
|
return looped.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
|
|||||||
Reference in New Issue
Block a user