#include <listensupport.h>
Public Slots | |
void | setStation (radioStation *newStation) |
void | setNoStation () |
Signals | |
void | isPlayingChanged (bool newValue) |
Public Member Functions | |
listenSupport (QObject *parent=0) | |
virtual | ~listenSupport () |
bool | isPlaying () const |
Properties | |
bool | isPlaying |
Private Slots | |
void | setRelayPort (qlonglong ignored, PropertyValue value) |
void | processNewState (Phonon::State newstate) |
Private Member Functions | |
void | setIsPlaying (bool newValue) |
void | reloadListening () |
Private Attributes | |
Phonon::AudioOutput * | audioOutput |
bool | internal_isPlaying |
Phonon::MediaObject * | media |
radioStation * | station |
qlonglong | relayPort |
This class offers support for listening in streams. The stream who is played (There is only one stream played at the same time.) can be defined by passing a radioStation object to setStation().
The class handles autoatically any relevant changes in the radioStation object (changing relay port). You can safely delete the radioStation object. Playback stops in this case.
Definition at line 39 of file listensupport.h.
listenSupport::listenSupport | ( | QObject * | parent = 0 |
) |
The constructor.
parent | The parent of this object. |
Definition at line 27 of file listensupport.cpp.
References audioOutput, media, processNewState(), relayPort, setIsPlaying(), and station.
listenSupport::~listenSupport | ( | ) | [virtual] |
bool listenSupport::isPlaying | ( | ) | const |
See property isPlaying.
void listenSupport::isPlayingChanged | ( | bool | newValue | ) | [signal] |
void listenSupport::processNewState | ( | Phonon::State | newstate | ) | [private, slot] |
Processes a changed state of media.
Definition at line 114 of file listensupport.cpp.
References setIsPlaying().
Referenced by listenSupport().
void listenSupport::reloadListening | ( | ) | [private] |
Stops the playback. If a valid relayPort (>=0) is given, playback is than restarted for this relay port.
Definition at line 91 of file listensupport.cpp.
References media, and relayPort.
Referenced by setRelayPort().
void listenSupport::setIsPlaying | ( | bool | newValue | ) | [private] |
See property isPlaying.
Definition at line 106 of file listensupport.cpp.
References internal_isPlaying, and isPlayingChanged().
Referenced by listenSupport(), and processNewState().
void listenSupport::setNoStation | ( | ) | [slot] |
Conveniance function that calls
setStation(0)
Definition at line 70 of file listensupport.cpp.
References setStation().
Referenced by setStation().
void listenSupport::setRelayPort | ( | qlonglong | ignored, | |
PropertyValue | value | |||
) | [private, slot] |
Sets the relay port. If it is necessary that the playback changes, these changes are done.
ignored | This argument is ignored. | |
value | The new value |
Definition at line 75 of file listensupport.cpp.
References PropertyValue::internalValue, relayPort, reloadListening(), PropertyValue::type, and PropertyValue::value.
Referenced by setStation().
void listenSupport::setStation | ( | radioStation * | newStation | ) | [slot] |
Determinates the station where to listen.
newStation | The corresponding radioStation object. You can pass a NULL pointer here to disable listening in. |
Definition at line 45 of file listensupport.cpp.
References ripping::relayPort, setNoStation(), setRelayPort(), and station.
Referenced by stationlistModel::disableListeningIn(), stationlistModel::enableListeningIn(), and setNoStation().
Phonon::AudioOutput* listenSupport::audioOutput [private] |
The audio output object.
Definition at line 76 of file listensupport.h.
Referenced by listenSupport(), and ~listenSupport().
bool listenSupport::internal_isPlaying [private] |
Used internally to store the property isPlaying.
Definition at line 78 of file listensupport.h.
Referenced by setIsPlaying().
Phonon::MediaObject* listenSupport::media [private] |
The media object.
Definition at line 80 of file listensupport.h.
Referenced by listenSupport(), reloadListening(), and ~listenSupport().
qlonglong listenSupport::relayPort [private] |
The actual relay port.
Definition at line 92 of file listensupport.h.
Referenced by listenSupport(), reloadListening(), and setRelayPort().
radioStation* listenSupport::station [private] |
If it is NULL, than no listening in is desired. Else, listening in is desired for the specified station.
Definition at line 89 of file listensupport.h.
Referenced by listenSupport(), and setStation().
bool listenSupport::isPlaying [read] |
This property holds if the listen support is playing actually or not.
bool isPlaying() const
void isPlayingChanged(bool newValue)
void setIsPlaying(bool newValue);
bool internal_isPlaying
Definition at line 51 of file listensupport.h.