summaryrefslogtreecommitdiffstats
path: root/kradio3/src/include/soundstreamclient_interfaces.h
blob: 310d42ada0b8b4a020f378d1da56f8dff1f92876 (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
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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
/***************************************************************************
                      sounddevice_interfaces.h  -  description
                             -------------------
    begin                : Sun Mar 21 2004
    copyright            : (C) 2004 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:                                            *
 *                                                                         *
 *   ISoundDevice(Client)                                                  *
 *                                                                         *
 ***************************************************************************/

#ifndef KRADIO_SOUNDSTREAMCLIENT_INTERFACES_H
#define KRADIO_SOUNDSTREAMCLIENT_INTERFACES_H

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

#include <kconfig.h>
#include <tqmap.h>

#include "interfaces.h"
#include "soundformat.h"
#include "soundstreamid.h"
#include "sound_metadata.h"


#define CALL_SNDSTR_SERVER(name, param, call) \
    inline int name param const { \
        return  iConnections.count() ? iConnections.getFirst()->name call : 0; \
    }


#define SIZE_T_DONT_CARE ((size_t)(-1))

class RadioStation;

INTERFACE(ISoundStreamServer, ISoundStreamClient)
{
friend class ISoundStreamClient;
public:
    IF_CON_DESTRUCTOR(ISoundStreamServer, -1)

    virtual void noticeConnectedI(cmplInterface *i, bool valid);
    virtual void noticeDisconnectedI(cmplInterface *i, bool valid);

    virtual TQMap<TQString, ISoundStreamClient *> getPlaybackClients() const;
    virtual TQMap<TQString, TQString>              getPlaybackClientDescriptions() const;
    virtual TQMap<TQString, ISoundStreamClient *> getCaptureClients() const;
    virtual TQMap<TQString, TQString>              getCaptureClientDescriptions() const;
    virtual ISoundStreamClient                 *getSoundStreamClientWithID(const TQString &id) const;

ANSWERS:
    virtual TQPtrList<ISoundStreamClient>   getPlaybackMixers() const;
    virtual TQPtrList<ISoundStreamClient>   getCaptureMixers() const;


SENDERS:
    IF_SENDER_FINE  (  notifyPlaybackChannelsChanged, (const TQString &/*client_id*/, const TQStringList &)                     )
    IF_SENDER_FINE  (  notifyCaptureChannelsChanged, (const TQString &/*client_id*/, const TQStringList &)                      )

    IF_SENDER_FINE  (  sendPlaybackVolume, (SoundStreamID /*id*/,  float /*volume*/)                  )
    IF_SENDER_FINE  (  sendCaptureVolume, (SoundStreamID /*id*/,   float /*volume*/)                  )
    IF_SENDER_FINE  (  queryPlaybackVolume, (SoundStreamID /*id*/, float &/*volume*/)                 )
    IF_SENDER_FINE  (  queryCaptureVolume, (SoundStreamID /*id*/,  float &/*volume*/)                 )
    IF_SENDER_FINE  (  notifyPlaybackVolumeChanged, (SoundStreamID /*id*/, float /*volume*/)          )
    IF_SENDER_FINE  (  notifyCaptureVolumeChanged, (SoundStreamID /*id*/, float /*volume*/)           )

    IF_SENDER_FINE  (  notifyTrebleChanged, (SoundStreamID /*id*/, float /*v*/)                       )
    IF_SENDER_FINE  (  notifyBassChanged, (SoundStreamID /*id*/, float /*v*/)                         )
    IF_SENDER_FINE  (  notifyBalanceChanged, (SoundStreamID /*id*/, float /*v*/)                      )
    IF_SENDER_FINE  (  notifyMuted, (SoundStreamID /*id*/, bool /*m*/)                                )
    IF_SENDER_FINE  (  notifySignalQualityChanged, (SoundStreamID /*id*/, float /*q*/)                )
    IF_SENDER_FINE  (  notifySignalQualityBoolChanged, (SoundStreamID /*id*/, bool /*good*/)              )
    IF_SENDER_FINE  (  notifySignalMinQualityChanged, (SoundStreamID /*id*/, float /*q*/)             )
    IF_SENDER_FINE  (  notifyStereoChanged, (SoundStreamID /*id*/, bool  /*s*/)                       )

    IF_SENDER_FINE  (  sendTreble,   (SoundStreamID /*id*/, float /*v*/)                              )
    IF_SENDER_FINE  (  sendBass,     (SoundStreamID /*id*/, float /*v*/)                              )
    IF_SENDER_FINE  (  sendBalance,  (SoundStreamID /*id*/, float /*v*/)                              )
    IF_SENDER_FINE  (  sendMute,  (SoundStreamID /*id*/, bool mute = true)                            )
    IF_SENDER_FINE  (  sendUnmute,  (SoundStreamID /*id*/, bool unmute = true)                        )
    IF_SENDER_FINE  (  sendSignalMinQuality,  (SoundStreamID /*id*/, float /*q*/)                     )
    IF_SENDER_FINE  (  sendStereo, (SoundStreamID /*id*/, bool /*s*/)                                 )

    IF_SENDER_FINE  (  queryTreble, (SoundStreamID /*id*/, float &)                               )
    IF_SENDER_FINE  (  queryBass, (SoundStreamID /*id*/, float &)                                 )
    IF_SENDER_FINE  (  queryBalance, (SoundStreamID /*id*/, float &)                              )
    IF_SENDER_FINE  (  querySignalQuality, (SoundStreamID /*id*/, float &)                        )
    IF_SENDER_FINE  (  querySignalMinQuality, (SoundStreamID /*id*/, float &)                     )
    IF_SENDER_FINE  (  queryHasGoodQuality, (SoundStreamID /*id*/, bool &)                        )
    IF_SENDER_FINE  (  queryIsStereo, (SoundStreamID /*id*/, bool &)                              )
    IF_SENDER_FINE  (  queryIsMuted, (SoundStreamID /*id*/, bool &)                               )


    // sendPreparePlayback/sendPrepareCapture don't make sense for multiple tqreceivers
    IF_SENDER_FINE  (  sendReleasePlayback, (SoundStreamID id)                                 )
    IF_SENDER_FINE  (  sendReleaseCapture,  (SoundStreamID id)                                 )

    IF_SENDER_FINE  (  sendStartPlayback, (SoundStreamID id)                                   )
    IF_SENDER_FINE  (  sendPausePlayback, (SoundStreamID id)                                   )
    IF_SENDER_FINE  (  sendStopPlayback, (SoundStreamID id)                                    )
    IF_SENDER_FINE  (  queryIsPlaybackRunning, (SoundStreamID id, bool &)                      )

//    IF_SENDER_FINE  (  sendStartCapture, (SoundStreamID id)                                    )
    IF_SENDER_FINE  (  sendStartCaptureWithFormat, (SoundStreamID id,
                                   const SoundFormat &proposed_format,
                                   SoundFormat       &real_format,
                                   bool force_format = false)                                   )
    IF_SENDER_FINE  (  sendStopCapture, (SoundStreamID id)                                      )
    IF_SENDER_FINE  (  queryIsCaptureRunning, (SoundStreamID id, bool &running, SoundFormat &sf))

    // we need extra recording, in order to distinguish between plain capturing
    // (making sound data available to kradio) and writing a stream to disk  or sth similar
    IF_SENDER_FINE  (  sendStartRecording, (SoundStreamID id)                                  )
    IF_SENDER_FINE  (  sendStartRecordingWithFormat, (SoundStreamID id,
                                   const SoundFormat &proposed_format,
                                   SoundFormat       &real_format)                                )
    IF_SENDER_FINE  (  sendStopRecording, (SoundStreamID id)                                      )
    IF_SENDER_FINE  (  queryIsRecordingRunning, (SoundStreamID id, bool &running, SoundFormat &sf))

    IF_SENDER_FINE  (  querySoundStreamDescription, (SoundStreamID id, TQString &descr)         )
    IF_SENDER_FINE  (  querySoundStreamRadioStation, (SoundStreamID id, const RadioStation *&rs))
    IF_SENDER_FINE  (  queryEnumerateSoundStreams, (TQMap<TQString, SoundStreamID> &) )

    IF_SENDER_FINE  (  notifySoundStreamCreated, (SoundStreamID id)                            )
    IF_SENDER_FINE  (  notifySoundStreamClosed, (SoundStreamID id)                             )
    IF_SENDER_FINE  (  notifySoundStreamRedirected, (SoundStreamID oldID, SoundStreamID newID)    )

    // e.g description or whatever changed
    IF_SENDER_FINE  (  notifySoundStreamChanged, (SoundStreamID id)                            )

    IF_SENDER_FINE  (  notifySoundStreamData, (SoundStreamID /*id*/, const SoundFormat &, const char */*data*/, size_t /*size*/, size_t &/*consumed_size*/, const SoundMetaData &/*md*/) )
    IF_SENDER_FINE  (  notifyReadyForPlaybackData, (SoundStreamID /*id*/, size_t /*size*/)           )
};


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

INTERFACE(ISoundStreamClient, ISoundStreamServer)
{
public:
    ISoundStreamClient();
    virtual ~ISoundStreamClient();

    cmplInterface *getSoundStreamServer() const { return m_Server; }


     virtual void noticeConnectedSoundClient(thisInterface *i, bool valid);
     virtual void noticeDisconnectedSoundClient(thisInterface *i, bool valid);

     virtual void noticeConnectedI(cmplInterface *i, bool valid);
     virtual void noticeDisconnectedI(cmplInterface *i, bool valid);

// some rarely implemented functions are not pure virtual for convenience

// direct playback / capture device functions

RECEIVERS:
    IF_RECEIVER_EMPTY( preparePlayback(SoundStreamID /*id*/, const TQString &/*channel*/, bool /*active_mode*/, bool /*start_immediately = false*/)   )
    IF_RECEIVER_EMPTY( prepareCapture(SoundStreamID /*id*/, const TQString &/*channel*/)                                                          )
    IF_RECEIVER_EMPTY( releasePlayback(SoundStreamID /*id*/)   )
    IF_RECEIVER_EMPTY( releaseCapture(SoundStreamID /*id*/)    )

ANSWERS:
    virtual bool supportsPlayback() const  { return false; }
    virtual bool supportsCapture()  const  { return false; }

    virtual const TQString &getSoundStreamClientID() const;
    virtual       TQString  getSoundStreamClientDescription() const { return TQString(); }

    virtual TQMap<TQString, ISoundStreamClient *> getPlaybackClients() const;
    virtual TQMap<TQString, TQString>              getPlaybackClientDescriptions() const;
    virtual TQMap<TQString, ISoundStreamClient *> getCaptureClients() const;
    virtual TQMap<TQString, TQString>              getCaptureClientDescriptions() const;
    virtual ISoundStreamClient                 *getSoundStreamClientWithID(const TQString &id) const;

// device mixer functions

TQUERIES:
    IF_TQUERY ( TQPtrList<ISoundStreamClient>   queryPlaybackMixers()     );
    IF_TQUERY ( TQPtrList<ISoundStreamClient>   queryCaptureMixers()      );


ANSWERS:
    virtual const TQStringList &getPlaybackChannels() const;
    virtual const TQStringList &getCaptureChannels()  const;

RECEIVERS:
    IF_RECEIVER_EMPTY(  noticePlaybackChannelsChanged(const TQString & /*client_id*/, const TQStringList &/*channels*/) );
    IF_RECEIVER_EMPTY(  noticeCaptureChannelsChanged (const TQString & /*client_id*/, const TQStringList &/*channels*/) );


RECEIVERS:
    IF_RECEIVER_EMPTY(  setPlaybackVolume(SoundStreamID /*id*/, float /*volume*/)                    )
    IF_RECEIVER_EMPTY(  setCaptureVolume(SoundStreamID /*id*/,  float /*volume*/)                    )
    IF_RECEIVER_EMPTY(  getPlaybackVolume(SoundStreamID /*id*/, float &/*volume*/) const             )
    IF_RECEIVER_EMPTY(  getCaptureVolume(SoundStreamID /*id*/,  float &/*volume*/) const             )
    IF_RECEIVER_EMPTY(  noticePlaybackVolumeChanged(SoundStreamID /*id*/, float /*volume*/)          )
    IF_RECEIVER_EMPTY(  noticeCaptureVolumeChanged(SoundStreamID /*id*/, float /*volume*/)           )

    IF_RECEIVER_EMPTY(  setTreble (SoundStreamID /*id*/, float /*v*/)                                )
    IF_RECEIVER_EMPTY(  setBass   (SoundStreamID /*id*/, float /*v*/)                                )
    IF_RECEIVER_EMPTY(  setBalance (SoundStreamID /*id*/, float /*v*/)                               )
    IF_RECEIVER_EMPTY(  mute (SoundStreamID /*id*/, bool /*mute*/)                                   )
    IF_RECEIVER_EMPTY(  unmute (SoundStreamID /*id*/, bool /*unmute*/)                               )
    IF_RECEIVER_EMPTY(  setSignalMinQuality(SoundStreamID /*id*/, float /*q*/)                       )
    IF_RECEIVER_EMPTY(  setStereo(SoundStreamID /*id*/, bool /*s*/)                                  )

    IF_RECEIVER_EMPTY(  noticeTrebleChanged(SoundStreamID /*id*/, float /*v*/)                       )
    IF_RECEIVER_EMPTY(  noticeBassChanged(SoundStreamID /*id*/, float /*v*/)                         )
    IF_RECEIVER_EMPTY(  noticeBalanceChanged(SoundStreamID /*id*/, float /*v*/)                      )
    IF_RECEIVER_EMPTY(  noticeSignalQualityChanged(SoundStreamID /*id*/, float /*q*/)                )
    IF_RECEIVER_EMPTY(  noticeSignalQualityChanged(SoundStreamID /*id*/, bool /*good*/)              )
    IF_RECEIVER_EMPTY(  noticeSignalMinQualityChanged(SoundStreamID /*id*/, float /*q*/)             )
    IF_RECEIVER_EMPTY(  noticeStereoChanged(SoundStreamID /*id*/, bool  /*s*/)                       )
    IF_RECEIVER_EMPTY(  noticeMuted(SoundStreamID /*id*/, bool /*m*/)                                )

    IF_RECEIVER_EMPTY(  getTreble (SoundStreamID /*id*/, float &/*v*/) const                         )
    IF_RECEIVER_EMPTY(  getBass   (SoundStreamID /*id*/, float &/*v*/) const                         )
    IF_RECEIVER_EMPTY(  getBalance(SoundStreamID /*id*/, float &/*v*/) const                         )
    IF_RECEIVER_EMPTY(  isMuted(SoundStreamID /*id*/, bool &/*m*/) const                             )
    IF_RECEIVER_EMPTY(  getSignalQuality(SoundStreamID /*id*/, float &/*q*/) const                   )
    IF_RECEIVER_EMPTY(  getSignalMinQuality(SoundStreamID /*id*/, float &/*q*/) const                )
    IF_RECEIVER_EMPTY(  hasGoodQuality(SoundStreamID /*id*/, bool &/*good*/) const                   )
    IF_RECEIVER_EMPTY(  isStereo(SoundStreamID /*id*/, bool &/*s*/) const                            )

// generic stream handling (broadcasts)

RECEIVERS:
    IF_RECEIVER_EMPTY(  startPlayback(SoundStreamID /*id*/)                                           )
    IF_RECEIVER_EMPTY(  pausePlayback(SoundStreamID /*id*/)                                           )
    IF_RECEIVER_EMPTY(  stopPlayback(SoundStreamID /*id*/)                                            )
    IF_RECEIVER_EMPTY(  isPlaybackRunning(SoundStreamID /*id*/, bool &) const                         )

//    IF_RECEIVER_EMPTY(  startCapture(SoundStreamID /*id*/)                                            )
    IF_RECEIVER_EMPTY(  startCaptureWithFormat(SoundStreamID /*id*/,
                                     const SoundFormat &/*proposed_format*/,
                                     SoundFormat       &/*real_format*/,
                                     bool               /*force_format*/ = false)                       )
    IF_RECEIVER_EMPTY(  stopCapture(SoundStreamID /*id*/)                                               )
    IF_RECEIVER_EMPTY(  isCaptureRunning(SoundStreamID /*id*/, bool &/*running*/, SoundFormat &/*sf*/) const    )

    IF_RECEIVER_EMPTY(  startRecording(SoundStreamID /*id*/)                                            )
    IF_RECEIVER_EMPTY(  startRecordingWithFormat(SoundStreamID /*id*/,
                                     const SoundFormat &/*proposed_format*/,
                                     SoundFormat       &/*real_format*/)                                )
    IF_RECEIVER_EMPTY(  stopRecording(SoundStreamID /*id*/)                                             )
    IF_RECEIVER_EMPTY(  isRecordingRunning(SoundStreamID /*id*/, bool &/*running*/, SoundFormat &/*sf*/) const  )

    IF_RECEIVER_EMPTY(  getSoundStreamDescription(SoundStreamID /*id*/, TQString &/*descr*/) const     )
    IF_RECEIVER_EMPTY(  getSoundStreamRadioStation(SoundStreamID /*id*/, const RadioStation *&/*rs*/) const  )

    IF_RECEIVER_EMPTY(  enumerateSoundStreams(TQMap<TQString, SoundStreamID> &/*list*/) const                   )

    IF_RECEIVER_EMPTY(  noticeSoundStreamCreated(SoundStreamID /*id*/)                                )
    IF_RECEIVER_EMPTY(  noticeSoundStreamClosed(SoundStreamID /*id*/)                                 )
    IF_RECEIVER_EMPTY(  noticeSoundStreamRedirected(SoundStreamID /*oldID*/, SoundStreamID /*newID*/)    )

    // e.g description or whatever changed
    IF_RECEIVER_EMPTY(  noticeSoundStreamChanged(SoundStreamID /*id*/)                                    )

    IF_RECEIVER_EMPTY(  noticeSoundStreamData(SoundStreamID /*id*/, const SoundFormat &, const char */*data*/, size_t /*size*/, size_t &/*consumed_size*/, const SoundMetaData &/*md*/))
    IF_RECEIVER_EMPTY(  noticeReadyForPlaybackData(SoundStreamID /*id*/, size_t /*size*/)           )

SENDERS:
    CALL_SNDSTR_SERVER  (  notifyPlaybackChannelsChanged, (const TQString &client_id, const TQStringList &map), (client_id, map)                     )
    CALL_SNDSTR_SERVER  (  notifyCaptureChannelsChanged,  (const TQString &client_id, const TQStringList &map), (client_id, map)                     )

    CALL_SNDSTR_SERVER  (  sendPlaybackVolume, (SoundStreamID id,  float volume), (id, volume)                  )
    CALL_SNDSTR_SERVER  (  sendCaptureVolume, (SoundStreamID id,   float volume), (id, volume)                  )
    CALL_SNDSTR_SERVER  (  queryPlaybackVolume, (SoundStreamID id, float &volume), (id, volume)                 )
    CALL_SNDSTR_SERVER  (  queryCaptureVolume, (SoundStreamID id,  float &volume), (id, volume)                 )
    CALL_SNDSTR_SERVER  (  notifyPlaybackVolumeChanged, (SoundStreamID id, float volume), (id, volume)          )
    CALL_SNDSTR_SERVER  (  notifyCaptureVolumeChanged, (SoundStreamID id, float volume), (id, volume)           )

    CALL_SNDSTR_SERVER  (  notifyTrebleChanged, (SoundStreamID id, float v), (id, v)                       )
    CALL_SNDSTR_SERVER  (  notifyBassChanged, (SoundStreamID id, float v), (id, v)                         )
    CALL_SNDSTR_SERVER  (  notifyBalanceChanged, (SoundStreamID id, float v), (id, v)                      )
    CALL_SNDSTR_SERVER  (  notifyMuted, (SoundStreamID id, bool m), (id, m)                                )
    CALL_SNDSTR_SERVER  (  notifySignalQualityChanged, (SoundStreamID id, float q), (id, q)                )
    CALL_SNDSTR_SERVER  (  notifySignalQualityBoolChanged, (SoundStreamID id, bool good), (id, good)           )
    CALL_SNDSTR_SERVER  (  notifySignalMinQualityChanged, (SoundStreamID id, float q), (id, q)             )
    CALL_SNDSTR_SERVER  (  notifyStereoChanged, (SoundStreamID id, bool  s), (id, s)                       )

    CALL_SNDSTR_SERVER  (  sendTreble  , (SoundStreamID id, float v), (id, v)                              )
    CALL_SNDSTR_SERVER  (  sendBass    , (SoundStreamID id, float v), (id, v)                              )
    CALL_SNDSTR_SERVER  (  sendBalance , (SoundStreamID id, float v), (id, v)                              )
    CALL_SNDSTR_SERVER  (  sendMute , (SoundStreamID id, bool mute = true), (id, mute)                            )
    CALL_SNDSTR_SERVER  (  sendUnmute , (SoundStreamID id, bool unmute = true), (id, unmute)                      )
    CALL_SNDSTR_SERVER  (  sendSignalMinQuality , (SoundStreamID id, float q), (id, q)                     )
    CALL_SNDSTR_SERVER  (  sendStereo, (SoundStreamID id, bool s), (id, s)                                 )

    CALL_SNDSTR_SERVER  (  queryTreble, (SoundStreamID id, float &v), (id, v)                               )
    CALL_SNDSTR_SERVER  (  queryBass, (SoundStreamID id, float &v), (id, v)                                 )
    CALL_SNDSTR_SERVER  (  queryBalance, (SoundStreamID id, float &v), (id, v)                              )
    CALL_SNDSTR_SERVER  (  querySignalQuality, (SoundStreamID id, float &v), (id, v)                        )
    CALL_SNDSTR_SERVER  (  querySignalMinQuality, (SoundStreamID id, float &v), (id, v)                     )
    CALL_SNDSTR_SERVER  (  queryHasGoodQuality, (SoundStreamID id, bool &v), (id, v)                        )
    CALL_SNDSTR_SERVER  (  queryIsStereo, (SoundStreamID id, bool &v), (id, v)                              )
    CALL_SNDSTR_SERVER  (  queryIsMuted, (SoundStreamID id, bool &v), (id, v)                               )


    // sendPreparePlayback/sendPrepareCapture don't make sense for multiple tqreceivers
    CALL_SNDSTR_SERVER  (  sendReleasePlayback, (SoundStreamID id), (id)                                    )
    CALL_SNDSTR_SERVER  (  sendReleaseCapture,  (SoundStreamID id), (id)                                    )

    CALL_SNDSTR_SERVER  (  sendStartPlayback, (SoundStreamID id), (id)                                      )
    CALL_SNDSTR_SERVER  (  sendPausePlayback, (SoundStreamID id), (id)                                      )
    CALL_SNDSTR_SERVER  (  sendStopPlayback, (SoundStreamID id), (id)                                       )
    CALL_SNDSTR_SERVER  (  queryIsPlaybackRunning, (SoundStreamID id, bool &b), (id, b)                     )

//    CALL_SNDSTR_SERVER  (  sendStartCapture, (SoundStreamID id), (id)                                       )
    CALL_SNDSTR_SERVER  (  sendStartCaptureWithFormat, (SoundStreamID id,
                                   const SoundFormat &proposed_format,
                                   SoundFormat       &real_format,
                                   bool               force_format = false), (id, proposed_format, real_format, force_format)   )
    CALL_SNDSTR_SERVER  (  sendStopCapture, (SoundStreamID id), (id)                                                            )
    CALL_SNDSTR_SERVER  (  queryIsCaptureRunning, (SoundStreamID id, bool &b, SoundFormat &sf), (id, b, sf)                     )

    CALL_SNDSTR_SERVER  (  sendStartRecording, (SoundStreamID id), (id)                                                         )
    CALL_SNDSTR_SERVER  (  sendStartRecordingWithFormat, (SoundStreamID id,
                                   const SoundFormat &proposed_format,
                                   SoundFormat       &real_format), (id, proposed_format, real_format)   )
    CALL_SNDSTR_SERVER  (  sendStopRecording, (SoundStreamID id), (id)                                     )
    CALL_SNDSTR_SERVER  (  queryIsRecordingRunning, (SoundStreamID id, bool &b, SoundFormat &sf), (id, b, sf)                     )

    CALL_SNDSTR_SERVER  (  querySoundStreamDescription, (SoundStreamID id, TQString &descr), (id, descr)  )
    CALL_SNDSTR_SERVER  (  querySoundStreamRadioStation,(SoundStreamID id, const RadioStation *&rs), (id, rs)  )

    CALL_SNDSTR_SERVER  (  queryEnumerateSoundStreams, (TQMap<TQString, SoundStreamID> &list), (list)              )

    CALL_SNDSTR_SERVER  (  notifySoundStreamCreated, (SoundStreamID id), (id)                            )
    CALL_SNDSTR_SERVER  (  notifySoundStreamClosed, (SoundStreamID id), (id)                             )
    CALL_SNDSTR_SERVER  (  notifySoundStreamRedirected, (SoundStreamID oldID, SoundStreamID newID), (oldID, newID)    )

    // e.g description or whatever changed
    CALL_SNDSTR_SERVER  (  notifySoundStreamChanged, (SoundStreamID id), (id)                             )

    CALL_SNDSTR_SERVER  (  notifySoundStreamData, (SoundStreamID id, const SoundFormat &f, const char *data, size_t size, size_t consumed_size, const SoundMetaData &md), (id, f, data, size, consumed_size, md) )
    CALL_SNDSTR_SERVER  (  notifyReadyForPlaybackData, (SoundStreamID id, size_t size), (id, size)           )

protected:

    SoundStreamID  createNewSoundStream(bool notify = true) const;
    SoundStreamID  createNewSoundStream(SoundStreamID old_id, bool notify = true) const;
    void           closeSoundStream(SoundStreamID id, bool notify = true);

    static TQString createNewSoundStreamClientID();
    void           setSoundStreamClientID(const TQString &s);

    TQString        m_SoundStreamClientID;

    cmplInterface  *m_Server;
};


#endif