![]() |
Python_2
1.0
|
Intended to play files using mplayer, and load subtitles automatically (ENG, POR and ESP). More...
Functions | |
def | getLocale () |
def | getOs () |
def | getFormat (fbase, code1, code2) |
def | getOptions (base, ext) |
def | parseFileName (fname) |
def | getSubList (fbase) |
def | getParamList (player, path, ext, subtitles, movie, options) |
def | play (fplayer, path, ext, subtitles, movie, movieOriginal, lparam) |
def | getInitialDir () |
def | selectFile () |
def | getPlayer () |
def | main (argv=None) |
Variables | |
string | __version__ = "$Revision: 1.71 $" |
ptype = os.P_WAIT | |
bool | RECURSIVE = False |
list | languages = [['EN', '.HI'], ['PT', '_PT'], ['BR', '_BR'], ['ES', '.SP']] |
list | audio_file = [".flac", ".mp3", ".m4a", ".mpc", ".ogg", ".wav", ".wma"] |
list | video_file |
string | bindir = "" |
Intended to play files using mplayer, and load subtitles automatically (ENG, POR and ESP).
They can be switched during playback using the "j" key.
Subtitle files must have the same prefix of the movie file (without white spaces and weird characters, please) and a language code: my.movie.CD1.EN.srt, my.movie.CD1.PT.srt, my.movie.CD1.ES.sub, or my.movie.CD1.rar
The following empty files in the movie directory cause the script to pass the corresponding option to mplayer during playback: xvid, divx4, nocache, or fbyt (for a 4:3 aspect ratio).
Command Line Parameters – name of a file to play.
Note1: if more than one argument is passed, they are concatenated, because I suppose it is a file name with white spaces in this case.
Note2: it is possible to create a desktop icon and just drag the file to be played onto it. For windows, however, the desktop icon has to be edited, and "python" (supposed to be in the path) has to be appended before the "program name".
def mplayertv.getFormat | ( | fbase, | |
code1, | |||
code2 | |||
) |
Looks for a file in .sub or .srt format Keyword arguments: fbase -- file path and base name (without extension) code1 -- language code (BR,EN,ES,PT) code2 -- alternative language code (_BR,.HI,.SP,_PT)
Referenced by getSubList().
def mplayertv.getInitialDir | ( | ) |
def mplayertv.getOptions | ( | base, | |
ext | |||
) |
Gets option list, based on the presence of empty files
Referenced by main().
def mplayertv.getOs | ( | ) |
References getLocale().
Referenced by getInitialDir(), getPlayer(), main(), and selectFile().
def mplayertv.getParamList | ( | player, | |
path, | |||
ext, | |||
subtitles, | |||
movie, | |||
options | |||
) |
Returns the parameter list.
Referenced by main().
def mplayertv.getPlayer | ( | ) |
Returns mplayer executable based on the OS.
References getOs().
Referenced by _07_alarme_class.main(), and main().
def mplayertv.getSubList | ( | fbase | ) |
def mplayertv.main | ( | argv = None | ) |
Main program.
References getLocale(), getOptions(), getOs(), getParamList(), getPlayer(), getSubList(), parseFileName(), play(), and selectFile().
Referenced by mplayerdvd.main(), and play().
def mplayertv.parseFileName | ( | fname | ) |
Breaks fname in path/base.ext
Referenced by main().
def mplayertv.play | ( | fplayer, | |
path, | |||
ext, | |||
subtitles, | |||
movie, | |||
movieOriginal, | |||
lparam | |||
) |
def mplayertv.selectFile | ( | ) |
Creates a tkFileDialog for selecting a file.
References getInitialDir(), and getOs().
Referenced by _07_alarme_class.main(), and main().
|
private |
list mplayertv.audio_file = [".flac", ".mp3", ".m4a", ".mpc", ".ogg", ".wav", ".wma"] |
string mplayertv.bindir = "" |
Referenced by _07_alarme_class.volume.setChannel().
list mplayertv.languages = [['EN', '.HI'], ['PT', '_PT'], ['BR', '_BR'], ['ES', '.SP']] |
mplayertv.ptype = os.P_WAIT |
bool mplayertv.RECURSIVE = False |