summaryrefslogtreecommitdiffstats
path: root/plugins/gui-standard-display/radioview_frequencyradio.h
blob: fb3bd5931a0be72c3a175705d70aad7432d645f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/***************************************************************************
                          tderadiodisplay.h  -  description
                             -------------------
    begin                : Mit Jan 29 2003
    copyright            : (C) 2003 by Martin Witte
    email                : [email protected]
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef KRADIO_RADIOVIEW_FREQUENCYRADIO_H
#define KRADIO_RADIOVIEW_FREQUENCYRADIO_H

#include "../../src/include/radiodevice_interfaces.h"
#include "../../src/include/soundstreamclient_interfaces.h"
#include "radioview_element.h"
#include "displaycfg_interfaces.h"

/**
  *@author Martin Witte
  */

class RadioViewFrequencyRadio : public RadioViewElement,  // is a TQObject, must be first
                                public IRadioDeviceClient,
                                public IFrequencyRadioClient,
                                public ISoundStreamClient,
                                public IDisplayCfg
{
Q_OBJECT
  
public:
    RadioViewFrequencyRadio(TQWidget *parent, const TQString &name);
    ~RadioViewFrequencyRadio();

    float getUsability (Interface *) const;

    virtual void   saveState (TDEConfig *) const;
    virtual void   restoreState (TDEConfig *);

    ConfigPageInfo createConfigurationPage();

// Interface

    bool connectI   (Interface *);
    bool disconnectI(Interface *);

// IDisplayCfg

RECEIVERS:
    bool  setDisplayColors(const TQColor &activeColor, const TQColor &inactiveColor, const TQColor &bkgnd);
    bool  setDisplayFont (const TQFont &f);

ANSWERS:
    const TQColor   &getDisplayActiveColor()   const { return m_colorActiveText; }
    const TQColor   &getDisplayInactiveColor() const { return m_colorInactiveText; }
    const TQColor   &getDisplayBkgndColor()    const { return m_colorButton; }
    const TQFont    &getDisplayFont()          const { return m_font; }

// IRadioDeviceClient
RECEIVERS:
    bool noticePowerChanged   (bool on, const IRadioDevice *sender = NULL);
    bool noticeStationChanged (const RadioStation &, const IRadioDevice *sender = NULL);
    bool noticeDescriptionChanged (const TQString &, const IRadioDevice *sender = NULL);
    bool noticeCurrentSoundStreamIDChanged(SoundStreamID /*id*/, const IRadioDevice */*sender*/) { return false; }

// ISoundStreamClient
RECEIVERS:
    void noticeConnectedI (ISoundStreamServer *s, bool pointer_valid);

    bool noticeSignalQualityChanged(SoundStreamID id, float q);
    bool noticeStereoChanged(SoundStreamID id, bool  s);

// IFrequencyRadioClient
RECEIVERS:
    bool noticeFrequencyChanged(float f, const RadioStation *s);
    bool noticeMinMaxFrequencyChanged(float min, float max);
    bool noticeDeviceMinMaxFrequencyChanged(float min, float max);
    bool noticeScanStepChanged(float s);

// own stuff ;)

public:

    void reparent (TQWidget *parent, WFlags f, const TQPoint &p, bool showIt = FALSE);

protected:

    void drawContents(TQPainter *p);

protected:

    TQColor  m_colorActiveText, m_colorInactiveText, m_colorButton;
    TQFont   m_font;

    bool  m_power;
    bool  m_valid;
    float m_frequency;
    float m_quality;
    bool  m_stereo;
};

#endif