summaryrefslogtreecommitdiffstats
path: root/labb8/lib/StanfordCPPLib/sound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'labb8/lib/StanfordCPPLib/sound.cpp')
-rwxr-xr-xlabb8/lib/StanfordCPPLib/sound.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/labb8/lib/StanfordCPPLib/sound.cpp b/labb8/lib/StanfordCPPLib/sound.cpp
new file mode 100755
index 0000000..f0c4705
--- /dev/null
+++ b/labb8/lib/StanfordCPPLib/sound.cpp
@@ -0,0 +1,31 @@
+/*
+ * File: sound.cpp
+ * ---------------
+ * Implementation of the Sound class.
+ */
+
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <vector>
+#include "gevents.h"
+#include "gtypes.h"
+#include "sound.h"
+#include "vector.h"
+#include "platform.h"
+using namespace std;
+
+static Platform *pp = getPlatform();
+
+Sound::Sound(string filename) {
+ pp->createSound(this, filename);
+}
+
+Sound::~Sound() {
+ pp->deleteSound(this);
+}
+
+void Sound::play() {
+ pp->playSound(this);
+}
+