Removed quickplayer and references to quickplayer
This commit is contained in:
parent
106a20ad33
commit
07907177e7
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
.vs/
|
||||
build/
|
||||
deb_dist/
|
||||
**/*.pyc
|
||||
|
|
|
@ -27,7 +27,6 @@ DBusGMainLoop(set_as_default=True)
|
|||
|
||||
# imports from module
|
||||
from monitoredplayer import MonitoredPlayer
|
||||
from quickplayer import QuickPlayer
|
||||
|
||||
|
||||
class MediaService(dbus.service.Object):
|
||||
|
@ -37,7 +36,6 @@ class MediaService(dbus.service.Object):
|
|||
dbus.service.Object.__init__(self, bus_name, '/nl/miqra/MediaCore/Media')
|
||||
|
||||
self.player = MonitoredPlayer()
|
||||
self.quickplayer = QuickPlayer()
|
||||
|
||||
self.player.connect('playback-ready',self.onPlayerReady) # parameters: source_file tag_dict
|
||||
self.player.connect('playback-playing',self.onPlayerPlaying) # parameters: None
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
# perform gstreamer imports (python3 style)
|
||||
import gi
|
||||
gi.require_version('Gst','1.0')
|
||||
|
||||
from gi.repository import GObject
|
||||
|
||||
# import from this module
|
||||
from monitoredplayer import MonitoredPlayer
|
||||
|
||||
class QuickPlayer(GObject.GObject):
|
||||
|
||||
def __init__(self):
|
||||
GObject.GObject.__init__(self)
|
||||
self.player = MonitoredPlayer()
|
||||
self._duration = -1;
|
||||
self.player.connect("playback-ready",self.onReady)
|
||||
self.player.connect("playback-error",self.onError)
|
||||
|
||||
|
||||
# Calling functions for file
|
||||
def playfor(self,file,duration):
|
||||
if duration > 0: # not much point in wasting system resources otherwise
|
||||
self._duration = duration
|
||||
self.player.load(file)
|
||||
elif duration < 0: # same as normal play
|
||||
self.play(file)
|
||||
|
||||
def play(self,file):
|
||||
self._duration = -1;
|
||||
self.player.load(file)
|
||||
|
||||
# Calling functions for urls
|
||||
def playurlfor(self,url,duration):
|
||||
if duration > 0: # not much point in wasting system resources otherwise
|
||||
self._duration = duration
|
||||
self.player.load_uri(url)
|
||||
elif duration < 0: # same as normal play
|
||||
self.playurl(url)
|
||||
|
||||
def playurl(self,url):
|
||||
self._duration = -1;
|
||||
self.player.load_uri(url)
|
||||
|
||||
# stop function
|
||||
def stop(self):
|
||||
self._duration = -1
|
||||
self.player.stop()
|
||||
|
||||
def onReady(self,player,file,tags):
|
||||
print "Quickplay loaded: {0}".format(file)
|
||||
for tag in tags:
|
||||
print " {0}: {1}".format(tag,tags[tag])
|
||||
if self._duration > 0:
|
||||
self.player.playfor(self._duration)
|
||||
elif self._duration < 0:
|
||||
self.player.play()
|
||||
|
||||
def onError(self,player,player_state,error,debug):
|
||||
print "Quickplay error during " + player_state + ":"
|
||||
print " " + error
|
||||
print " "
|
||||
print " " + debug
|
||||
|
||||
|
||||
GObject.type_register(QuickPlayer)
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
from mediaserver.audioplayer import AudioPlayer
|
||||
from mediaserver.quickplayer import QuickPlayer
|
||||
from gi.repository import GObject
|
||||
import sys
|
||||
|
||||
def onReady(player, file, tags):
|
||||
print "Starting {0} ...\n".format(file)
|
||||
print " Tags:\n"
|
||||
for tag in tags:
|
||||
print " {0} : '{1}'\n".format(tag,tags[tag])
|
||||
|
||||
duration = player.duration()
|
||||
pos = player.position()
|
||||
print "Song duration is {0} seconds".format(duration)
|
||||
print "Current position is {0} seconds".format(pos)
|
||||
|
||||
player.playfor(20)
|
||||
|
||||
def onPlaying(player):
|
||||
|
||||
print "Playing ..."
|
||||
|
||||
#print "Jumping to 40 seconds"
|
||||
#player.seek(40)
|
||||
|
||||
def onStop(player):
|
||||
print "Quitting...."
|
||||
loop.quit()
|
||||
|
||||
player = QuickPlayer()
|
||||
#player.connect("playback-ready",onReady)
|
||||
#player.connect("playback-playing",onPlaying)
|
||||
#player.connect("playback-finished",onStop)
|
||||
#player.connect("playback-stopped",onStop)
|
||||
|
||||
#print "Attempting to play {0}".format(sys.argv[1])
|
||||
player.play(sys.argv[1])
|
||||
|
||||
|
||||
|
||||
loop = GObject.MainLoop()
|
||||
loop.run()
|
Loading…
Reference in New Issue
Block a user