summaryrefslogtreecommitdiffstats
path: root/src/include/radio_interfaces.h
blob: 009df8cb2206b979ab5ef8a9462116d77287488c (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
110
111
112
113
114
115
116
117
/***************************************************************************
                          radio_interfaces.h  -  description
                             -------------------
    begin                : Mon Mär 10 2003
    copyright            : (C) 2003 by Martin Witte
    email                : witte@kawo1.rwth-aachen.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   Interfaces in this header:                                            *
 *                                                                         *
 *   IRadio(Client)                                                        *
 *                                                                         *
 ***************************************************************************/

#ifndef KRADIO_RADIO_INTERFACES_H
#define KRADIO_RADIO_INTERFACES_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "interfaces.h"
#include "soundstreamid.h"

class RadioStation;
class StationList;


///////////////////////////////////////////////////////////////////////


INTERFACE(IRadio, IRadioClient)
{
public :
    IF_CON_DESTRUCTOR(IRadio, -1)

RECEIVERS:
    IF_RECEIVER(  powerOn()                                      )
    IF_RECEIVER(  powerOff()                                     )
    IF_RECEIVER(  activateStation(const RadioStation &rs)        )
    IF_RECEIVER(  activateStation(int index)                     )
    IF_RECEIVER(  setStations(const StationList &sl)             )
    IF_RECEIVER(  setPresetFile(const TQString &f)                )

SENDERS:
    IF_SENDER  (  notifyPowerChanged(bool on)                          )
    IF_SENDER  (  notifyStationChanged (const RadioStation &, int idx) )
    IF_SENDER  (  notifyStationsChanged(const StationList &sl)         )
    IF_SENDER  (  notifyPresetFileChanged(const TQString &sl)           )
    IF_SENDER  (  notifyCurrentSoundStreamIDChanged(SoundStreamID id)  )

ANSWERS:
    IF_ANSWER  (  bool                   isPowerOn() const         )
    IF_ANSWER  (  bool                   isPowerOff() const        )
    IF_ANSWER  (  const RadioStation  &  getCurrentStation() const )
    IF_ANSWER  (  int                    getStationIdx(const RadioStation &rs) const )
    IF_ANSWER  (  int                    getCurrentStationIdx() const )
    IF_ANSWER  (  const StationList   &  getStations() const       )
    IF_ANSWER  (  const TQString       &  getPresetFile() const     );

    IF_ANSWER  (  SoundStreamID          getCurrentSoundStreamID() const  );

};


INTERFACE(IRadioClient, IRadio)
{
friend class IRadio;

public :
    IF_CON_DESTRUCTOR(IRadioClient, 1)

SENDERS:
    IF_SENDER  (  sendPowerOn()                                      )
    IF_SENDER  (  sendPowerOff()                                     )
    IF_SENDER  (  sendActivateStation(const RadioStation &rs)        )
    IF_SENDER  (  sendActivateStation(int index)                     )
    IF_SENDER  (  sendStations(const StationList &sl)                )
    IF_SENDER  (  sendPresetFile(const TQString &f)                   )

RECEIVERS:
    IF_RECEIVER(  noticePowerChanged(bool on)                        )
    IF_RECEIVER(  noticeStationChanged (const RadioStation &, int idx) )
    IF_RECEIVER(  noticeStationsChanged(const StationList &sl)       )
    IF_RECEIVER(  noticePresetFileChanged(const TQString &f)          )
    IF_RECEIVER(  noticeCurrentSoundStreamIDChanged(SoundStreamID id))

QUERIES:
    IF_QUERY   (  bool                   queryIsPowerOn()          )
    IF_QUERY   (  bool                   queryIsPowerOff()         )
    IF_QUERY   (  const RadioStation  &  queryCurrentStation()     )
    IF_QUERY   (  int                    queryStationIdx(const RadioStation &rs)  )
    IF_QUERY   (  int                    queryCurrentStationIdx()  )
    IF_QUERY   (  const StationList &    queryStations()           )
    IF_QUERY   (  const TQString     &    queryPresetFile()         )

    IF_QUERY   (  SoundStreamID          queryCurrentSoundStreamID() );

RECEIVERS:
    virtual void noticeConnectedI    (cmplInterface *, bool pointer_valid);
    virtual void noticeDisconnectedI (cmplInterface *, bool pointer_valid);
};



#endif