summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio/audio-interface.vala8
-rw-r--r--src/scanner-session/scannersession.vala20
2 files changed, 28 insertions, 0 deletions
diff --git a/src/audio/audio-interface.vala b/src/audio/audio-interface.vala
index fe13af5..12bfae4 100644
--- a/src/audio/audio-interface.vala
+++ b/src/audio/audio-interface.vala
@@ -22,3 +22,11 @@ public interface AudioPlayer : Object {
public abstract string[] get_user_themes() throws IOError;
public abstract void play_user(string theme, string type) throws IOError;
}
+
+public enum AudioType {
+ ERROR,
+ LOGIN,
+ LOGOUT,
+ PURCHASE,
+ INFO
+}
diff --git a/src/scanner-session/scannersession.vala b/src/scanner-session/scannersession.vala
index 9638ef5..eeb02e3 100644
--- a/src/scanner-session/scannersession.vala
+++ b/src/scanner-session/scannersession.vala
@@ -78,6 +78,26 @@ public class ScannerSessionImplementation {
return true;
}
+ private void play_audio(AudioType audioType){
+ switch (audioType) {
+ case AudioType.ERROR:
+ audio.play_system("error.ogg");
+ break;
+ case AudioType.LOGIN:
+ audio.play_user(theme, "login");
+ break;
+ case AudioType.LOGOUT:
+ audio.play_user(theme, "logout");
+ break;
+ case AudioType.PURCHASE:
+ audio.play_user(theme, "purchase");
+ break;
+ case AudioType.INFO:
+ audio.play_user(theme, "login");
+ break;
+ }
+ }
+
private void handle_barcode(string scannerdata) {
try {
stdout.printf("scannerdata: %s\n", scannerdata);