Commit fe28513c authored by Frank Scholz's avatar Frank Scholz
Browse files

Change program and module name to compere.

parent bf1317ae
......@@ -23,9 +23,9 @@ from coherence.upnp.core import DIDLLite
import louie
from mediarenderer.menus import Menu
from mediarenderer.images import Images
from mediarenderer.audio import Audio
from compere.menus import Menu
from compere.images import Images
from compere.audio import Audio
SCREENRECT = Rect(0, 0, 800, 480)
SCREENDEPTH = 32
......@@ -74,7 +74,7 @@ class MediaRenderer(object):
pygame.mouse.set_visible(False)
# decorate the game window
pygame.display.set_caption('Coherence MediaRenderer')
pygame.display.set_caption('Compère')
self.screen = None
self.view = None
......@@ -88,6 +88,14 @@ class MediaRenderer(object):
self.background.clear_screen()
self.menus = []
self.top_zone = 110 #70
self.left_zone = 90 #70
self.right_zone = 690 #730
self.cut_right = 80
self.cut_bottom = 60
self.width_redux = 0
self.height_redux = 0
# buttons = (('return',(4,50),None,None),
# ('server-scan',(22,216),None,None),
# ('exit',(4,380),self.quit,None))
......@@ -121,6 +129,19 @@ class MediaRenderer(object):
def quit(self):
reactor.stop()
def toggle_fullscreen(self):
if self.fullscreen == 1:
self.fullscreen = FULLSCREEN
self.width_redux = 0
self.height_redux = 0
else:
self.fullscreen = 1
self.width_redux = self.cut_right
self.height_redux = self.cut_bottom
self.screen = pygame.display.set_mode(SCREENRECT.size, self.fullscreen, self.bestdepth)
self.background.clear_screen()
self.view.toggle_fullscreen(SCREENRECT.size, self.fullscreen, self.bestdepth)
def display_redraw_part(self, part, rect, from_rect=None):
if from_rect == None:
from_rect = part.get_rect()
......@@ -170,7 +191,7 @@ class MediaRenderer(object):
self.audio.toggle_to = None
self.view = self.images
self.screen = self.images.screen
pygame.display.set_caption('Coherence MediaRenderer - %s' % self.images.current_title)
pygame.display.set_caption('Compère - %s' % self.images.current_title)
try:
self.menus.remove(self.right_menu)
except:
......@@ -218,15 +239,15 @@ class MediaRenderer(object):
if event.type == MOUSEMOTION:
#self.screen.react(event.pos)
if event.pos[0] <= 70:
if event.pos[0] <= self.left_zone and hasattr(self,'left_menu'):
"""left hotspot """
self.hide_menus(self.left_menu)
self.left_menu.show(event.pos)
elif event.pos[0] > 730:
elif event.pos[0] > self.right_zone and hasattr(self,'right_menu'):
"""right hotspot """
self.hide_menus(self.right_menu)
self.right_menu.show(event.pos)
elif event.pos[1] <= 70:
elif event.pos[1] <= self.top_zone and hasattr(self,'top_menu'):
"""top hotspot """
self.hide_menus(self.top_menu)
self.top_menu.show(event.pos)
......@@ -243,6 +264,14 @@ class MediaRenderer(object):
m.check(event.button,event.pos)
if self.view is not None:
self.view.check(event.button,event.pos)
if event.pos[0] <= self.left_zone and hasattr(self,'left_menu'):
"""left hotspot """
self.left_menu.prepare2hide()
elif event.pos[0] > self.right_zone and hasattr(self,'right_menu'):
"""right hotspot """
self.right_menu.prepare2hide()
elif event.pos[1] <= self.top_zone and hasattr(self,'top_menu'):
self.top_menu.prepare2hide()
if((event.type == KEYDOWN and event.key == K_ESCAPE) or
event.type == QUIT):
......
__version_info__ = (0,0,3)
__version_info__ = (0,0,4)
__version__ = '%d.%d.%d' % (__version_info__[0],__version_info__[1],__version_info__[2],)
__pgk_name__ = 'mediarenderer'
\ No newline at end of file
__pgk_name__ = 'compere'
\ No newline at end of file
......@@ -22,7 +22,7 @@ from coherence.base import Coherence
from coherence.upnp.core import DIDLLite
import louie
from mediarenderer.menus import Menu
from menus import Menu
class Cover(object):
......@@ -179,7 +179,7 @@ class Audio(object):
self.view = 1
self.toggle_to = 0
louie.send('MediaRenderer.Screen.redraw', None, self.screen)
pygame.display.set_caption('Coherence MediaRenderer - %s' % self.track_view.title)
pygame.display.set_caption('Compère - %s' % self.track_view.title)
def album_view_ready(self,r):
for album in self.content[:18]:
......@@ -204,7 +204,7 @@ class Audio(object):
if self.track_view is not None:
self.toggle_to = 1
louie.send('MediaRenderer.Screen.redraw', None, self.screen)
pygame.display.set_caption('Coherence MediaRenderer - Albums')
pygame.display.set_caption('Compère - Albums')
def draw_screen(self):
print "audio draw_screen", self.track_view, self.toggle_to
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment