rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
mpl = config.MPLAYER_CMD + ' ' + config.MPLAYER_ARGS_MPG
mpl += (' ' + config.MPLAYER_ARGS_MPG)
def play(self, mode, filename, playlist, repeat=0, mplayer_options=""):
command = config.MPLAYER_CMD + ' ' + config.MPLAYER_ARGS_DVDNAV
mpl += (' ' + config.MPLAYER_ARGS_DVDNAV) command = mpl
def play(self, mode, filename, playlist, repeat=0, mplayer_options=""):
mpl = config.MPLAYER_CMD + ' ' + config.MPLAYER_ARGS_VCD
mpl += (' ' + config.MPLAYER_ARGS_VCD + ' -alang ' + config.DVD_LANG_PREF) if config.DVD_SUBTITLE_PREF: mpl += (' -slang ' + config.DVD_SUBTITLE_PREF)
def play(self, mode, filename, playlist, repeat=0, mplayer_options=""):
mpl = config.MPLAYER_CMD
def play(self, mode, filename, playlist, repeat=0, mplayer_options=""):
mpl = config.MPLAYER_CMD + ' ' + config.MPLAYER_ARGS_DVD
mpl += (' ' + config.MPLAYER_ARGS_DVD + ' -alang ' + config.DVD_LANG_PREF) if config.DVD_SUBTITLE_PREF: mpl += (' -slang ' + config.DVD_SUBTITLE_PREF)
def play(self, mode, filename, playlist, repeat=0, mplayer_options=""):
mixer.setPcmVolume(100) mixer.setLineinVolume(0) mixer.setMicVolume(0)
if config.CONTROL_ALL_AUDIO: mixer.setLineinVolume( 0 ) mixer.setMicVolume( 0 ) if( config.MAJOR_AUDIO_CTRL == 'VOL' ): mixer.setPcmVolume( 100 ) elif( config.MAJOR_AUDIO_CTRL == 'PCM' ): mixer.setMainVolume( 100 ) mixer.setIgainVolume( 0 )
def play(self, mode, filename, playlist, repeat=0, mplayer_options=""):
self.audioinfo.draw()
if not self.audioinfo.pause: self.audioinfo.draw()
def run(self): while 1: if self.mode == 'idle': self.mode_flag.wait() self.mode_flag.clear() elif self.mode == 'play':
self.recordings.remove(remote.recording)
self.recordings.remove(remote)
def check_recordings(self): """ Check the internal list of recordings and add or remove them from the external application. """ if self.check_timer: notifier.removeTimer(self.check_timer) for remote in copy.copy(self.recordings): if remote.id == IN_PROGRESS: # already checking break if remote.id == UNKNOWN_ID and not r...
if event == em.STOP or em.PLAY_END or event == em.USER_END and menuw:
if event in (em.STOP, em.PLAY_END, em.USER_END) and menuw:
def eventhandler(self, event, menuw=None): if not menuw: menuw = self.menuw
log.info('checking took %s seconds' % \ (float(int((time.time() - ctime) * 100)) / 100))
log.info('checking took %2.2f seconds' % (t2 - t1))
def __check_recordings(self): """ Check the current recordings. This includes checking conflicts, removing old entries. At the end, the timer is set for the next recording. """ notifier.removeTimer(self.check_timer) self.check_timer = None
self.context = self.popups[-1]._evt_context
self.context = self.popups[-1].event_context
def set_focus(self): """ change the focus """ if self.stack_change: previous, app = self.stack_change else: previous, app = None, self.applications[-1] if not self.popups: self.context = app._evt_context else: self.context = self.popups[-1]._evt_context
cached_guide.timestamp != os.path.getmtime(config.XMLTV_FILE)):
(os.path.isfile(config.XMLTV_FILE) and cached_guide.timestamp != os.path.getmtime(config.XMLTV_FILE))):
def get_guide(): global cached_guide # Yes, but can we use the cached version (if same as the file)? if (cached_guide == None or cached_guide.timestamp != os.path.getmtime(config.XMLTV_FILE)): # No, is there a pickled version ("file cache") in a file? pname = config.XMLTV_FILE + '.pickled' if os.path.isfile(pname) an...
if os.path.isfile(pname) and (os.path.getmtime(pname) > os.path.getmtime(config.XMLTV_FILE)):
if (os.path.isfile(config.XMLTV_FILE) and os.path.isfile(pname) and (os.path.getmtime(pname) > os.path.getmtime(config.XMLTV_FILE))):
def get_guide(): global cached_guide # Yes, but can we use the cached version (if same as the file)? if (cached_guide == None or cached_guide.timestamp != os.path.getmtime(config.XMLTV_FILE)): # No, is there a pickled version ("file cache") in a file? pname = config.XMLTV_FILE + '.pickled' if os.path.isfile(pname) an...
if DEBUG: print 'XMLTV, reading raw file (%s)' % config.XMLTV_FILE
if DEBUG: print 'XMLTV, trying to read raw file (%s)' % config.XMLTV_FILE
def get_guide(): global cached_guide # Yes, but can we use the cached version (if same as the file)? if (cached_guide == None or cached_guide.timestamp != os.path.getmtime(config.XMLTV_FILE)): # No, is there a pickled version ("file cache") in a file? pname = config.XMLTV_FILE + '.pickled' if os.path.isfile(pname) an...
guide.timestamp = os.path.getmtime(config.XMLTV_FILE)
def load_guide(): # Create a new guide guide = epg_types.TvGuide() guide.timestamp = os.path.getmtime(config.XMLTV_FILE) # Is there a file to read from? gotfile = 1 if not os.path.isfile(config.XMLTV_FILE): if DEBUG: print 'XMLTV file (%s) missing!' % config.XMLTV_FILE gotfile = 0 # Add the channels that are in the c...
gotfile = 1 if not os.path.isfile(config.XMLTV_FILE):
if os.path.isfile(config.XMLTV_FILE): gotfile = 1 guide.timestamp = os.path.getmtime(config.XMLTV_FILE) else:
def load_guide(): # Create a new guide guide = epg_types.TvGuide() guide.timestamp = os.path.getmtime(config.XMLTV_FILE) # Is there a file to read from? gotfile = 1 if not os.path.isfile(config.XMLTV_FILE): if DEBUG: print 'XMLTV file (%s) missing!' % config.XMLTV_FILE gotfile = 0 # Add the channels that are in the c...
def suffix(self, ind):
def suffix(self):
def suffix(self, ind): """ the suffixes are specified in the config file. """
if config.GAMES_ITEMS[ind][0] is 'USER': suf = config.GAMES_ITEMS[ind][5]
if config.GAMES_ITEMS[self.index][0] is 'USER': suf = config.GAMES_ITEMS[self.index][5]
def suffix(self, ind): """ the suffixes are specified in the config file. """
suf = machine.ext(config.GAMES_ITEMS[ind][0])
suf = machine.ext(config.GAMES_ITEMS[self.index][0])
def suffix(self, ind): """ the suffixes are specified in the config file. """
ind, done = 0, 0
self.index, done = 0, 0
def get(self, parent, listing): items = []
ind = ind + 1
self.index = self.index + 1
def get(self, parent, listing): items = []
all_files = listing.match_suffix(self.suffix(ind))
all_files = listing.match_suffix(self.suffix())
def get(self, parent, listing): items = []
items.append(GameItem(parent, file, ind, imgpath))
items.append(GameItem(parent, file, self.index, imgpath))
def get(self, parent, listing): items = []
icon_size = 64
icon_size = 48
def DrawMenu_Selection(self, menuw, settings, x0, y0, width, height): val = settings menu = menuw.menustack[-1]
menuw.menustack[0].choices += p.items(parent)
menuw.menustack[0].choices += p.items(self)
def select(self, arg=None, menuw=None): """ Load the new skin and rebuild the main menu """ import plugin skin.settings = skin.load(self.skin, copy_content = False) pos = menuw.menustack[0].choices.index(menuw.menustack[0].selected)
if track.has_key('length'):
if track.has_key('length') and track['length']:
def create(self, filename): """ create mmpython information about the given file """ info = mmpython.Factory().create(filename) if info: info = self.simplify(info) name = util.getname(filename) if name == name.upper() and info.has_key('type') and \ info['type'] in ('DVD', 'VCD'): name = util.getname(filename.lower()) i...
if info['tracks'][0].has_key('length') and \
if info['tracks'][0].has_key('length') and info['tracks'][0]['length'] and \
def create(self, filename): """ create mmpython information about the given file """ info = mmpython.Factory().create(filename) if info: info = self.simplify(info) name = util.getname(filename) if name == name.upper() and info.has_key('type') and \ info['type'] in ('DVD', 'VCD'): name = util.getname(filename.lower()) i...
Playlist.eventhandler(self, event, menuw)
return Playlist.eventhandler(self, event, menuw)
def eventhandler(self, event, menuw=None): if event == DIRECTORY_CHANGE_DISPLAY_TYPE and menuw.menustack[-1] == self.menu: try: pos = possible_display_types.index(self.display_type) type = possible_display_types[(pos+1) % len(possible_display_types)]
if self.background_playlist:
if hasattr(self, 'background_playlist') and self.background_playlist:
def eventhandler(self, event, menuw=None): """ Handle playlist specific events """ if not menuw: menuw = self.menuw if event in ( PLAYLIST_NEXT, PLAY_END, USER_END) \ and self.current_item and self.playlist: pos = self.playlist.index(self.current_item) pos = (pos+1) % len(self.playlist)
if notifier and notifier.addTimer: notifier.addTimer(random.randint(1, 5) * 100, self.__precache)
def __init__(self, id, display_name, access_id, epg): self.id = id self.access_id = access_id self.programs = [] self.logo = '' self.__epg = epg self.name = display_name self.title = display_name if notifier and notifier.addTimer: # add random timer 100-500ms to fill the # database with init v...
self.__import_programs(ctime - 3600 * 4, ctime + 366 * 10)
self.__import_programs(ctime - 3600 * 4, ctime + 3600 * 10)
def __precache(self): ctime = int(time.time()) self.__import_programs(ctime - 3600 * 4, ctime + 366 * 10) return False
self.__import_programs(start - 60, p.start)
self.__import_programs(start - 60 - 2 * 3600, p.start)
def __getitem__(self, key): """ Get a program or a list of programs. Possible usage is channel[time] to get the programm running at 'time' channel[start:stop] to get the programms between start and stop channel[start:] to get all programms beginning at start """ if isinstance(key, slice): start = key.start stop = key....
self.__import_programs(p.stop, stop + 60)
self.__import_programs(p.stop, stop + 60 + 2 * 3600)
def __getitem__(self, key): """ Get a program or a list of programs. Possible usage is channel[time] to get the programm running at 'time' channel[start:stop] to get the programms between start and stop channel[start:] to get all programms beginning at start """ if isinstance(key, slice): start = key.start stop = key....
i = self.fileitem.getattr(strtag[1])
i = str(self.fileitem[strtag[1]])
def drawosd(self): """ draw the image osd """ if self.osd_text: # if osd_text is preset, remove it self.osd_text.unparent() self.osd_text = None newosd = False else: # it's a new osd, let it move in newosd = True
self.osd_box = gui.Rectangle(pos, size, 0xaa000000)
self.osd_box = gui.Rectangle(pos, size, 0xaa000000L)
def drawosd(self): """ draw the image osd """ if self.osd_text: # if osd_text is preset, remove it self.osd_text.unparent() self.osd_text = None newosd = False else: # it's a new osd, let it move in newosd = True
all_variables = ('DIRECTORY_AUTOPLAY_SINGLE_ITEM', 'AUDIO_RANDOM_PLAYLIST') for v in all_variables: setattr(self, v, eval('config.%s' % v))
def __init__(self, disc_id, parent, devicename = None, display_type = None):
self.view(filename, pos, self.playlist)
self.view(filename, pos, self.playlist, zoom=self.zoom, rotation=self.rotation)
def eventhandler(self, event):
print DATABASE
def create_db(): print DATABASE db = sqlite.connect(DATABASE) cursor = db.cursor() cursor.execute("CREATE TABLE music (id INTEGER PRIMARY KEY, dirtitle VARCHAR(255), md5 VARCHAR(32) UNIQUE, path VARCHAR(255), filename VARCHAR(255), type VARCHAR(3), artist VARCHAR(255), title VARCHAR(255), album VARCHAR(255), year VARCH...
item.files.files = files item.files.fxd = fxd_file item.files.image = image
item.files.files = files item.files.fxd_file = fxd_file item.files.image = image
def parse_video_child(fxd, node, dirname): """ parse a subitem from <video> """ filename = fxd.gettext(node) media_id = fxd.getattr(node, 'media-id') mode = node.name id = fxd.getattr(node, 'id') options = fxd.getattr(node, 'mplayer-options') player = fxd.childcontent(node, 'player') playlist ...
key = filename
def cache_dir(self, directory, callback): """ cache every file in the directory for future use """ if not self.__need_update__(directory): return 0
s += 'Channel %s\n' % tunername
s += 'Channel %s\n' % tunername.encode('Latin-1')
def set_schedule(arg=None, menuw=None): '''Use the information in the module global variable recinfo to schedule a recording through the recording daemon (it might be started by this function if it should start immediately).''' tunerid = tv.get_tunerid(recinfo.channel) tunername = tv.get_friendly_channel(recinfo.chann...
try: actions = menu.selected.actions() if config.FREEVO_PLUGINS.has_key(menu.selected.type): for a in config.FREEVO_PLUGINS[menu.selected.type]: try: actions += a(menu.selected) except: traceback.print_exc() if len(actions) > 1: self.make_submenu(menu.selected.name, actions, menu.selected) except: pass
actions = menu.selected.actions() if len(actions) > 1: self.make_submenu(menu.selected.name, actions, menu.selected)
def eventhandler(self, event): menu = self.menustack[-1]
DIR_MOVIES = [ ('Video', '/usr/local/mm/video'), ('Serier', '/usr/local/mm/serier')]
DIR_MOVIES = [ ('Test Movies', 'testfiles/Movies') ]
def ConfigInit(videotools = 'sim'): print 'VIDEOTOOLS = %s' % videotools # global MPLAYER_CMD, not needed already global global MPLAYER_ARGS_MPG, MPLAYER_ARGS_DVD, MPLAYER_ARGS_VCD global MPLAYER_ARGS_DVDNAV, VIDREC_MQ, VIDREC_HQ # # There are two sets of tool settings, one for a real box, # and one for development. ...
if self.mode > 0:
if self.mode > 0 and self.playlist[self.number][1]:
def view(self, filename, number, playlist, mode, zoom=0, rotation=0):
print text
def __init__(self, parent='osd', text=' ', handler=None, left=None, top=None, width=0, height=0, bg_color=None, fg_color=None, icon=None, border=None, bd_color=None, bd_width=None, vertical_expansion=1, text_prop=None):
fname = os.path.join(dirname, fxd.gettext(child))
fname = os.path.join(dirname, String(fxd.gettext(child)))
def fxdhandler(self, fxd, node): """ parse image specific stuff from fxd files
if fontname in config.OSD_FONT_ALIASES: alt_fname = os.path.join(config.FONT_DIR, config.OSD_FONT_ALIASES[fontname])
if fontname.lower() in config.OSD_FONT_ALIASES: alt_fname = os.path.join(config.FONT_DIR, config.OSD_FONT_ALIASES[fontname.lower()])
def __getfont__(self, filename, ptsize): ptsize = int(ptsize / 0.7) # XXX pygame multiplies by 0.7 for some reason
self.micVolume = 0 self.setMainVolume(self.mainVolume) self.setPcmVolume(self.pcmVolume) self.setLineinVolume(self.lineinVolume) self.setMicVolume(self.micVolume) data = struct.pack('L', self.SOUND_MASK_LINE) fcntl.ioctl(self.mixfd.fileno(), self.SOUND_MIXER_WRITE_RECSRC, data)
self.micVolume = 0 self.igainVolume = 0 self.ogainVolume = 0 self.setMainVolume( self.mainVolume ) self.setPcmVolume( self.pcmVolume ) self.setLineinVolume( self.lineinVolume ) self.setMicVolume( self.micVolume ) data = struct.pack( 'L', self.SOUND_MASK_LINE ) fcntl.ioctl( self.mixfd.fileno(), self.SOUND_MIXER_W...
def __init__(self): self.mixfd = open(config.DEV_MIXER, 'r') self.mainVolume = 0 self.pcmVolume = 0 self.lineinVolume = 0 self.micVolume = 0 self.setMainVolume(self.mainVolume) self.setPcmVolume(self.pcmVolume) self.setLineinVolume(self.lineinVolume) self.setMicVolume(self.micVolume) data = struct.pack('L', self.SOUND_...
def getPcmVolume( self ): return( self.pcmVolume )
def decMainVolume(self): self.mainVolume -= 5 if self.mainVolume < 0: self.mainVolume = 0 self._setVolume(self.SOUND_MIXER_WRITE_VOLUME, self.mainVolume)
def setLineinVolume(self, volume): self._setVolume(self.SOUND_MIXER_WRITE_LINE, volume) def setMicVolume(self, volume): self._setVolume(self.SOUND_MIXER_WRITE_MIC, volume)
def incIgainVolume( self ): self.igainVolume += 5 if self.igainVolume > 100: self.igainVolume = 100 os.popen( 'aumix -i+5' ) def setOgainVolume( self, volume ): """For Ogain on SB Live Cards""" if volume > 100: volume = 100 elif volume < 0: volume = 0 self.ogainVolume = volume os.popen( 'aumix -o' + str(volume) )
def setLineinVolume(self, volume): self._setVolume(self.SOUND_MIXER_WRITE_LINE, volume)
(self.s_w, self.s_h) = self.region_surface_rect \ = self.region_surface.get_rect()[2:3]
(None, None, self.s_w, self.s_h) = self.region_surface_rect \ = self.region_surface.get_rect()
def set_surface(self, surface): self.region_surface = surface
img = open(media.devicename) img.seek(0x0000832d) id = img.read(16) img.seek(32808, 0) label = img.read(32) m = LABEL_REGEXP(label) if m: label = m.group(1) img.close()
try: img = open(media.devicename) img.seek(0x0000832d) id = img.read(16) img.seek(32808, 0) label = img.read(32) m = LABEL_REGEXP(label) if m: label = m.group(1) img.close() except IOError: print 'I/O error on disc %s' % media.devicename return
def identify(self, media):
THEME_CHANGE.post()
signals['theme change'].emit()
def set(new): """ set current fxd theme """ global current_theme if not current_theme: init_module() if new == current_theme: # new and old theme are the same, # don't do anything return current_theme if isinstance(new, str): # new theme is only a string, load the theme file # based on the current theme log.info('loadi...
t1 = time.time()
def prepare(self): log.info('preparing skin settings')
if type == 'table': print 'no' else: print 'do it'
if type != 'table':
def parse(self, node, scale, c_dir=''): XML_menuitem.parse(self, node, scale, c_dir) type = attr_str(node, "type", "") for subnode in node.children: if subnode.name == u'expand': self.expand.parse(subnode, scale)
left=None, top=None, width=600, height=360, bg_color=None,
left=None, top=None, width=600, height=400, bg_color=None,
def __init__(self, parent='osd', text=None, handler=None, left=None, top=None, width=600, height=360, bg_color=None, fg_color=None, icon=None, border=None, bd_color=None, bd_width=None):
(config.REC_CMD, string.split(prog.channel_id)[0], duration, title)
(config.REC_CMD, prog.tunerid, duration, title)
def checkToRecord(): rec_cmd = None scheduledRecordings = getScheduledRecordings() progs = scheduledRecordings.getProgramList() now = time.time() for prog in progs.values(): print 'checkToRecord: progloop = %s' % prog try: recording = prog.isRecording except: recording = FALSE if prog.start <= now and prog.stop >= ...
if filename.endswith('.raw'):
if isinstance(filename, str) and filename.endswith('.raw'):
def _getbitmap(self, url): """ load the bitmap or thumbnail """ if not pygame.display.get_init(): return None
for name in cha.keys():
for name in channels:
def parse_category_data(url): html=urllib.urlopen(url).readlines() programs=[] count=0 ; in_name=0 for line in html: line = line.strip() if line.find('<span class="charteventname"')>=0: if count>0: programs.append(expand(name)) count += 1 ; in_name=1 ; name="" continue if in_name: if line.find('</span>')>=0: in_name...
cha_keys.sort() x ='<tv generator-info-name="dagenstv2xmltv by Per Wigren - wigren@open-source.nu"'
cha_keys.sort() x ='<?xml version="1.0" encoding="ISO-8859-1"?>\n' x+='<!DOCTYPE tv SYSTEM "xmltv.dtd">\n' x+='<tv generator-info-name="dagenstv2xmltv by Per Wigren - wigren@open-source.nu"'
def create_xml(program): # Sort by start-time, then program name prog_keys=[] ; cha_keys=[] for key in program.keys(): prog_keys.append( (program[key]['start'],key) ) prog_keys.sort() for key in cha.keys(): cha_keys.append( (key.lower(), key) ) cha_keys.sort() x ='<tv generator-info-name="dagenstv2xmltv by Per Wigren...
writexml( unicode(create_xml(program),'latin-1').encode("utf-8") )
writexml( unicode(create_xml(program),'latin-1').encode("iso-8859-1") )
def create_xml(program): # Sort by start-time, then program name prog_keys=[] ; cha_keys=[] for key in program.keys(): prog_keys.append( (program[key]['start'],key) ) prog_keys.sort() for key in cha.keys(): cha_keys.append( (key.lower(), key) ) cha_keys.sort() x ='<tv generator-info-name="dagenstv2xmltv by Per Wigren...
filename = os.path.splitext(self.item.filename)[0] helpers.imdb.get_data_and_write_fxd(arg[0], filename, None, None,
if self.item.media and self.item.media.id: filename = os.path.join(config.MOVIE_DATA_DIR, self.item.media.id) device = self.item.media.devicename helpers.imdb.drive = self.item.media.devicename else: filename = os.path.splitext(self.item.filename)[0] device = None helpers.imdb.get_data_and_write_fxd(arg[0], file...
def imdb_create_fxd(self, arg=None, menuw=None): """ create fxd file for the item """ import helpers.imdb import directory box = PopupBox(text='getting data...') box.show() filename = os.path.splitext(self.item.filename)[0] helpers.imdb.get_data_and_write_fxd(arg[0], filename, None, None, (os.path.basename(self.item....
return []
return (FALSE, 'no search string')
def findMatches(self, find=None): global guide
size = osd.drawstringframed( element.text, 0, 0,
size = osd.drawstringframed( _(element.text), 0, 0,
def return_formatedtext( self, sel_list ): """ receives a list of indexex of elements to be used and returns a array with XML_FormatText ready to print (with its elements x, y, width and height already calculated) """ x, y = 0, 0 item = self.infoitem
self.possible_player = _get_possible_player()
self.possible_player = self._get_possible_player()
def play(self, arg=None, menuw=None, alternateplayer=False): """ play the item. """ # set the current_item of the parent to this one # to make playlists possible
reactor.callLater(60, self.minuteCheck)
next_minute = (int(time.time()/60) * 60 + 60) - int(time.time()) if next_minute != 60: if DEBUG: log.debug('top of the minute in %s seconds' % next_minute) reactor.callLater(next_minute, self.minuteCheck) else: reactor.callLater(60, self.minuteCheck)
def minuteCheck(self): reactor.callLater(60, self.minuteCheck) rec_prog = self.checkToRecord() if rec_prog: self.record_app = plugin.getbyname('RECORD') self.record_app.Record(rec_prog)
amazon.setLicense(self.license)
amazon.setLicense(self.license) search_string = '%s %s' % (artist,album) search_string = re.sub('[\(\[].*[\)\]]', '', search_string)
def cover_search_file(self, arg=None, menuw=None): """ search imdb for this item """ import amazon
cover = amazon.searchByKeyword('%s %s' % (artist,album) , product_line="music")
cover = amazon.searchByKeyword(search_string , product_line="music")
def cover_search_file(self, arg=None, menuw=None): """ search imdb for this item """ import amazon
print "Checking Large Cover"
def cover_search_file(self, arg=None, menuw=None): """ search imdb for this item """ import amazon
print "No Large Cover, Checking Small Cover..."
def cover_search_file(self, arg=None, menuw=None): """ search imdb for this item """ import amazon
print cover[i].ImageUrlLarge
def cover_search_file(self, arg=None, menuw=None): """ search imdb for this item """ import amazon
if not self.filename:
if not self.filename or self.filename == '0':
def actions(self): """ return a list of possible actions on this item. """ items = [ (self.play, 'Play'), (self.settings, 'Change play settings') ]
print menu_items[i].action
def getcmd(): items = [] # Load the main menu items from the skin menu_items = skin.settings.mainmenu.items for i in menu_items: if menu_items[i].visible: print menu_items[i].action # if it's has actions() it is an item already if hasattr(eval(menu_items[i].action), 'actions'): item = eval(menu_items[i].action)(None...
self.DIRECTORY_USE_MEDIAID_TAG_NAMES = config.DIRECTORY_USE_MEDIAID_TAG_NAMES
def __init__(self, name='', playlist=[], parent=None, display_type=None, random=False, build=False, autoplay=False, repeat=False): """ Init the playlist
def Play(self, mode, tuner_channel=None):
def Play(self, mode, tuner_channel=None, channel_change=0):
def Play(self, mode, tuner_channel=None):
if os.path.isfile('./freevo_xwin') and osd.sdl_driver == 'x11':
if self.xwin_wid: wid = self.xwin_wid mpl += ' -wid 0x%08x -xy %s -monitoraspect 4:3' % (wid, osd.width) elif os.path.isfile('./freevo_xwin') and osd.sdl_driver == 'x11':
def Play(self, mode, tuner_channel=None):
linein_vol = mixer.getLineinVolume() igain_vol = mixer.getIgainVolume()
def Play(self, mode, tuner_channel=None):
elif config.MAJOR_AUDIO_CTRL == 'PCM': mixer.setMainVolume(0) if config.CONTROL_ALL_AUDIO: mixer.setLineinVolume(0) mixer.setIgainVolume(0) mixer.setMicVolume(0)
def Play(self, mode, tuner_channel=None):
time.sleep(0.3)
time.sleep(0.2)
def Play(self, mode, tuner_channel=None):
mixer.setLineinVolume(linein_vol) mixer.setIgainVolume(igain_vol)
mixer.setLineinVolume(config.TV_IN_VOLUME) mixer.setIgainVolume(config.TV_IN_VOLUME) if config.MAJOR_AUDIO_CTRL == 'VOL': mixer.setMainVolume(mixer_vol) elif config.MAJOR_AUDIO_CTRL == 'PCM': mixer.setPcmVolume(mixer_vol)
def Play(self, mode, tuner_channel=None):
def Stop(self): if config.MAJOR_AUDIO_CTRL == 'VOL': mixer.setPcmVolume(config.MAX_VOLUME) elif config.MAJOR_AUDIO_CTRL == 'PCM': mixer.setMainVolume(config.MAX_VOLUME) mixer.setLineinVolume(0) mixer.setMicVolume(0) mixer.setIgainVolume(0)
def Stop(self, channel_change=0): if not channel_change: mixer.setLineinVolume(0) mixer.setMicVolume(0) mixer.setIgainVolume(0)
def Stop(self): if config.MAJOR_AUDIO_CTRL == 'VOL': mixer.setPcmVolume(config.MAX_VOLUME) elif config.MAJOR_AUDIO_CTRL == 'PCM': mixer.setMainVolume(config.MAX_VOLUME) mixer.setLineinVolume(0) mixer.setMicVolume(0) mixer.setIgainVolume(0) # Input on emu10k cards.
self.Stop()
self.Stop(channel_change=1)
def EventHandler(self, event): print '%s: %s app got %s event' % (time.time(), self.mode, event) if (event == rc.MENU or event == rc.STOP or event == rc.EXIT or event == rc.SELECT or event == rc.PLAY_END): self.Stop() skin.hold = FALSE # Allow drawing again rc.app = None menuwidget.refresh()
os.system('killall -9 freevo_xwin 2&> /dev/null')
def kill(self): childapp.ChildApp.kill(self, signal.SIGINT) # XXX Krister testcode for proper X11 video if DEBUG: print 'Killing mplayer' os.system('killall -9 freevo_xwin 2&> /dev/null')
PopupBox.__init__(self, text=self.prog.title, left=left, top=top, width=width, height=height, vertical_expansion=vertical_expansion)
PopupBox.__init__(self, parent=parent, text=self.prog.title, left=left, top=top, width=width, height=height, vertical_expansion=vertical_expansion)
def __init__(self, parent=None, prog=None, context=None, left=None, top=None, width=600, height=None, vertical_expansion=1):
print self.parent
def __init__(self, parent=None, prog=None, context=None, left=None, top=None, width=600, height=None, vertical_expansion=1):
pop = PopupBox(parent=self, text='"%s" has been removed' % \ self.prog.title) pop.show() time.sleep(2) pop.destroy()
def eventhandler(self, event, menuw=None): if DEBUG: print 'ProgramDisplay: event = %s' % event
searcher.refreshList()
def eventhandler(self, event, menuw=None): if DEBUG: print 'ProgramDisplay: event = %s' % event
self.valid = False
self.valid = 0
def __init__(self, title='', start=0, stop=0): self.channel_id = '' self.title = title self.desc = '' self.sub_title = '' self.start = start self.stop = stop self.ratings = {} self.advisories = [] self.categories = [] self.date = None self.pos = None if title == NO_DATA: self.vali...
self.valid = True
self.valid = 1
def __init__(self, title='', start=0, stop=0): self.channel_id = '' self.title = title self.desc = '' self.sub_title = '' self.start = start self.stop = stop self.ratings = {} self.advisories = [] self.categories = [] self.date = None self.pos = None if title == NO_DATA: self.vali...
if item.mode == 'dvd':
if item.mode == 'dvd' and item.url == 'dvd://':
def play(self, options, item): """ play a dvd with xine """ self.app_mode = item.mode # dvd or vcd keymap self.item = item
plugin.DaemonPlugin.__init__(self)
def __init__(self): self.reason = config.REDESIGN_FIXME return
self.poll_interval = 1 self.poll_menu_only = False
rc.register(self.handle, True, 1)
def __init__(self): self.reason = config.REDESIGN_FIXME return
def poll(self):
def handle(self):
def poll(self): command = '' _debug_('self.joyfd = %s' % self.joyfd, level=3) (r, w, e) = select.select([self.joyfd], [], [], 0) _debug_('r,w,e = %s,%s,%s' % (r,w,e), level=3) if r: c = os.read(self.joyfd, 8) else: return
print " length: " + str(self.length) def get_cover_image( self ):
print " Length: " + str(self.length) print " Image: " + str(temp) def get_cover_image( self, filename ): cover_logo = os.path.dirname(filename) cover_logo += '/cover.png' print cover_logo if os.path.isfile(cover_logo): self.image = cover_logo if os.path.isfile(os.path.splitext(filename)[0] + '.png'): self.image =...
def __init__( self, file, drawall=0 ): self.drawall = drawall self.filename = file self.album = '' self.artist = '' self.length = 0 self.title = 0 self.track = 0 self.year = 0 self.start = 0 self.elapsed = 0 self.remain = 0 self.done = 0.0 self.image = '' self.la...
for root, dirs, files in os.path.walk(top, topdown=False): for name in files: os.remove(os.path.join(root, name)) for name in dirs: os.rmdir(os.path.join(root, name)) os.rmdir(top)
files = [[],[]] path_walk = os.path.walk(top, rmrf_helper, files) for f in files[0]: try: os.remove(f) except IOError: pass for d in files[1]: try: os.rmdir(d) except IOError: pass
def rmrf(top=None): """ Pure python version of 'rm -rf' """ if not top == '/' and not top == '' and not top == ' ' and top: for root, dirs, files in os.path.walk(top, topdown=False): for name in files: os.remove(os.path.join(root, name)) for name in dirs: os.rmdir(os.path.join(root, name)) os.rmdir(top)
cmenu.table = (15, 17, 70)
cmenu.table = (15, 15, 70)
def eventhandler(self, event): if MenuApplication.eventhandler(self, event): return True
self.dfb = DirectFB() caps = self.dfb.getCardCapabilities() self.layer = self.dfb.getDisplayLayer(self.layerno) self.layer.setCooperativeLevel(DLSCL_ADMINISTRATIVE) self.layer.setConfiguration(pixelformat = DSPF_ARGB, buffermode = DLBM_BACKSYSTEM)
self.dfb = DirectFB() caps = self.dfb.getCardCapabilities() self.layer = self.dfb.getDisplayLayer(self.layerno) self.layer.setCooperativeLevel(DLSCL_ADMINISTRATIVE) self.layer.setConfiguration(pixelformat = DSPF_RGB32, buffermode = DLBM_BACKSYSTEM, width = width, height = height) print 'DirectFB layer config:' layer_co...
def __init__(self, size, layerno): super(DirectFBCanvas, self).__init__(size, preserve_alpha = False, blit_once = True) width, height = size self.layerno = layerno print 'DEBUG: size is %sx%s' % (width, height)
print 'DirectFB layer config:' layer_config = self.layer.getConfiguration() for k, v in layer_config.items(): print ' %s: %s' % (k, v) print ' goemetry: %dx%d' % (layer_config.get('width'), layer_config.get('height')) print ' pixelformat: %x' % layer_config.get('pixelformat') self.layer.enableCursor(0) self.osd ...
self.layer.enableCursor(0) self.osd = self.layer.createWindow(caps=DWCAPS_ALPHACHANNEL, width=width, height=height) self._surface = self.osd.getSurface() self.osd.setOpacity(0xFF) self._rect = []
def __init__(self, size, layerno): super(DirectFBCanvas, self).__init__(size, preserve_alpha = False, blit_once = True) width, height = size self.layerno = layerno print 'DEBUG: size is %sx%s' % (width, height)
self._rect = rect.optimize_for_rendering(self._rect) data = img.get_raw_data("BGRA") self._surface.overlay(DSPF_ARGB, str(data)) self._surface.flip() return
self._rect = rect.optimize_for_rendering(self._rect) data = img._image.get_raw_data() self._surface.overlay(DSPF_ARGB, data) img._image.free_raw_data() self._surface.flip(DSFLIP_WAIT) return
def _blit(self, img, r): pos, size = r
v.print_settings()
if DEBUG: v.print_settings()
def run(self): while 1: print('Record_Thread::run: mode=%s' % self.mode) if self.mode == 'idle': self.mode_flag.wait() self.mode_flag.clear() elif self.mode == 'record': print 'Record_Thread::run: started recording'