From b37085501e22fcb09cbe0cf4abba08cce7754efc Mon Sep 17 00:00:00 2001 From: bjschuma Date: Tue, 22 Dec 2009 00:37:52 -0500 Subject: [PATCH] Can pause music --- src/core/gstreamer.py | 12 +++++++++--- src/core/load.py | 2 +- src/core/pause.py | 29 +++++++++++++++++++++++++++++ src/core/play.py | 9 ++++----- 4 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 src/core/pause.py diff --git a/src/core/gstreamer.py b/src/core/gstreamer.py index d06f665e..9f2f2dea 100644 --- a/src/core/gstreamer.py +++ b/src/core/gstreamer.py @@ -5,8 +5,8 @@ __date__ ="$Dec 21, 2009 11:58:37 PM$" global name, app, type, path, opt -name = "test" -app = "scion" +name = "gstreamer" +app = "ocarina" type = "core" path = "" opt = [] @@ -41,6 +41,11 @@ def play(): pipeline.set_state(gst.STATE_PLAYING) +def pause(): + global pipeline + pipeline.set_state(gst.STATE_PAUSED) + + # Called every time the plugin is enabled @@ -48,9 +53,10 @@ def open(): global pipeline pipeline = gst.Pipeline() pipeline.set_state(gst.STATE_NULL) - write(songs) + songs = settings.get("args") if len(songs) > 0: load(songs[0]) + settings.replace("args", []) diff --git a/src/core/load.py b/src/core/load.py index 903472cb..6e6d5bb9 100644 --- a/src/core/load.py +++ b/src/core/load.py @@ -5,7 +5,7 @@ __date__ ="$Dec 21, 2009 10:35:01 PM$" global name, app, type, path, opt -name = "audio" +name = "load" app = "ocarina" type = "core" path = "" diff --git a/src/core/pause.py b/src/core/pause.py new file mode 100644 index 00000000..98f339c9 --- /dev/null +++ b/src/core/pause.py @@ -0,0 +1,29 @@ +# This is a simple test plugin, to make sure everything is working + +__author__="bjschuma" +__date__ ="$Dec 22, 2009 12:29:58 AM$" + + +global name, app, type, path, opt +name = "pause" +app = "ocarina" +type = "core" +path = "" +opt = [] + +import gstreamer + + +# Called every time the plugin is enabled +def open(): + pass + + +# Called every time the plugin is stopped +def close(): + pass + + +# Called when the plugin needs to perform some action +def run(args=None): + gstreamer.pause() diff --git a/src/core/play.py b/src/core/play.py index bd50d8d0..ff73a835 100644 --- a/src/core/play.py +++ b/src/core/play.py @@ -5,8 +5,8 @@ __date__ ="$Dec 22, 2009 12:05:02 AM$" global name, app, type, path, opt -name = "test" -app = "scion" +name = "play" +app = "ocarina" type = "core" path = "" opt = [] @@ -17,13 +17,12 @@ import gstreamer # Called every time the plugin is enabled def open(): - write("Example plugin has been started",True) - #write("Example plugin has been changed",True) + pass # Called every time the plugin is stopped def close(): - write("Example plugin has been stopped",True) + pass # Called when the plugin needs to perform some action