Moved play and pause to libsaria/controls.py
They have been moved from libsaria/audio/__init__.py.
This commit is contained in:
parent
f8e4999ad3
commit
c8c79272b6
|
@ -39,17 +39,6 @@ def load(file):
|
||||||
return call("LOAD", audio.load, file)
|
return call("LOAD", audio.load, file)
|
||||||
|
|
||||||
|
|
||||||
def play():
|
|
||||||
global audio
|
|
||||||
return call("PLAY", audio.play)
|
|
||||||
|
|
||||||
|
|
||||||
def pause():
|
|
||||||
global audio
|
|
||||||
return call("PAUSE", audio.pause)
|
|
||||||
libsaria.event.invite("PREEOS", pause)
|
|
||||||
|
|
||||||
|
|
||||||
def stop():
|
def stop():
|
||||||
global audio
|
global audio
|
||||||
return call("STOP", audio.stop)
|
return call("STOP", audio.stop)
|
||||||
|
|
|
@ -1,15 +1,23 @@
|
||||||
# Bryan Schumaker (11/23/2010)
|
# Bryan Schumaker (11/23/2010)
|
||||||
|
|
||||||
audio = None
|
audio = None
|
||||||
call = None
|
call = None
|
||||||
|
invite = None
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
global call
|
global call
|
||||||
global audio
|
global audio
|
||||||
|
global invite
|
||||||
|
|
||||||
import libsaria
|
import libsaria
|
||||||
call = libsaria.event.call
|
call = libsaria.event.call
|
||||||
|
invite = libsaria.event.invite
|
||||||
|
|
||||||
from audio import audio
|
from audio import audio
|
||||||
|
invite("PREEOS", pause)
|
||||||
|
|
||||||
def play():
|
def play():
|
||||||
return call("PLAY", audio.play)
|
return call("PLAY", audio.play)
|
||||||
|
|
||||||
|
def pause():
|
||||||
|
return call("PAUSE", audio.pause)
|
||||||
|
|
|
@ -146,7 +146,7 @@ def inc_count(id):
|
||||||
def play_id(id):
|
def play_id(id):
|
||||||
libsaria.sources.cur_lib_id = id
|
libsaria.sources.cur_lib_id = id
|
||||||
libsaria.audio.load(get_attrs(id, "filepath")[0])
|
libsaria.audio.load(get_attrs(id, "filepath")[0])
|
||||||
libsaria.audio.play()
|
libsaria.controls.play()
|
||||||
|
|
||||||
def filter(text):
|
def filter(text):
|
||||||
global visible
|
global visible
|
||||||
|
|
|
@ -53,7 +53,7 @@ class PauseButton(Button):
|
||||||
invite("POSTPAUSE", self.hide)
|
invite("POSTPAUSE", self.hide)
|
||||||
invite("POSTSTOP", self.hide)
|
invite("POSTSTOP", self.hide)
|
||||||
def clicked(self, button):
|
def clicked(self, button):
|
||||||
LS.audio.pause()
|
LS.controls.pause()
|
||||||
def hide(self, paused):
|
def hide(self, paused):
|
||||||
if paused == True:
|
if paused == True:
|
||||||
Button.hide(self)
|
Button.hide(self)
|
||||||
|
|
Loading…
Reference in New Issue