MediaSource Class Reference
from PyKDE4.phonon import *
Namespace: Phonon.MediaSource
Detailed Description
\class MediaSource mediasource.h Phonon/MediaSource
Note that all constructors of this class are implicit, so that you can simply write
MediaObject m;
QString fileName("/home/foo/bar.ogg");
QUrl url("http://www.example.com/stream.mp3");
QBuffer *someBuffer;
m.setCurrentSource(fileName);
m.setCurrentSource(url);
m.setCurrentSource(someBuffer);
m.setCurrentSource(Phonon.Cd);
- Author:
- Matthias Kretz <kretz@kde.org>
Enumerations |
Type | { Invalid, LocalFile, Url, Disc, Stream, Empty } |
Methods |
| __init__ (self) |
| __init__ (self, QString fileName) |
| __init__ (self, QUrl url) |
| __init__ (self, Phonon::DiscType discType, QString deviceName=QString()) |
| __init__ (self, Phonon.AbstractMediaStream stream) |
| __init__ (self, QIODevice ioDevice) |
| __init__ (self, Phonon.MediaSource rhs) |
bool | autoDelete (self) |
QString | deviceName (self) |
Phonon::DiscType | discType (self) |
QString | fileName (self) |
bool | operator == (self, Phonon.MediaSource rhs) |
| setAutoDelete (self, bool enable) |
Phonon.AbstractMediaStream | stream (self) |
Phonon.MediaSource.Type | type (self) |
QUrl | url (self) |
Method Documentation
__init__ |
( |
self, |
|
|
|
QString |
fileName |
|
) |
|
|
|
__init__ |
( |
self, |
|
|
|
QUrl |
url |
|
) |
|
|
|
__init__ |
( |
self, |
|
|
|
Phonon::DiscType |
discType, |
|
|
QString |
deviceName=QString() |
|
) |
|
|
|
Returns the setting of the auto-delete option. The default is false.
- See also:
- setAutoDelete
Returns the device name of the MediaSource if type() == Disc; otherwise returns
QString().
Phonon::DiscType discType |
( |
|
self ) |
|
Returns the disc type of the MediaSource if type() == Disc; otherwise returns
NoDisc.
Returns the file name of the MediaSource if type() == LocalFile; otherwise returns
QString().
Returns true if this MediaSource is equal to rhs; otherwise returns false.
setAutoDelete |
( |
self, |
|
|
|
bool |
enable |
|
) |
|
|
|
Tell the MediaSource to take ownership of the AbstractMediaStream or QIODevice that was
passed in the constructor.
The default setting is false, for safety. If you turn it on, you should only access
the AbstractMediaStream/QIODevice object as long as you yourself keep a MediaSource
object around. As long as you keep the MediaSource object wrapping the stream/device
the object will not get deleted.
- See also:
- autoDelete
Returns the media stream of the MediaSource if type() == Stream; otherwise returns 0.
QIODevices are handled as streams, too.
Returns the type of the MediaSource (depends on the constructor that was used).
- See also:
- Type
Returns the url of the MediaSource if type() == URL or type() == LocalFile; otherwise
returns QUrl().
Enumeration Documentation