4 * Created on: Dec 9, 2011
8 #include "ControlSender.h"
9 #include "PluginTemplate.h"
14 ControlSender::ControlSender(std::string controlPluginFile)
18 if (!controlPluginFile.empty())
20 ControlSendInterface* (*createFunc)();
21 createFunc = getCreateFunction<ControlSendInterface*()>(controlPluginFile,mlibHandle);
22 assert(createFunc!=NULL);
23 mController = createFunc();
27 DLT_LOG(AudioManager,DLT_LOG_ERROR, DLT_STRING("No controller loaded !"));
31 ControlSender::~ControlSender()
33 if (mlibHandle) dlclose(mlibHandle);
36 void ControlSender::hookAllPluginsLoaded()
38 mController->hookAllPluginsLoaded();
43 am_Error_e ControlSender::hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t & mainConnectionID)
45 return mController->hookUserConnectionRequest(sourceID,sinkID,mainConnectionID);
50 am_Error_e ControlSender::hookUserDisconnectionRequest(const am_mainConnectionID_t connectionID)
52 return mController->hookUserDisconnectionRequest(connectionID);
57 am_Error_e ControlSender::hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s & soundProperty)
59 return mController->hookUserSetMainSinkSoundProperty(sinkID,soundProperty);
64 am_Error_e ControlSender::hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s & soundProperty)
66 return mController->hookUserSetMainSourceSoundProperty(sourceID,soundProperty);
71 am_Error_e ControlSender::hookUserSetSystemProperty(const am_SystemProperty_s & property)
73 return mController->hookUserSetSystemProperty(property);
78 am_Error_e ControlSender::hookUserVolumeChange(const am_sinkID_t sinkID, const am_mainVolume_t newVolume)
80 return mController->hookUserVolumeChange(sinkID,newVolume);
85 am_Error_e ControlSender::hookUserVolumeStep(const am_sinkID_t sinkID, const int16_t increment)
87 return mController->hookUserVolumeStep(sinkID,increment);
92 am_Error_e ControlSender::hookUserSetSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState)
94 return mController->hookUserSetSinkMuteState(sinkID,muteState);
99 am_Error_e ControlSender::hookSystemRegisterDomain(const am_Domain_s & domainData, am_domainID_t & domainID)
101 return mController->hookSystemRegisterDomain(domainData,domainID);
106 am_Error_e ControlSender::hookSystemDeregisterDomain(const am_domainID_t domainID)
108 return mController->hookSystemDeregisterDomain(domainID);
113 void ControlSender::hookSystemDomainRegistrationComplete(const am_domainID_t domainID)
115 return mController->hookSystemDomainRegistrationComplete(domainID);
120 am_Error_e ControlSender::hookSystemRegisterSink(const am_Sink_s & sinkData, am_sinkID_t & sinkID)
122 return mController->hookSystemRegisterSink(sinkData,sinkID);
127 am_Error_e ControlSender::hookSystemDeregisterSink(const am_sinkID_t sinkID)
129 return mController->hookSystemDeregisterSink(sinkID);
134 am_Error_e ControlSender::hookSystemRegisterSource(const am_Source_s & sourceData, am_sourceID_t & sourceID)
136 return mController->hookSystemRegisterSource(sourceData,sourceID);
141 am_Error_e ControlSender::hookSystemDeregisterSource(const am_sourceID_t sourceID)
143 return mController->hookSystemDeregisterSource(sourceID);
148 am_Error_e ControlSender::hookSystemRegisterGateway(const am_Gateway_s & gatewayData, am_gatewayID_t & gatewayID)
150 return mController->hookSystemRegisterGateway(gatewayData,gatewayID);
155 am_Error_e ControlSender::hookSystemDeregisterGateway(const am_gatewayID_t gatewayID)
157 return mController->hookSystemDeregisterGateway(gatewayID);
162 am_Error_e ControlSender::hookSystemRegisterCrossfader(const am_Crossfader_s & crossfaderData, am_crossfaderID_t & crossfaderID)
164 return mController->hookSystemRegisterCrossfader(crossfaderData,crossfaderID);
169 am_Error_e ControlSender::hookSystemDeregisterCrossfader(const am_crossfaderID_t crossfaderID)
171 return mController->hookSystemDeregisterCrossfader(crossfaderID);
176 void ControlSender::hookSystemSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume)
178 return mController->hookSystemSinkVolumeTick(handle,sinkID,volume);
183 void ControlSender::hookSystemSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume)
185 return mController->hookSystemSourceVolumeTick(handle,sourceID,volume);
190 void ControlSender::hookSystemInterruptStateChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState)
192 return mController->hookSystemInterruptStateChange(sourceID,interruptState);
197 void ControlSender::hookSystemSinkAvailablityStateChange(const am_sinkID_t sinkID, const am_Availability_s & availability)
199 return mController->hookSystemSinkAvailablityStateChange(sinkID,availability);
204 void ControlSender::hookSystemSourceAvailablityStateChange(const am_sourceID_t sourceID, const am_Availability_s & availability)
206 return mController->hookSystemSourceAvailablityStateChange(sourceID,availability);
211 void ControlSender::hookSystemDomainStateChange(const am_domainID_t domainID, const am_DomainState_e state)
213 return mController->hookSystemDomainStateChange(domainID,state);
218 void ControlSender::hookSystemReceiveEarlyData(const std::vector<am_EarlyData_s> & data)
220 return mController->hookSystemReceiveEarlyData(data);
225 void ControlSender::hookSystemSpeedChange(const am_speed_t speed)
227 return mController->hookSystemSpeedChange(speed);
232 void ControlSender::hookSystemTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time)
234 return mController->hookSystemTimingInformationChanged(mainConnectionID,time);
239 void ControlSender::cbAckConnect(const am_Handle_s handle, const am_Error_e errorID)
241 return mController->cbAckConnect(handle,errorID);
246 void ControlSender::cbAckDisconnect(const am_Handle_s handle, const am_Error_e errorID)
248 return mController->cbAckDisconnect(handle,errorID);
253 void ControlSender::cbAckCrossFade(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error)
255 return mController->cbAckCrossFade(handle,hostsink,error);
260 void ControlSender::cbAckSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)
262 return mController->cbAckSetSinkVolumeChange(handle,volume,error);
267 void ControlSender::cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)
269 return mController->cbAckSetSourceVolumeChange(handle,volume,error);
274 void ControlSender::cbAckSetSourceState(const am_Handle_s handle, const am_Error_e error)
276 return mController->cbAckSetSourceState(handle,error);
281 void ControlSender::cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error)
283 return mController->cbAckSetSourceSoundProperty(handle,error);
288 am_Error_e ControlSender::startupController(ControlReceiveInterface *controlreceiveinterface)
290 return mController->startupController(controlreceiveinterface);
293 am_Error_e ControlSender::stopController()
295 return mController->stopController();
298 void ControlSender::cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error)
300 return mController->cbAckSetSinkSoundProperty(handle,error);