summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--src/audio.vala27
2 files changed, 29 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 81b7680..77bdb1e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-SRC=src/main.vala src/device.vala src/db.vala src/web.vala src/graph-data.vala src/template.vala src/session.vala src/price.vapi
-DEPS=--pkg posix --pkg linux --pkg libsoup-2.4 --pkg sqlite3 --pkg gee-1.0 --pkg gmodule-2.0 --pkg gio-2.0
+SRC=src/main.vala src/device.vala src/db.vala src/audio.vala src/web.vala src/graph-data.vala src/template.vala src/session.vala src/price.vapi
+DEPS=--pkg posix --pkg linux --pkg libsoup-2.4 --pkg sqlite3 --pkg gee-1.0 --pkg gio-2.0 --pkg gstreamer-0.10
FLAGS=-X -w
barcode-scanner: $(SRC)
diff --git a/src/audio.vala b/src/audio.vala
new file mode 100644
index 0000000..c1032c5
--- /dev/null
+++ b/src/audio.vala
@@ -0,0 +1,27 @@
+/* Copyright 2012, Sebastian Reichel <sre@ring0.de>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+public class AudioPlayer {
+ private dynamic Gst.Element p;
+
+ public AudioPlayer() {
+ p = Gst.ElementFactory.make("playbin", "play");
+ }
+
+ public void play(string file) {
+ p.uri = file;
+ p.set_state(Gst.State.PLAYING);
+ }
+}