def __init__(self, standalone=False): """ init the upsoon plugin """ _debug_('upsoon.PluginInterface.__init__()', 2) plugin.DaemonPlugin.__init__(self) plugin.register(self, 'upsoon') self.standalone = standalone self.lock = thread.allocate_lock() self.running = True self.timer = Timer(self.timer_handler).start(15) self.event = EventHandler(self.event_handler) #self.event.register(('VIDEO_START', 'VIDEO_END')) self.event.register() self.recordclient = RecordClient() self.fc = FreevoChannels() self.rdev = config.RADIO_DEVICE self.next_program = None self.seconds_before_announce = 120 self.seconds_before_start = 60 self.pending_lockfile = config.FREEVO_CACHEDIR + '/record.soon' self.tv_lockfile = None # lockfile of recordserver self.stopped = None # flag that tells upsoon what stopped
def __init__(self, standalone=False): """ init the upsoon plugin """ logger.log( 9, 'upsoon.PluginInterface.__init__()') plugin.DaemonPlugin.__init__(self) plugin.register(self, 'upsoon') self.standalone = standalone self.lock = thread.allocate_lock() self.running = True self.timer = Timer(self.timer_handler).start(15) self.event = EventHandler(self.event_handler) #self.event.register(('VIDEO_START', 'VIDEO_END')) self.event.register() self.recordclient = RecordClient() self.fc = FreevoChannels() self.rdev = config.RADIO_DEVICE self.next_program = None self.announced = False self.seconds_before_announce = config.TV_UPSOON_ANNOUNCE self.seconds_before_start = config.TV_UPSOON_BEFORE_START self.pending_lockfile = config.FREEVO_CACHEDIR + '/record.soon' self.tv_lockfile = None # lockfile of recordserver self.stopped = None # flag that tells upsoon what stopped if os.path.exists(self.pending_lockfile): os.remove(self.pending_lockfile) logger.debug('%r lockfile removed', self.pending_lockfile)
def __init__(self): """initialise the DaemonPlugin interface""" logger.log(9, 'detachbar.PluginInterface.__init__()') plugin.DaemonPlugin.__init__(self) self.plugin_name = 'audio.detachbar' self.player = None self.timer = Timer(self._timer_handler) self.event = EventHandler(self._event_handler) self.event.register() self.state = BAR_NOTSET self.update(BAR_HIDE) # tunables self.wait_timeout = 3 # 3 seconds till we hide the bar
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 = ''
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
def __init__(self, db): self.monitors = [] self.timer = Timer(self.check) db.signals['changed'].connect(self.changed)