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