diff options
| author | KuroiIeWa5Da <tyuki@adu.me> | 2012-01-23 01:41:05 -0600 |
|---|---|---|
| committer | KuroiIeWa5Da <tyuki@adu.me> | 2012-01-23 01:41:05 -0600 |
| commit | 4d0797bc3a6ae0ea4b44e8b6463339d662f5d669 (patch) | |
| tree | 03b824a1bb511bbb8c57ea378c1d27ea04c27ef7 /music/pokeredmusicdisasm/Volume.cpp | |
| parent | Finished PkmnHealed music data - all 3 channels (diff) | |
| download | pokeyellow-4d0797bc3a6ae0ea4b44e8b6463339d662f5d669.tar.gz pokeyellow-4d0797bc3a6ae0ea4b44e8b6463339d662f5d669.tar.xz pokeyellow-4d0797bc3a6ae0ea4b44e8b6463339d662f5d669.zip | |
made changes in repo
hg-commit-id: 1145e088ee27
Diffstat (limited to 'music/pokeredmusicdisasm/Volume.cpp')
| -rw-r--r-- | music/pokeredmusicdisasm/Volume.cpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/music/pokeredmusicdisasm/Volume.cpp b/music/pokeredmusicdisasm/Volume.cpp new file mode 100644 index 00000000..3c717f0e --- /dev/null +++ b/music/pokeredmusicdisasm/Volume.cpp @@ -0,0 +1,67 @@ +#include <sstream>
+#include "Volume.h"
+using namespace std;
+
+Volume::Volume()
+{
+ volume = 0;
+}
+
+Volume::Volume(unsigned char* byte) // Parse Immidiately
+{
+ Parse(byte);
+}
+
+Volume::Volume(unsigned char volume, bool) // Set value
+{
+ SetVolume(volume);
+}
+
+unsigned char Volume::GetVolume()
+{
+ return volume;
+}
+
+void Volume::SetVolume(unsigned char value)
+{
+ volume = value;
+}
+
+bool Volume::IsValid(unsigned char* byte)
+{
+ if(byte[0] == 0xF0)
+ {
+ error = false;
+ return true;
+ }
+ else
+ {
+ error = true;
+ return false;
+ }
+}
+
+string Volume::GenAsm()
+{
+ string tmpRet = AbstractData::GenAsm();
+ if(tmpRet != "") return false;
+
+ stringstream tmpAsmOut;
+ tmpAsmOut << "mus_volume" << " " << (short)volume;
+ return tmpAsmOut.str();
+}
+
+bool Volume::Parse(unsigned char* byte)
+{
+ // If it's not a Note, don't even bother parsing
+ if(!AbstractData::Parse(byte)) return false;
+
+ volume = byte[1];
+ return true;
+}
+
+unsigned int Volume::Arguments()
+{
+ // 1 1-byte argument = 1
+ return 1;
+}
\ No newline at end of file |
