Changeset db5304ba69956c405ec4d52122aeb9d863218024
- Timestamp:
- 12/02/07 21:36:08 (1 year ago)
- git-parent:
[f119c965fdada55f12312fd1eed9e5dbc4f32b49], [df37f8482406e455b5a03c8382cad2372571adc4]
- Files:
-
- config.py (modified) (5 diffs)
- plugins/video/transcode.py (modified) (1 diff)
- pyTivoConfigurator.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
config.py
r10bf9e4 rdb5304b 84 84 return True 85 85 86 def getOptres(): 87 try: 88 optres = config.get('Server', 'optres') 89 if optres.lower() == 'true': 90 return True 91 else: 92 return False 93 except NoOptionError: 94 return False 95 86 96 def get(section, key): 87 97 return config.get(section, key) … … 116 126 return b 117 127 128 def nearestTivoHeight(height): 129 return nearest(height, getValidHeights()) 130 118 131 def nearestTivoWidth(width): 119 132 return nearest(width, getValidWidths()) … … 122 135 if tsn and config.has_section('_tivo_' + tsn): 123 136 try: 124 height = int(config.get('_tivo_' + tsn, 'height _br'))137 height = int(config.get('_tivo_' + tsn, 'height')) 125 138 return nearest(height, getValidHeights()) 126 139 except NoOptionError: … … 129 142 try: 130 143 height = int(config.get('Server', 'height')) 131 return nearest (height, getValidHeights())144 return nearestTivoHeight(height) 132 145 except NoOptionError: #default 133 146 return 480 … … 174 187 return config.get('Server', 'max_video_br') 175 188 except NoOptionError: #default to 17M 176 return '17 M'189 return '17408k' 177 190 178 191 def getBuffSize(): plugins/video/transcode.py
r10bf9e4 rdb5304b 76 76 debug_write(['aspect169:', aspect169, '\n']) 77 77 78 optres = Config.getOptres() 79 80 debug_write(['optres:', optres, '\n']) 81 82 if optres: 83 optHeight = Config.nearestTivoHeight(height) 84 optWidth = Config.nearestTivoWidth(width) 85 if optHeight < TIVO_HEIGHT: 86 TIVO_HEIGHT = optHeight 87 if optWidth < TIVO_WIDTH: 88 TIVO_WIDTH = optWidth 89 78 90 d = gcd(height,width) 79 91 ratio = (width*100)/height 80 92 rheight, rwidth = height/d, width/d 81 93 82 debug_write(['select_aspect: File=', inFile, ' Type=', type, ' width=', width, ' height=', height, ' fps=', fps, ' millisecs=', millisecs, ' ratio=', ratio, ' rheight=', rheight, ' rwidth=', rwidth, ' \n'])94 debug_write(['select_aspect: File=', inFile, ' Type=', type, ' width=', width, ' height=', height, ' fps=', fps, ' millisecs=', millisecs, ' ratio=', ratio, ' rheight=', rheight, ' rwidth=', rwidth, ' TIVO_HEIGHT=', TIVO_HEIGHT, 'TIVO_WIDTH=', TIVO_WIDTH, '\n']) 83 95 84 96 multiplier16by9 = (16.0 * TIVO_HEIGHT) / (9.0 * TIVO_WIDTH) pyTivoConfigurator.py
r6f08163 rdf37f84 8 8 def buildContainerList(self): 9 9 frame = Frame(self) 10 frame.pack(fill= Y, expand=1)10 frame.pack(fill=BOTH, expand=1) 11 11 scrollbar = Scrollbar(frame, orient=VERTICAL) 12 12 self.container_list = Listbox(frame, yscrollcommand=scrollbar.set) … … 25 25 26 26 def buildButtons(self): 27 frame = Frame( )28 frame.pack(fill= Y, expand=1)27 frame = Frame(self) 28 frame.pack(fill=X) 29 29 30 30 save_button = Button(frame, text="Save", command=self.save) … … 56 56 def buildPath(self): 57 57 frame = Frame(self) 58 frame.pack(fill= Y, expand=1)58 frame.pack(fill=X) 59 59 l = Label(frame, text="Path") 60 60 l.pack(side=LEFT) … … 64 64 65 65 self.path = Entry(frame) 66 self.path.pack(side=RIGHT, fill= Y, expand=1)66 self.path.pack(side=RIGHT, fill=X, expand=1) 67 67 68 68 … … 99 99 Frame.__init__(self, master) 100 100 self.master.title('pyTivoConfigurator') 101 self.pack( )101 self.pack(fill=BOTH, expand=1) 102 102 103 103 import os
