Changeset - 77c39b6e71ab
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 20 years ago 2005-06-17 23:41:08
drewp@bigasterisk.com
new asco xmlrpc commands to seek/pause
1 file changed with 13 insertions and 1 deletions:
0 comments (0 inline, 0 general)
bin/ascoltami
Show inline comments
 
@@ -11,13 +11,12 @@ features and limitations:
 
    getting the current time in the playing song
 
    requesting what song is playing
 
    saying what song should play
 

	
 
todo:
 

	
 
presong and postsong silence
 

	
 
"""
 

	
 
from __future__ import division,nested_scopes
 

	
 
from optparse import OptionParser
 
@@ -46,12 +45,25 @@ class XMLRPCServe(xmlrpc.XMLRPC):
 
    def xmlrpc_playfile(self,musicfilename):
 
        self.player.play(musicfilename)
 
        return 'ok'
 
    def xmlrpc_stop(self):
 
        self.player.state.set('stop')
 
        return 'ok'
 
    def xmlrpc_seek_to(self,t):
 
        self.player.seek_to(t)
 
        return 'ok'
 
    def xmlrpc_seekplay_or_pause(self,t):
 
        """either seek to t and play; or pause. this is the
 
        curvecalc click-play interface"""
 
        if self.player.state.get() == "play":
 
            self.player.pause()
 
            return 'paused'
 
        else:
 
            self.player.seek_to(t)
 
            self.player.play()
 
            return 'playing'
 
    def xmlrpc_gettime(self):
 
        """returns seconds from start of song"""
 
        return float(self.player.smoothCurrentTime())
 
    def xmlrpc_songlength(self):
 
        """song length, in seconds"""
 
        return float(self.player.total_time.get())
0 comments (0 inline, 0 general)