listensupport.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2008-2010  Lukas Sommer < SommerLuk at gmail dot com >
00003 
00004     This program is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU General Public License as
00006     published by the Free Software Foundation; either version 2 of
00007     the License or (at your option) version 3 or any later version
00008     accepted by the membership of KDE e.V. (or its successor approved
00009     by the membership of KDE e.V.), which shall act as a proxy
00010     defined in Section 14 of version 3 of the license.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019 */
00020 
00021 #ifndef LISTENSUPPORT_H
00022 #define LISTENSUPPORT_H
00023 
00024 #include <QPointer>
00025 #include <QList>
00026 #include <phonon/mediaobject.h>
00027 #include <phonon/path.h>
00028 #include <phonon/audiooutput.h>
00029 #include "radiostation.h"
00030 
00039 class listenSupport : public QObject
00040 {
00041 
00042   Q_OBJECT
00043 
00051   Q_PROPERTY(bool isPlaying READ isPlaying)
00052 
00053   public:
00056     listenSupport(QObject *parent = 0);
00058     virtual ~listenSupport();
00060     bool isPlaying() const;
00061 
00062   public slots:
00066     void setStation(radioStation *newStation);
00068     void setNoStation();
00069 
00070   signals:
00072     void isPlayingChanged(bool newValue);
00073 
00074   private:
00076     Phonon::AudioOutput *audioOutput;
00078     bool internal_isPlaying;
00080     Phonon::MediaObject *media;
00082     void setIsPlaying(bool newValue);
00089     radioStation *station;
00092     qlonglong relayPort;
00095     void reloadListening();
00096 
00097   private slots:
00103     void setRelayPort(qlonglong ignored, PropertyValue value);
00105     void processNewState(Phonon::State newstate);
00106 };
00107 
00108 #endif

doxygen