ERIS CORE

◆ queryTypesByFunction()

uint16_t AudioDirector::queryTypesByFunction ( const char *  function)
protected

query the obj pool for the list of audio blocks belonging to the given function type

Parameters
function
Returns
uint16_t

Definition at line 282 of file AudioDirector.cpp.

282  {
284  for (uint16_t j = 0; j < MAX_AUDIO_TYPES_BY_FUNCTION_QUERY_RESULT; j++){
285  query_result[j] = 0;
286  }
287 
288  for (uint16_t i = 0; i < obj_count; i++){ //for each object
289  bool found;
290  found = false;
291  for (uint16_t j = 0; j < MAX_AUDIO_TYPES_BY_FUNCTION_QUERY_RESULT; j++){ //check if cat name is already in the list
292  if (query_result[j] != 0){ //dont test uninitialized string pointers
293  if ((strcmp(*query_result[j],p_audiostream_obj_pool[i]->short_name)==0)) found = true;
294  }
295  }
296  if (found==false && (strcmp(function,p_audiostream_obj_pool[i]->category)==0)) query_result[query_result_count++] = (char**)&p_audiostream_obj_pool[i]->short_name; //add to the list if not existing
297  if (query_result_count==MAX_AUDIO_TYPES_BY_FUNCTION_QUERY_RESULT) return query_result_count; //limit the result list to the size of the category buffer
298  }
299 
300  return query_result_count;
301 }
AudioStream * p_audiostream_obj_pool[MAX_AUDIO_STREAM_OBJECTS]
Definition: AudioDirector.h:71
uint16_t query_result_count
Definition: AudioDirector.h:79
char **volatile query_result[MAX_AUDIO_TYPES_BY_FUNCTION_QUERY_RESULT]
Definition: AudioDirector.h:81
uint16_t obj_count
Definition: AudioDirector.h:77

References obj_count, p_audiostream_obj_pool, query_result, and query_result_count.

Referenced by getTypeCountByFunction(), and getTypeListItem().

+ Here is the caller graph for this function: