diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-08-18 18:51:31 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-08-18 18:51:31 +0000 |
| commit | c1793a87ebea8c8e1bb2d5d1a409d105bfae3871 (patch) | |
| tree | b7ff53cf9747ad61a80b169e1adad96950f4b16c /pokemod/Sound.cpp | |
| parent | fa4764c9e4d86fdfa976bb9fa9f6976e82c496d5 (diff) | |
| download | sigen-c1793a87ebea8c8e1bb2d5d1a409d105bfae3871.tar.gz sigen-c1793a87ebea8c8e1bb2d5d1a409d105bfae3871.tar.xz sigen-c1793a87ebea8c8e1bb2d5d1a409d105bfae3871.zip | |
[FIX] Script to make a tarball now defaults to HEAD for the revision
[FIX] Enumeration types used to help remove some checks
[FIX] Macro code moved to static members of Object (not all though)
[FIX] Scripting wrappers now share information by keeping track of already-created instances of the wrapper
[FIX] Scripting methods are now Q_SCRIPTABLE and not slots
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@239 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Sound.cpp')
| -rw-r--r-- | pokemod/Sound.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/pokemod/Sound.cpp b/pokemod/Sound.cpp index d23f9fbe..a625274f 100644 --- a/pokemod/Sound.cpp +++ b/pokemod/Sound.cpp @@ -22,6 +22,8 @@ #include "Macros.h" #include "Pokemod.h" +const QStringList Pokemod::Sound::TypeStr = QStringList() << "Sound Effect" << "Music"; + Pokemod::Sound::Sound(const Sound& sound) : Object(sound.parent(), sound.id()) { @@ -31,6 +33,7 @@ Pokemod::Sound::Sound(const Sound& sound) : Pokemod::Sound::Sound(const Pokemod* parent, const int id) : Object(parent, id), m_name(""), + m_type(SoundEffect), m_data() { } @@ -61,15 +64,17 @@ void Pokemod::Sound::validate() void Pokemod::Sound::load(const QDomElement& xml) { LOAD_BEGIN(); - LOAD(QString, name); - LOAD(QByteArray, data); + LOAD(name); + LOAD(type); + LOAD(data); } QDomElement Pokemod::Sound::save() const { SAVE_CREATE(); - SAVE(QString, name); - SAVE(QByteArray, data); + SAVE(name); + SAVE(type); + SAVE(data); return xml; } @@ -78,6 +83,11 @@ void Pokemod::Sound::setName(const QString& name) CHECK(name); } +void Pokemod::Sound::setType(const Type type) +{ + CHECK(type); +} + void Pokemod::Sound::setData(const QByteArray& data) { CHECK(data); @@ -88,6 +98,11 @@ QString Pokemod::Sound::name() const return m_name; } +Pokemod::Sound::Type Pokemod::Sound::type() const +{ + return m_type; +} + QByteArray Pokemod::Sound::data() const { return m_data; @@ -99,6 +114,7 @@ Pokemod::Sound& Pokemod::Sound::operator=(const Sound& rhs) return *this; clear(); COPY(name); + COPY(type); COPY(data); return *this; } |
