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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
|
/***************************************************************************
radiodevice_interfaces.h - description
-------------------
begin : Fre Apr 18 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: *
* *
* IRadioDevice(Client) *
* IRadioSound(Client) *
* ISeekRadio(Client) *
* IFrequencyRadio(Client) *
* IInternetRadio(Client) *
* *
***************************************************************************/
#ifndef KRADIO_RADIODEVICE_INTERFACES_H
#define KRADIO_RADIODEVICE_INTERFACES_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "soundstreamid.h"
#include "interfaces.h"
class RadioStation;
class KURL;
INTERFACE(IRadioDevice, IRadioDeviceClient)
{
public:
IF_CON_DESTRUCTOR(IRadioDevice, -1)
RECEIVERS:
IF_RECEIVER( setPower(bool on) )
IF_RECEIVER( powerOn() )
IF_RECEIVER( powerOff() )
IF_RECEIVER( activateStation(const RadioStation &rs) )
SENDERS:
IF_SENDER ( notifyPowerChanged(bool on) )
IF_SENDER ( notifyStationChanged (const RadioStation &) )
IF_SENDER ( notifyDescriptionChanged (const TQString &) )
IF_SENDER ( notifyCurrentSoundStreamIDChanged(SoundStreamID id))
ANSWERS:
IF_ANSWER ( bool isPowerOn() const );
IF_ANSWER ( bool isPowerOff() const );
IF_ANSWER ( const RadioStation & getCurrentStation() const );
IF_ANSWER ( const TQString & getDescription() const );
IF_ANSWER ( SoundStreamID getCurrentSoundStreamID() const );
};
INTERFACE(IRadioDeviceClient, IRadioDevice)
{
public :
IF_CON_DESTRUCTOR(IRadioDeviceClient, 1);
IRadioDeviceClient(int _maxConnections) : IRadioDeviceClient::BaseClass(_maxConnections) {}
SENDERS:
IF_SENDER ( sendPower(bool on) )
IF_SENDER ( sendPowerOn() )
IF_SENDER ( sendPowerOff() )
IF_SENDER ( sendActivateStation (const RadioStation &rs) )
RECEIVERS:
IF_RECEIVER( noticePowerChanged (bool on, const IRadioDevice *sender = NULL) )
IF_RECEIVER( noticeStationChanged (const RadioStation &, const IRadioDevice *sender = NULL) )
IF_RECEIVER( noticeDescriptionChanged (const TQString &, const IRadioDevice *sender = NULL) )
IF_RECEIVER( noticeCurrentSoundStreamIDChanged(SoundStreamID id, const IRadioDevice *sender = NULL))
QUERIES:
IF_QUERY ( bool queryIsPowerOn() )
IF_QUERY ( bool queryIsPowerOff() )
IF_QUERY ( const RadioStation & queryCurrentStation() )
IF_QUERY ( const TQString & queryDescription() )
IF_QUERY ( SoundStreamID queryCurrentSoundStreamID() )
RECEIVERS:
virtual void noticeConnectedI (cmplInterface *, bool pointer_valid);
virtual void noticeDisconnectedI (cmplInterface *, bool pointer_valid);
};
/////////////////////////////////////////////////////////////////////////////
// deprecated, use IRadioSoundStreamClient
/*
INTERFACE(IRadioSound, IRadioSoundClient)
{
public :
IF_CON_DESTRUCTOR(IRadioSound, -1)
RECEIVERS:
IF_RECEIVER( setVolume (float v) )
IF_RECEIVER( setTreble (float v) )
IF_RECEIVER( setBass (float v) )
IF_RECEIVER( setBalance (float v) )
IF_RECEIVER( mute (bool mute) )
IF_RECEIVER( unmute (bool unmute) )
IF_RECEIVER( setSignalMinQuality(float q) )
IF_RECEIVER( setStereo(bool s) )
SENDERS:
IF_SENDER ( notifyVolumeChanged(float v) )
IF_SENDER ( notifyTrebleChanged(float v) )
IF_SENDER ( notifyBassChanged(float v) )
IF_SENDER ( notifyBalanceChanged(float v) )
IF_SENDER ( notifyMuted(bool m) )
IF_SENDER ( notifySignalQualityChanged(float q) )
IF_SENDER ( notifySignalQualityBoolChanged(bool good) )
IF_SENDER ( notifySignalMinQualityChanged(float q) )
IF_SENDER ( notifyStereoChanged(bool s) )
ANSWERS:
IF_ANSWER ( float getVolume() const )
IF_ANSWER ( float getTreble() const )
IF_ANSWER ( float getBass () const )
IF_ANSWER ( float getBalance () const )
IF_ANSWER ( bool isMuted() const )
IF_ANSWER ( float getSignalQuality() const )
IF_ANSWER ( float getSignalMinQuality() const )
IF_ANSWER ( bool hasGoodQuality() const )
IF_ANSWER ( bool isStereo() const )
};
INTERFACE(IRadioSoundClient, IRadioSound)
{
public :
IF_CON_DESTRUCTOR(IRadioSoundClient, 1)
SENDERS:
IF_SENDER ( sendVolume (float v) )
IF_SENDER ( sendTreble (float v) )
IF_SENDER ( sendBass (float v) )
IF_SENDER ( sendBalance (float v) )
IF_SENDER ( sendMute (bool mute = true) )
IF_SENDER ( sendUnmute (bool unmute = true) )
IF_SENDER ( sendSignalMinQuality (float q) )
IF_SENDER ( sendStereo(bool s) )
RECEIVERS:
IF_RECEIVER( noticeVolumeChanged(float v) )
IF_RECEIVER( noticeTrebleChanged(float v) )
IF_RECEIVER( noticeBassChanged(float v) )
IF_RECEIVER( noticeBalanceChanged(float v) )
IF_RECEIVER( noticeSignalQualityChanged(float q) )
IF_RECEIVER( noticeSignalQualityChanged(bool good) )
IF_RECEIVER( noticeSignalMinQualityChanged(float q) )
IF_RECEIVER( noticeStereoChanged(bool s) )
IF_RECEIVER( noticeMuted(bool m) )
QUERIES:
IF_QUERY ( float queryVolume() )
IF_QUERY ( float queryTreble() )
IF_QUERY ( float queryBass() )
IF_QUERY ( float queryBalance () )
IF_QUERY ( float querySignalQuality() )
IF_QUERY ( float querySignalMinQuality() )
IF_QUERY ( bool queryHasGoodQuality() )
IF_QUERY ( bool queryIsStereo() )
IF_QUERY ( bool queryIsMuted() )
RECEIVERS:
virtual void noticeConnectedI (cmplInterface *, bool pointer_valid);
virtual void noticeDisconnectedI (cmplInterface *, bool pointer_valid);
};
*/
/////////////////////////////////////////////////////////////////////////////
INTERFACE(ISeekRadio, ISeekRadioClient)
{
friend class SeekHelper;
public :
IF_CON_DESTRUCTOR(ISeekRadio, -1)
RECEIVERS:
IF_RECEIVER( toBeginning() )
IF_RECEIVER( toEnd() )
IF_RECEIVER( startSeek (bool up) )
IF_RECEIVER( startSeekUp() )
IF_RECEIVER( startSeekDown() )
IF_RECEIVER( stopSeek() )
SENDERS:
IF_SENDER ( notifySeekStarted (bool up) )
IF_SENDER ( notifySeekStopped () )
IF_SENDER ( notifySeekFinished (const RadioStation &s, bool goodQuality) )
IF_SENDER ( notifyProgress (float f) )
ANSWERS:
IF_ANSWER ( bool isSeekRunning() const )
IF_ANSWER ( bool isSeekUpRunning() const )
IF_ANSWER ( bool isSeekDownRunning() const )
IF_ANSWER ( float getProgress () const )
};
INTERFACE(ISeekRadioClient, ISeekRadio)
{
public :
IF_CON_DESTRUCTOR(ISeekRadioClient, 1)
SENDERS:
IF_SENDER ( sendToBeginning() )
IF_SENDER ( sendToEnd() )
IF_SENDER ( sendStartSeek (bool up) )
IF_SENDER ( sendStartSeekUp() )
IF_SENDER ( sendStartSeekDown() )
IF_SENDER ( sendStopSeek() )
RECEIVERS:
IF_RECEIVER( noticeSeekStarted (bool up) )
IF_RECEIVER( noticeSeekStopped () )
IF_RECEIVER( noticeSeekFinished (const RadioStation &s, bool goodQuality) )
IF_RECEIVER( noticeProgress (float f) )
QUERIES:
IF_QUERY ( bool queryIsSeekRunning() )
IF_QUERY ( bool queryIsSeekUpRunning() )
IF_QUERY ( bool queryIsSeekDownRunning() )
IF_QUERY ( float queryProgress () )
RECEIVERS:
virtual void noticeConnectedI (cmplInterface *, bool pointer_valid);
virtual void noticeDisconnectedI (cmplInterface *, bool pointer_valid);
};
/////////////////////////////////////////////////////////////////////////////
INTERFACE(IFrequencyRadio, IFrequencyRadioClient)
{
public :
IF_CON_DESTRUCTOR(IFrequencyRadio, -1)
RECEIVERS:
IF_RECEIVER( setFrequency(float f) )
IF_RECEIVER( setMinFrequency(float mf) )
IF_RECEIVER( setMaxFrequency(float mf) )
IF_RECEIVER( setScanStep(float s) )
SENDERS:
IF_SENDER ( notifyFrequencyChanged(float f, const RadioStation *s) )
IF_SENDER ( notifyMinMaxFrequencyChanged(float min, float max) )
IF_SENDER ( notifyDeviceMinMaxFrequencyChanged(float min, float max) )
IF_SENDER ( notifyScanStepChanged(float s) )
ANSWERS:
IF_ANSWER ( float getFrequency() const )
IF_ANSWER ( float getMinFrequency() const )
IF_ANSWER ( float getMinDeviceFrequency() const )
IF_ANSWER ( float getMaxFrequency() const )
IF_ANSWER ( float getMaxDeviceFrequency() const )
IF_ANSWER ( float getScanStep() const )
};
INTERFACE(IFrequencyRadioClient, IFrequencyRadio)
{
public :
IF_CON_DESTRUCTOR(IFrequencyRadioClient, 1)
SENDERS:
IF_SENDER ( sendFrequency(float f) )
IF_SENDER ( sendMinFrequency(float mf) )
IF_SENDER ( sendMaxFrequency(float mf) )
IF_SENDER ( sendScanStep(float s) )
RECEIVERS:
IF_RECEIVER( noticeFrequencyChanged(float f, const RadioStation *s) )
IF_RECEIVER( noticeMinMaxFrequencyChanged(float min, float max) )
IF_RECEIVER( noticeDeviceMinMaxFrequencyChanged(float min, float max) )
IF_RECEIVER( noticeScanStepChanged(float s) )
QUERIES:
IF_QUERY ( float queryFrequency() )
IF_QUERY ( float queryMinFrequency() )
IF_QUERY ( float queryMinDeviceFrequency() )
IF_QUERY ( float queryMaxFrequency() )
IF_QUERY ( float queryMaxDeviceFrequency() )
IF_QUERY ( float queryScanStep() )
RECEIVERS:
virtual void noticeConnectedI (cmplInterface *, bool pointer_valid);
virtual void noticeDisconnectedI (cmplInterface *, bool pointer_valid);
};
/////////////////////////////////////////////////////////////////////////////
INTERFACE(IInternetRadio, IInternetRadioClient)
{
public :
IF_CON_DESTRUCTOR(IInternetRadio, -1)
RECEIVERS:
IF_RECEIVER( setURL(const KURL &url) )
SENDERS:
IF_SENDER ( notifyURLChanged(const KURL &u) )
ANSWERS:
IF_ANSWER ( const KURL & getURL() const )
};
INTERFACE(IInternetRadioClient, IInternetRadio)
{
public :
IF_CON_DESTRUCTOR(IInternetRadioClient, 1)
SENDERS:
IF_SENDER ( sendURL(const KURL &url) )
RECEIVERS:
IF_RECEIVER( noticeURLChanged(const KURL &url) )
QUERIES:
IF_QUERY ( const KURL &queryURL() )
RECEIVERS:
virtual void noticeConnectedI (cmplInterface *, bool pointer_valid);
virtual void noticeDisconnectedI (cmplInterface *, bool pointer_valid);
};
#endif
|