Stacked sound player works
[gregoa/zavai.git] / src / zavai.vala
index 7e6f9fab221abf7f293b0c0bcd94a736e03e0ca8..408dfa5540659a208f6adeede6dba34ee834cf50 100644 (file)
@@ -298,14 +298,25 @@ static int main (string[] args) {
     {
         zavai.audio.musicplayer.play("file://" + args[2]);
 
-        // Timeout.add(3 * 1000, () => {
-        //     zavai.audio.soundplayer.play("file:///backup/ciapino/src/openmoocow/data/moo.wav", true);
-        //     Timeout.add(4 * 1000, () => {
-        //         zavai.audio.soundplayer.stop();
-        //         return false;
-        //     });
-        //     return false;
-        // });
+        Timeout.add(2 * 1000, () => {
+            var ps = new zavai.audio.PlayerState("zavai", "file:///backup/ciapino/src/openmoocow/data/moo.wav", true);
+            zavai.audio.soundplayer.push_state(ps);
+            Timeout.add(8 * 1000, () => {
+                zavai.audio.soundplayer.pop_state("zavai");
+                return false;
+            });
+            return false;
+        });
+
+        Timeout.add(3 * 1000, () => {
+            var ps = new zavai.audio.PlayerState("zavai", zavai.config.ringtone_alarm, false);
+            zavai.audio.soundplayer.push_state(ps);
+            Timeout.add(4 * 1000, () => {
+                zavai.audio.soundplayer.pop_state("zavai");
+                return false;
+            });
+            return false;
+        });
     }
 
        Gtk.main();