Video cleanup part1

This commit is contained in:
Tim Bentley 2009-11-01 16:06:59 +00:00
parent 70b04f5821
commit 6df0649fbc
3 changed files with 25 additions and 30 deletions

View File

@ -117,11 +117,6 @@ class ServiceItem(object):
slide[u'image'] = \ slide[u'image'] = \
self.RenderManager.resize_image(slide[u'image']) self.RenderManager.resize_image(slide[u'image'])
self.frames = self.service_frames self.frames = self.service_frames
elif self.service_item_type == ServiceItemType.Video:
for slide in self.service_frames:
slide[u'image'] = \
self.RenderManager.resize_image(slide[u'image'])
self.frames = self.service_frames
else: else:
log.error(u'Invalid value renderer :%s' % self.service_item_type) log.error(u'Invalid value renderer :%s' % self.service_item_type)

View File

@ -294,7 +294,7 @@ class SlideController(QtGui.QWidget):
#More than 20 verses hard luck #More than 20 verses hard luck
pass pass
self.Songbar.setVisible(True) self.Songbar.setVisible(True)
elif item.service_item_type == ServiceType.Image: elif item.service_item_type == ServiceItemType.Image:
#Not sensible to allow loops with 1 frame #Not sensible to allow loops with 1 frame
if len(item.frames) > 1: if len(item.frames) > 1:
self.Toolbar.makeWidgetsVisible(self.image_list) self.Toolbar.makeWidgetsVisible(self.image_list)
@ -444,7 +444,7 @@ class SlideController(QtGui.QWidget):
if row > -1 and row < self.PreviewListWidget.rowCount(): if row > -1 and row < self.PreviewListWidget.rowCount():
if self.commandItem.service_item_type == ServiceItemType.Command: if self.commandItem.service_item_type == ServiceItemType.Command:
Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row]) Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row])
if isLive: if self.isLive:
QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) QtCore.QTimer.singleShot(0.5, self.grabMainDisplay)
else: else:
frame = self.serviceitem.frames[row][u'image'] frame = self.serviceitem.frames[row][u'image']

View File

@ -91,31 +91,31 @@ class MediaMediaItem(MediaManagerItem):
#service_item.add_from_image(path, name, frame) #service_item.add_from_image(path, name, frame)
print path print path
print name print name
service_item.add_from_media(path, name, frame) service_item.add_from_command(path, name, frame)
return True return True
def onPreviewClick(self): # def onPreviewClick(self):
log.debug(u'Media Preview Button pressed') # log.debug(u'Media Preview Button pressed')
items = self.ListView.selectedIndexes() # items = self.ListView.selectedIndexes()
for item in items: # for item in items:
baseItem = self.ListView.item(item.row()) # baseItem = self.ListView.item(item.row())
itemText = unicode(baseItem.data(QtCore.Qt.UserRole).toString()) # itemText = unicode(baseItem.data(QtCore.Qt.UserRole).toString())
print itemText # print itemText
#
def onLiveClick(self): # def onLiveClick(self):
log.debug(u'Media Live Button pressed') # log.debug(u'Media Live Button pressed')
items = self.ListView.selectedIndexes() # items = self.ListView.selectedIndexes()
if len(items) > 0: # if len(items) > 0:
firstPass = True # firstPass = True
for item in items: # for item in items:
baseItem = self.ListView.item(item.row()) # baseItem = self.ListView.item(item.row())
filename = unicode(baseItem.data(QtCore.Qt.UserRole).toString()) # filename = unicode(baseItem.data(QtCore.Qt.UserRole).toString())
if firstPass: # if firstPass:
self.MainDisplay.queueMedia(filename, firstPass) # self.MainDisplay.queueMedia(filename, firstPass)
firstPass = False # firstPass = False
else: # else:
self.MainDisplay.queueMedia(filename, firstPass) # self.MainDisplay.queueMedia(filename, firstPass)
self.MainDisplay.playMedia() # self.MainDisplay.playMedia()
def initialise(self): def initialise(self):
self.ListView.setSelectionMode( self.ListView.setSelectionMode(