72 lines
1.2 KiB
Python
72 lines
1.2 KiB
Python
# Bryan Schumaker (8/7/2010)
|
|
|
|
__major__ = 4
|
|
__minor__ = 5
|
|
__bug__ = 0
|
|
__dev__ = True
|
|
|
|
__vstr__ = "%s.%s" % (__major__, __minor__)
|
|
if __bug__ > 0:
|
|
__vstr__ = "%s.%s" % (__vstr__, __bug__)
|
|
if __dev__ == True:
|
|
__vstr__ += "-dev"
|
|
__vers__ = "Libsaria %s" % __vstr__
|
|
|
|
import prefs
|
|
import audio
|
|
import event
|
|
|
|
import path
|
|
from path.cache import Cache
|
|
|
|
# The cache is also saved across sessions
|
|
cache = Cache()
|
|
|
|
#plugin = None
|
|
lastfm = None
|
|
controls = None
|
|
|
|
|
|
# Initialize helpful variables
|
|
def init():
|
|
global lastfm
|
|
global controls
|
|
|
|
import controls
|
|
import sources
|
|
from path import lastfm
|
|
event.invite("POSTLIBLOAD", parse_user_input)
|
|
|
|
sources.library.init_bg()
|
|
sources.playlist.init_bg()
|
|
sources.queue.init_bg()
|
|
controls.init()
|
|
event.start("POSTINIT")
|
|
|
|
|
|
def startup():
|
|
# global plugin
|
|
# import plugin
|
|
|
|
event.start("PRESTART")
|
|
controls.init2()
|
|
# plugin.load_all()
|
|
prefs.enable_save()
|
|
event.start("POSTSTART")
|
|
sources.playlist.startup()
|
|
|
|
|
|
def shutdown():
|
|
event.start("PREQUIT")
|
|
audio.shutdown()
|
|
## import plugin
|
|
## plugin.quit()
|
|
event.start("POSTQUIT")
|
|
|
|
|
|
def parse_user_input():
|
|
import sys
|
|
for item in sys.argv[1:]:
|
|
path.files.universal_open(item)
|
|
init()
|