2010-08-07 12:55:23 -04:00
|
|
|
# Bryan Schumaker (8/7/2010)
|
|
|
|
|
2010-11-14 13:50:35 -05:00
|
|
|
__all__ = [ "audio", "sources",
|
2010-11-20 10:01:25 -05:00
|
|
|
"event", "map", "path", "plugin"]
|
2010-08-07 12:55:23 -04:00
|
|
|
|
2011-01-22 11:19:18 -05:00
|
|
|
__major__ = 4
|
2011-04-28 07:50:33 -04:00
|
|
|
__minor__ = 5
|
2011-01-22 10:38:32 -05:00
|
|
|
__bug__ = 0
|
2011-04-28 07:50:33 -04:00
|
|
|
__dev__ = True
|
2010-12-05 12:54:32 -05:00
|
|
|
|
2011-01-22 11:19:18 -05:00
|
|
|
__vstr__ = "%s.%s" % (__major__, __minor__)
|
2010-12-05 12:54:32 -05:00
|
|
|
if __bug__ > 0:
|
2011-01-22 11:19:18 -05:00
|
|
|
__vstr__ = "%s.%s" % (__vstr__, __bug__)
|
2010-11-06 13:36:03 -04:00
|
|
|
if __dev__ == True:
|
2011-01-22 11:19:18 -05:00
|
|
|
__vstr__ += "-dev"
|
|
|
|
__vers__ = "Libsaria %s" % __vstr__
|
2010-10-23 20:17:25 -04:00
|
|
|
|
2010-08-07 14:23:50 -04:00
|
|
|
import event
|
2010-08-07 19:39:46 -04:00
|
|
|
import path
|
2010-11-14 17:29:31 -05:00
|
|
|
from trees import Tree, PersPrefTree
|
2010-11-20 09:54:14 -05:00
|
|
|
from path.cache import Cache
|
2010-08-07 12:55:23 -04:00
|
|
|
|
2010-10-24 17:26:53 -04:00
|
|
|
# The cache is also saved across sessions
|
2010-08-07 14:23:50 -04:00
|
|
|
prefs = None
|
2010-10-24 17:26:53 -04:00
|
|
|
cache = Cache()
|
2010-08-07 12:55:23 -04:00
|
|
|
|
2011-04-26 07:57:06 -04:00
|
|
|
#plugin = None
|
2010-11-23 20:37:24 -05:00
|
|
|
audio = None
|
|
|
|
lastfm = None
|
|
|
|
controls = None
|
2010-08-15 13:39:31 -04:00
|
|
|
|
2010-11-15 21:11:12 -05:00
|
|
|
init_pref = None
|
2010-11-15 08:17:31 -05:00
|
|
|
|
2010-08-07 19:39:46 -04:00
|
|
|
|
2010-08-15 01:05:37 -04:00
|
|
|
# Initialize helpful variables
|
|
|
|
def init():
|
2010-08-07 14:23:50 -04:00
|
|
|
global prefs
|
2010-11-15 21:11:12 -05:00
|
|
|
global init_pref
|
2010-11-08 20:58:33 -05:00
|
|
|
global audio
|
2010-10-26 22:44:09 -04:00
|
|
|
global lastfm
|
2010-11-27 15:38:48 -05:00
|
|
|
global controls
|
2010-10-20 20:04:23 -04:00
|
|
|
|
2010-11-15 21:11:12 -05:00
|
|
|
prefs = trees.get_pref_tree("preferences")
|
|
|
|
init_pref = prefs.init_pref
|
2010-11-08 20:58:33 -05:00
|
|
|
import audio
|
2010-11-27 15:38:48 -05:00
|
|
|
import controls
|
2011-04-18 21:38:29 -04:00
|
|
|
import sources
|
2010-11-20 10:05:12 -05:00
|
|
|
from path import lastfm
|
2010-11-27 22:22:44 -05:00
|
|
|
event.invite("POSTLIBLOAD", parse_user_input)
|
2010-10-20 20:04:23 -04:00
|
|
|
|
2011-04-18 21:38:29 -04:00
|
|
|
sources.library.init_bg()
|
2011-04-18 22:29:26 -04:00
|
|
|
sources.playlist.init_bg()
|
2011-04-18 23:01:59 -04:00
|
|
|
sources.queue.init_bg()
|
2010-11-27 15:38:48 -05:00
|
|
|
controls.init()
|
2010-08-07 19:39:46 -04:00
|
|
|
event.start("POSTINIT")
|
2010-08-13 23:58:19 -04:00
|
|
|
|
|
|
|
|
2010-08-15 01:05:37 -04:00
|
|
|
def startup():
|
2011-04-26 07:57:06 -04:00
|
|
|
# global plugin
|
|
|
|
# import plugin
|
2010-08-30 17:57:08 -04:00
|
|
|
|
2010-08-19 23:02:30 -04:00
|
|
|
event.start("PRESTART")
|
2010-11-08 20:58:33 -05:00
|
|
|
audio.init()
|
2010-11-27 15:38:48 -05:00
|
|
|
controls.init2()
|
2011-04-26 07:57:06 -04:00
|
|
|
# plugin.load_all()
|
2011-01-21 22:10:37 -05:00
|
|
|
prefs.enable_save()
|
2010-08-19 23:02:30 -04:00
|
|
|
event.start("POSTSTART")
|
2011-04-26 08:07:07 -04:00
|
|
|
sources.playlist.startup()
|
2010-08-15 13:39:31 -04:00
|
|
|
|
|
|
|
|
|
|
|
def shutdown():
|
|
|
|
event.start("PREQUIT")
|
2011-04-26 07:57:06 -04:00
|
|
|
# import plugin
|
|
|
|
# plugin.quit()
|
2010-08-15 13:39:31 -04:00
|
|
|
event.start("POSTQUIT")
|
2010-11-14 17:32:09 -05:00
|
|
|
|
|
|
|
|
2010-11-27 22:22:44 -05:00
|
|
|
def parse_user_input():
|
|
|
|
import sys
|
|
|
|
for item in sys.argv[1:]:
|
|
|
|
path.files.universal_open(item)
|
|
|
|
|
|
|
|
|
2010-11-14 17:32:09 -05:00
|
|
|
init()
|