2 * RoutingReceiverAsyncShadow.h
4 * Created on: Dec 23, 2011
8 #ifndef ROUTINGRECEIVERASYNCSHADOW_H_
9 #define ROUTINGRECEIVERASYNCSHADOW_H_
11 #include <routing/RoutingReceiveInterface.h>
12 #include <SocketHandler.h>
19 * Threadsafe shadow of the RoutingReceiverInterface
20 * Register and deregister Functions are sychronous so they do not show up here...
22 class RoutingReceiverAsyncShadow
25 RoutingReceiverAsyncShadow();
26 virtual ~RoutingReceiverAsyncShadow();
27 void ackConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error) ;
28 void ackDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error) ;
29 void ackSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) ;
30 void ackSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) ;
31 void ackSetSourceState(const am_Handle_s handle, const am_Error_e error) ;
32 void ackSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
33 void ackSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
34 void ackCrossFading(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error) ;
35 void ackSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume) ;
36 void ackSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume) ;
37 void hookInterruptStatusChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState) ;
38 void hookSinkAvailablityStatusChange(const am_sinkID_t sinkID, const am_Availability_s& availability) ;
39 void hookSourceAvailablityStatusChange(const am_sourceID_t sourceID, const am_Availability_s& availability) ;
40 void hookDomainStateChange(const am_domainID_t domainID, const am_DomainState_e domainState) ;
41 void hookTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t delay) ;
43 am_Error_e setRoutingInterface(RoutingReceiveInterface *receiveInterface);
44 void asyncMsgReceiver(const pollfd pollfd,const sh_pollHandle_t handle, void* userData);
45 bool asyncDispatcher(const sh_pollHandle_t handle, void* userData);
46 bool asyncChecker(const sh_pollHandle_t handle, void* userData);
48 shPollFired_T<RoutingReceiverAsyncShadow> asyncMsgReceive;
49 shPollDispatch_T<RoutingReceiverAsyncShadow> asyncDispatch;
50 shPollCheck_T<RoutingReceiverAsyncShadow> asyncCheck;
57 MSG_ACKSETSINKVOLUMECHANGE,
58 MSG_ACKSETSOURCEVOLUMECHANGE,
59 MSG_ACKSETSOURCESTATE,
60 MSG_ACKSETSINKSOUNDPROPERTY,
61 MSG_ACKSETSOURCESOUNDPROPERTY,
63 MSG_ACKSOURCEVOLUMETICK,
64 MSG_ACKSINKVOLUMETICK,
65 MSG_HOOKINTERRUPTSTATUSCHANGE,
66 MSG_HOOKSINKAVAILABLITYSTATUSCHANGE,
67 MSG_HOOKSOURCEAVAILABLITYSTATUSCHANGE,
68 MSG_HOOKDOMAINSTATECHANGE,
69 MSG_HOOKTIMINGINFORMATIONCHANGED
75 am_connectionID_t connectionID;
92 struct a_crossfading_s
99 struct a_sourceVolumeTick_s
101 am_sourceID_t sourceID;
106 struct a_sinkVolumeTick_s
113 struct a_interruptStatusChange_s
115 am_sourceID_t sourceID;
116 am_InterruptState_e interruptState;
119 struct a_sinkAvailability_s
122 am_Availability_s availability;
125 struct a_sourceAvailability_s
127 am_sourceID_t sourceID;
128 am_Availability_s availability;
131 struct a_hookDomainStateChange_s
133 am_domainID_t domainID;
134 am_DomainState_e state;
137 struct a_timingInfoChanged_s
139 am_connectionID_t connectionID;
148 a_crossfading_s crossfading;
149 a_sourceVolumeTick_s sourceVolumeTick;
150 a_sinkVolumeTick_s sinkVolumeTick;
151 a_interruptStatusChange_s interruptStatusChange;
152 a_sinkAvailability_s sinkAvailability;
153 a_sourceAvailability_s sourceAvailability;
154 a_hookDomainStateChange_s domainStateChange;
155 a_timingInfoChanged_s timingInfoChange;
161 parameter_u parameters;
164 SocketHandler *mSocketHandler;
165 RoutingReceiveInterface *mRoutingReceiveInterface;
166 std::queue<msg_s> mQueue;
167 static pthread_mutex_t mMutex;
168 sh_pollHandle_t mHandle;
173 #endif /* ROUTINGRECEIVERASYNCSHADOW_H_ */