2010-08-07 12:55:23 -04:00
|
|
|
# Bryan Schumaker (8/7/2010)
|
|
|
|
|
2011-05-06 22:36:33 -04:00
|
|
|
import version
|
2011-04-28 08:27:51 -04:00
|
|
|
import prefs
|
2011-04-30 12:06:48 -04:00
|
|
|
import audio
|
2010-08-07 12:55:23 -04:00
|
|
|
|
2011-04-30 10:48:59 -04:00
|
|
|
import path
|
|
|
|
from path.cache import Cache
|
2010-08-07 12:55:23 -04:00
|
|
|
|
2011-04-30 10:48:59 -04:00
|
|
|
# The cache is also saved across sessions
|
|
|
|
cache = Cache()
|
2010-08-15 13:39:31 -04:00
|
|
|
|
2011-04-30 10:48:59 -04:00
|
|
|
#plugin = None
|
|
|
|
lastfm = None
|
|
|
|
controls = None
|
2010-11-15 08:17:31 -05:00
|
|
|
|
2010-08-07 19:39:46 -04:00
|
|
|
|
2011-04-30 10:48:59 -04:00
|
|
|
# Initialize helpful variables
|
|
|
|
def init():
|
|
|
|
global lastfm
|
|
|
|
global controls
|
2010-10-20 20:04:23 -04:00
|
|
|
|
2011-04-30 10:48:59 -04:00
|
|
|
import controls
|
|
|
|
import sources
|
|
|
|
from path import lastfm
|
2010-10-20 20:04:23 -04:00
|
|
|
|
2011-04-30 10:48:59 -04:00
|
|
|
sources.library.init_bg()
|
|
|
|
sources.playlist.init_bg()
|
|
|
|
sources.queue.init_bg()
|
|
|
|
controls.init()
|
2010-08-13 23:58:19 -04:00
|
|
|
|
|
|
|
|
2011-04-30 10:48:59 -04:00
|
|
|
def startup():
|
|
|
|
# global plugin
|
|
|
|
# import plugin
|
2010-08-30 17:57:08 -04:00
|
|
|
|
2011-04-30 10:48:59 -04:00
|
|
|
controls.init2()
|
|
|
|
# plugin.load_all()
|
|
|
|
prefs.enable_save()
|
2011-05-01 10:02:34 -04:00
|
|
|
parse_user_input()
|
2011-04-30 10:48:59 -04:00
|
|
|
sources.playlist.startup()
|
2010-08-15 13:39:31 -04:00
|
|
|
|
2010-11-14 17:32:09 -05:00
|
|
|
|
2011-04-30 10:48:59 -04:00
|
|
|
def shutdown():
|
2011-04-30 12:57:10 -04:00
|
|
|
audio.shutdown()
|
2011-04-28 08:27:51 -04:00
|
|
|
## import plugin
|
|
|
|
## plugin.quit()
|
2010-11-27 22:22:44 -05:00
|
|
|
|
2011-04-28 08:27:51 -04:00
|
|
|
|
2011-04-30 10:48:59 -04:00
|
|
|
def parse_user_input():
|
|
|
|
import sys
|
|
|
|
for item in sys.argv[1:]:
|
|
|
|
path.files.universal_open(item)
|
|
|
|
init()
|