ocarina/libsaria/__init__.py
Bryan Schumaker 69481ffa70 libsaria: Shut down gstreamer on exit
This gives gstreamer a chance to clean up while exiting.
2011-05-01 12:46:16 -04:00

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()