From 07907177e7ce6a93fcd6a1adc043d295e05e7fe9 Mon Sep 17 00:00:00 2001 From: Miqra Developer Date: Wed, 26 Sep 2018 19:16:39 +0000 Subject: [PATCH] Removed quickplayer and references to quickplayer --- .gitignore | 1 + mediaserver/mediaserver.py | 2 -- mediaserver/quickplayer.py | 66 -------------------------------------- test_basicplayer.py | 44 ------------------------- 4 files changed, 1 insertion(+), 112 deletions(-) delete mode 100755 mediaserver/quickplayer.py delete mode 100755 test_basicplayer.py diff --git a/.gitignore b/.gitignore index 412b8f1..8cbe41e 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.vs/ build/ deb_dist/ **/*.pyc diff --git a/mediaserver/mediaserver.py b/mediaserver/mediaserver.py index 082e916..e24c760 100755 --- a/mediaserver/mediaserver.py +++ b/mediaserver/mediaserver.py @@ -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 diff --git a/mediaserver/quickplayer.py b/mediaserver/quickplayer.py deleted file mode 100755 index b152688..0000000 --- a/mediaserver/quickplayer.py +++ /dev/null @@ -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) - \ No newline at end of file diff --git a/test_basicplayer.py b/test_basicplayer.py deleted file mode 100755 index b00443a..0000000 --- a/test_basicplayer.py +++ /dev/null @@ -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()