diff options
author | Sebastian Reichel <sre@ring0.de> | 2013-04-28 21:41:46 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2013-04-28 21:41:46 +0200 |
commit | f90cc533f5bb44c73017bd0f9d2591be1e246724 (patch) | |
tree | 9bf512008c9e6c70f28675b47d694117c4dfbeb0 /src/audio/main.vala | |
parent | 04fc88e7de0f9acec11b189522228de59403e2ef (diff) | |
download | serial-barcode-scanner-f90cc533f5bb44c73017bd0f9d2591be1e246724.tar.bz2 |
put audio path into config
Diffstat (limited to 'src/audio/main.vala')
-rw-r--r-- | src/audio/main.vala | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/audio/main.vala b/src/audio/main.vala index 1490601..ac80c75 100644 --- a/src/audio/main.vala +++ b/src/audio/main.vala @@ -16,6 +16,8 @@ AudioPlayerImplementation player; public static int main(string[] args) { + Gst.init(ref args); + Bus.own_name( BusType.SESSION, "io.mainframe.shopsystem.AudioPlayer", @@ -24,9 +26,15 @@ public static int main(string[] args) { () => {}, () => stderr.printf("Could not aquire name\n")); - Gst.init(ref args); - - player = new AudioPlayerImplementation(); + try { + Config cfg = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config"); + var path = cfg.get_string("AUDIO", "path"); + player = new AudioPlayerImplementation(path); + } catch(IOError e) { + error("IOError: %s\n", e.message); + } catch(KeyFileError e) { + error("Config Error: %s\n", e.message); + } new MainLoop().run(); |