36 #define __METHOD_NAME__ std::string (std::string("CAmDatabaseHandlerMap::") + __func__) 39 #ifdef WITH_DATABASE_CHANGE_CHECK 40 # define DB_COND_UPDATE_RIE(x,y) \ 41 if (isDataEqual(x,y)) return (E_NO_CHANGE); else x = y 42 # define DB_COND_UPDATE_INIT \ 44 # define DB_COND_UPDATE(x,y) \ 45 if (!isDataEqual(x,y)) { x = y; modified = true; } 46 # define DB_COND_ISMODIFIED \ 49 # define DB_COND_UPDATE_RIE(x,y) \ 51 # define DB_COND_UPDATE_INIT 52 # define DB_COND_UPDATE(x,y) \ 54 # define DB_COND_ISMODIFIED \ 59 #define NOTIFY_OBSERVERS(CALL)\ 60 for(AmDatabaseObserverCallbacks * nextObserver: mDatabaseObservers)\ 61 if(nextObserver->CALL)\ 64 #define NOTIFY_OBSERVERS1(CALL, ARG1)\ 65 for(AmDatabaseObserverCallbacks * nextObserver: mDatabaseObservers)\ 66 if(nextObserver->CALL)\ 67 nextObserver->CALL(ARG1); 69 #define NOTIFY_OBSERVERS2(CALL, ARG1, ARG2)\ 70 for(AmDatabaseObserverCallbacks * nextObserver: mDatabaseObservers)\ 71 if(nextObserver->CALL)\ 72 nextObserver->CALL(ARG1, ARG2); 74 #define NOTIFY_OBSERVERS3(CALL, ARG1, ARG2, ARG3)\ 75 for(AmDatabaseObserverCallbacks * nextObserver: mDatabaseObservers)\ 76 if(nextObserver->CALL)\ 77 nextObserver->CALL(ARG1, ARG2, ARG3); 79 #define NOTIFY_OBSERVERS4(CALL, ARG1, ARG2, ARG3, ARG4)\ 80 for(AmDatabaseObserverCallbacks * nextObserver: mDatabaseObservers)\ 81 if(nextObserver->CALL)\ 82 nextObserver->CALL(ARG1, ARG2, ARG3, ARG4); 90 template <
typename T>
bool isDataEqual(
const T & left,
const T & right)
92 return static_cast<bool>(!std::memcmp(&left, &right,
sizeof(T)));
95 template <
typename T,
typename L = std::vector<T> >
bool isDataEqual(
const L & left,
const L & right)
97 return std::equal(left.begin(), left.end(), right.begin(),
isDataEqual);
104 template <
typename TMapKeyType,
class TMapObjectType> TMapObjectType
const *
objectForKeyIfExistsInMap(
const TMapKeyType & key,
const std::unordered_map<TMapKeyType,TMapObjectType> & map)
106 typename std::unordered_map<TMapKeyType,TMapObjectType>::const_iterator iter = map.find(key);
107 if( iter!=map.end() )
108 return &iter->second;
115 template <
typename TMapKeyType,
class TMapObjectType>
bool existsObjectWithKeyInMap(
const TMapKeyType & key,
const std::unordered_map<TMapKeyType,TMapObjectType> & map)
129 template <
class TReturn,
typename TIdentifier>
const TReturn *
objectMatchingPredicate(
const std::unordered_map<TIdentifier, TReturn> & map,
130 std::function<
bool(
const TReturn & refObject)> comparator)
132 typename std::unordered_map<TIdentifier, TReturn>::const_iterator elementIterator = map.begin();
133 for (;elementIterator != map.end(); ++elementIterator)
135 if( comparator(elementIterator->second) )
136 return &elementIterator->second;
144 void CAmDatabaseHandlerMap::AmDomain::getDescription (std::string & outString)
const 146 std::ostringstream fmt;
147 fmt <<
"Domain(" << name.c_str() <<
") id(" << domainID <<
")" << std::endl <<
148 "bus name(" << busname.c_str() <<
149 ") node name(" << nodename.c_str() <<
150 ") early(" << early <<
151 ") domainID(" << domainID <<
152 ") complete(" << complete <<
153 ") state(" << state <<
154 ") reserved(" << reserved <<
")" << std::endl;
155 outString = fmt.str();
160 void CAmDatabaseHandlerMap::AmSource::getSourceType(
am_SourceType_s & sourceType)
const 162 sourceType.
name = name;
168 void CAmDatabaseHandlerMap::AmSource::getDescription (std::string & outString)
const 170 std::ostringstream fmt;
171 fmt <<
"Source(" << name.c_str() <<
") id(" << sourceID <<
")" << std::endl <<
172 "sourceClassID(" << sourceClassID <<
173 ") domainID(" << domainID <<
174 ") visible(" << visible <<
175 ") volume(" << volume <<
176 ") interruptState(" << interruptState <<
177 ") sourceState(" << sourceState <<
178 ") reserved(" << reserved <<
")" <<
179 ") available([availability:" << available.availability <<
" availabilityReason:" << available.availabilityReason <<
"]" 180 ") listSoundProperties (";
181 std::for_each(listSoundProperties.begin(), listSoundProperties.end(), [&](
const am_SoundProperty_s & ref) {
182 fmt <<
"[type:" << ref.type <<
" value:" << ref.value <<
"]";
184 fmt <<
") listConnectionFormats (";
186 fmt <<
"[" << ref <<
"]";
188 fmt <<
") listMainSoundProperties (";
189 std::for_each(listMainSoundProperties.begin(), listMainSoundProperties.end(), [&](
const am_MainSoundProperty_s & ref) {
190 fmt <<
"[type:" << ref.type <<
" value:" << ref.value <<
"]";
192 fmt <<
") listMainNotificationConfigurations (";
193 std::for_each(listMainNotificationConfigurations.begin(), listMainNotificationConfigurations.end(), [&](
const am_NotificationConfiguration_s & ref) {
194 fmt <<
"[type:" << ref.type <<
" status:" << ref.status <<
" parameter:" << ref.parameter <<
"]";
196 fmt <<
") listNotificationConfigurations (";
198 fmt <<
"[type:" << ref.type <<
" status:" << ref.status <<
" parameter:" << ref.parameter <<
"]";
200 fmt <<
")" << std::endl;
201 outString = fmt.str();
206 void CAmDatabaseHandlerMap::AmSink::getDescription (std::string & outString)
const 208 std::ostringstream fmt;
209 fmt <<
"Sink(" << name.c_str() <<
") id(" << sinkID <<
")" << std::endl <<
210 "sinkClassID(" << sinkClassID <<
211 ") domainID(" << domainID <<
212 ") visible(" << visible <<
213 ") volume(" << volume <<
214 ") muteState(" << muteState <<
215 ") mainVolume(" << mainVolume <<
216 ") reserved(" << reserved <<
")" <<
217 ") available([availability:" << available.availability <<
" availabilityReason:" << available.availabilityReason <<
"]" 218 ") listSoundProperties (";
219 std::for_each(listSoundProperties.begin(), listSoundProperties.end(), [&](
const am_SoundProperty_s & ref) {
220 fmt <<
"[type:" << ref.type <<
" value:" << ref.value <<
"]";
222 fmt <<
") listConnectionFormats (";
224 fmt <<
"[" << ref <<
"]";
226 fmt <<
") listMainSoundProperties (";
227 std::for_each(listMainSoundProperties.begin(), listMainSoundProperties.end(), [&](
const am_MainSoundProperty_s & ref) {
228 fmt <<
"[type:" << ref.type <<
" value:" << ref.value <<
"]";
230 fmt <<
") listMainNotificationConfigurations (";
231 std::for_each(listMainNotificationConfigurations.begin(), listMainNotificationConfigurations.end(), [&](
const am_NotificationConfiguration_s & ref) {
232 fmt <<
"[type:" << ref.type <<
" status:" << ref.status <<
" parameter:" << ref.parameter <<
"]";
234 fmt <<
") listNotificationConfigurations (";
236 fmt <<
"[type:" << ref.type <<
" status:" << ref.status <<
" parameter:" << ref.parameter <<
"]";
238 fmt <<
")" << std::endl;
239 outString = fmt.str();
242 void CAmDatabaseHandlerMap::AmSink::getSinkType(
am_SinkType_s & sinkType)
const 244 sinkType.
name = name;
248 sinkType.
volume = mainVolume;
254 void CAmDatabaseHandlerMap::AmConnection::getDescription (std::string & outString)
const 256 std::ostringstream fmt;
257 fmt <<
"Connection id(" << connectionID <<
") " << std::endl <<
258 "sourceID(" << sourceID <<
259 ") sinkID(" << sinkID <<
260 ") delay(" << delay <<
261 ") connectionFormat(" << connectionFormat <<
262 ") reserved(" << reserved <<
")" << std::endl;
263 outString = fmt.str();
268 void CAmDatabaseHandlerMap::AmMainConnection::getDescription (std::string & outString)
const 270 std::ostringstream fmt;
271 fmt <<
"MainConnection id(" << mainConnectionID <<
") " << std::endl <<
272 "connectionState(" << connectionState <<
273 ") sinkID(" << sinkID <<
274 ") sourceID(" << sourceID <<
275 ") delay(" << delay <<
276 ") listConnectionID (";
277 std::for_each(listConnectionID.begin(), listConnectionID.end(), [&](
const am_connectionID_t & connID) {
278 fmt <<
"["<< connID <<
"]";
280 fmt <<
")" << std::endl;
281 outString = fmt.str();
284 void CAmDatabaseHandlerMap::am_MainConnection_Database_s::getMainConnectionType(
am_MainConnectionType_s & connectionType)
const 288 connectionType.
sinkID = sinkID;
290 connectionType.
delay = delay;
295 void CAmDatabaseHandlerMap::AmSourceClass::getDescription (std::string & outString)
const 297 std::ostringstream fmt;
298 fmt <<
"Source class(" << name.c_str() <<
") id(" << sourceClassID <<
")\n" <<
299 ") listClassProperties (";
300 std::for_each(listClassProperties.begin(), listClassProperties.end(), [&](
const am_ClassProperty_s & ref) {
301 fmt <<
"[classProperty:" << ref.classProperty <<
" value:" << ref.value <<
"]";
303 fmt <<
")" << std::endl;
304 outString = fmt.str();
309 void CAmDatabaseHandlerMap::AmSinkClass::getDescription (std::string & outString)
const 311 std::ostringstream fmt;
312 fmt <<
"Sink class(" << name.c_str() <<
") id(" << sinkClassID <<
")\n" <<
313 ") listClassProperties (";
314 std::for_each(listClassProperties.begin(), listClassProperties.end(), [&](
const am_ClassProperty_s & ref) {
315 fmt <<
"[classProperty:" << ref.classProperty <<
" value:" << ref.value <<
"]";
317 fmt <<
")" << std::endl;
318 outString = fmt.str();
324 void CAmDatabaseHandlerMap::AmGateway::getDescription (std::string & outString)
const 326 std::ostringstream fmt;
327 fmt <<
"Gateway(" << name.c_str() <<
") id(" << gatewayID <<
")\n" <<
328 "sinkID(" << sinkID <<
329 ") sourceID(" << sourceID <<
330 ") domainSinkID(" << domainSinkID <<
331 ") domainSourceID(" << domainSourceID <<
332 ") controlDomainID(" << controlDomainID <<
333 ") listSourceFormats (";
335 fmt <<
"[" << ref <<
"]";
337 fmt <<
") listSinkFormats (";
339 fmt <<
"[" << ref <<
"]";
341 fmt <<
") convertionMatrix (";
342 std::for_each(convertionMatrix.begin(), convertionMatrix.end(), [&](
const bool & ref) {
343 fmt <<
"[" << ref <<
"]";
345 fmt <<
")" << std::endl;
346 outString = fmt.str();
351 void CAmDatabaseHandlerMap::AmConverter::getDescription (std::string & outString)
const 353 std::ostringstream fmt;
354 fmt <<
"Converter(" << name.c_str() <<
") id(" << converterID <<
")\n" <<
355 "sinkID(" << sinkID <<
356 ") sourceID(" << sourceID <<
357 ") domainSinkID(" << domainID <<
358 ") listSourceFormats (";
360 fmt <<
"[" << ref <<
"]";
362 fmt <<
") listSinkFormats (";
364 fmt <<
"[" << ref <<
"]";
366 fmt <<
") convertionMatrix (";
367 std::for_each(convertionMatrix.begin(), convertionMatrix.end(), [&](
const bool & ref) {
368 fmt <<
"[" << ref <<
"]";
370 fmt <<
")" << std::endl;
371 outString = fmt.str();
376 void CAmDatabaseHandlerMap::AmCrossfader::getDescription (std::string & outString)
const 378 std::ostringstream fmt;
379 fmt <<
"Crossfader(" << name.c_str() <<
") id(" << crossfaderID <<
")\n" <<
380 "sinkID_A(" << sinkID_A <<
381 ") sinkID_B(" << sinkID_B <<
382 ") sourceID(" << sourceID <<
383 ") hotSink(" << hotSink <<
385 outString = fmt.str();
388 bool CAmDatabaseHandlerMap::AmMappedData::increaseID(int16_t & resultID, AmIdentifier & elementID,
389 int16_t
const desiredStaticID = 0)
391 if( desiredStaticID > 0 && desiredStaticID < elementID.mMin )
393 resultID = desiredStaticID;
396 else if( elementID.mCurrentValue < elementID.mMax )
398 resultID = elementID.mCurrentValue++;
408 template <
typename TMapKey,
class TMapObject>
bool CAmDatabaseHandlerMap::AmMappedData::getNextConnectionID(int16_t & resultID, AmIdentifier & connID,
409 const std::unordered_map<TMapKey, TMapObject> & map)
412 int16_t
const lastID = connID.mCurrentValue;
413 if( connID.mCurrentValue < connID.mMax )
414 nextID = connID.mCurrentValue++;
416 nextID = connID.mCurrentValue = connID.mMin;
418 bool notFreeIDs =
false;
422 if( connID.mCurrentValue < connID.mMax )
423 nextID = connID.mCurrentValue++;
426 connID.mCurrentValue = connID.mMin;
427 nextID = connID.mCurrentValue;
430 if( connID.mCurrentValue == lastID )
445 bool CAmDatabaseHandlerMap::AmMappedData::increaseMainConnectionID(int16_t & resultID)
447 return getNextConnectionID(resultID, mCurrentMainConnectionID, mMainConnectionMap);
450 bool CAmDatabaseHandlerMap::AmMappedData::increaseConnectionID(int16_t & resultID)
452 return getNextConnectionID(resultID, mCurrentConnectionID, mConnectionMap);
457 mFirstStaticSink(true),
458 mFirstStaticSource(true),
459 mFirstStaticGateway(true),
460 mFirstStaticConverter(true),
461 mFirstStaticSinkClass(true),
462 mFirstStaticSourceClass(true),
463 mFirstStaticCrossfader(true),
464 mListConnectionFormat(),
475 ptr->mpDatabaseHandler=
nullptr;
480 if(domainData.
name.empty())
496 am_Domain_s const *reservedDomain = objectMatchingPredicate<AmDomain, am_domainID_t>(mMappedData.mDomainMap, [&](
const AmDomain & obj){
497 return domainData.
name.compare(obj.name)==0;
502 if( NULL != reservedDomain )
506 mMappedData.mDomainMap[nextID] = domainData;
507 mMappedData.mDomainMap[nextID].domainID = nextID;
508 mMappedData.mDomainMap[nextID].reserved = 0;
509 logVerbose(
"DatabaseHandler::enterDomainDB entered reserved domain with name=", domainData.
name,
"busname=", domainData.
busname,
"nodename=", domainData.
nodename,
"reserved ID:", domainID);
517 if(mMappedData.increaseID(nextID, mMappedData.mCurrentDomainID, domainData.
domainID))
520 mMappedData.mDomainMap[nextID] = domainData;
521 mMappedData.mDomainMap[nextID].domainID = nextID;
522 logVerbose(
"DatabaseHandler::enterDomainDB entered new domain with name=", domainData.
name,
"busname=", domainData.
busname,
"nodename=", domainData.
nodename,
"assigned ID:", domainID);
537 int16_t CAmDatabaseHandlerMap::calculateDelayForRoute(
const std::vector<am_connectionID_t>& listConnectionID)
540 std::vector<am_connectionID_t>::const_iterator elementIterator = listConnectionID.begin();
541 for (; elementIterator < listConnectionID.end(); ++elementIterator)
544 std::unordered_map<am_connectionID_t, am_Connection_Database_s>::const_iterator it = mMappedData.mConnectionMap.find(key);
545 if (it!=mMappedData.mConnectionMap.end())
547 int16_t temp_delay = it->second.delay;
548 if (temp_delay != -1 && delay != -1)
582 if(mMappedData.increaseMainConnectionID(nextID))
584 connectionID = nextID;
585 mMappedData.mMainConnectionMap[nextID] = mainConnectionData;
586 mMappedData.mMainConnectionMap[nextID].mainConnectionID = nextID;
597 logVerbose(
"DatabaseHandler::enterMainConnectionDB entered new mainConnection with sourceID", mainConnectionData.
sourceID,
"sinkID:", mainConnectionData.
sinkID,
"delay:", delay,
"assigned ID:", connectionID);
600 if (mDatabaseObservers.size())
603 mMappedData.mMainConnectionMap[nextID].getMainConnectionType(mainConnection);
606 NOTIFY_OBSERVERS2(dboMainConnectionStateChanged, connectionID, mMappedData.mMainConnectionMap[nextID].connectionState)
624 if( mMappedData.increaseID(nextID, mMappedData.mCurrentSinkID, sinkData.
sinkID) )
627 mMappedData.mSinkMap[nextID] = sinkData;
628 mMappedData.mSinkMap[nextID].sinkID = nextID;
629 filterDuplicateNotificationConfigurationTypes(mMappedData.mSinkMap[nextID].listNotificationConfigurations);
630 filterDuplicateNotificationConfigurationTypes(mMappedData.mSinkMap[nextID].listMainNotificationConfigurations);
643 if(sinkData.
sinkID>=DYNAMIC_ID_BOUNDARY)
653 if(sinkData.
name.empty())
673 am_Sink_s const *reservedDomain = objectMatchingPredicate<AmSink, am_sinkID_t>(mMappedData.mSinkMap, [&](
const AmSink & obj){
674 return true==obj.reserved && obj.name.compare(sinkData.
name)==0;
676 if( NULL!=reservedDomain )
679 mMappedData.mSinkMap[oldSinkID] = sinkData;
680 mMappedData.mSinkMap[oldSinkID].reserved = 0;
681 temp_SinkID = oldSinkID;
682 temp_SinkIndex = oldSinkID;
687 if ( sinkData.
sinkID != 0 || mFirstStaticSink )
696 result = insertSinkDB(sinkData, temp_SinkID);
697 if(
false == result )
699 temp_SinkIndex = temp_SinkID;
702 if (sinkData.
sinkID == 0 && mFirstStaticSink)
704 mFirstStaticSink =
false;
706 mMappedData.mSinkMap[temp_SinkIndex].sinkID = temp_SinkID;
707 sinkID = temp_SinkID;
709 am_Sink_s & sink = mMappedData.mSinkMap[temp_SinkID];
721 if(mMappedData.increaseID(nextID, mMappedData.mCurrentCrossfaderID, crossfaderData.
crossfaderID))
723 crossfaderID = nextID;
724 mMappedData.mCrossfaderMap[nextID] = crossfaderData;
725 mMappedData.mCrossfaderMap[nextID].crossfaderID = nextID;
749 if(crossfaderData.
name.empty())
776 if (crossfaderData.
crossfaderID != 0 || mFirstStaticCrossfader)
785 result = insertCrossfaderDB(crossfaderData, temp_CrossfaderID);
786 if(
false == result )
788 temp_CrossfaderIndex = temp_CrossfaderID;
791 if ( 0==crossfaderData.
crossfaderID && mFirstStaticCrossfader)
793 mFirstStaticCrossfader =
false;
796 mMappedData.mCrossfaderMap[temp_CrossfaderIndex].crossfaderID = temp_CrossfaderID;
797 crossfaderID = temp_CrossfaderID;
798 logVerbose(
"DatabaseHandler::enterCrossfaderDB entered new crossfader with name=", crossfaderData.
name,
"sinkA= ", crossfaderData.
sinkID_A,
"sinkB=", crossfaderData.
sinkID_B,
"source=", crossfaderData.
sourceID,
"assigned ID:", crossfaderID);
800 NOTIFY_OBSERVERS1(dboNewCrossfader, mMappedData.mCrossfaderMap[temp_CrossfaderIndex])
808 if(mMappedData.increaseID(nextID, mMappedData.mCurrentGatewayID, gatewayData.
gatewayID))
811 mMappedData.mGatewayMap[nextID] = gatewayData;
812 mMappedData.mGatewayMap[nextID].gatewayID = nextID;
826 if(gatewayData.
gatewayID>=DYNAMIC_ID_BOUNDARY)
838 if(gatewayData.
name.empty())
852 if (gatewayData.
gatewayID != 0 || mFirstStaticGateway)
861 result = insertGatewayDB(gatewayData, temp_GatewayID);
862 if(
false == result )
865 temp_GatewayIndex = temp_GatewayID;
867 if (gatewayData.
gatewayID == 0 && mFirstStaticGateway)
869 mFirstStaticGateway =
false;
871 mMappedData.mGatewayMap[temp_GatewayIndex].gatewayID = temp_GatewayID;
872 gatewayID = temp_GatewayID;
874 logVerbose(
"DatabaseHandler::enterGatewayDB entered new gateway with name", gatewayData.
name,
"sourceID:", gatewayData.
sourceID,
"sinkID:", gatewayData.
sinkID,
"assigned ID:", gatewayID);
883 if(mMappedData.increaseID(nextID, mMappedData.mCurrentConverterID, converteData.
converterID))
885 converterID = nextID;
886 mMappedData.mConverterMap[nextID] = converteData;
887 mMappedData.mConverterMap[nextID].converterID = nextID;
924 if(converterData.
name.empty())
938 if (converterData.
converterID != 0 || mFirstStaticConverter)
947 result = insertConverterDB(converterData, tempID);
948 if(
false == result )
953 if (converterData.
converterID == 0 && mFirstStaticConverter)
955 mFirstStaticConverter =
false;
957 mMappedData.mConverterMap[tempIndex].converterID = tempID;
958 converterID = tempID;
960 logVerbose(
"DatabaseHandler::enterConverterDB entered new converter with name", converterData.
name,
"sourceID:", converterData.
sourceID,
"sinkID:", converterData.
sinkID,
"assigned ID:", converterID);
968 output << std::endl <<
"****************** DUMP START ******************" << std::endl;
969 AmMappedData::printMap(mMappedData.mDomainMap, output);
970 AmMappedData::printMap(mMappedData.mSourceMap, output);
971 AmMappedData::printMap(mMappedData.mSinkMap, output);
972 AmMappedData::printMap(mMappedData.mSourceClassesMap, output);
973 AmMappedData::printMap(mMappedData.mSinkClassesMap, output);
974 AmMappedData::printMap(mMappedData.mConnectionMap, output);
975 AmMappedData::printMap(mMappedData.mMainConnectionMap, output);
976 AmMappedData::printMap(mMappedData.mCrossfaderMap, output);
977 AmMappedData::printMap(mMappedData.mGatewayMap, output);
978 AmVectorSystemProperties::const_iterator iter = mMappedData.mSystemProperties.begin();
979 output <<
"System properties" <<
"\n";
980 for(; iter!=mMappedData.mSystemProperties.end(); iter++)
981 output <<
"[type:" << iter->type <<
" value:" << iter->value <<
"]";
982 output << std::endl <<
"****************** DUMP END ******************" << std::endl;
988 if(mMappedData.increaseID(nextID, mMappedData.mCurrentSourceID, sourceData.
sourceID))
991 mMappedData.mSourceMap[nextID] = sourceData;
992 mMappedData.mSourceMap[nextID].sourceID = nextID;
993 filterDuplicateNotificationConfigurationTypes(mMappedData.mSourceMap[nextID].listNotificationConfigurations);
994 filterDuplicateNotificationConfigurationTypes(mMappedData.mSourceMap[nextID].listMainNotificationConfigurations);
1007 if(sourceData.
sourceID>=DYNAMIC_ID_BOUNDARY)
1017 if(sourceData.
name.empty())
1034 bool isFirstStatic = sourceData.
sourceID == 0 && mFirstStaticSource;
1037 AmSource
const *reservedSource = objectMatchingPredicate<AmSource, am_sourceID_t>(mMappedData.mSourceMap, [&](
const AmSource & obj){
1038 return true==obj.reserved && obj.name.compare(sourceData.
name)==0;
1040 if( NULL != reservedSource )
1043 mMappedData.mSourceMap[oldSourceID] = sourceData;
1044 mMappedData.mSourceMap[oldSourceID].reserved = 0;
1045 temp_SourceID = oldSourceID;
1046 temp_SourceIndex = oldSourceID;
1051 if ( !isFirstStatic )
1060 result = insertSourceDB(sourceData, temp_SourceID);
1061 if(
false == result )
1063 temp_SourceIndex = temp_SourceID;
1066 if ( isFirstStatic )
1069 mFirstStaticSource =
false;
1071 mMappedData.mSourceMap[temp_SourceIndex].sourceID = temp_SourceID;
1072 sourceID = temp_SourceID;
1074 logVerbose(
"DatabaseHandler::enterSourceDB entered new source with name", sourceData.
name,
"domainID:", sourceData.
domainID,
"classID:", sourceData.
sourceClassID,
"visible:", sourceData.
visible,
"assigned ID:", sourceID);
1102 if(mMappedData.increaseConnectionID(nextID))
1104 connectionID = nextID;
1105 mMappedData.mConnectionMap[nextID] = connection;
1106 mMappedData.mConnectionMap[nextID].connectionID = nextID;
1107 mMappedData.mConnectionMap[nextID].reserved =
true;
1116 logVerbose(
"DatabaseHandler::enterConnectionDB entered new connection sinkID=", connection.
sinkID,
"sourceID=", connection.
sourceID,
"connectionFormat=", connection.
connectionFormat,
"assigned ID=", connectionID);
1123 if(mMappedData.increaseID(nextID, mMappedData.mCurrentSinkClassesID, sinkClass.
sinkClassID))
1125 sinkClassID = nextID;
1126 mMappedData.mSinkClassesMap[nextID] = sinkClass;
1127 mMappedData.mSinkClassesMap[nextID].sinkClassID = nextID;
1146 if(sinkClass.
name.empty())
1156 if (sinkClass.
sinkClassID != 0 || mFirstStaticSinkClass)
1165 result = insertSinkClassDB(sinkClass, temp_SinkClassID);
1166 if(
false == result )
1169 temp_SinkClassIndex = temp_SinkClassID;
1171 if (sinkClass.
sinkClassID == 0 && mFirstStaticSinkClass)
1173 mFirstStaticSinkClass =
false;
1175 mMappedData.mSinkClassesMap[temp_SinkClassIndex].sinkClassID = temp_SinkClassID;
1176 sinkClassID = temp_SinkClassID;
1179 logVerbose(
"DatabaseHandler::enterSinkClassDB entered new sinkClass");
1187 if(mMappedData.increaseID(nextID, mMappedData.mCurrentSourceClassesID, sourceClass.
sourceClassID))
1189 sourceClassID = nextID;
1190 mMappedData.mSourceClassesMap[nextID] = sourceClass;
1191 mMappedData.mSourceClassesMap[nextID].sourceClassID = nextID;
1210 if(sourceClass.
name.empty())
1221 if (sourceClass.
sourceClassID != 0 || mFirstStaticSourceClass)
1230 result = insertSourceClassDB(temp_SourceClassID, sourceClass);
1231 if(
false == result )
1234 temp_SourceClassIndex = temp_SourceClassID;
1236 if (sourceClass.
sourceClassID == 0 && mFirstStaticSourceClass)
1238 mFirstStaticSinkClass =
false;
1240 mMappedData.mSourceClassesMap[temp_SourceClassIndex].sourceClassID = temp_SourceClassID;
1241 sourceClassID = temp_SourceClassID;
1245 logVerbose(
"DatabaseHandler::enterSourceClassDB entered new sourceClass");
1254 if(listSystemProperties.empty())
1260 mMappedData.mSystemProperties = listSystemProperties;
1262 logVerbose(
"DatabaseHandler::enterSystemProperties entered system properties");
1268 if(mainconnectionID==0)
1280 int16_t delay = calculateDelayForRoute(listConnectionID);
1283 mMappedData.mMainConnectionMap[mainconnectionID].listConnectionID = listConnectionID;
1286 logError(
"DatabaseHandler::changeMainConnectionRouteDB error while changing mainConnectionDelay to ", delay);
1288 logVerbose(
"DatabaseHandler::changeMainConnectionRouteDB entered new route:", mainconnectionID);
1294 if(mainconnectionID==0)
1312 DB_COND_UPDATE_RIE(mMappedData.mMainConnectionMap[mainconnectionID].connectionState, connectionState);
1314 logVerbose(
"DatabaseHandler::changeMainConnectionStateDB changed mainConnectionState of MainConnection:", mainconnectionID,
"to:", connectionState);
1315 NOTIFY_OBSERVERS2(dboMainConnectionStateChanged, mainconnectionID, connectionState)
1329 logVerbose(
"DatabaseHandler::changeSinkMainVolumeDB changed mainVolume of sink:", sinkID,
"to:", mainVolume);
1378 logVerbose(
"DatabaseHandler::changDomainStateDB changed domainState of domain:", domainID,
"to:", domainState);
1399 logVerbose(
"DatabaseHandler::changeSinkMuteStateDB changed sinkMuteState of sink:", sinkID,
"to:", muteState);
1414 am_Sink_Database_s & sink = mMappedData.mSinkMap[sinkID];
1415 std::vector<am_MainSoundProperty_s>::iterator elementIterator = sink.listMainSoundProperties.begin();
1416 for (;elementIterator != sink.listMainSoundProperties.end(); ++elementIterator)
1418 if (elementIterator->type == soundProperty.
type)
1421 if(sink.cacheMainSoundProperties.size())
1422 sink.cacheMainSoundProperties[soundProperty.
type] = soundProperty.
value;
1427 logVerbose(
"DatabaseHandler::changeMainSinkSoundPropertyDB changed MainSinkSoundProperty of sink:", sinkID,
"type:", soundProperty.
type,
"to:", soundProperty.
value);
1440 am_Source_Database_s & source = mMappedData.mSourceMap.at(sourceID);
1441 std::vector<am_MainSoundProperty_s>::iterator elementIterator = source.listMainSoundProperties.begin();
1442 for (;elementIterator != source.listMainSoundProperties.end(); ++elementIterator)
1444 if (elementIterator->type == soundProperty.
type)
1447 if(source.cacheMainSoundProperties.size())
1448 source.cacheMainSoundProperties[soundProperty.
type] = soundProperty.
value;
1453 logVerbose(
"DatabaseHandler::changeMainSourceSoundPropertyDB changed MainSinkSoundProperty of source:", sourceID,
"type:", soundProperty.
type,
"to:", soundProperty.
value);
1486 std::vector<am_SystemProperty_s>::iterator elementIterator = mMappedData.mSystemProperties.begin();
1487 for (;elementIterator != mMappedData.mSystemProperties.end(); ++elementIterator)
1489 if (elementIterator->type == property.
type)
1493 logVerbose(
"DatabaseHandler::changeSystemPropertyDB changed system property");
1514 mMappedData.mMainConnectionMap.erase(mainConnectionID);
1515 logVerbose(
"DatabaseHandler::removeMainConnectionDB removed:", mainConnectionID);
1532 mMappedData.mSinkMap.erase(sinkID);
1535 logVerbose(
"DatabaseHandler::removeSinkDB removed:", sinkID);
1553 mMappedData.mSourceMap.erase(sourceID);
1558 logVerbose(
"DatabaseHandler::removeSourceDB removed:", sourceID);
1572 mMappedData.mGatewayMap.erase(gatewayID);
1574 logVerbose(
"DatabaseHandler::removeGatewayDB removed:", gatewayID);
1588 mMappedData.mConverterMap.erase(converterID);
1590 logVerbose(
"DatabaseHandler::removeConverterDB removed:", converterID);
1603 mMappedData.mCrossfaderMap.erase(crossfaderID);
1605 logVerbose(
"DatabaseHandler::removeCrossfaderDB removed:", crossfaderID);
1619 mMappedData.mDomainMap.erase(domainID);
1621 logVerbose(
"DatabaseHandler::removeDomainDB removed:", domainID);
1636 mMappedData.mSinkClassesMap.erase(sinkClassID);
1638 logVerbose(
"DatabaseHandler::removeSinkClassDB removed:", sinkClassID);
1652 mMappedData.mSourceClassesMap.erase(sourceClassID);
1653 logVerbose(
"DatabaseHandler::removeSourceClassDB removed:", sourceClassID);
1666 mMappedData.mConnectionMap.erase(connectionID);
1668 logVerbose(
"DatabaseHandler::removeConnection removed:", connectionID);
1680 am_Source_Database_s source = mMappedData.mSourceMap.at(sourceID);
1688 classInfo = tmpClass;
1702 am_Sink_Database_s mappedSink = mMappedData.mSinkMap.at(sinkID);
1703 if(
true == mappedSink.reserved )
1705 sinkData = mappedSink;
1719 am_Source_Database_s mappedSource = mMappedData.mSourceMap.at(sourceID);
1720 if(
true == mappedSource.reserved )
1723 sourceData = mappedSource;
1736 mainConnectionData = temp;
1758 logVerbose(
"DatabaseHandler::setSinkClassInfoDB set setSinkClassInfo");
1779 logVerbose(
"DatabaseHandler::setSinkClassInfoDB set setSinkClassInfo");
1791 am_Sink_Database_s sink = mMappedData.mSinkMap.at(sinkID);
1800 sinkClass = tmpSinkClass;
1813 gatewayData = mMappedData.mGatewayMap.at(gatewayID);
1827 converterData = mMappedData.mConverterMap.at(converterID);
1841 crossfaderData = mMappedData.mCrossfaderMap.at(crossfaderID);
1855 std::unordered_map<am_sinkID_t, am_Sink_Database_s>::const_iterator elementIterator = mMappedData.mSinkMap.begin();
1856 for (;elementIterator != mMappedData.mSinkMap.end(); ++elementIterator)
1858 if (0==elementIterator->second.reserved && domainID==elementIterator->second.domainID)
1859 listSinkID.push_back(elementIterator->second.sinkID);
1866 listSourceID.clear();
1872 AmMapSource::const_iterator elementIterator = mMappedData.mSourceMap.begin();
1873 for (;elementIterator != mMappedData.mSourceMap.end(); ++elementIterator)
1875 if (0==elementIterator->second.reserved && domainID==elementIterator->second.domainID)
1876 listSourceID.push_back(elementIterator->second.sourceID);
1884 listCrossfader.clear();
1891 AmMapSource::const_iterator sourceIterator = mMappedData.mSourceMap.begin();
1892 for (;sourceIterator != mMappedData.mSourceMap.end(); ++sourceIterator)
1894 if (domainID==sourceIterator->second.domainID)
1896 AmMapCrossfader::const_iterator elementIterator = mMappedData.mCrossfaderMap.begin();
1897 for (;elementIterator != mMappedData.mCrossfaderMap.end(); ++elementIterator)
1899 if ( sourceIterator->second.sourceID==elementIterator->second.sourceID )
1900 listCrossfader.push_back(elementIterator->second.crossfaderID);
1911 listGatewaysID.clear();
1918 AmMapGateway::const_iterator elementIterator = mMappedData.mGatewayMap.begin();
1919 for (;elementIterator != mMappedData.mGatewayMap.end(); ++elementIterator)
1921 if (domainID==elementIterator->second.controlDomainID)
1922 listGatewaysID.push_back(elementIterator->second.gatewayID);
1929 listConvertersID.clear();
1936 AmMapConverter::const_iterator elementIterator = mMappedData.mConverterMap.begin();
1937 for (;elementIterator != mMappedData.mConverterMap.end(); ++elementIterator)
1939 if (domainID==elementIterator->second.domainID)
1940 listConvertersID.push_back(elementIterator->second.converterID);
1947 listMainConnections.clear();
1949 AmMapMainConnection::const_iterator elementIterator = mMappedData.mMainConnectionMap.begin();
1950 for (;elementIterator != mMappedData.mMainConnectionMap.end(); ++elementIterator)
1952 listMainConnections.push_back(elementIterator->second);
1960 listDomains.clear();
1962 AmMapDomain::const_iterator elementIterator = mMappedData.mDomainMap.begin();
1963 for (;elementIterator != mMappedData.mDomainMap.end(); ++elementIterator)
1965 if( 0==elementIterator->second.reserved )
1966 listDomains.push_back(elementIterator->second);
1974 listConnections.clear();
1976 AmMapConnection::const_iterator elementIterator = mMappedData.mConnectionMap.begin();
1977 for (;elementIterator != mMappedData.mConnectionMap.end(); ++elementIterator)
1979 if( 0==elementIterator->second.reserved )
1980 listConnections.push_back(elementIterator->second);
1988 listConnections.clear();
1990 AmMapConnection::const_iterator elementIterator = mMappedData.mConnectionMap.begin();
1991 for (;elementIterator != mMappedData.mConnectionMap.end(); ++elementIterator)
1993 if( elementIterator->second.reserved )
1994 listConnections.push_back(elementIterator->second);
2004 std::for_each(mMappedData.mSinkMap.begin(), mMappedData.mSinkMap.end(), [&](
const std::pair<am_sinkID_t, am_Sink_Database_s>& ref) {
2005 if( 0==ref.second.reserved )
2006 listSinks.push_back(ref.second);
2014 listSources.clear();
2016 std::for_each(mMappedData.mSourceMap.begin(), mMappedData.mSourceMap.end(), [&](
const std::pair<am_sourceID_t, am_Source_Database_s>& ref) {
2017 if( 0==ref.second.reserved )
2019 listSources.push_back(ref.second);
2027 listSourceClasses.clear();
2029 std::for_each(mMappedData.mSourceClassesMap.begin(), mMappedData.mSourceClassesMap.end(), [&](
const std::pair<am_sourceClass_t, am_SourceClass_s>& ref) {
2030 listSourceClasses.push_back(ref.second);
2038 listCrossfaders.clear();
2040 std::for_each(mMappedData.mCrossfaderMap.begin(), mMappedData.mCrossfaderMap.end(), [&](
const std::pair<am_crossfaderID_t, am_Crossfader_s>& ref) {
2041 listCrossfaders.push_back(ref.second);
2049 listGateways.clear();
2051 std::for_each(mMappedData.mGatewayMap.begin(), mMappedData.mGatewayMap.end(), [&](
const std::pair<am_gatewayID_t, am_Gateway_s>& ref) {
2052 listGateways.push_back(ref.second);
2060 listConverters.clear();
2062 std::for_each(mMappedData.mConverterMap.begin(), mMappedData.mConverterMap.end(), [&](
const std::pair<am_converterID_t, am_Converter_s>& ref) {
2063 listConverters.push_back(ref.second);
2071 listSinkClasses.clear();
2073 std::for_each(mMappedData.mSinkClassesMap.begin(), mMappedData.mSinkClassesMap.end(), [&](
const std::pair<am_gatewayID_t, am_SinkClass_s>& ref) {
2074 listSinkClasses.push_back(ref.second);
2082 listConnections.clear();
2083 std::for_each(mMappedData.mMainConnectionMap.begin(), mMappedData.mMainConnectionMap.end(), [&](
const std::pair<am_mainConnectionID_t, am_MainConnection_Database_s>& ref) {
2084 listConnections.emplace_back();
2085 ref.second.getMainConnectionType(listConnections.back());
2093 listMainSinks.clear();
2094 std::for_each(mMappedData.mSinkMap.begin(), mMappedData.mSinkMap.end(), [&](
const std::pair<am_sinkID_t, am_Sink_Database_s>& ref) {
2095 if( 0==ref.second.reserved && 1==ref.second.visible )
2097 listMainSinks.emplace_back();
2098 ref.second.getSinkType(listMainSinks.back());
2107 listMainSources.clear();
2108 std::for_each(mMappedData.mSourceMap.begin(), mMappedData.mSourceMap.end(), [&](
const std::pair<am_sourceID_t, am_Source_Database_s>& ref) {
2109 if( 0==ref.second.reserved && 1==ref.second.visible )
2111 listMainSources.emplace_back();
2112 ref.second.getSourceType(listMainSources.back());
2127 const am_Sink_s & sink = mMappedData.mSinkMap.at(sinkID);
2140 const am_Source_s & source = mMappedData.mSourceMap.at(sourceID);
2154 const am_Sink_Database_s & sink = mMappedData.mSinkMap.at(sinkID);
2155 listSoundproperties = sink.listSoundProperties;
2168 const am_Source_Database_s & source = mMappedData.mSourceMap.at(sourceID);
2169 listSoundproperties = source.listSoundProperties;
2176 listSystemProperties = mMappedData.mSystemProperties;
2187 const am_Sink_s & sink = mMappedData.mSinkMap.at(sinkID);
2200 const am_Source_s & source = mMappedData.mSourceMap.at(sourceID);
2213 ListConnectionFormat::const_iterator iter = mListConnectionFormat.begin();
2214 iter = mListConnectionFormat.find(gatewayID);
2215 if (iter == mListConnectionFormat.end())
2217 logWarning(
"DatabaseHandler::getListGatewayConnectionFormats database error with convertionFormat");
2221 listConnectionFormat = iter->second;
2235 const am_MainConnection_s & mainConnection = mMappedData.mMainConnectionMap.at(mainConnectionID);
2236 delay = mainConnection.
delay;
2275 return (0==source->reserved);
2288 return sourceWithNameOrID(sourceID, name);
2308 bool returnVal =
false;
2309 AmMapSink::const_iterator elementIterator = mMappedData.mSinkMap.begin();
2310 for (;elementIterator != mMappedData.mSinkMap.end(); ++elementIterator)
2312 if( 0==elementIterator->second.reserved &&
2313 sinkID==elementIterator->second.sinkID)
2328 const CAmDatabaseHandlerMap::am_Source_Database_s * CAmDatabaseHandlerMap::sourceWithNameOrID(
const am_sourceID_t sourceID,
const std::string & name)
const 2330 std::function<bool(const CAmDatabaseHandlerMap::am_Source_Database_s & refObject)> comparator = [&](
const CAmDatabaseHandlerMap::am_Source_Database_s & source)->
bool{
2331 return ( 0==source.reserved &&
2332 (sourceID==source.sourceID || name.compare(source.name)==0));
2343 const CAmDatabaseHandlerMap::am_Sink_Database_s * CAmDatabaseHandlerMap::sinkWithNameOrID(
const am_sinkID_t sinkID,
const std::string & name)
const 2345 std::function<bool(const CAmDatabaseHandlerMap::am_Sink_Database_s & refObject)> comparator = [&](
const CAmDatabaseHandlerMap::am_Sink_Database_s & sink)->
bool{
2346 return ( 0==sink.reserved &&
2347 (sinkID==sink.sinkID || name.compare(sink.name)==0));
2360 return sinkWithNameOrID( sinkID, name)!=NULL;
2382 return (0==source->reserved);
2409 domainID = source->domainID;
2422 domainID = source->domainID;
2469 mMappedData.mConnectionMap[connectionID].delay = delay;
2475 AmMapMainConnection::const_iterator iter = mMappedData.mMainConnectionMap.begin();
2476 for(; iter != mMappedData.mMainConnectionMap.end(); ++iter)
2492 if( NULL!=connection )
2494 mMappedData.mConnectionMap.at(connectionID).reserved =
false;
2505 const am_MainConnection_s & mainConnection = mMappedData.mMainConnectionMap.at(mainConnectionID);
2507 std::vector<am_connectionID_t>::const_iterator iter = mainConnection.
listConnectionID.begin();
2513 delay += std::max(source->delay, static_cast<am_timeSync_t>(0));
2516 return (delay == 0 ? -1 : std::min(delay, static_cast<am_timeSync_t>(SHRT_MAX)));
2536 am_Source_Database_s source = mMappedData.mSourceMap.at(sourceID);
2537 return source.visible;
2550 if(0==source->reserved)
2551 return source->visible;
2564 am_Connection_Database_s
const * connectionObject = objectMatchingPredicate<am_Connection_Database_s, am_connectionID_t>(mMappedData.mConnectionMap, [&](
const am_Connection_Database_s & obj){
2565 return false==obj.reserved &&
2566 connection.
sinkID == obj.sinkID &&
2567 connection.
sourceID == obj.sourceID &&
2570 return ( NULL!=connectionObject );
2581 if( NULL!=connection )
2603 sourceState = source->sourceState;
2623 mMappedData.mSourceMap.at(sourceID).sourceState = sourceState;
2632 assert(sourceID!=0);
2636 mMappedData.mSourceMap.at(sourceID).interruptState = interruptState;
2649 mainVolume = source->mainVolume;
2663 volume = source->volume;
2676 volume = source->volume;
2690 if(pObject->listSoundProperties.size()>0 && 0==pObject->cacheSoundProperties.size())
2692 std::vector<am_SoundProperty_s>::const_iterator iter = pObject->listSoundProperties.begin();
2693 for(; iter<pObject->listSoundProperties.end(); ++iter)
2694 pObject->cacheSoundProperties[iter->type] = iter->value;
2696 auto it = pObject->cacheSoundProperties.find(propertyType);
2697 if(it!=pObject->cacheSoundProperties.end())
2713 if(pObject->listSoundProperties.size()>0 && 0==pObject->cacheSoundProperties.size())
2715 std::vector<am_SoundProperty_s>::const_iterator iter = pObject->listSoundProperties.begin();
2716 for(; iter<pObject->listSoundProperties.end(); ++iter)
2717 pObject->cacheSoundProperties[iter->type] = iter->value;
2719 auto it = pObject->cacheSoundProperties.find(propertyType);
2720 if(it!=pObject->cacheSoundProperties.end())
2736 if(pObject->listMainSoundProperties.size()>0 && 0==pObject->cacheMainSoundProperties.size())
2738 std::vector<am_MainSoundProperty_s>::const_iterator iter = pObject->listMainSoundProperties.begin();
2739 for(; iter<pObject->listMainSoundProperties.end(); ++iter)
2740 pObject->cacheMainSoundProperties[iter->type] = iter->value;
2742 auto it = pObject->cacheMainSoundProperties.find(propertyType);
2743 if(it!=pObject->cacheMainSoundProperties.end())
2760 if(pObject->listMainSoundProperties.size()>0 && 0==pObject->cacheMainSoundProperties.size())
2762 std::vector<am_MainSoundProperty_s>::const_iterator iter = pObject->listMainSoundProperties.begin();
2763 for(; iter<pObject->listMainSoundProperties.end(); ++iter)
2764 pObject->cacheMainSoundProperties[iter->type] = iter->value;
2766 auto it = pObject->cacheMainSoundProperties.find(propertyType);
2767 if(it!=pObject->cacheMainSoundProperties.end())
2785 state = source->state;
2797 am_Domain_Database_s
const *reservedDomain = objectMatchingPredicate<am_Domain_Database_s, am_domainID_t>(mMappedData.mDomainMap, [&](
const am_Domain_Database_s & obj){
2798 return name.compare(obj.name)==0;
2801 if( NULL != reservedDomain )
2803 domainID = reservedDomain->domainID;
2809 if( mMappedData.increaseID( nextID, mMappedData.mCurrentDomainID) )
2812 am_Domain_Database_s domain;
2813 domain.domainID = nextID;
2815 domain.reserved = 1;
2816 mMappedData.mDomainMap[nextID] = domain;
2826 am_Sink_Database_s
const *reservedSink = objectMatchingPredicate<am_Sink_Database_s, am_sinkID_t>(mMappedData.mSinkMap, [&](
const am_Sink_Database_s & obj){
2827 return name.compare(obj.name)==0;
2829 if( NULL!=reservedSink )
2831 sinkID = reservedSink->sinkID;
2837 if(mMappedData.increaseID(nextID, mMappedData.mCurrentSinkID))
2839 if(mFirstStaticSink)
2841 nextID = DYNAMIC_ID_BOUNDARY;
2842 mFirstStaticSink =
false;
2845 am_Sink_Database_s object;
2846 object.sinkID = nextID;
2848 object.reserved = 1;
2849 mMappedData.mSinkMap[nextID] = object;
2858 am_Source_Database_s
const *reservedSrc = objectMatchingPredicate<am_Source_Database_s, am_sourceID_t>(mMappedData.mSourceMap, [&](
const am_Source_Database_s & obj){
2859 return name.compare(obj.name)==0;
2861 if( NULL!=reservedSrc )
2863 sourceID = reservedSrc->sourceID;
2869 if(mMappedData.increaseID(nextID, mMappedData.mCurrentSourceID))
2871 if(mFirstStaticSource)
2874 mFirstStaticSource =
false;
2877 am_Source_Database_s object;
2878 object.sourceID = nextID;
2880 object.reserved = 1;
2881 mMappedData.mSourceMap[nextID] = object;
2897 mMappedData.mSinkMap[sinkID].volume = volume;
2908 mMappedData.mSourceMap[sourceID].volume = volume;
2921 am_Source_Database_s & source = mMappedData.mSourceMap[sourceID];
2922 std::vector<am_SoundProperty_s>::iterator iter = source.listSoundProperties.begin();
2923 for(; iter<source.listSoundProperties.end(); ++iter)
2925 if( soundProperty.
type == iter->type )
2927 iter->value = soundProperty.
value;
2928 if(source.cacheSoundProperties.size())
2929 source.cacheSoundProperties[soundProperty.
type] = soundProperty.
value;
2945 am_Sink_Database_s & sink = mMappedData.mSinkMap[sinkID];
2946 std::vector<am_SoundProperty_s>::iterator iter = sink.listSoundProperties.begin();
2947 for(; iter<sink.listSoundProperties.end(); ++iter)
2949 if( soundProperty.
type == iter->type )
2951 iter->value = soundProperty.
value;
2952 if(sink.cacheSoundProperties.size())
2953 sink.cacheSoundProperties[soundProperty.
type] = soundProperty.
value;
2970 mMappedData.mCrossfaderMap[crossfaderID].hotSink = hotsink;
2976 bool ret = isConnected(gateway);
2982 bool ret = isConnected(converter);
2990 am_SinkClass_Database_s
const *reserved = objectMatchingPredicate<am_SinkClass_Database_s, am_sinkClass_t>(mMappedData.mSinkClassesMap, [&](
const am_SinkClass_Database_s & obj){
2991 return name.compare(obj.name)==0;
2993 if( NULL!=reserved )
2995 sinkClassID = reserved->sinkClassID;
3005 am_SourceClass_Database_s
const *ptrSource = objectMatchingPredicate<am_SourceClass_Database_s, am_sourceClass_t>(mMappedData.mSourceClassesMap, [&](
const am_SourceClass_Database_s & obj){
3006 return name.compare(obj.name)==0;
3008 if( NULL!=ptrSource )
3010 sourceClassID = ptrSource->sourceClassID;
3028 std::vector<am_MainSoundProperty_s> listMainSoundPropertiesOut(listMainSoundProperties);
3031 std::unordered_map<am_sourceID_t, am_Source_Database_s>::iterator iter = mMappedData.mSourceMap.begin();
3032 for(; iter!=mMappedData.mSourceMap.end(); ++iter)
3034 if( iter->second.sourceID == sourceID )
3036 if (sourceClassID != 0)
3040 else if (0 == iter->second.reserved)
3042 sourceClassOut = iter->second.sourceClassID;
3049 if (!listSoundProperties.empty())
3051 mMappedData.mSourceMap.at(sourceID).listSoundProperties = listSoundProperties;
3052 mMappedData.mSourceMap.at(sourceID).cacheSoundProperties.clear();
3056 if (!listConnectionFormats.empty())
3058 mMappedData.mSourceMap.at(sourceID).listConnectionFormats = listConnectionFormats;
3064 if (!listMainSoundProperties.empty())
3066 DB_COND_UPDATE(mMappedData.mSourceMap.at(sourceID).listMainSoundProperties, listMainSoundProperties);
3067 mMappedData.mSourceMap.at(sourceID).cacheMainSoundProperties.clear();
3077 logVerbose(
"DatabaseHandler::changeSource changed changeSource of source:", sourceID);
3092 std::vector<am_MainSoundProperty_s> listMainSoundPropertiesOut(listMainSoundProperties);
3100 std::unordered_map<am_sinkID_t, am_Sink_Database_s>::iterator iter = mMappedData.mSinkMap.begin();
3101 for(; iter!=mMappedData.mSinkMap.end(); ++iter)
3103 if (iter->second.sinkID == sinkID)
3105 if (sinkClassID != 0)
3109 else if (0 == iter->second.reserved)
3111 sinkClassOut = iter->second.sinkClassID;
3118 if (!listSoundProperties.empty())
3120 mMappedData.mSinkMap.at(sinkID).listSoundProperties = listSoundProperties;
3121 mMappedData.mSinkMap.at(sinkID).cacheSoundProperties.clear();
3125 if (!listConnectionFormats.empty())
3127 mMappedData.mSinkMap.at(sinkID).listConnectionFormats = listConnectionFormats;
3133 if (!listMainSoundProperties.empty())
3135 DB_COND_UPDATE(mMappedData.mSinkMap.at(sinkID).listMainSoundProperties, listMainSoundProperties);
3136 mMappedData.mSinkMap.at(sinkID).cacheMainSoundProperties.clear();
3146 logVerbose(
"DatabaseHandler::changeSink changed changeSink of sink:", sinkID);
3162 listMainNotificationConfigurations.clear();
3164 listMainNotificationConfigurations = mMappedData.mSinkMap.at(sinkID).listMainNotificationConfigurations;
3178 listMainNotificationConfigurations = mMappedData.mSourceMap.at(sourceID).listMainNotificationConfigurations;
3186 std::vector<am_NotificationConfiguration_s>::iterator iter = listMainNotificationConfigurations.begin();
3187 for(; iter<listMainNotificationConfigurations.end(); ++iter)
3189 if( mainNotificationConfiguration.
type == iter->type )
3191 #ifdef WITH_DATABASE_CHANGE_CHECK 3192 if( iter->status == mainNotificationConfiguration.
status && iter->parameter == mainNotificationConfiguration.
parameter )
3195 *iter = mainNotificationConfiguration;
3213 logVerbose(
"DatabaseHandler::changeMainSinkNotificationConfigurationDB changed MainNotificationConfiguration of source:", sinkID,
"type:", mainNotificationConfiguration.
type,
"to status=", mainNotificationConfiguration.
status,
"and parameter=",mainNotificationConfiguration.
parameter);
3215 NOTIFY_OBSERVERS2(dboSinkMainNotificationConfigurationChanged, sinkID, mainNotificationConfiguration)
3232 logVerbose(
"DatabaseHandler::changeMainSourceNotificationConfigurationDB changed MainNotificationConfiguration of source:", sourceID,
"type:", mainNotificationConfiguration.
type,
"to status=", mainNotificationConfiguration.
status,
"and parameter=",mainNotificationConfiguration.
parameter);
3234 NOTIFY_OBSERVERS2(dboSourceMainNotificationConfigurationChanged, sourceID, mainNotificationConfiguration)
3248 if (!listSourceConnectionFormats.empty())
3250 mMappedData.mGatewayMap.at(gatewayID).listSourceFormats = listSourceConnectionFormats;
3253 if (!listSinkConnectionFormats.empty())
3255 mMappedData.mGatewayMap.at(gatewayID).listSinkFormats = listSinkConnectionFormats;
3258 if (!convertionMatrix.empty())
3260 mListConnectionFormat.clear();
3261 mListConnectionFormat.insert(std::make_pair(gatewayID, convertionMatrix));
3264 logVerbose(
"DatabaseHandler::changeGatewayDB changed Gateway with ID", gatewayID);
3279 if (!listSourceConnectionFormats.empty())
3281 mMappedData.mConverterMap.at(converterID).listSourceFormats = listSourceConnectionFormats;
3284 if (!listSinkConnectionFormats.empty())
3286 mMappedData.mConverterMap.at(converterID).listSinkFormats = listSinkConnectionFormats;
3289 if (!convertionMatrix.empty())
3291 mListConnectionFormat.clear();
3292 mListConnectionFormat.insert(std::make_pair(converterID, convertionMatrix));
3295 logVerbose(
"DatabaseHandler::changeConverterDB changed Gateway with ID", converterID);
3303 bool changed =
false;
3304 std::vector<am_NotificationConfiguration_s>::iterator iter = listNotificationConfigurations.begin();
3305 for(; iter<listNotificationConfigurations.end(); ++iter)
3307 if( notificationConfiguration.
type == iter->type )
3309 iter->status = notificationConfiguration.
status;
3310 iter->parameter = notificationConfiguration.
parameter;
3328 logVerbose(
"DatabaseHandler::changeMainSinkNotificationConfigurationDB changed MainNotificationConfiguration of source:", sinkID,
"type:", notificationConfiguration.
type,
"to status=", notificationConfiguration.
status,
"and parameter=",notificationConfiguration.
parameter);
3346 logVerbose(
"DatabaseHandler::changeSourceNotificationConfigurationDB changed MainNotificationConfiguration of source:", sourceID,
"type:", notificationConfiguration.
type,
"to status=", notificationConfiguration.
status,
"and parameter=",notificationConfiguration.
parameter);
3354 for(
auto it = mMappedData.mSourceMap.begin(); it!=mMappedData.mSourceMap.end(); it++)
3356 const am_Source_Database_s *pObject = &it->second;
3357 if( 0==pObject->reserved )
3365 for(
auto it = mMappedData.mSinkMap.begin(); it!=mMappedData.mSinkMap.end(); it++)
3367 const am_Sink_Database_s *pObject = &it->second;
3368 if( 0==pObject->reserved )
3376 for(
auto it = mMappedData.mGatewayMap.begin(); it!=mMappedData.mGatewayMap.end(); it++)
3386 for(
auto it = mMappedData.mConverterMap.begin(); it!=mMappedData.mConverterMap.end(); it++)
3395 assert(iObserver!=NULL);
3396 if (std::find(mDatabaseObservers.begin(), mDatabaseObservers.end(), iObserver) == mDatabaseObservers.end())
3398 mDatabaseObservers.push_back(static_cast<AmDatabaseObserverCallbacks*>(iObserver));
3405 assert(iObserver!=NULL);
3406 auto it = std::find(mDatabaseObservers.begin(), mDatabaseObservers.end(), iObserver);
3407 if (it != mDatabaseObservers.end()) {
3408 mDatabaseObservers.erase(it);
3416 return mDatabaseObservers.size();
am_Error_e getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s &mainConnectionData) const
am_Error_e getListSinkClasses(std::vector< am_SinkClass_s > &listSinkClasses) const
am_sourceID_t sourceID
The sourceID of the converter sink-end.
am_Error_e removeConverterDB(const am_converterID_t converterID)
am_Error_e getListGateways(std::vector< am_Gateway_s > &listGateways) const
std::string busname
the busname.
am_Error_e changeSinkMuteStateDB(const am_MuteState_e muteState, const am_sinkID_t sinkID)
am_Error_e getListConnections(std::vector< am_Connection_s > &listConnections) const
std::string name
The name of the crossfader.
am_Error_e changeCrossFaderHotSink(const am_crossfaderID_t crossfaderID, const am_HotSink_e hotsink)
am_Error_e changeSinkDB(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector< am_SoundProperty_s > &listSoundProperties, const std::vector< am_CustomAvailabilityReason_t > &listConnectionFormats, const std::vector< am_MainSoundProperty_s > &listMainSoundProperties)
am_MuteState_e muteState
This attribute reflects the muteState of the sink.
uint16_t am_connectionID_t
a connection ID
uint16_t am_CustomSoundPropertyType_t
Within genivi only the some example properties are defined.
am_Error_e changeDelayMainConnection(const am_timeSync_t &delay, const am_mainConnectionID_t &connectionID)
am_Error_e getListSourcesOfDomain(const am_domainID_t domainID, std::vector< am_sourceID_t > &listSourceID) const
std::vector< am_ClassProperty_s > listClassProperties
the list of the class properties.
bool sourceVisible(const am_sourceID_t sourceID) const
registers the Observer at the Database
void logWarning(T value, TArgs...args)
logs given values with warninglevel with the default context
am_converterID_t converterID
This is the ID of the converter, it is unique in the system.
A Common-API wrapper class, which loads the common-api runtime and instantiates all necessary objects...
am_sourceClass_t sourceClassID
the source ID
the desired object is non existent
bool existsObjectWithKeyInMap(const TMapKeyType &key, const std::unordered_map< TMapKeyType, TMapObjectType > &map)
bool existSourceName(const std::string &name) const
checks if a name exits
am_CustomNotificationType_t type
The notification type of the notification.
am_Error_e
the errors of the audiomanager.
am_Error_e changeConnectionFinal(const am_connectionID_t connectionID)
This struct holds information about the configuration for notifications.
the desired object already exists
am_Error_e peekDomain(const std::string &name, am_domainID_t &domainID)
am_Error_e changeSourceNotificationConfigurationDB(const am_sourceID_t sourceID, const am_NotificationConfiguration_s notificationConfiguration)
am_Error_e getListSinkSoundProperties(const am_sinkID_t sinkID, std::vector< am_SoundProperty_s > &listSoundproperties) const
am_Error_e getListMainSinkSoundProperties(const am_sinkID_t sinkID, std::vector< am_MainSoundProperty_s > &listSoundProperties) const
std::vector< am_ClassProperty_s > listClassProperties
the list of the class properties.
struct describing source classes
This struct describes the attribiutes of a sink.
bool sinkVisible(const am_sinkID_t sinkID) const
gives information about the visibility of a sink
int16_t value
the actual value
am_DomainState_e state
the current domain state
am_Error_e getListMainSinkNotificationConfigurations(const am_sinkID_t sinkID, std::vector< am_NotificationConfiguration_s > &listMainNotificationConfigurations)
am_sinkID_t sinkID_A
The sinkID of the SinkA.
am_Error_e getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t &domainID) const
am_Error_e changeSourceVolume(const am_sourceID_t sourceID, const am_volume_t volume)
am_Error_e getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s &sinkData) const
am_Error_e removeMainConnectionDB(const am_mainConnectionID_t mainConnectionID)
am_Error_e getListSources(std::vector< am_Source_s > &lisSources) const
const TReturn * objectMatchingPredicate(const std::unordered_map< TIdentifier, TReturn > &map, std::function< bool(const TReturn &refObject)> comparator)
Returns an object matching predicate.
am_Error_e enumerateSinks(std::function< void(const am_Sink_s &element)> cb) const
am_sinkID_t sinkID
This is the ID of the sink, it is unique in the system.
unsigned countObservers()
am_Error_e removeSinkClassDB(const am_sinkClass_t sinkClassID)
This struct describes the attribiutes of a domain.
am_domainID_t controlDomainID
This is the ID of the domain that registers the gateway.
std::string name
The name of the source.
uint16_t am_crossfaderID_t
a crossfader ID
am_sinkID_t sinkID
the sinkID
uint16_t am_CustomConnectionFormat_t
This type classifies the format in which data is exchanged within a connection.
am_sinkID_t sinkID
The sinkID of the convertersink-end.
am_HotSink_e hotSink
This enum can have 3 states:
am_Error_e getListMainSources(std::vector< am_SourceType_s > &listMainSources) const
uint16_t am_CustomMainSoundPropertyType_t
Here are all SoundProperties that can be set via the CommandInterface.
am_Error_e changeSinkAvailabilityDB(const am_Availability_s &availability, const am_sinkID_t sinkID)
am_Error_e getListCrossfadersOfDomain(const am_domainID_t domainID, std::vector< am_crossfaderID_t > &listGatewaysID) const
this type holds all information of sinks relevant to the HMI
am_Error_e changeDomainStateDB(const am_DomainState_e domainState, const am_domainID_t domainID)
am_sourceID_t sourceID
the sourceID where the connection starts
am_crossfaderID_t crossfaderID
This is the ID of the crossfader, it is unique in the system.
am_SourceState_e sourceState
The source state is an indication towards the source if it is actively heard or not.
bool isDataEqual(const T &left, const T &right)
int16_t am_timeSync_t
offset time that is introduced in milli seconds.
am_Error_e enumerateSources(std::function< void(const am_Source_s &element)> cb) const
am_Availability_s availability
the availability of the source
am_Error_e changeSystemPropertyDB(const am_SystemProperty_s &property)
am_Error_e getListSourceSoundProperties(const am_sourceID_t sourceID, std::vector< am_SoundProperty_s > &listSoundproperties) const
bool existSink(const am_sinkID_t sinkID) const
checks for a certain Sink
am_Error_e getListSinksOfDomain(const am_domainID_t domainID, std::vector< am_sinkID_t > &listSinkID) const
am_gatewayID_t gatewayID
This is the ID of the gateway, it is unique in the system.
am_Error_e getConverterInfoDB(const am_converterID_t converterID, am_Converter_s &converterData) const
am_sourceClass_t sourceClassID
the sourceClassID, indicates the class the source is in.
describes class properties
SPDX license identifier: MPL-2.0.
am_Error_e getListSourceConnectionFormats(const am_sourceID_t sourceID, std::vector< am_CustomAvailabilityReason_t > &listConnectionFormats) const
std::string name
the name of the sourceClass - must be unique in the system
struct that holds attribiutes of a mainconnection
am_Error_e getSoureState(const am_sourceID_t sourceID, am_SourceState_e &sourceState) const
am_Error_e getListMainConnections(std::vector< am_MainConnection_s > &listMainConnections) const
bool existConverter(const am_converterID_t converterID) const
am_sinkID_t sinkID
The sinkID of the gateway sink-end.
am_Error_e peekSink(const std::string &name, am_sinkID_t &sinkID)
am_Error_e changeSourceClassInfoDB(const am_SourceClass_s &sourceClass)
SPDX license identifier: MPL-2.0.
bool existDomain(const am_domainID_t domainID) const
checks for a certain domain
bool existConnectionID(const am_connectionID_t connectionID) const
checks if a connection with the given ID exists
am_Error_e enterSourceDB(const am_Source_s &sourceData, am_sourceID_t &sourceID)
am_Error_e changeConnectionTimingInformation(const am_connectionID_t connectionID, const am_timeSync_t delay)
am_Error_e changeSinkClassInfoDB(const am_SinkClass_s &sinkClass)
am_Error_e getListSystemProperties(std::vector< am_SystemProperty_s > &listSystemProperties) const
am_CustomConnectionFormat_t connectionFormat
the used connectionformat
am_sinkID_t sinkID
the sinkID where the connection ends
am_Error_e getListGatewaysOfDomain(const am_domainID_t domainID, std::vector< am_gatewayID_t > &listGatewaysID) const
std::string name
The name of the sink.
am_Error_e getListSinks(std::vector< am_Sink_s > &listSinks) const
std::vector< am_MainSoundProperty_s > listMainSoundProperties
This is the list of the available mainSoundProperties.
am_Error_e getSinkMainVolume(const am_sinkID_t sinkID, am_mainVolume_t &mainVolume) const
struct describing system properties
am_Error_e getSinkSoundPropertyValue(const am_sinkID_t sinkID, const am_CustomSoundPropertyType_t propertyType, int16_t &value) const
am_mainConnectionID_t mainConnectionID
the assigned ID
bool existConnection(const am_Connection_s &connection) const
checks if a connection already exists.
uint16_t am_converterID_t
a converter ID
void logVerbose(T value, TArgs...args)
logs given values with verbose with the default context
am_sourceID_t sourceID
The sourceID of the crossfader source.
am_Error_e getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s &sourceData) const
#define NOTIFY_OBSERVERS(CALL)
am_Error_e removeDomainDB(const am_domainID_t domainID)
am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector< am_connectionID_t > &listConnectionID)
bool existCrossFader(const am_crossfaderID_t crossfaderID) const
checks if a CrossFader exists
am_Error_e peekSourceClassID(const std::string &name, am_sourceClass_t &sourceClassID)
am_Error_e getSourceVolume(const am_sourceID_t sourceID, am_volume_t &volume) const
am_sourceID_t sourceID
This is the ID of the source, it is unique in the system.
am_Error_e enterSinkClassDB(const am_SinkClass_s &sinkClass, am_sinkClass_t &sinkClassID)
struct describung mainsound property
am_Error_e getListDomains(std::vector< am_Domain_s > &listDomains) const
SPDX license identifier: MPL-2.0.
bool unregisterObserver(IAmDatabaseObserver *iObserver)
am_ConnectionState_e connectionState
the current connection state
bool existSourceNameOrID(const am_sourceID_t sourceID, const std::string &name) const
checks if a source name or ID exists
am_Availability_s availability
This attribute reflects the availability of the sink.
am_Error_e removeConnection(const am_connectionID_t connectionID)
am_domainID_t domainID
The domainID is the domain the source belongs to.
#define DB_COND_UPDATE(x, y)
am_ConnectionState_e connectionState
the current connection state
std::string name
The name of the gateway.
am_Error_e enterSourceClassDB(am_sourceClass_t &sourceClassID, const am_SourceClass_s &sourceClass)
am_Error_e getSourceClassInfoDB(const am_sourceID_t sourceID, am_SourceClass_s &classInfo) const
am_Error_e getListSinkConnectionFormats(const am_sinkID_t sinkID, std::vector< am_CustomAvailabilityReason_t > &listConnectionFormats) const
bool existSourceClass(const am_sourceClass_t sourceClassID) const
checks for certain sourceClass
am_Error_e changeSinkMainVolumeDB(const am_mainVolume_t mainVolume, const am_sinkID_t sinkID)
am_Error_e peekSource(const std::string &name, am_sourceID_t &sourceID)
am_Error_e changeSinkVolume(const am_sinkID_t sinkID, const am_volume_t volume)
virtual ~CAmDatabaseHandlerMap()
am_Error_e enumerateConverters(std::function< void(const am_Converter_s &element)> cb) const
uint16_t am_sourceID_t
a source ID
am_CustomMainSoundPropertyType_t type
the type of the property
struct describing the sound property
am_sinkID_t sinkID
This is the ID of the sink, it is unique in the system.
am_Error_e getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t &domainID) const
am_Error_e removeCrossfaderDB(const am_crossfaderID_t crossfaderID)
am_sourceClass_t sourceClassID
the sourceClassID, indicates the class the source is in.
am_CustomSystemPropertyType_t type
the type that is set
am_sourceID_t sourceID
the source the audio flows from
am_sourceID_t sourceID
the sourceID
am_sinkClass_t sinkClassID
The sinkClassID references to a sinkClass.
am_Error_e enterCrossfaderDB(const am_Crossfader_s &crossfaderData, am_crossfaderID_t &crossfaderID)
struct describing sinkclasses
bool visible
This Boolean flag indicates whether a source is visible to the commandInterface or not...
am_NotificationStatus_e status
The Notification status.
am_Error_e removeSinkDB(const am_sinkID_t sinkID)
am_Error_e getSourceSoundPropertyValue(const am_sourceID_t sourceID, const am_CustomSoundPropertyType_t propertyType, int16_t &value) const
bool existSinkClass(const am_sinkClass_t sinkClassID) const
checks for certain SinkClass
am_Error_e getSinkVolume(const am_sinkID_t sinkID, am_volume_t &volume) const
am_Error_e enterDomainDB(const am_Domain_s &domainData, am_domainID_t &domainID)
The following interface methods must be implemented by the subclass.
Database observer protocol.
#define DB_COND_ISMODIFIED
This class handles and abstracts the database.
am_CustomAvailabilityReason_t availabilityReason
the reason for the last change.
bool changeNotificationConfiguration(std::vector< am_NotificationConfiguration_s > &listNotificationConfigurations, const am_NotificationConfiguration_s ¬ificationConfiguration)
am_Error_e getListCrossfaders(std::vector< am_Crossfader_s > &listCrossfaders) const
am_Error_e getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s &gatewayData) const
std::string nodename
the name of the node
std::vector< am_connectionID_t > listConnectionID
the list of sub connection IDs the mainconnection consists of
am_Error_e getCrossfaderInfoDB(const am_crossfaderID_t crossfaderID, am_Crossfader_s &crossfaderData) const
am_mainVolume_t volume
This is the representation of the Volume for the commandInterface.
am_ConnectionState_e
represents the connection state
std::vector< am_MainSoundProperty_s > listMainSoundProperties
This is the list of the available mainSoundProperties.
This struct describes the attributes of a converter.
am_Error_e getListMainSourceSoundProperties(const am_sourceID_t sourceID, std::vector< am_MainSoundProperty_s > &listSourceProperties) const
bool existSource(const am_sourceID_t sourceID) const
checks for a certain Source
bool changeMainNotificationConfiguration(std::vector< am_NotificationConfiguration_s > &listMainNotificationConfigurations, const am_NotificationConfiguration_s &mainNotificationConfiguration)
am_Error_e removeSourceClassDB(const am_sourceClass_t sourceClassID)
bool registerObserver(IAmDatabaseObserver *iObserver)
am_Error_e getListSourceClasses(std::vector< am_SourceClass_s > &listSourceClasses) const
am_HotSink_e
describes the active sink of a crossfader.
am_Error_e changeSourceInterruptState(const am_sourceID_t sourceID, const am_InterruptState_e interruptState)
am_Availability_e availability
the current availability state
am_Error_e enumerateGateways(std::function< void(const am_Gateway_s &element)> cb) const
int16_t am_volume_t
The unit is 0.1 db steps,The smallest value -3000 (=AM_MUTE).
This struct describes the attribiutes of a crossfader.
am_sourceID_t sourceID
This is the ID of the source, it is unique in the system.
am_CustomSoundPropertyType_t type
the type of the property - a project specific enum
am_sinkID_t sinkID_B
The sinkID of the SinkB.
am_Error_e enterConnectionDB(const am_Connection_s &connection, am_connectionID_t &connectionID)
am_Error_e changeMainSinkNotificationConfigurationDB(const am_sinkID_t sinkID, const am_NotificationConfiguration_s mainNotificationConfiguration)
am_Error_e getListConnectionsReserved(std::vector< am_Connection_s > &listConnections) const
am_Error_e changeMainSourceNotificationConfigurationDB(const am_sourceID_t sourceID, const am_NotificationConfiguration_s mainNotificationConfiguration)
am_Error_e changeSourceSoundPropertyDB(const am_SoundProperty_s &soundProperty, const am_sourceID_t sourceID)
am_Error_e getMainSinkSoundPropertyValue(const am_sinkID_t sinkID, const am_CustomMainSoundPropertyType_t propertyType, int16_t &value) const
bool isComponentConnected(const am_Gateway_s &gateway) const
am_Error_e changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState)
this type holds all information of connections relevant to the HMI
the desired action is not possible
am_Error_e changeMainSinkSoundPropertyDB(const am_MainSoundProperty_s &soundProperty, const am_sinkID_t sinkID)
bool existGateway(const am_gatewayID_t gatewayID) const
checks for certain gateway
am_sourceID_t sourceID
The sourceID of the gateway sink-end.
uint16_t am_sourceClass_t
am_connectionID_t connectionID
the assigned ID
std::string name
the name of the sinkClass - must be unique in the system
am_domainID_t domainID
the domain ID
am_domainID_t domainID
This is the ID of the domain that registers the converter.
am_Error_e enterMainConnectionDB(const am_MainConnection_s &mainConnectionData, am_mainConnectionID_t &connectionID)
am_Error_e removeGatewayDB(const am_gatewayID_t gatewayID)
am_Error_e peekSinkClassID(const std::string &name, am_sinkClass_t &sinkClassID)
this describes the availability of a sink or a source together with the latest change ...
am_Error_e getDomainState(const am_domainID_t domainID, am_DomainState_e &state) const
am_Error_e changeSourceDB(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector< am_SoundProperty_s > &listSoundProperties, const std::vector< am_CustomAvailabilityReason_t > &listConnectionFormats, const std::vector< am_MainSoundProperty_s > &listMainSoundProperties)
This struct describes the attributes of a gateway.
am_Error_e getListConvertersOfDomain(const am_domainID_t domainID, std::vector< am_converterID_t > &listConvertersID) const
void logError(T value, TArgs...args)
logs given values with errorlevel with the default context
am_Error_e changeSourceAvailabilityDB(const am_Availability_s &availability, const am_sourceID_t sourceID)
#define NOTIFY_OBSERVERS1(CALL, ARG1)
am_timeSync_t delay
the delay of the mainconnection
am_mainConnectionID_t mainConnectionID
the ID of the mainconnection
am_Error_e changeSourceState(const am_sourceID_t sourceID, const am_SourceState_e sourceState)
am_Error_e changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s &soundProperty, const am_sourceID_t sourceID)
#define NOTIFY_OBSERVERS2(CALL, ARG1, ARG2)
void dump(std::ostream &output) const
uint16_t am_domainID_t
a domain ID
am_Error_e enterSystemProperties(const std::vector< am_SystemProperty_s > &listSystemProperties)
am_Error_e enterSinkDB(const am_Sink_s &sinkData, am_sinkID_t &sinkID)
int16_t am_mainVolume_t
This is the volume presented on the command interface.
std::string name
The name of the converter.
am_Error_e changeSinkSoundPropertyDB(const am_SoundProperty_s &soundProperty, const am_sinkID_t sinkID)
no error - positive reply
bool existSinkName(const std::string &name) const
checks if a sink with the name exists
TMapObjectType const * objectForKeyIfExistsInMap(const TMapKeyType &key, const std::unordered_map< TMapKeyType, TMapObjectType > &map)
am_Error_e getListMainSourceNotificationConfigurations(const am_sourceID_t sourceID, std::vector< am_NotificationConfiguration_s > &listMainNotificationConfigurations)
int16_t value
the actual value of the property
am_Error_e getListVisibleMainConnections(std::vector< am_MainConnectionType_s > &listConnections) const
am_Error_e getDomainOfCrossfader(const am_converterID_t crossfader, am_domainID_t &domainID) const
#define DB_COND_UPDATE_RIE(x, y)
std::vector< am_CustomConnectionFormat_t > listConnectionFormats
This list holds information about the formats that the Source is capable of supporting when deliverin...
#define DB_COND_UPDATE_INIT
only relevant for connectionStatechanged.
this type holds all information of sources relevant to the HMI
bool existSinkNameOrID(const am_sinkID_t sinkID, const std::string &name) const
checks if a sink with the ID or the name exists
uint16_t am_gatewayID_t
a gateway ID
This struct describes the attribiutes of a source.
am_Error_e removeSourceDB(const am_sourceID_t sourceID)
am_Error_e enterGatewayDB(const am_Gateway_s &gatewayData, am_gatewayID_t &gatewayID)
std::string name
The name of the sink.
am_Error_e getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t &delay) const
am_volume_t volume
This is the volume of the sink.
am_Error_e getListConverters(std::vector< am_Converter_s > &listConverters) const
std::string name
The name of the source.
std::string name
the name of the domain
uint16_t am_sinkID_t
a sink ID
uint16_t am_mainConnectionID_t
a mainConnection ID
am_Error_e changeSinkNotificationConfigurationDB(const am_sinkID_t sinkID, const am_NotificationConfiguration_s notificationConfiguration)
am_Error_e changeGatewayDB(const am_gatewayID_t gatewayID, const std::vector< am_CustomAvailabilityReason_t > &listSourceConnectionFormats, const std::vector< am_CustomAvailabilityReason_t > &listSinkConnectionFormats, const std::vector< bool > &convertionMatrix)
int16_t parameter
This gives additional information to the notification status.
am_domainID_t domainID
The domainID is the domain the sink belongs to.
am_SourceState_e
The source state reflects the state of the source.
am_Error_e getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s &sinkClass) const
am_Error_e changeConverterDB(const am_converterID_t converterID, const std::vector< am_CustomConnectionFormat_t > &listSourceConnectionFormats, const std::vector< am_CustomConnectionFormat_t > &listSinkConnectionFormats, const std::vector< bool > &convertionMatrix)
am_sinkClass_t sinkClassID
The sinkClassID references to a sinkClass.
am_Error_e getListGatewayConnectionFormats(const am_gatewayID_t gatewayID, std::vector< bool > &listConnectionFormat) const
am_Error_e getListMainSinks(std::vector< am_SinkType_s > &listMainSinks) const
a database error occurred
am_Error_e enterConverterDB(const am_Converter_s &converterData, am_converterID_t &converterID)
bool existMainConnection(const am_mainConnectionID_t mainConnectionID) const
checks for a certain mainConnection
am_timeSync_t delay
the delay of the connection
#define NOTIFY_OBSERVERS4(CALL, ARG1, ARG2, ARG3, ARG4)
am_sinkClass_t sinkClassID
the ID of the sinkClass
std::vector< am_CustomConnectionFormat_t > listConnectionFormats
This list holds information about the formats that the Source is capable of supporting when deliverin...
am_Error_e getMainSourceSoundPropertyValue(const am_sourceID_t sourceID, const am_CustomMainSoundPropertyType_t propertyType, int16_t &value) const
am_sinkID_t sinkID
the sink the audio flows to