diff options
Diffstat (limited to 'src/audio')
-rw-r--r-- | src/audio/audio-interface.vala | 8 | ||||
-rw-r--r-- | src/audio/audio.vala | 10 | ||||
-rw-r--r-- | src/audio/main.vala | 2 |
3 files changed, 11 insertions, 9 deletions
diff --git a/src/audio/audio-interface.vala b/src/audio/audio-interface.vala index 12bfae4..721a484 100644 --- a/src/audio/audio-interface.vala +++ b/src/audio/audio-interface.vala @@ -17,10 +17,10 @@ public interface AudioPlayer : Object { public abstract signal void end_of_stream(); - public abstract void play_system(string file) throws IOError; - public abstract string get_random_user_theme() throws IOError; - public abstract string[] get_user_themes() throws IOError; - public abstract void play_user(string theme, string type) throws IOError; + public abstract void play_system(string file) throws DBusError, IOError; + public abstract string get_random_user_theme() throws DBusError, IOError; + public abstract string[] get_user_themes() throws DBusError, IOError; + public abstract void play_user(string theme, string type) throws DBusError, IOError; } public enum AudioType { diff --git a/src/audio/audio.vala b/src/audio/audio.vala index 9afb840..ccced20 100644 --- a/src/audio/audio.vala +++ b/src/audio/audio.vala @@ -30,7 +30,7 @@ public class AudioPlayerImplementation { return true; } - public AudioPlayerImplementation(string path) throws IOError { + public AudioPlayerImplementation(string path) throws IOError, DBusError { this.path = path; var alsa = Gst.ElementFactory.make("alsasink", "alsa"); @@ -45,7 +45,7 @@ public class AudioPlayerImplementation { p.get_bus().add_watch(Priority.DEFAULT, bus_callback); } - public void play_system(string file) { + public void play_system(string file) throws IOError, DBusError { p.set_state(Gst.State.NULL); p.uri = "file://" + path + "system/" + file; p.set_state(Gst.State.PLAYING); @@ -76,15 +76,15 @@ public class AudioPlayerImplementation { return files[index]; } - public string get_random_user_theme() { + public string get_random_user_theme() throws IOError, DBusError { return get_random_file(path + "user/"); } - public string[] get_user_themes() { + public string[] get_user_themes() throws IOError, DBusError { return get_files(path + "user/"); } - public void play_user(string theme, string type) { + public void play_user(string theme, string type) throws IOError, DBusError { p.set_state(Gst.State.NULL); var file = get_random_file(path + "user/" + theme+ "/" + type); p.uri = "file://" + path + "user/" + theme+ "/" + type + "/" + file; diff --git a/src/audio/main.vala b/src/audio/main.vala index ac64f52..2a7d918 100644 --- a/src/audio/main.vala +++ b/src/audio/main.vala @@ -34,6 +34,8 @@ public static int main(string[] args) { error("IOError: %s\n", e.message); } catch(KeyFileError e) { error("Config Error: %s\n", e.message); + } catch(DBusError e) { + error("DBus Error: %s\n", e.message); } new MainLoop().run(); |