Package elisa :: Package plugins :: Package bad :: Package poblenou_frontend :: Package poblenou_widgets :: Module volume_osd
[hide private]
[frames] | no frames]

Source Code for Module elisa.plugins.bad.poblenou_frontend.poblenou_widgets.volume_osd

 1  # -*- coding: utf-8 -*- 
 2  # Elisa - Home multimedia server 
 3  # Copyright (C) 2006-2008 Fluendo Embedded S.L. (www.fluendo.com). 
 4  # All rights reserved. 
 5  # 
 6  # This file is available under one of two license agreements. 
 7  # 
 8  # This file is licensed under the GPL version 3. 
 9  # See "LICENSE.GPL" in the root of this distribution including a special 
10  # exception to use Elisa with Fluendo's plugins. 
11  # 
12  # The GPL part of Elisa is also available under a commercial licensing 
13  # agreement from Fluendo. 
14  # See "LICENSE.Elisa" in the root directory of this distribution package 
15  # for details on that license. 
16   
17  import pgm 
18  from pgm.graph.text import Text 
19  from dock import Dock 
20   
21 -class VolumeOsd(Dock):
22
23 - def __init__(self, canvas, layer, template, 24 width, height, background_image):
25 26 Dock.__init__(self, canvas, layer, width, height, background_image) 27 28 self._template = template 29 self._volume_value = 0 30 31 inner_width = width * 0.95 32 inner_height = height * 0.45 33 inner_x = (width - inner_width) / 2.0 34 inner_y = (height - inner_height) / 2.0 35 36 self._volume = Text() 37 self._volume.label = "" 38 self._volume.ellipsize = pgm.TEXT_ELLIPSIZE_END 39 self._volume.fg_color = (220, 220, 220, 255) 40 self._volume.bg_color = (0, 0, 0, 0) 41 self.add(self._volume) 42 self._volume.position = (inner_x, inner_y, 0.0) 43 self._volume.size = (inner_width, inner_height) 44 self._volume.font_height = self._volume.height 45 46 self._volume.visible = True
47
48 - def volume__set(self, value):
49 self._volume_value = value 50 self._volume.label = self._template % int(value)
51
52 - def volume__get(self):
53 return self._volume_value
54