Track/Album/Artist displayed

git-svn-id: file:///home/anna/Desktop/ocarina-legacy/mithos/ocarina@37 1daee41c-8060-4895-b1f0-2197c00d777a
This commit is contained in:
bjschuma 2009-06-29 04:13:15 +00:00
parent 920ce35570
commit 65210bc029
9 changed files with 70 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 667 B

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 956 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

After

Width:  |  Height:  |  Size: 740 B

View File

@ -1,3 +1,3 @@
# Used for initializing things in the GuiObjects directory # Used for initializing things in the GuiObjects directory
__all__ = ['button','menuItem','libView','plistView'] __all__ = ['button','menuItem','libView','infoView','plistView']

View File

@ -0,0 +1,44 @@
import pango
import gobject
import pygtk
pygtk.require('2.0')
import gtk
class InfoView(gtk.VBox):
def __init__(self,data):
gtk.VBox.__init__(self,False,0)
self.data = data
self.title = self.makeLabel("",13000)
self.album = self.makeLabel("",10000)
self.artist = self.makeLabel("",10000)
self.changeLabels()
gobject.timeout_add(1000,self.changeLabels)
self.show()
def changeLabels(self):
title = ""
album = ""
artist = ""
if self.data.song.info:
title = self.data.song.info.title
album = self.data.song.info.album
artist = self.data.song.info.artist
self.title.set_text("Title: "+title)
self.album.set_text("Album: "+album)
self.artist.set_text("Artist "+artist)
return True
def makeLabel(self,text,size):
label = gtk.Label(text)
align = gtk.Alignment(0,1,0,0)
attr = pango.AttrList()
attr.insert(pango.AttrSize(size,0,-1))
label.set_attributes(attr)
align.add(label)
self.pack_start(align,False,False,0)
label.show()
align.show()
return label

View File

@ -17,6 +17,7 @@ class PlistView(gtk.ScrolledWindow):
self.makeList() self.makeList()
self.loadSong() self.loadSong()
gobject.timeout_add(1000,self.checkUpdate) gobject.timeout_add(1000,self.checkUpdate)
self.show()
# Check if the playlist has been updated # Check if the playlist has been updated
@ -138,11 +139,26 @@ class PlistView(gtk.ScrolledWindow):
return return
selrow = 0 selrow = 0
row = 0 row = 0
for i in range(len(self.trackList)): for i in range(len(self.data.curList)):
if self.trackList[i] == self.data.curSong: if self.trackList[i][0] == self.data.song.info.id:
if i > 10: if i > 10:
selrow = i - 10 selrow = i - 10
row = i row = i
break break
#self.tree.scroll_to_cell(selrow,None,True,0,0) print selrow,row
self.tree.set_cursor(self.data.curSong,None,False) self.tree.scroll_to_cell(selrow,None,True,0,0)
treesel = self.tree.get_selection()
treesel.select_path(row)
#model = self.tree.get_model()
#selrow = 0
#row = 0
#for i in range(len(model)):
#if i > 10:
# selrow = self.trackList[i - 10][0]
# if model[i][0] == self.data.curSong:
# row = i
# break
#print model[i][0],self.data.curSong,row
#print self.tree[row][0],self.data.curSong
#self.tree.scroll_to_cell(row,None,False,0,0)
#model.set_cursor(row,None,False)

View File

@ -12,10 +12,11 @@ class Song():
self.quit=exitFunc self.quit=exitFunc
# initialize player pipeline # initialize player pipeline
self.next = None self.next = None
self.info = None
self.player = gst.Pipeline("player") self.player = gst.Pipeline("player")
self.bin = gst.element_factory_make("playbin",None) self.bin = gst.element_factory_make("playbin",None)
self.player.add(self.bin) self.player.add(self.bin)
# initialize bus # initialize bus
bus = self.player.get_bus() bus = self.player.get_bus()
bus.add_signal_watch() bus.add_signal_watch()

View File

@ -10,6 +10,7 @@ from GuiObjects.menuItem import MenuItem
from GuiObjects.libView import LibView from GuiObjects.libView import LibView
from GuiObjects.plistView import PlistView from GuiObjects.plistView import PlistView
from GuiObjects.controlPanel import ControlPanel from GuiObjects.controlPanel import ControlPanel
from GuiObjects.infoView import InfoView
class Window(gtk.Window): class Window(gtk.Window):
@ -183,8 +184,9 @@ class Window(gtk.Window):
rightPane=gtk.VBox(False,0) rightPane=gtk.VBox(False,0)
infoview = InfoView(self.data)
rightPane.pack_start(infoview,False,False,0)
self.plistview = PlistView(self.data) self.plistview = PlistView(self.data)
self.plistview.show()
rightPane.add(self.plistview) rightPane.add(self.plistview)
self.makeBottomRow(rightPane) self.makeBottomRow(rightPane)
rightPane.show() rightPane.show()