00001 /*************************************************************************** 00002 frequencyradiostation.h - description 00003 ------------------- 00004 begin : Sat March 29 2003 00005 copyright : (C) 2003 by Klas Kalass, Ernst Martin Witte 00006 email : klas@kde.org, witte@kawo1.rwth-aachen.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef KRADIO_FREQUENCYRADIOSTATION_H 00019 #define KRADIO_FREQUENCYRADIOSTATION_H 00020 00021 #ifdef HAVE_CONFIG_H 00022 #include <config.h> 00023 #endif 00024 00025 #include "radiostation.h" 00026 00032 // Kopenhagener Wellenplan: 300kHz 00033 #define STATION_FREQ_INTERVAL_FM 0.3 00034 00035 // Kopenhagener Wellenplan: 9kHz 00036 #define STATION_FREQ_INTERVAL_AM 0.009 00037 00038 class FrequencyRadioStation : public RadioStation { 00039 public: 00040 FrequencyRadioStation (); 00041 FrequencyRadioStation (float frequency); 00042 FrequencyRadioStation (const QString &name, const QString &shortName, float frequency); 00043 FrequencyRadioStation (const FrequencyRadioStation &); 00044 FrequencyRadioStation (RegisterStationClass, const QString &classname = QString::null); 00045 ~FrequencyRadioStation(); 00046 00047 float frequency() const { return m_frequency; } 00048 void setFrequency (float frequency) { m_frequency = frequency; } 00049 00050 virtual QString longName() const; 00051 virtual QString description() const; 00052 virtual bool isValid () const; 00053 00054 /* = 0 : "this" is same as "s", i.e. approximately same frequency 00055 > 0 : this.frequency > s.frequency 00056 < 0 : this.frequency < s.frequency 00057 other class than FrequencyRadioStation: compare typeid(.).name() 00058 */ 00059 virtual int compare (const RadioStation &s) const; 00060 00062 virtual RadioStation *copy() const; 00063 virtual RadioStation *copyNewID() const; 00064 00065 virtual RadioStationConfig *createEditor() const; 00066 00067 // for XML-Parsing/Export 00068 virtual bool setProperty(const QString &property_name, const QString &val); 00069 virtual QString getProperty(const QString &property_name) const; 00070 virtual QStringList getPropertyNames() const; 00071 virtual QString getClassName() const { return "FrequencyRadioStation"; } 00072 00073 00074 virtual bool operator == (const RadioStation &x) const; 00075 00076 protected: 00077 00078 float m_frequency; 00079 }; 00080 00081 00082 00083 #endif