kradio4  r778
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
rds_type_2ab_decoder.h
Go to the documentation of this file.
1 /***************************************************************************
2  rds_decoder_0a.h - description
3  -------------------
4  begin : Feb 2009
5  copyright : (C) 2009 Ernst Martin Witte
6  email : emw-kradio@nocabal.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef KRADIO_V4LRADIO_RDS_DECODER_2AB_H
19 #define KRADIO_V4LRADIO_RDS_DECODER_2AB_H
20 
21 #ifdef HAVE_CONFIG_H
22 #include <config.h>
23 #endif
24 
25 #include <kdemacros.h>
26 
27 #include "rds_type_decoder.h"
28 
29 #include <QtCore/QString>
30 
31 #ifndef max
32  #define max(a,b) ((a) > (b) ? (a) : (b))
33 #endif
34 
35 #define RDS_2AB_POS_BLOCK RDS_BLK_B
36 #define RDS_2AB_POS_SHIFT 0
37 #define RDS_2AB_POS_MASK 0x000F
38 
39 #define RDS_2AB_AB_FLAG_BLOCK RDS_BLK_B
40 #define RDS_2AB_AB_FLAG_MASK 0x0010
41 
42 #define RDS_RADIOTEXT_A_MAX_LEN 64
43 #define RDS_RADIOTEXT_B_MAX_LEN 32
44 #define RDS_RADIOTEXT_MAX_LEN (max(RDS_RADIOTEXT_A_MAX_LEN, RDS_RADIOTEXT_B_MAX_LEN))
45 
47 
48 class KDE_EXPORT RDS_Type2AB_Decoder : public RDSTypeDecoder
49 {
50 public:
51  RDS_Type2AB_Decoder(bool type_A_not_B);
52 
53  virtual void addGroup(const RDSGroup &g);
54  virtual bool isComplete() const;
55 
56  const QString &getRadioText() const;
57 
58 protected:
59  void addChar(char c);
60  void clear();
61  void complete();
62 
63  char m_radioText[RDS_RADIOTEXT_MAX_LEN+1];
65 
67  unsigned int m_max_len;
69 
71  mutable bool m_workaround_completed;
72 };
73 
74 
75 
76 
77 #endif
78 
virtual void addGroup(const RDSGroup &g)=0
#define RDS_RADIOTEXT_MAX_LEN
virtual bool isComplete() const =0
unsigned int m_next_expected_position