- Image row now working reasonably
This commit is contained in:
parent
6f17098b62
commit
ca80e68b0a
|
@ -9,6 +9,7 @@ class MusicObjectRow(ImageRow):
|
|||
def __init__(self, glossMgr, width, height, columns, music_player):
|
||||
ImageRow.__init__(self, glossMgr, width, height, columns)
|
||||
self.music_player = music_player
|
||||
self.sleep = False
|
||||
|
||||
self.objectLibrary = []
|
||||
|
||||
|
@ -20,9 +21,12 @@ class MusicObjectRow(ImageRow):
|
|||
|
||||
for i in range(start, end):
|
||||
object = self.objectLibrary[i]
|
||||
#print "loading: " + object.name
|
||||
print "loading: " + object.name
|
||||
pixbuf = object.get_image()
|
||||
time.sleep(self.music_player.sleep_time)
|
||||
#If there is currently motion, we need to pause this work
|
||||
if self.sleep:
|
||||
self.timeline.connect('completed', self.restart_cb)
|
||||
time.sleep(self.music_player.sleep_time)
|
||||
if pixbuf == object.PENDING_DOWNLOAD:
|
||||
#Get the temporary image
|
||||
object.get_default_image()
|
||||
|
@ -52,6 +56,9 @@ class MusicObjectRow(ImageRow):
|
|||
clutter.threads_init()
|
||||
tmpImage.set_pixbuf(pixbuf)
|
||||
clutter.threads_leave()
|
||||
|
||||
def restart_cb(self, data):
|
||||
self.sleep = True
|
||||
|
||||
def get_current_object(self):
|
||||
return self.objectLibrary[self.currentSelection]
|
|
@ -1,7 +1,7 @@
|
|||
import pygtk
|
||||
import gtk
|
||||
import clutter
|
||||
import thread, time
|
||||
#import thread, time
|
||||
from modules.music_player.backends.myth_music import Backend
|
||||
from modules.music_player.lastFM_interface import lastFM_interface
|
||||
from modules.music_player.music_object_row import MusicObjectRow
|
||||
|
@ -72,7 +72,9 @@ class Module:
|
|||
if (event.keyval == clutter.keysyms.Left) or (event.keyval == clutter.keysyms.Right):
|
||||
#calculate a period of time the loading threads should sleep for when a timline is in progress
|
||||
#self.sleep_time = float(MusicObjectRow.frames) / float(MusicObjectRow.fps)
|
||||
duration = float(MusicObjectRow.frames) / float(MusicObjectRow.fps)
|
||||
self.artistImageRow.input_queue.input(event)
|
||||
self.artistImageRow.sleep = True
|
||||
|
||||
#Just a little test code
|
||||
artist = self.artistImageRow.get_current_object()
|
||||
|
|
|
@ -16,8 +16,8 @@ class ImageRow(clutter.Group):
|
|||
inactiveOpacity = 150
|
||||
images_size_percent = 1 #0.90 #This is the percentage of the total group size that the covers will take
|
||||
|
||||
fps = 35
|
||||
frames = 25
|
||||
fps = 25
|
||||
frames = 15
|
||||
|
||||
def __init__(self, glossMgr, width, height, columns):
|
||||
clutter.Group.__init__(self)
|
||||
|
@ -117,7 +117,7 @@ class ImageRow(clutter.Group):
|
|||
edge_texture_incoming_no = outgoingItem - (self.center)
|
||||
edge_texture_outgoing_no = outgoingItem + (self.center-1)
|
||||
|
||||
if edge_texture_incoming_no < len(self.textureLibrary):
|
||||
if (edge_texture_incoming_no < len(self.textureLibrary)) and (edge_texture_incoming_no >= 0):
|
||||
edge_texture_incoming = self.textureLibrary[edge_texture_incoming_no]
|
||||
self.images_group.add(edge_texture_incoming)
|
||||
|
||||
|
|
Loading…
Reference in New Issue