File: pympg.6

package info (click to toggle)
pykaraoke 0.7.5-1.2%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,608 kB
  • sloc: python: 6,696; ansic: 577; makefile: 71; sh: 46
file content (83 lines) | stat: -rw-r--r-- 3,773 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.\" Please adjust this date whenever revising the manpage.
.\" 
.\" Some roff macros, for reference:
.\" .nh        disable hyphenation
.\" .hy        enable hyphenation
.\" .ad l      left justify
.\" .ad b      justify to both left and right margins
.\" .nf        disable filling
.\" .fi        enable filling
.\" .br        insert line break
.\" .sp <n>    insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.TH "PYMPG" "6" "july 16, 2006" "" ""
.SH "NAME"
pykaraoke \- free CDG/MIDI/MPEG karaoke player
.SH "SYNOPSIS"
.B pympg
mpegfilename.mpg
.SH "OVERVIEW"
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
.\" respectively.
\fBpykaraoke\fP is a free karaoke player for Linux, FreeBSD and Windows. 
.PP 
\fBpymng\fP is an MPEG player built using python. It was written for the PyKaraoke project but is in fact a general purpose MPEG player that could be used in other python projects requiring an MPEG player.
.PP 
The player uses the pygame library (www.pygame.org), and can therefore run on any operating system that runs pygame (currently Linux, FreeBSD, Windows and OSX).
.PP 
You can use this file as a standalone player, or together with PyKaraoke. PyKaraoke provides a graphical user interface, playlists, searchable song database etc.
.PP 
For those writing a media player or similar project who would like MPG support, this module has been designed to be easily incorporated into such projects and is released under the LGPL.
.SH "USAGE"
To start the player, pass the MPEG filename/path on the command line:
.PP 
	python pympg.py /path/song.mpg
.PP 
You can also incorporate a MPG player in your own projects by importing this module. The class mpgPlayer is exported by the module. You can import and start it as follows:
.PP 
	import pympg
.br 
	player = pympg.mpgPlayer("/path/song.mpg")
.br 
	player.Play()
.PP 
If you do this, you must also arrange to call pympg.manager.Poll() from time to time, at least every 100 milliseconds or so, to allow the player to do its work.
.PP 
The class also exports Close(), Pause(), Rewind(), GetPos().
.PP 
There are two optional parameters to the initialiser, errorNotifyCallback and doneCallback:
.PP 
errorNotifyCallback, if provided, will be used to print out any error messages (e.g. song file not found). This allows the module to fit together well with GUI playlist managers by utilising the same GUI's error popup window mechanism (or similar). If no callback is provided, errors are printed to stdout. errorNotifyCallback should take one parameter, the error string, e.g.:
.PP 
	def errorPopup (ErrorString):
.br 
		msgBox (ErrorString)
.PP 
doneCallback can be used to register a callback so that the player calls you back when the song is finished playing. The callback should take no parameters, e.g.:
.PP 
	def songFinishedCallback():
.br 
		msgBox ("Song is finished")
.PP 
To register callbacks, pass the functions in to the initialiser:
.PP 
	mpgPlayer ("/path/song.mpg", errorPopup, songFinishedCallback)
.PP 
These parameters are optional and default to None.
.PP 
If the initialiser fails (e.g. the song file is not present), __init__ raises an exception.
.SH "SEE ALSO"
.
You can find PyKaraoke's home page at: http://www.kibosh.org/pykaraoke/
.P
.SH "AUTHOR"
PyKaraoke was written by Kelvin Lawson <kelvinl@users.sourceforge.net>
and William Ferrell <willfe@gmail.com>.
.PP 
This manual page was written by Miriam Ruiz <little_miry@yahoo.es>,
for the Debian project (but may be used by others).