changed AudioPlayer::PlaySound() to AudioPlayer::playSound()

This commit is contained in:
andreja6
2018-05-01 12:14:54 -07:00
parent c875454b40
commit e6ca1cd502
4 changed files with 70 additions and 54 deletions

View File

@@ -58,7 +58,7 @@ void mixaudio(void *unused, Uint8 *stream, int len)
} }
} }
void AudioPlayer::PlaySound(std::string fileString) void AudioPlayer::playSound(std::string fileString)
{ {
if(initiated) if(initiated)

View File

@@ -6,6 +6,6 @@ class AudioPlayer
public: public:
AudioPlayer(void); AudioPlayer(void);
~AudioPlayer(void); ~AudioPlayer(void);
static void PlaySound(std::string); static void playSound(std::string);
static void init(); static void init();
}; };

View File

@@ -234,30 +234,14 @@
RelativePath=".\AudioPlayer.cpp" RelativePath=".\AudioPlayer.cpp"
> >
</File> </File>
<File
RelativePath=".\BaseButtonInstance.cpp"
>
</File>
<File <File
RelativePath=".\ButtonListener.cpp" RelativePath=".\ButtonListener.cpp"
> >
</File> </File>
<File
RelativePath=".\DataModelInstance.cpp"
>
</File>
<File <File
RelativePath=".\Dialogs.rc" RelativePath=".\Dialogs.rc"
> >
</File> </File>
<File
RelativePath=".\ImageButtonInstance.cpp"
>
</File>
<File
RelativePath=".\Instance.cpp"
>
</File>
<File <File
RelativePath="main.cpp" RelativePath="main.cpp"
> >
@@ -278,6 +262,25 @@
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
<Filter
Name="Instances"
>
<File
RelativePath=".\BaseButtonInstance.cpp"
>
</File>
<File
RelativePath=".\DataModelInstance.cpp"
>
</File>
<File
RelativePath=".\ImageButtonInstance.cpp"
>
</File>
<File
RelativePath=".\Instance.cpp"
>
</File>
<File <File
RelativePath=".\PhysicalInstance.cpp" RelativePath=".\PhysicalInstance.cpp"
> >
@@ -286,6 +289,11 @@
RelativePath=".\TextButtonInstance.cpp" RelativePath=".\TextButtonInstance.cpp"
> >
</File> </File>
<File
RelativePath=".\WorkspaceInstance.cpp"
>
</File>
</Filter>
</Filter> </Filter>
<Filter <Filter
Name="Header Files" Name="Header Files"
@@ -296,11 +304,18 @@
> >
</File> </File>
<File <File
RelativePath=".\BaseButtonInstance.h" RelativePath=".\ButtonListener.h"
> >
</File> </File>
<File <File
RelativePath=".\ButtonListener.h" RelativePath=".\resource.h"
>
</File>
<Filter
Name="Instances"
>
<File
RelativePath=".\BaseButtonInstance.h"
> >
</File> </File>
<File <File
@@ -319,14 +334,15 @@
RelativePath=".\PhysicalInstance.h" RelativePath=".\PhysicalInstance.h"
> >
</File> </File>
<File
RelativePath=".\resource.h"
>
</File>
<File <File
RelativePath=".\TextButtonInstance.h" RelativePath=".\TextButtonInstance.h"
> >
</File> </File>
<File
RelativePath=".\WorkspaceInstance.h"
>
</File>
</Filter>
</Filter> </Filter>
<Filter <Filter
Name="Resource Files" Name="Resource Files"

View File

@@ -255,7 +255,7 @@ public:
void CameraButtonListener::onButton1MouseClick(BaseButtonInstance* button) void CameraButtonListener::onButton1MouseClick(BaseButtonInstance* button)
{ {
AudioPlayer::PlaySound(cameraSound); AudioPlayer::playSound(cameraSound);
CoordinateFrame frame = usableApp->debugCamera.getCoordinateFrame(); CoordinateFrame frame = usableApp->debugCamera.getCoordinateFrame();
if(button->name == "CenterCam") if(button->name == "CenterCam")
centerCam = true; centerCam = true;
@@ -280,7 +280,7 @@ void GUDButtonListener::onButton1MouseClick(BaseButtonInstance* button)
{ {
if(selectedInstance != NULL) if(selectedInstance != NULL)
{ {
AudioPlayer::PlaySound(dingSound); AudioPlayer::playSound(dingSound);
if(button->name == "Duplicate") if(button->name == "Duplicate")
{ {
@@ -298,7 +298,7 @@ void RotateButtonListener::onButton1MouseClick(BaseButtonInstance* button)
{ {
if(selectedInstance != NULL) if(selectedInstance != NULL)
{ {
AudioPlayer::PlaySound(clickSound); AudioPlayer::playSound(clickSound);
if(selectedInstance->getClassName() == "Part") if(selectedInstance->getClassName() == "Part")
{ {
PhysicalInstance* part = (PhysicalInstance*) selectedInstance; PhysicalInstance* part = (PhysicalInstance*) selectedInstance;
@@ -324,7 +324,7 @@ void deleteInstance()
instances.erase(instances.begin() + i); instances.erase(instances.begin() + i);
delete deleting; delete deleting;
selectedInstance = NULL; selectedInstance = NULL;
AudioPlayer::PlaySound(GetFileInPath("/content/sounds/pageturn.wav")); AudioPlayer::playSound(GetFileInPath("/content/sounds/pageturn.wav"));
} }
} }
} }
@@ -1049,13 +1049,13 @@ void Demo::onUserInput(UserInput* ui) {
if(ui->keyPressed(SDL_MOUSE_WHEEL_UP_KEY)) if(ui->keyPressed(SDL_MOUSE_WHEEL_UP_KEY))
{ {
AudioPlayer::PlaySound(cameraSound); AudioPlayer::playSound(cameraSound);
CoordinateFrame frame = app->debugCamera.getCoordinateFrame(); CoordinateFrame frame = app->debugCamera.getCoordinateFrame();
cameraPos = cameraPos + frame.lookVector()*2; cameraPos = cameraPos + frame.lookVector()*2;
} }
if(ui->keyPressed(SDL_MOUSE_WHEEL_DOWN_KEY)) if(ui->keyPressed(SDL_MOUSE_WHEEL_DOWN_KEY))
{ {
AudioPlayer::PlaySound(cameraSound); AudioPlayer::playSound(cameraSound);
CoordinateFrame frame = app->debugCamera.getCoordinateFrame(); CoordinateFrame frame = app->debugCamera.getCoordinateFrame();
cameraPos = cameraPos - frame.lookVector()*2; cameraPos = cameraPos - frame.lookVector()*2;
} }