summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-03 16:52:15 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-03 16:55:25 +0300
commitaa1e8a7a7236d49d91501eac2da81bdb96f0bba5 (patch)
tree833744617232b18ae86aa108dddc72dad8381360 /src/resources
parentd69ea30539a6fe816dd6e1d943a0a2adcbd95c19 (diff)
downloadplus-aa1e8a7a7236d49d91501eac2da81bdb96f0bba5.tar.gz
plus-aa1e8a7a7236d49d91501eac2da81bdb96f0bba5.tar.bz2
plus-aa1e8a7a7236d49d91501eac2da81bdb96f0bba5.tar.xz
plus-aa1e8a7a7236d49d91501eac2da81bdb96f0bba5.zip
Rename music.cpp/h to sdlmusic.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/resourcemanager.cpp6
-rw-r--r--src/resources/resourcemanager.h4
-rw-r--r--src/resources/sdlmusic.cpp (renamed from src/resources/music.cpp)12
-rw-r--r--src/resources/sdlmusic.h (renamed from src/resources/music.h)14
4 files changed, 18 insertions, 18 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index 6779419f1..20cd37587 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -32,7 +32,7 @@
#include "resources/image.h"
#include "resources/imagehelper.h"
#include "resources/imageset.h"
-#include "resources/music.h"
+#include "resources/sdlmusic.h"
#include "resources/openglimagehelper.h"
#include "resources/soundeffect.h"
#include "resources/spritedef.h"
@@ -549,9 +549,9 @@ Resource *ResourceManager::load(const std::string &path, const loader fun)
return get(path, ResourceLoader::load, &rl);
}
-Music *ResourceManager::getMusic(const std::string &idPath)
+SDLMusic *ResourceManager::getMusic(const std::string &idPath)
{
- return static_cast<Music*>(load(idPath, Music::load));
+ return static_cast<SDLMusic*>(load(idPath, SDLMusic::load));
}
SoundEffect *ResourceManager::getSoundEffect(const std::string &idPath)
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index 220c5f3f3..d08f8043c 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -37,7 +37,7 @@
class AnimationDelayLoad;
class Image;
class ImageSet;
-class Music;
+class SDLMusic;
class Resource;
class SoundEffect;
class SpriteDef;
@@ -195,7 +195,7 @@ class ResourceManager final
* Convenience wrapper around ResourceManager::get for loading
* songs.
*/
- Music *getMusic(const std::string &idPath) A_WARN_UNUSED;
+ SDLMusic *getMusic(const std::string &idPath) A_WARN_UNUSED;
/**
* Convenience wrapper around ResourceManager::get for loading
diff --git a/src/resources/music.cpp b/src/resources/sdlmusic.cpp
index d88b3ccac..fe06b43f1 100644
--- a/src/resources/music.cpp
+++ b/src/resources/sdlmusic.cpp
@@ -20,28 +20,28 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "resources/music.h"
+#include "resources/sdlmusic.h"
#include "logger.h"
#include "debug.h"
-Music::Music(Mix_Music *const music) :
+SDLMusic::SDLMusic(Mix_Music *const music) :
Resource(),
mMusic(music)
{
}
-Music::~Music()
+SDLMusic::~SDLMusic()
{
Mix_FreeMusic(mMusic);
}
-Resource *Music::load(SDL_RWops *const rw)
+Resource *SDLMusic::load(SDL_RWops *const rw)
{
if (Mix_Music *const music = Mix_LoadMUS_RW(rw))
{
- return new Music(music);
+ return new SDLMusic(music);
}
else
{
@@ -50,7 +50,7 @@ Resource *Music::load(SDL_RWops *const rw)
}
}
-bool Music::play(const int loops, const int fadeIn)
+bool SDLMusic::play(const int loops, const int fadeIn)
{
if (fadeIn > 0)
return Mix_FadeInMusic(mMusic, loops, fadeIn);
diff --git a/src/resources/music.h b/src/resources/sdlmusic.h
index bf0a572dc..2d599cb4b 100644
--- a/src/resources/music.h
+++ b/src/resources/sdlmusic.h
@@ -20,8 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef MUSIC_H
-#define MUSIC_H
+#ifndef SDLMUSIC_H
+#define SDLMUSIC_H
#include "resources/resource.h"
@@ -32,20 +32,20 @@
/**
* Defines a class for loading and storing music.
*/
-class Music final : public Resource
+class SDLMusic final : public Resource
{
public:
- Music() :
+ SDLMusic() :
Resource(),
mMusic(nullptr)
{ }
- A_DELETE_COPY(Music)
+ A_DELETE_COPY(SDLMusic)
/**
* Destructor.
*/
- virtual ~Music();
+ virtual ~SDLMusic();
/**
* Loads a music from a buffer in memory.
@@ -73,7 +73,7 @@ class Music final : public Resource
/**
* Constructor.
*/
- Music(Mix_Music *const music);
+ SDLMusic(Mix_Music *const music);
Mix_Music *mMusic;
};