Rename libsaria.music
I decided that libsaria.music should be known as libsaria.audio. It makes more sense to me.
This commit is contained in:
parent
7b99572f39
commit
2dc7f58206
|
@ -1,6 +1,6 @@
|
||||||
# Bryan Schumaker (8/7/2010)
|
# Bryan Schumaker (8/7/2010)
|
||||||
|
|
||||||
__all__ = [ "collection", "music",
|
__all__ = [ "collection", "audio",
|
||||||
"data", "event", "map", "path", "plugin"]
|
"data", "event", "map", "path", "plugin"]
|
||||||
|
|
||||||
__major__ = 1
|
__major__ = 1
|
||||||
|
@ -22,7 +22,7 @@ prefs = None
|
||||||
cache = Cache()
|
cache = Cache()
|
||||||
|
|
||||||
plugin = None
|
plugin = None
|
||||||
music = None
|
audio = None
|
||||||
lastfm = None
|
lastfm = None
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,12 +30,12 @@ lastfm = None
|
||||||
def init():
|
def init():
|
||||||
global vars
|
global vars
|
||||||
global prefs
|
global prefs
|
||||||
global music
|
global audio
|
||||||
global lastfm
|
global lastfm
|
||||||
|
|
||||||
vars = Map()
|
vars = Map()
|
||||||
prefs = Map("preferences")
|
prefs = Map("preferences")
|
||||||
import music
|
import audio
|
||||||
import lastfm
|
import lastfm
|
||||||
|
|
||||||
event.start("POSTINIT")
|
event.start("POSTINIT")
|
||||||
|
@ -58,7 +58,7 @@ def startup():
|
||||||
import plugin
|
import plugin
|
||||||
|
|
||||||
event.start("PRESTART")
|
event.start("PRESTART")
|
||||||
music.init()
|
audio.init()
|
||||||
plugin.load_all()
|
plugin.load_all()
|
||||||
event.start("POSTSTART")
|
event.start("POSTSTART")
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ def choose_next():
|
||||||
return call("NEXT", play_id, next)
|
return call("NEXT", play_id, next)
|
||||||
|
|
||||||
def change_score():
|
def change_score():
|
||||||
prcnt = libsaria.music.get_progress()
|
prcnt = libsaria.audio.get_progress()
|
||||||
if prcnt > 0.75:
|
if prcnt > 0.75:
|
||||||
inc_count(cur_lib_id)
|
inc_count(cur_lib_id)
|
||||||
inc_score(cur_lib_id)
|
inc_score(cur_lib_id)
|
||||||
|
|
|
@ -103,8 +103,8 @@ def inc_count(id):
|
||||||
def play_id(id):
|
def play_id(id):
|
||||||
libsaria.collection.cur_lib_id = id
|
libsaria.collection.cur_lib_id = id
|
||||||
filepath = get_attr(id, "filepath")
|
filepath = get_attr(id, "filepath")
|
||||||
libsaria.music.load(filepath)
|
libsaria.audio.load(filepath)
|
||||||
libsaria.music.play()
|
libsaria.audio.play()
|
||||||
|
|
||||||
def filter(text):
|
def filter(text):
|
||||||
global visible
|
global visible
|
||||||
|
|
|
@ -59,7 +59,7 @@ def universal_open(file):
|
||||||
if id:
|
if id:
|
||||||
libsaria.collection.play_id(id)
|
libsaria.collection.play_id(id)
|
||||||
else:
|
else:
|
||||||
libsaria.music.load(file)
|
libsaria.audio.load(file)
|
||||||
except Exception,e:
|
except Exception,e:
|
||||||
print e
|
print e
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -37,7 +37,7 @@ class PlayButton(Button):
|
||||||
LS.event.invite("POSTPAUSE", self.show)
|
LS.event.invite("POSTPAUSE", self.show)
|
||||||
LS.event.invite("POSTSTOP", self.show)
|
LS.event.invite("POSTSTOP", self.show)
|
||||||
def clicked(self, button):
|
def clicked(self, button):
|
||||||
LS.music.play()
|
LS.audio.play()
|
||||||
def hide(self, playing):
|
def hide(self, playing):
|
||||||
if playing == True:
|
if playing == True:
|
||||||
Button.hide(self)
|
Button.hide(self)
|
||||||
|
@ -52,7 +52,7 @@ class PauseButton(Button):
|
||||||
LS.event.invite("POSTPAUSE", self.hide)
|
LS.event.invite("POSTPAUSE", self.hide)
|
||||||
LS.event.invite("POSTSTOP", self.hide)
|
LS.event.invite("POSTSTOP", self.hide)
|
||||||
def clicked(self, button):
|
def clicked(self, button):
|
||||||
LS.music.pause()
|
LS.audio.pause()
|
||||||
def hide(self, paused):
|
def hide(self, paused):
|
||||||
if paused == True:
|
if paused == True:
|
||||||
Button.hide(self)
|
Button.hide(self)
|
||||||
|
@ -65,7 +65,7 @@ class StopButton(Button):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
Button.__init__(self, gtk.STOCK_MEDIA_STOP)
|
Button.__init__(self, gtk.STOCK_MEDIA_STOP)
|
||||||
def clicked(self, button):
|
def clicked(self, button):
|
||||||
LS.music.stop()
|
LS.audio.stop()
|
||||||
|
|
||||||
|
|
||||||
class NextButton(Button):
|
class NextButton(Button):
|
||||||
|
@ -79,14 +79,14 @@ class ForwardButton(Button):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
Button.__init__(self, gtk.STOCK_MEDIA_FORWARD)
|
Button.__init__(self, gtk.STOCK_MEDIA_FORWARD)
|
||||||
def clicked(self, button):
|
def clicked(self, button):
|
||||||
LS.music.seek_sec(5)
|
LS.audio.seek_sec(5)
|
||||||
|
|
||||||
|
|
||||||
class RewindButton(Button):
|
class RewindButton(Button):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
Button.__init__(self, gtk.STOCK_MEDIA_REWIND)
|
Button.__init__(self, gtk.STOCK_MEDIA_REWIND)
|
||||||
def clicked(self, button):
|
def clicked(self, button):
|
||||||
LS.music.seek_sec(-5)
|
LS.audio.seek_sec(-5)
|
||||||
|
|
||||||
class OpenButton(Button):
|
class OpenButton(Button):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -161,5 +161,5 @@ class VolumeButton(gtk.VolumeButton):
|
||||||
image.set_from_icon_name(icon, gtk.ICON_SIZE_BUTTON)
|
image.set_from_icon_name(icon, gtk.ICON_SIZE_BUTTON)
|
||||||
|
|
||||||
def changed(self, widget, value):
|
def changed(self, widget, value):
|
||||||
LS.music.set_volume(value)
|
LS.audio.set_volume(value)
|
||||||
widget.resize()
|
widget.resize()
|
||||||
|
|
|
@ -16,8 +16,8 @@ def set_fns():
|
||||||
global get_time
|
global get_time
|
||||||
global get_attr
|
global get_attr
|
||||||
global file_to_id
|
global file_to_id
|
||||||
#update = ocarina.libsaria.music.get_progress
|
#update = ocarina.libsaria.audio.get_progress
|
||||||
get_time = ocarina.libsaria.music.get_time
|
get_time = ocarina.libsaria.audio.get_time
|
||||||
get_attr = libsaria.collection.get_attr
|
get_attr = libsaria.collection.get_attr
|
||||||
file_to_id = libsaria.collection.file_to_id
|
file_to_id = libsaria.collection.file_to_id
|
||||||
invite("POSTSTART", set_fns)
|
invite("POSTSTART", set_fns)
|
||||||
|
|
|
@ -10,8 +10,8 @@ def set_fns():
|
||||||
global update
|
global update
|
||||||
global get_time
|
global get_time
|
||||||
global seek
|
global seek
|
||||||
update = ocarina.libsaria.music.get_progress
|
update = ocarina.libsaria.audio.get_progress
|
||||||
seek = ocarina.libsaria.music.seek
|
seek = ocarina.libsaria.audio.seek
|
||||||
ocarina.libsaria.event.invite("POSTSTART", set_fns)
|
ocarina.libsaria.event.invite("POSTSTART", set_fns)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ menu = ocarina.menu
|
||||||
|
|
||||||
def check_pause(*args):
|
def check_pause(*args):
|
||||||
if vars["PAUSEAFTER"] == True:
|
if vars["PAUSEAFTER"] == True:
|
||||||
libsaria.music.pause()
|
libsaria.audio.pause()
|
||||||
vars["PAUSEAFTER"] = False
|
vars["PAUSEAFTER"] = False
|
||||||
|
|
||||||
def set_pause(*args):
|
def set_pause(*args):
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import ocarina
|
import ocarina
|
||||||
|
|
||||||
music = ocarina.libsaria.music
|
audio = ocarina.libsaria.audio
|
||||||
gtk = ocarina.gtk
|
gtk = ocarina.gtk
|
||||||
webkit = None
|
webkit = None
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ class WebPage(gtk.ScrolledWindow):
|
||||||
self.web.show()
|
self.web.show()
|
||||||
|
|
||||||
def doc_load_finished(self, view, webframe):
|
def doc_load_finished(self, view, webframe):
|
||||||
music.pause()
|
audio.pause()
|
||||||
|
|
||||||
def start():
|
def start():
|
||||||
global webkit
|
global webkit
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
# Bryan Schumaker (8/7/2010)
|
# Bryan Schumaker (8/7/2010)
|
||||||
|
|
||||||
from libsaria import music
|
from libsaria import audio
|
||||||
|
|
||||||
path = "~/Music/Eagles/Hotel California.mp3"
|
path = "~/Music/Eagles/Hotel California.mp3"
|
||||||
|
|
||||||
music.load(path)
|
audio.load(path)
|
||||||
|
|
||||||
raw_input("Press ENTER to play ... ")
|
raw_input("Press ENTER to play ... ")
|
||||||
music.play()
|
audio.play()
|
||||||
|
|
||||||
raw_input("Press ENTER to pause ... ")
|
raw_input("Press ENTER to pause ... ")
|
||||||
music.pause()
|
audio.pause()
|
||||||
|
|
||||||
raw_input("Press ENTER to play ... ")
|
raw_input("Press ENTER to play ... ")
|
||||||
music.play()
|
audio.play()
|
||||||
|
|
||||||
raw_input("Press ENTER to stop ... ")
|
raw_input("Press ENTER to stop ... ")
|
||||||
music.stop()
|
audio.stop()
|
||||||
|
|
||||||
raw_input("Press ENTER to play ... ")
|
raw_input("Press ENTER to play ... ")
|
||||||
music.play()
|
audio.play()
|
||||||
|
|
||||||
raw_input("Press ENTER to quit ... ")
|
raw_input("Press ENTER to quit ... ")
|
||||||
|
|
Loading…
Reference in New Issue