Pass input args from ocarina to ocarina.py when called
git-svn-id: file:///home/anna/Desktop/ocarina-legacy/mithos/ocarina@17 1daee41c-8060-4895-b1f0-2197c00d777a
This commit is contained in:
parent
0292895823
commit
f712855a9b
|
@ -1,2 +1,2 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
`which python` ocarina.py
|
`which python` ocarina.py $?
|
||||||
|
|
|
@ -70,7 +70,7 @@ class main:
|
||||||
self.playButton = self.makeButton("playButton","images/play.png",None,self.ops.play)
|
self.playButton = self.makeButton("playButton","images/play.png",None,self.ops.play)
|
||||||
self.pauseButton = self.makeButton("pauseButton","images/pause.png",None,self.ops.pause)
|
self.pauseButton = self.makeButton("pauseButton","images/pause.png",None,self.ops.pause)
|
||||||
self.nextButton = self.makeButton("nextButton","images/next.png",None,self.ops.next)
|
self.nextButton = self.makeButton("nextButton","images/next.png",None,self.ops.next)
|
||||||
self.thisButton = self.makeButton("thisButton",None,"This",self.this)
|
self.thisButton = self.makeButton("thisButton",None,"This",self.ops.this)
|
||||||
self.infoButton = self.makeButton("infoButton",None,"Info",self.ops.info)
|
self.infoButton = self.makeButton("infoButton",None,"Info",self.ops.info)
|
||||||
# Add buttons to window
|
# Add buttons to window
|
||||||
self.inside.pack_start(self.playButton,False,False,0)
|
self.inside.pack_start(self.playButton,False,False,0)
|
||||||
|
@ -128,40 +128,28 @@ class main:
|
||||||
|
|
||||||
|
|
||||||
# Show running time info
|
# Show running time info
|
||||||
def time(self,unused):
|
#def time(self,unused):
|
||||||
if self.song == None:
|
# if self.song == None:
|
||||||
return
|
# return
|
||||||
cur = self.song.curTime()
|
# cur = self.song.curTime()
|
||||||
tot = self.song.info.length
|
# tot = self.song.info.length
|
||||||
self.commands.printLine(cur.toStr()+" / "+tot.toStr())
|
# self.commands.printLine(cur.toStr()+" / "+tot.toStr())
|
||||||
|
|
||||||
# Show detailed song info
|
|
||||||
#def info(self,widget,data):
|
# Show basic song info
|
||||||
# # Return if no song found
|
#def this(self,unused):
|
||||||
|
#def this(self,widget,data):
|
||||||
|
# # Return if no song found
|
||||||
# if self.song == None:
|
# if self.song == None:
|
||||||
# return
|
# return
|
||||||
# # Return if no tags found
|
# # Return if no tags found
|
||||||
# if self.song.info.tags == None:
|
# if self.song.info.tags == None:
|
||||||
# print "Could not find any tags"
|
# print "Could not find any tags"
|
||||||
# return
|
# return
|
||||||
# for tag in self.song.info.tags.keys():
|
# fields = ["title","artist","track-number","track-count","album"]
|
||||||
# print tag+":",self.song.info.tags[tag]
|
# for field in fields:
|
||||||
# print self.song.info.filename
|
# if (field in self.song.info.tags.keys()) == True:
|
||||||
|
# print field+":",self.song.info.tags[field]
|
||||||
# Show basic song info
|
|
||||||
#def this(self,unused):
|
|
||||||
def this(self,widget,data):
|
|
||||||
# Return if no song found
|
|
||||||
if self.song == None:
|
|
||||||
return
|
|
||||||
# Return if no tags found
|
|
||||||
if self.song.info.tags == None:
|
|
||||||
print "Could not find any tags"
|
|
||||||
return
|
|
||||||
fields = ["title","artist","track-number","track-count","album"]
|
|
||||||
for field in fields:
|
|
||||||
if (field in self.song.info.tags.keys()) == True:
|
|
||||||
print field+":",self.song.info.tags[field]
|
|
||||||
|
|
||||||
|
|
||||||
def scanLib(self,dir):
|
def scanLib(self,dir):
|
||||||
|
|
|
@ -39,13 +39,29 @@ class Operations:
|
||||||
|
|
||||||
# Mark progress on the progress bar
|
# Mark progress on the progress bar
|
||||||
def markProgress(self,widget,data):
|
def markProgress(self,widget,data):
|
||||||
time = self.song.curTime()
|
time = (False,None)
|
||||||
|
while time[0] == False:
|
||||||
|
time = self.song.curTime()
|
||||||
widget.set_fraction(float(self.song.current)/float(self.song.total))
|
widget.set_fraction(float(self.song.current)/float(self.song.total))
|
||||||
widget.set_text(time.toStr()+" / "+self.song.info.length.toStr())
|
widget.set_text(time[1].toStr()+" / "+self.song.info.length.toStr())
|
||||||
#print float(self.song.current)/float(self.song.total)
|
#print float(self.song.current)/float(self.song.total)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def this(self,widget,data):
|
||||||
|
# Return if no song found
|
||||||
|
if self.song == None:
|
||||||
|
return
|
||||||
|
# Return if no tags found
|
||||||
|
if self.song.info.tags == None:
|
||||||
|
print "Could not find any tags"
|
||||||
|
return
|
||||||
|
fields = ["title","artist","track-number","track-count","album"]
|
||||||
|
for field in fields:
|
||||||
|
if (field in self.song.info.tags.keys()) == True:
|
||||||
|
print field+":",self.song.info.tags[field]
|
||||||
|
|
||||||
|
|
||||||
# Print detailed song info
|
# Print detailed song info
|
||||||
def info(self,widget,data):
|
def info(self,widget,data):
|
||||||
# Return if no song found
|
# Return if no song found
|
||||||
|
|
|
@ -88,8 +88,11 @@ class Song():
|
||||||
|
|
||||||
# Print out current running time
|
# Print out current running time
|
||||||
def curTime(self):
|
def curTime(self):
|
||||||
length = self.player.query_position(self.time_format,None)[0]
|
try:
|
||||||
self.current = length
|
length = self.player.query_position(self.time_format,None)[0]
|
||||||
dur = Duration()
|
self.current = length
|
||||||
dur.setTime(length)
|
dur = Duration()
|
||||||
return dur
|
dur.setTime(length)
|
||||||
|
return (True,dur)
|
||||||
|
except:
|
||||||
|
return (False,None)
|
||||||
|
|
Loading…
Reference in New Issue