radiostation.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2008  Tim Fechtner < urwald at users dot sourceforge dot net >
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 RADIOSTATION_H
00022 #define RADIOSTATION_H
00023 
00024 #include "get_stream_info.h"
00025 #include "ripping.h"
00026 #include "settings_stream_dialog.h"
00027 
00036 class radioStation : public ripping
00037 {
00038 
00039      Q_OBJECT
00040 
00050      Q_PROPERTY(QString configFileName READ configFileName)
00051 
00052      
00066      Q_PROPERTY(PropertyValue uri READ uri)
00067 
00068   public:
00069      //contructor(s) and destructor(s)
00087      explicit radioStation(QObject *parent = 0,
00088                            QWidget *mainWidget = 0,
00089                            const QString & configFileName = QString());
00108      explicit radioStation(QObject *parent,
00109                            QWidget *mainWidget,
00110                            const QString & configFileName,
00111                            qlonglong index);
00113      virtual ~radioStation();
00115      QString configFileName() const;
00117      virtual PropertyValue uri() const;
00120      virtual void setServerUri(const QUrl & uri);
00122      static PropertyValue formatedUri(const QString & theUri);
00123 
00124   signals:
00125      void uriChanged(qlonglong index, PropertyValue newUri);
00126 
00127   public slots:
00130      int execSettingsDialog();
00133      void showSettingsDialog();
00134 
00135   protected:
00139      QPointer<settings_stream> config_skeleton;
00143      QPointer<QWidget> m_mainWidget;
00146      virtual QStringList parameterList() const;
00148      virtual QString serverUri() const;
00152      // doxygen doesn't accept "#configFileName" in this special section.
00154 
00155      virtual void setBitrate(const qint64 bitrate);
00157      virtual void setMetaInterval(const qint64 metaInterval);
00159      virtual void setServerName(const QString & newServerName);
00161      virtual void setStreamName(const QString & newStreamName);
00163 
00165      QPointer<settings_stream_dialog> settingsDialog;
00166      virtual QString workingDirectory() const;
00167 
00168   protected slots:
00175      virtual void setBitrate(const qlonglong ignored, const PropertyValue & newBitrate);
00182      virtual void setMetaInterval(const qlonglong ignored, const PropertyValue & newMetaInterval);
00189      virtual void setServerName(const qlonglong ignored, const PropertyValue & newServerName);
00196      virtual void setStreamName(const qlonglong ignored, const PropertyValue & newStreamName);
00197 
00198   private:
00206      void helper_setupConfigSystem(const QString & configFile);
00218      int helper_displaySettingsDialog(const bool returnImmediately);
00220      QString internal_configFileName;
00230      KSharedConfig::Ptr shared_config;
00232      QPointer<get_stream_info> infoCatcher;
00233 
00234   private slots:
00247     void helper_write_properties_from_file_to_class_ripping();
00250     void updateMetaData();
00251  };
00252 
00253 #endif

doxygen