예제 #1
0
    def __init__(self, x, y, width, height, coverfile=None):
        self.coverfile = coverfile

        BaseAnimation.__init__(self, (x, y, width, height), fps=100,
                               bg_update=False, bg_redraw=False)
        pygoom.set_exportfile(mmap_file)
        pygoom.set_resolution(width, height, 0)
예제 #2
0
    def __init__(self):
        BaseAnimation.__init__(self, self.get_osd().screen.get_rect(),
                               fps=5, bg_update=True, bg_redraw=True)

        self.overlay = self.get_surface(self.rect.width,
                                        self.rect.height).convert_alpha()
        self.overlay.fill(0x66000000)
예제 #3
0
    def __init__(self):
        BaseAnimation.__init__(self,
                               self.get_osd().screen.get_rect(),
                               fps=5,
                               bg_update=True,
                               bg_redraw=True)

        self.overlay = self.get_surface(self.rect.width,
                                        self.rect.height).convert_alpha()
        self.overlay.fill(0x66000000)
예제 #4
0
    def __init__(self, x, y, width, height, title=None, coverfilename=None):
        """
        Initialise the MPlayer Visualization Goom
        """
        logger.debug('%s.__init__(x=%r y=%r width=%r height=%r coverfilename=%r)', 
self.__class__, x, y, width, height, coverfilename)

        self.mode = MpvMode(config.MPLAYERVIS_MODE)
        self.coverfilename = coverfilename
        self.showfps = False

        if not os.path.exists(MMAP_FILE):
            f = open(MMAP_FILE, 'w')
            s = str(chr(0)) * 2064
            f.write(s)
            f.close()

        #pygoom.debug(2)
        BaseAnimation.__init__(self, (x, y, width, height), fps=100, bg_update=False, bg_redraw=False)
        # goom doesn't handle Unicode, so make it a string
        self.goom = pygoom.PyGoom(width, height, MMAP_FILE, songtitle=self.to_str(title) or '')
        self.infodata = None

        self.width = width
        self.height = height
        self.fade_step = config.MPLAYERVIS_FADE_STEP
        self.init_counter = self.fade_step * config.MPLAYERVIS_INIT_COUNTER
        self.fade_in_wait_counter = self.fade_step * config.MPLAYERVIS_FADE_IN_WAIT_COUNTER
        self.fade_out_wait_counter = self.fade_step * config.MPLAYERVIS_FADE_OUT_WAIT_COUNTER
        self.fade_counter = self.fade_step * config.MPLAYERVIS_FADE_COUNTER
        self.fade_machine = {
            'init': self.init_state,
            'fade_out_wait': self.fade_out_wait_state,
            'fade_out': self.fade_out_state,
            'fade_in_wait': self.fade_in_wait_state,
            'fade_in': self.fade_in_state,
        }
        self.state = self.fade_machine['init']
        self.counter = self.init_counter
        self.fader = lambda n, m: int(float(n-m)/float(2))
        self.alpha = self.set_alpha(self.counter, 0)

        self.clock = Clock()
        self.running = False
        self.timer = Timer(self.goom_surface_update)
        self.last_time = 0
        self.message_counter = 1 # skip message at start
        self.message = ''
예제 #5
0
    def __init__(self, x, y, width, height, coverfile=None):
        """ Initialise the MPlayer Visualization Goom """
        _debug_(
            '__init__(x=%r y=%r width=%r height=%r coverfile=%r)' %
            (x, y, width, height, coverfile), 2)
        self.coverfile = coverfile

        BaseAnimation.__init__(self, (x, y, width, height),
                               fps=100,
                               bg_update=False,
                               bg_redraw=False)
        _debug_('pygoom.set_exportfile(mmap_file=%r)' % (mmap_file), 2)
        pygoom.set_exportfile(mmap_file)
        _debug_(
            'pygoom.set_resolution(width=%r, height=%r, 0)' % (width, height),
            2)
        pygoom.set_resolution(width, height, 0)

        self.fade_step = config.MPLAYERVIS_FADE_STEP
        self.init_counter = self.fade_step * config.MPLAYERVIS_INIT_COUNTER
        self.fade_in_wait_counter = self.fade_step * config.MPLAYERVIS_FADE_IN_WAIT_COUNTER
        self.fade_out_wait_counter = self.fade_step * config.MPLAYERVIS_FADE_OUT_WAIT_COUNTER
        self.fade_counter = self.fade_step * config.MPLAYERVIS_FADE_COUNTER
        self.fade_machine = {
            'init': self.init_state,
            'fade_out_wait': self.fade_out_wait_state,
            'fade_out': self.fade_out_state,
            'fade_in_wait': self.fade_in_wait_state,
            'fade_in': self.fade_in_state,
        }
        self.state = self.fade_machine['init']
        self.counter = self.init_counter
        self.fader = lambda n, m: int(float(n - m) / float(2))
        self.alpha = self.set_alpha(self.counter, 0)

        self.running = True
        Timer(self.timerhandler).start(0.1)
        self.last_time = 0