radiostation.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 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 
00052      Q_PROPERTY(QString configFileName READ configFileName)
00053 
00054      
00065      Q_PROPERTY(QString fullConfigFileName READ fullConfigFileName)
00066 
00076      Q_PROPERTY(QString fullParseRulesFileName READ fullParseRulesFileName)
00077 
00092      Q_PROPERTY(PropertyValue uri READ uri)
00093 
00094   public:
00095      //contructor(s) and destructor(s)
00109      explicit radioStation(QObject *parent = 0,
00110                            QWidget *mainWidget = 0,
00111                            const QString & configFileName = QString());
00126      explicit radioStation(QObject *parent,
00127                            QWidget *mainWidget,
00128                            const QString & configFileName,
00129                            void *index);
00131      virtual ~radioStation();
00133      QString configFileName() const;
00135      QString fullConfigFileName() const;
00137      QString fullParseRulesFileName() const;
00139      virtual PropertyValue uri() const;
00142      virtual void setServerUri(const QUrl & uri);
00144      static PropertyValue formatedUri(const QString & theUri);
00145 
00146   signals:
00147      void uriChanged(void *index, PropertyValue newUri);
00148 
00149   public slots:
00152      int execSettingsDialogWithoutApplyButton();
00155      void showSettingsDialogWithApplyButton();
00156 
00157   protected:
00161      QPointer<settings_stream> config_skeleton;
00165      QPointer<QWidget> m_mainWidget;
00168      virtual QStringList parameterList() const;
00170      virtual QString serverUri() const;
00174      // doxygen doesn't accept "#configFileName" in this special section.
00176 
00177      virtual void setBitrate(const qint64 bitrate);
00179      virtual void setMetaInterval(const qint64 metaInterval);
00181      virtual void setServerName(const QString & newServerName);
00183      virtual void setStreamName(const QString & newStreamName);
00185 
00187      QPointer<settings_stream_dialog> settingsDialog;
00188      virtual QString workingDirectory() const;
00189 
00190   protected slots:
00197      virtual void setBitrate(void *ignored, const PropertyValue & newBitrate);
00204      virtual void setMetaInterval(void *ignored, const PropertyValue & newMetaInterval);
00211      virtual void setServerName(void *ignored, const PropertyValue & newServerName);
00218      virtual void setStreamName(void *ignored, const PropertyValue & newStreamName);
00219 
00220   private:
00222      enum applyButton {
00223        showApplyButton,
00224        hideApplyButton
00225      };
00227      enum returnType {
00228        immediately,
00229        after_execution
00230      };
00235      QString helper_locateConfigfile(const QString & configfileName) const;
00243      void helper_setupConfigSystem(const QString & configFile);
00255      int helper_displaySettingsDialog(const returnType returnMode,
00256                                       const applyButton applyButtonMode);
00258      QString internal_configFileName;
00268      KSharedConfig::Ptr shared_config;
00270      QPointer<get_stream_info> infoCatcher;
00271 
00272   private slots:
00285     void helper_write_properties_from_file_to_class_ripping();
00288     void updateMetaData();
00289  };
00290 
00291 #endif

doxygen