Conf changes
This commit is contained in:
parent
b755aeb831
commit
32e9765ff0
|
@ -136,7 +136,14 @@ class GlossMgr:
|
|||
if self.currentPlugin.on_key_press_event(stage, event):
|
||||
self.currentPlugin.stop()
|
||||
self.currentPlugin = None
|
||||
|
||||
timeline_stop = clutter.Timeline(10,30)
|
||||
alpha = clutter.Alpha(timeline_stop, clutter.ramp_inc_func)
|
||||
self.stop_behaviour = clutter.BehaviourOpacity(opacity_start=0, opacity_end=255, alpha=alpha)
|
||||
self.currentMenu.set_opacity(0)
|
||||
self.currentMenu.show()
|
||||
self.stop_behaviour.apply(self.currentMenu)
|
||||
timeline_stop.start()
|
||||
#If there's no plugin running, go back one in the menu list (Providing we're not already at the first item.
|
||||
else:
|
||||
if len(self.menuHistory)>1:
|
||||
|
|
1
Menu.py
1
Menu.py
|
@ -137,6 +137,7 @@ class Menu(clutter.Group):
|
|||
else:
|
||||
self.menuItems[i].scaleLabel(2, self.timeline)
|
||||
|
||||
#print self.menuItems[self.selected].data + " " + str(self.menuItems[self.selected].itemTexturesGroup.scale_start)
|
||||
#Do the transition of the menu graphic
|
||||
#If there's no transition set (Would have been set in the theme) then the item is simply show
|
||||
if not self.menu_item_transition is None:
|
||||
|
|
|
@ -0,0 +1,131 @@
|
|||
import clutter
|
||||
import pygtk
|
||||
import gtk
|
||||
import random
|
||||
|
||||
class image_previewer(clutter.Group):
|
||||
tex1 = None
|
||||
tex2 = None
|
||||
tex3 = None
|
||||
frontTex = None
|
||||
behave1 = None
|
||||
behave2 = None
|
||||
behave3 = None
|
||||
|
||||
scale_start = 0.6
|
||||
|
||||
def __init__(self, stage):
|
||||
clutter.Group.__init__(self)
|
||||
self.textures = []
|
||||
self.stage = stage
|
||||
self.timeline = clutter.Timeline(200, 25)
|
||||
self.timeline.set_loop(True)
|
||||
self.timeline.connect('completed', self.next_image)
|
||||
|
||||
self.connect('show', self.start)
|
||||
|
||||
self.alpha = clutter.Alpha(self.timeline, clutter.ramp_inc_func)
|
||||
|
||||
self.behaviour_scale = clutter.BehaviourScale(x_scale_start=self.scale_start, y_scale_start=self.scale_start, x_scale_end=1, y_scale_end=1, alpha=self.alpha)
|
||||
self.behaviour_depth = clutter.BehaviourDepth(depth_start=-300, depth_end=200, alpha=self.alpha)
|
||||
|
||||
|
||||
def add_texture(self, texture_src):
|
||||
self.textures.append(texture_src)
|
||||
|
||||
def start(self, data):
|
||||
if len(self.textures) == 0:
|
||||
return None
|
||||
|
||||
self.tex1 = self.get_rand_tex()
|
||||
self.tex2 = self.get_rand_tex()
|
||||
self.tex3 = self.get_rand_tex()
|
||||
|
||||
self.behave1 = clutter.BehaviourPath(self.alpha, self.get_texture_knots(self.tex1))
|
||||
self.behave2 = clutter.BehaviourPath(self.alpha, self.get_texture_knots(self.tex2))
|
||||
self.behave3 = clutter.BehaviourPath(self.alpha, self.get_texture_knots(self.tex3))
|
||||
|
||||
#self.tex1.set_scale(self.scale_start, self.scale_start)
|
||||
self.behaviour_depth.apply(self.tex1)
|
||||
self.behave1.apply(self.tex1)
|
||||
|
||||
|
||||
self.add(self.tex1)
|
||||
parent = self.get_parent()
|
||||
if parent is None:
|
||||
print "Parent is none!"
|
||||
parent.show()
|
||||
#self.set_depth(100)
|
||||
#self.tex1.set_depth(100)
|
||||
#self.set_opacity(255)
|
||||
self.frontTex = self.tex1
|
||||
self.tex1.show()
|
||||
self.show()
|
||||
#parent.add(self)
|
||||
self.timeline.start()
|
||||
|
||||
def get_rand_tex(self):
|
||||
rand = random.randint(0, len(self.textures)-1)
|
||||
|
||||
texture = clutter.Texture()
|
||||
pixbuf = gtk.gdk.pixbuf_new_from_file(self.textures[rand])
|
||||
texture.set_pixbuf(pixbuf)
|
||||
xy_ratio = float(texture.get_width()) / texture.get_height()
|
||||
#texture.set_height(self.get_height())
|
||||
width = int(texture.get_height() * xy_ratio)
|
||||
#texture.set_width(width)
|
||||
return texture
|
||||
|
||||
def next_image(self, data):
|
||||
texture = self.get_rand_tex()
|
||||
self.add(texture)
|
||||
|
||||
|
||||
#Remove the old texture
|
||||
self.remove(self.frontTex)
|
||||
|
||||
#Setup the path behaviour specific to this tex
|
||||
knots = self.get_texture_knots(texture)
|
||||
|
||||
#Set the appropriate tex
|
||||
if self.frontTex == self.tex1:
|
||||
self.tex1 = texture
|
||||
self.behave1 = clutter.BehaviourPath(self.alpha, knots)
|
||||
currentBehave = self.behave1
|
||||
self.frontTex = self.tex2
|
||||
|
||||
#texture.lower(self.tex2)
|
||||
#texture.lower(self.tex3)
|
||||
|
||||
elif self.frontTex == self.tex2:
|
||||
self.tex2 = texture
|
||||
self.behave2 = clutter.BehaviourPath(self.alpha, knots)
|
||||
currentBehave = self.behave2
|
||||
self.frontTex = self.tex3
|
||||
|
||||
#texture.lower(self.tex1)
|
||||
#texture.lower(self.tex3)
|
||||
|
||||
elif self.frontTex == self.tex3:
|
||||
self.tex3 = texture
|
||||
self.behave3 = clutter.BehaviourPath(self.alpha, knots)
|
||||
currentBehave = self.behave3
|
||||
self.frontTex = self.tex1
|
||||
|
||||
#texture.lower(self.tex1)
|
||||
#texture.lower(self.tex2)
|
||||
|
||||
currentBehave.apply(texture)
|
||||
|
||||
texture.show()
|
||||
|
||||
def get_texture_knots(self, texture):
|
||||
knots = (\
|
||||
(0, 0),\
|
||||
#(int(self.get_width()*0.2), int(self.get_height()*0.2)),\
|
||||
#(int(self.stage.get_width()*0.1), int(self.stage.get_height()*0.1)),\
|
||||
(int(-texture.get_width()), int(self.get_height()*0.3))\
|
||||
)
|
||||
|
||||
return knots
|
||||
|
|
@ -2,6 +2,7 @@ import clutter
|
|||
from clutter import cluttergst
|
||||
#__import__("../../Menu", "Menu")
|
||||
from Menu import Menu
|
||||
from image_preview import image_previewer
|
||||
import time
|
||||
import os.path
|
||||
import pygtk
|
||||
|
@ -112,7 +113,7 @@ class Module:
|
|||
self.textures = []
|
||||
self.music = []
|
||||
#Then load them back up
|
||||
slideName = self.baseDir + "/" + self.glossMgr.get_current_menu().get_current_item().get_data()
|
||||
slideName = self.baseDir + "/" + self.menu.get_current_item().get_data() #self.glossMgr.get_current_menu().get_current_item().get_data()
|
||||
self.loadDir(slideName, True)
|
||||
#self.MenuMgr.get_selector_bar().set_spinner(False)
|
||||
|
||||
|
@ -130,7 +131,9 @@ class Module:
|
|||
timeline_backdrop = clutter.Timeline(10,30)
|
||||
alpha = clutter.Alpha(timeline_backdrop, clutter.ramp_inc_func)
|
||||
self.backdrop_behaviour = clutter.BehaviourOpacity(opacity_start=0, opacity_end=255, alpha=alpha)
|
||||
self.menu_behaviour = clutter.BehaviourOpacity(opacity_start=255, opacity_end=0, alpha=alpha)
|
||||
self.backdrop_behaviour.apply(self.backdrop)
|
||||
self.menu_behaviour.apply(self.menu.getItemGroup())
|
||||
timeline_backdrop.start()
|
||||
|
||||
|
||||
|
@ -329,9 +332,11 @@ class Module:
|
|||
timeline_stop = clutter.Timeline(10,30)
|
||||
alpha = clutter.Alpha(timeline_stop, clutter.ramp_inc_func)
|
||||
self.stop_behaviour = clutter.BehaviourOpacity(opacity_start=255, opacity_end=0, alpha=alpha)
|
||||
self.menu_behaviour = clutter.BehaviourOpacity(opacity_start=0, opacity_end=255, alpha=alpha)
|
||||
self.stop_behaviour.apply(self.currentTexture)
|
||||
self.stop_behaviour.apply(self.backdrop)
|
||||
self.stop_behaviour.apply(self.overlay)
|
||||
self.menu_behaviour.apply(self.menu.getItemGroup())
|
||||
timeline_stop.connect('completed', self.destroySlideshow)
|
||||
timeline_stop.start()
|
||||
|
||||
|
@ -357,6 +362,7 @@ class Module:
|
|||
def generateMenu(self):
|
||||
|
||||
tempMenu = Menu(self.glossMgr)
|
||||
self.menu = tempMenu
|
||||
#print self.baseDir
|
||||
#This occurs when there are not slideshows or we could not connect to the db to establish baseDir
|
||||
if self.baseDir is None:
|
||||
|
@ -373,12 +379,22 @@ class Module:
|
|||
for directoryEntry in file_list:
|
||||
subdir = self.baseDir + "/" + directoryEntry
|
||||
if os.path.isdir(subdir):
|
||||
if not (len(os.listdir(subdir)) == 0):
|
||||
imgPath = subdir + "/" + os.listdir(subdir)[0]
|
||||
#print imgPath
|
||||
tempItem = tempMenu.addItem(directoryEntry)
|
||||
tempItem.setAction(self)
|
||||
|
||||
tempItem = tempMenu.addItem(directoryEntry)
|
||||
|
||||
#Start experimental schtuff
|
||||
img_list = os.listdir(subdir)
|
||||
img_list = filter(self.filterImageFile, img_list)
|
||||
img_previewer = image_previewer(self.glossMgr.stage)
|
||||
for img in img_list:
|
||||
imgPath = subdir + "/" + img #os.listdir(subdir)[0]
|
||||
img_previewer.add_texture(imgPath)
|
||||
#print imgPath
|
||||
#new_file_list = os.listdir(dirPath)
|
||||
#tempItem.itemTexturesGroup = img_previewer
|
||||
img_previewer.set_position(tempItem.menu.menu_image_x, tempItem.menu.menu_image_y)
|
||||
|
||||
tempItem.setAction(self)
|
||||
|
||||
return tempMenu
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ class Module():
|
|||
|
||||
#Set the current viewer
|
||||
self.currentViewer = self.base_folder_menu.get_current_viewer()
|
||||
#self.currentViewer.set_depth(self.currentViewer.cover_size)
|
||||
|
||||
#Create the details group
|
||||
self.video_details = video_details(self.coverDetailsWidth)
|
||||
|
|
|
@ -7,7 +7,7 @@ from xml.dom import minidom
|
|||
class ThemeMgr:
|
||||
defaultTheme = "default"
|
||||
currentTheme = "default"
|
||||
#currentTheme = "Pear"
|
||||
currentTheme = "Pear"
|
||||
|
||||
def __init__(self, glossMgr):
|
||||
self.stage = glossMgr.stage
|
||||
|
|
|
@ -31,8 +31,8 @@ class Transition:
|
|||
self.old_behaviour_opacity.apply(oldGroup)
|
||||
|
||||
def on_transition_complete(self, data, oldGroup):
|
||||
if not oldGroup.get_parent is None:
|
||||
oldGroup.get_parent().remove(oldGroup)
|
||||
pass
|
||||
|
||||
def set_options(self, options):
|
||||
pass
|
|
@ -42,7 +42,7 @@ class Transition:
|
|||
self.entrance_behaviour_opacity = clutter.BehaviourOpacity(opacity_start=0, opacity_end=255, alpha=self.alpha)
|
||||
|
||||
#Setup some knots
|
||||
start_y = int(self.stage.get_height()/2 - newGroup.get_height()/2)
|
||||
start_y = oldGroup.get_y()#int(self.stage.get_height()/2 - newGroup.get_height()/2)
|
||||
start_x = int(self.stage.get_width())
|
||||
newGroup.set_position(start_x, start_y)
|
||||
#end_x = int(self.stage.get_width() - newGroup.get_width())/2
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
|
||||
<font id="main">
|
||||
<face>Tahoma</face>
|
||||
<size id="default">38</size>
|
||||
<size id="default">30</size>
|
||||
<size id="1024x768">38</size>
|
||||
<size id="800x600">30</size>
|
||||
<size id="1920x1080">25</size>
|
||||
</font>
|
||||
|
||||
<dimensions type="relativeToStage">
|
||||
|
@ -18,7 +19,7 @@
|
|||
</position>
|
||||
|
||||
<item_gap>0</item_gap>
|
||||
<num_visible_elements>3</num_visible_elements>
|
||||
<num_visible_elements>4</num_visible_elements>
|
||||
|
||||
<!-- The following properties all relate to the image / textures that accompany each menu item -->
|
||||
<menu_item_texture>
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
<texture id="video_covers_background">
|
||||
<image>video_player/cover_bg_long.png</image>
|
||||
<dimensions type="relativeToStage">
|
||||
<width>80%</width>
|
||||
<height>80%</height>
|
||||
<width>70%</width>
|
||||
<height>90%</height>
|
||||
</dimensions>
|
||||
<position type="relativeToStage">
|
||||
<x>15%</x>
|
||||
<y>15%</y>
|
||||
<x>25%</x>
|
||||
<y>4%</y>
|
||||
</position>
|
||||
</texture>
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
|||
</dimensions>
|
||||
<position type="relativeToStage">
|
||||
<x>30%</x>
|
||||
<y>70%</y>
|
||||
<y>65%</y>
|
||||
</position>
|
||||
</video_cover_details>
|
||||
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
|
||||
<font id="main">
|
||||
<face>Tahoma</face>
|
||||
<size id="default">40</size>
|
||||
<size id="default">30</size>
|
||||
<size id="1024x768">40</size>
|
||||
<size id="800x600">30</size>
|
||||
<size id="1920x1080">25</size>
|
||||
</font>
|
||||
|
||||
<dimensions type="relativeToStage">
|
||||
|
|
Loading…
Reference in New Issue