You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
4.4 KiB
97 lines
4.4 KiB
15 years ago
|
/***************************************************************************
|
||
|
radio_interfaces.cpp - description
|
||
|
-------------------
|
||
|
begin : Don Apr 17 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. *
|
||
|
* *
|
||
|
***************************************************************************/
|
||
|
|
||
|
#include "include/radio_interfaces.h"
|
||
|
#include "include/stationlist.h"
|
||
|
#include "include/radiostation.h"
|
||
|
|
||
|
// IRadio
|
||
|
|
||
|
IF_IMPL_SENDER ( IRadio::notifyPowerChanged(bool on),
|
||
|
noticePowerChanged(on) );
|
||
|
IF_IMPL_SENDER ( IRadio::notifyStationChanged (const RadioStation &s, int idx),
|
||
|
noticeStationChanged (s, idx) );
|
||
|
IF_IMPL_SENDER ( IRadio::notifyStationsChanged(const StationList &sl),
|
||
|
noticeStationsChanged(sl) );
|
||
14 years ago
|
IF_IMPL_SENDER ( IRadio::notifyPresetFileChanged(const TQString &f),
|
||
15 years ago
|
noticePresetFileChanged(f) );
|
||
|
IF_IMPL_SENDER ( IRadio::notifyCurrentSoundStreamIDChanged(SoundStreamID id),
|
||
|
noticeCurrentSoundStreamIDChanged(id) );
|
||
|
|
||
|
// IRadioClient
|
||
|
|
||
|
IF_IMPL_SENDER ( IRadioClient::sendPowerOn(),
|
||
|
powerOn() );
|
||
|
IF_IMPL_SENDER ( IRadioClient::sendPowerOff(),
|
||
|
powerOff() );
|
||
|
IF_IMPL_SENDER ( IRadioClient::sendActivateStation(const RadioStation &rs),
|
||
|
activateStation(rs) );
|
||
|
IF_IMPL_SENDER ( IRadioClient::sendActivateStation(int index),
|
||
|
activateStation(index) );
|
||
|
IF_IMPL_SENDER ( IRadioClient::sendStations(const StationList &sl),
|
||
|
setStations(sl) );
|
||
14 years ago
|
IF_IMPL_SENDER ( IRadioClient::sendPresetFile(const TQString &f),
|
||
15 years ago
|
setPresetFile(f) );
|
||
|
|
||
13 years ago
|
IF_IMPL_QUERY ( bool IRadioClient::queryIsPowerOn(),
|
||
15 years ago
|
isPowerOn(),
|
||
|
false );
|
||
|
|
||
13 years ago
|
IF_IMPL_QUERY ( bool IRadioClient::queryIsPowerOff(),
|
||
15 years ago
|
isPowerOff(),
|
||
|
true );
|
||
|
|
||
13 years ago
|
IF_IMPL_QUERY ( const RadioStation & IRadioClient::queryCurrentStation(),
|
||
15 years ago
|
getCurrentStation(),
|
||
|
undefinedRadioStation );
|
||
|
|
||
13 years ago
|
IF_IMPL_QUERY ( int IRadioClient::queryCurrentStationIdx(),
|
||
15 years ago
|
getCurrentStationIdx(),
|
||
|
-1 );
|
||
|
|
||
13 years ago
|
IF_IMPL_QUERY ( int IRadioClient::queryStationIdx(const RadioStation &rs),
|
||
15 years ago
|
getStationIdx(rs),
|
||
|
-1 );
|
||
|
|
||
13 years ago
|
IF_IMPL_QUERY ( const StationList & IRadioClient::queryStations(),
|
||
15 years ago
|
getStations(),
|
||
|
emptyStationList );
|
||
|
|
||
14 years ago
|
static TQString emptyString;
|
||
13 years ago
|
IF_IMPL_QUERY ( const TQString & IRadioClient::queryPresetFile(),
|
||
15 years ago
|
getPresetFile(),
|
||
|
emptyString );
|
||
|
|
||
13 years ago
|
IF_IMPL_QUERY ( SoundStreamID IRadioClient::queryCurrentSoundStreamID(),
|
||
15 years ago
|
getCurrentSoundStreamID(),
|
||
|
SoundStreamID::InvalidID );
|
||
|
|
||
|
void IRadioClient::noticeConnectedI (cmplInterface *, bool /*pointer_valid*/)
|
||
|
{
|
||
|
noticeStationsChanged(queryStations());
|
||
|
noticeStationChanged (queryCurrentStation(), queryCurrentStationIdx());
|
||
|
noticePowerChanged (queryIsPowerOn());
|
||
|
}
|
||
|
|
||
|
void IRadioClient::noticeDisconnectedI (cmplInterface *, bool /*pointer_valid*/)
|
||
|
{
|
||
|
noticeStationsChanged(queryStations());
|
||
|
noticeStationChanged(queryCurrentStation(), queryCurrentStationIdx());
|
||
|
noticePowerChanged(queryIsPowerOn());
|
||
|
}
|
||
|
|