Integrated updates from sailplayer
This commit is contained in:
parent
969d27b98e
commit
acc3ec8f2b
|
@ -48,6 +48,9 @@ class MediaService(dbus.service.Object):
|
||||||
self.player.connect('volume-changed',self.onPlayerVolumeChanged) # parameters: volume
|
self.player.connect('volume-changed',self.onPlayerVolumeChanged) # parameters: volume
|
||||||
self.player.connect('playback-buffering',self.onPlayerBuffering) # parameters: volume
|
self.player.connect('playback-buffering',self.onPlayerBuffering) # parameters: volume
|
||||||
|
|
||||||
|
self.loadcount = 0;
|
||||||
|
self.loadmax = 1;
|
||||||
|
|
||||||
@dbus.service.method(dbus_interface='nl.miqra.MediaCore.Media', in_signature='s', out_signature='')
|
@dbus.service.method(dbus_interface='nl.miqra.MediaCore.Media', in_signature='s', out_signature='')
|
||||||
def QuickPlay(self, file,):
|
def QuickPlay(self, file,):
|
||||||
""" Directly play back a local file
|
""" Directly play back a local file
|
||||||
|
@ -77,17 +80,26 @@ class MediaService(dbus.service.Object):
|
||||||
def LoadFile(self, file):
|
def LoadFile(self, file):
|
||||||
""" Load a local file for playback
|
""" Load a local file for playback
|
||||||
"""
|
"""
|
||||||
print "Loading file {0}".format(file)
|
if self.loadcount < self.loadmax:
|
||||||
self.player.load(file)
|
print "Loading file {0}".format(file)
|
||||||
self.OnLoading("file://{0}".format(file))
|
print file
|
||||||
|
self.player.load(file)
|
||||||
|
self.loadcount += 1;
|
||||||
|
self.OnLoading("file://{0}".format(file))
|
||||||
|
else:
|
||||||
|
print "Skipping load of file {0} because maximum simultaneous loads ({1}) was reached. Wait until ready....".format(file,self.loadmax);
|
||||||
|
|
||||||
@dbus.service.method(dbus_interface='nl.miqra.MediaCore.Media', in_signature='s', out_signature='')
|
@dbus.service.method(dbus_interface='nl.miqra.MediaCore.Media', in_signature='s', out_signature='')
|
||||||
def LoadUrl(self, uri):
|
def LoadUrl(self, uri):
|
||||||
""" Load an url for playback
|
""" Load an url for playback
|
||||||
"""
|
"""
|
||||||
print "Loading url {0}".format(file)
|
if self.loadcount < self.loadmax:
|
||||||
self.player.load_uri(uri)
|
print "Loading url {0}".format(uri)
|
||||||
self.OnLoading(uri)
|
self.player.load_uri(uri)
|
||||||
|
self.loadcount += 1;
|
||||||
|
self.OnLoading(uri)
|
||||||
|
else:
|
||||||
|
print "Skipping load of url {0} because maximum simultaneous loads ({1}) was reached. Wait until ready....".format(uri,self.loadmax);
|
||||||
|
|
||||||
@dbus.service.method(dbus_interface='nl.miqra.MediaCore.Media', in_signature='d', out_signature='')
|
@dbus.service.method(dbus_interface='nl.miqra.MediaCore.Media', in_signature='d', out_signature='')
|
||||||
def PlayFor(self, duration):
|
def PlayFor(self, duration):
|
||||||
|
@ -147,6 +159,11 @@ class MediaService(dbus.service.Object):
|
||||||
print " {0}: {1}".format(tag,taglist[tag])
|
print " {0}: {1}".format(tag,taglist[tag])
|
||||||
except Exception as x:
|
except Exception as x:
|
||||||
print "Error converting value for '{0}':\n {1}".format(tag,x)
|
print "Error converting value for '{0}':\n {1}".format(tag,x)
|
||||||
|
|
||||||
|
# reset load counter
|
||||||
|
self.loadcount = 0;
|
||||||
|
|
||||||
|
# signal ready
|
||||||
self.OnReady(filename,taglist)
|
self.OnReady(filename,taglist)
|
||||||
|
|
||||||
def onPlayerPlaying(self,player):
|
def onPlayerPlaying(self,player):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user