SoundService & SoundInstance
Basic implementation. More work needs to be done.
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
// Instances
|
||||
#include "WorkspaceInstance.h"
|
||||
#include "LevelInstance.h"
|
||||
#include "PartInstance.h"
|
||||
#include "ThumbnailGeneratorInstance.h"
|
||||
#include "SelectionService.h"
|
||||
#include "rapidxml/rapidxml.hpp"
|
||||
#include "GuiRootInstance.h"
|
||||
#include "ThumbnailGeneratorInstance.h"
|
||||
#include "XplicitNgine/XplicitNgine.h"
|
||||
#include "SoundService.h"
|
||||
|
||||
// Libraries
|
||||
#include "rapidxml/rapidxml.hpp"
|
||||
|
||||
class GuiRootInstance;
|
||||
|
||||
@@ -25,10 +30,12 @@ public:
|
||||
bool readXMLFileStream(std::ifstream* file);
|
||||
void drawMessage(RenderDevice*);
|
||||
|
||||
// Instance getters
|
||||
WorkspaceInstance* getWorkspace();
|
||||
LevelInstance* getLevel();
|
||||
XplicitNgine* getEngine();
|
||||
ThumbnailGeneratorInstance* getThumbnailGenerator();
|
||||
SoundService* getSoundService();
|
||||
|
||||
std::string message;
|
||||
std::string _loadedFileName;
|
||||
@@ -53,11 +60,16 @@ private:
|
||||
std::string _errMsg;
|
||||
bool _legacyLoad;
|
||||
float _modY;
|
||||
|
||||
// Instances
|
||||
WorkspaceInstance* workspace;
|
||||
LevelInstance* level;
|
||||
GuiRootInstance* guiRoot;
|
||||
SelectionService* selectionService;
|
||||
ThumbnailGeneratorInstance * thumbnailGenerator;
|
||||
ThumbnailGeneratorInstance* thumbnailGenerator;
|
||||
XplicitNgine* xplicitNgine;
|
||||
SoundService* soundService;
|
||||
|
||||
bool running;
|
||||
XplicitNgine * xplicitNgine;
|
||||
|
||||
};
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <G3DAll.h>
|
||||
#include "propertyGrid.h"
|
||||
#include "map"
|
||||
//#include "Properties/BoolProperty.h"
|
||||
|
||||
class Instance
|
||||
{
|
||||
|
||||
30
src/include/DataModelV2/SoundInstance.h
Normal file
30
src/include/DataModelV2/SoundInstance.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
#include "Instance.h"
|
||||
|
||||
class SoundInstance :
|
||||
public Instance
|
||||
{
|
||||
public:
|
||||
SoundInstance(void);
|
||||
~SoundInstance(void);
|
||||
|
||||
// Getters
|
||||
float getSoundVolume();
|
||||
std::string getSoundId();
|
||||
bool isPlayedOnRemove();
|
||||
bool isLooped();
|
||||
|
||||
// Setters
|
||||
void setSoundVolume(float newVolume);
|
||||
void setSoundId(std::string newSoundId);
|
||||
void setIsPlayedOnRemove(bool isPlayed);
|
||||
void setIsLooped(bool isLooped);
|
||||
|
||||
// Functions
|
||||
void play();
|
||||
private:
|
||||
float soundVolume;
|
||||
std::string soundId;
|
||||
bool playOnRemove;
|
||||
bool looped;
|
||||
};
|
||||
16
src/include/DataModelV2/SoundService.h
Normal file
16
src/include/DataModelV2/SoundService.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
#include "Instance.h"
|
||||
#include "SoundInstance.h"
|
||||
|
||||
class SoundService :
|
||||
public Instance
|
||||
{
|
||||
public:
|
||||
SoundService(void);
|
||||
~SoundService(void);
|
||||
|
||||
float getMusicVolume();
|
||||
void playSound(SoundInstance* sound);
|
||||
private:
|
||||
float musicVolume;
|
||||
};
|
||||
Reference in New Issue
Block a user