rds_type_0a_decoder.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KRADIO_V4LRADIO_RDS_DECODER_0A_H
00019 #define KRADIO_V4LRADIO_RDS_DECODER_0A_H
00020
00021 #ifdef HAVE_CONFIG_H
00022 #include <config.h>
00023 #endif
00024
00025 #include <kdemacros.h>
00026
00027 #include "rds_type_decoder.h"
00028
00029 #include <QtCore/QString>
00030
00031 #define RDS_0A_POS_BLOCK RDS_BLK_B
00032 #define RDS_0A_POS_SHIFT 0
00033 #define RDS_0A_POS_MASK 0x0003
00034
00035 #define RDS_STATIONNAME_MAX_LEN 8
00036
00037 enum RDS_0A_State { RDS_0A_WAIT4GRP, RDS_0A_COMPLETE };
00038
00039 class KDE_EXPORT RDS_Type0A_Decoder : public RDSTypeDecoder
00040 {
00041 public:
00042 RDS_Type0A_Decoder();
00043
00044 virtual void addGroup(const RDSGroup &g);
00045 virtual bool isComplete() const;
00046
00047 const QString &getStationName() const;
00048
00049 protected:
00050 void addChar(unsigned char c);
00051 void clear();
00052
00053 char m_stationName[RDS_STATIONNAME_MAX_LEN+1];
00054 QString m_stationNameComplete;
00055
00056 unsigned int m_next_expected_position;
00057
00058 RDS_0A_State m_state;
00059 };
00060
00061
00062
00063
00064 #endif
00065