/*************************************************************************** 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 #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)) TQUERIES: IF_TQUERY ( bool queryIsPowerOn() ) IF_TQUERY ( bool queryIsPowerOff() ) IF_TQUERY ( const RadioStation & queryCurrentStation() ) IF_TQUERY ( const TQString & queryDescription() ) IF_TQUERY ( 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) ) TQUERIES: IF_TQUERY ( float queryVolume() ) IF_TQUERY ( float queryTreble() ) IF_TQUERY ( float queryBass() ) IF_TQUERY ( float queryBalance () ) IF_TQUERY ( float querySignalQuality() ) IF_TQUERY ( float querySignalMinQuality() ) IF_TQUERY ( bool queryHasGoodQuality() ) IF_TQUERY ( bool queryIsStereo() ) IF_TQUERY ( 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) ) TQUERIES: IF_TQUERY ( bool queryIsSeekRunning() ) IF_TQUERY ( bool queryIsSeekUpRunning() ) IF_TQUERY ( bool queryIsSeekDownRunning() ) IF_TQUERY ( 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) ) TQUERIES: IF_TQUERY ( float queryFrequency() ) IF_TQUERY ( float queryMinFrequency() ) IF_TQUERY ( float queryMinDeviceFrequency() ) IF_TQUERY ( float queryMaxFrequency() ) IF_TQUERY ( float queryMaxDeviceFrequency() ) IF_TQUERY ( 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) ) TQUERIES: IF_TQUERY ( const KURL &queryURL() ) RECEIVERS: virtual void noticeConnectedI (cmplInterface *, bool pointer_valid); virtual void noticeDisconnectedI (cmplInterface *, bool pointer_valid); }; #endif