am_tone_sequence_handler.cc
来自「Motorola synergy audio component」· CC 代码 · 共 735 行 · 第 1/2 页
CC
735 行
current->Next = item; item->Prev = current; item->Next = NULL; current = current->Next; } current = current->Next; } } }}// ==============================================================================// Determine if we have anything in our queue to do// ==============================================================================BOOL Event_Queue_Handler::Exists(){ return (Head != NULL);}// ==============================================================================// Find the item from our list// ==============================================================================Tone_Item* Event_Queue_Handler::FindItem(TD_AUD_TONE_REQ_TONE_TYPE_T tone){ Tone_Item * current = Head; BOOL found = FALSE; while(current != NULL && !found) { if(current->ToneEvent.type == tone) { found = TRUE; } else { current = current->Next; } } return current;}// ==============================================================================// Find the item from our list// ==============================================================================Tone_Item* Event_Queue_Handler::FindItem(TD_AUD_TONE_REQ_TONE_TYPE_T tone, UINT32 seq){ Tone_Item * current = Head; BOOL found = FALSE; while(current != NULL && !found) { if((current->ToneEvent.type == tone) && ((current->SequenceID == seq) || (current->SequenceID == INVALID_SEQ_NUMBER) || (current->SequenceID == 0))) { found = TRUE; } else { current = current->Next; } } return current;}// ==============================================================================// Find the item from our list// ==============================================================================Tone_Item* Event_Queue_Handler::FindItem(UINT32 seq){ Tone_Item * current = Head; BOOL found = FALSE; while(current != NULL && !found) { if(current->SequenceID == seq) { found = TRUE; } else { current = current->Next; } } return current;}// ==============================================================================// Find the item from our list// ==============================================================================Tone_Item* Event_Queue_Handler::FindItem(AM_AUDIO_PATH_TYPE path_type){ Tone_Item * current = Head; BOOL found = FALSE; while(current != NULL && !found) { if(current->Path == path_type) { found = TRUE; } else { current = current->Next; } } return current;}// ==============================================================================// Remove the item from our list// ==============================================================================BOOL Event_Queue_Handler::Remove(TD_AUD_TONE_REQ_TONE_TYPE_T tone, UINT32 seq){ BOOL Success = FALSE; Tone_Item * current = FindItem(tone, seq); if (current != NULL) { Remove(current); Success = TRUE; } return (Success);}// ==============================================================================//Remove the item from our list. // ==============================================================================void Event_Queue_Handler::Detach(Tone_Item *current){ if ( current->ToneEvent.fields.id == DL_AUDIO_TONE_TYPE_MULTIMEDIA_PTT ) { am_set_ptt_session_state( FALSE ); } if(current == Head) { Head = current->Next; if(Head != NULL) { Head->Prev = NULL; } } else { current->Prev->Next = current->Next; if(current->Next != NULL) { current->Next->Prev = current->Prev; } }}// ==============================================================================//Remove the item from our list. // ==============================================================================void Event_Queue_Handler::Remove(Tone_Item *current){ Detach(current); current->Init();}void Event_Queue_Handler::RemoveAll(UINT8 path){ Tone_Item * current = Head; while(current != NULL) { if(current->Path == path) { Remove(current); current = Head; } else { current=current->Next; } }}// ==============================================================================// Turns off the uplink field of the specific item passed in// ==============================================================================void Event_Queue_Handler::TurnOffDtmfUL(Tone_Item *current){ if(current != NULL) { current->Uplink = FALSE; }} // ==============================================================================// find the record by the dsp sequence number// ==============================================================================Tone_Item * Event_Queue_Handler::FindbyDSPSeq (UINT8 DSP_Seq_Num){ Tone_Item * current = Head; while(current != NULL) { if(current->DSPSequenceID == DSP_Seq_Num) { return current; } current = current->Next; } return NULL;}// ==============================================================================// find the record by the media sequence number// ==============================================================================Tone_Item * Event_Queue_Handler::FindbyMediaSeq(UINT32 Seq_Num){ Tone_Item * current = Head; while(current != NULL) { if(current->MediaInfo.seq == Seq_Num) { return current; } current = current->Next; } return NULL;}// ==============================================================================// ==============================================================================Tone_Item * Event_Queue_Handler::GetCurrent(){ return Head;}// ===============================================================================// Update the tone status// ==============================================================================void Event_Queue_Handler:: UpdateStatus(Tone_Item *current, AM_TONE_STATUS_T status){ if (current != NULL) { current->status = status; }}// ===============================================================================// determine and return the tone priority// ==============================================================================AM_AUDIO_PRIORITY_T Event_Queue_Handler::GetPriority(Tone_Item *current){ AM_AUDIO_PRIORITY_T priority = AM_AUDIO_PRIORITY_INVALID; if (current != NULL) { switch (current->Path) { case AM_AUDIO_PATH_ID_MULTIMEDIA_MFT_VIB: case AM_AUDIO_PATH_ID_MULTIMEDIA_ALERT: case AM_AUDIO_PATH_ID_ALERT_LITE: priority = AM_AUDIO_PRIORITY_ALERT; break; case AM_AUDIO_PATH_ID_MULTIMEDIA_UI: case AM_AUDIO_PATH_ID_UI_LITE: if ( isIndicationUI(current->ToneEvent.fields.id) || isAlertUI(current->ToneEvent.fields.id) ) { priority = AM_AUDIO_PRIORITY_UI_IND; } else if (current->ToneEvent.fields.id == DL_AUDIO_TONE_TYPE_POWERDOWN_LITE) { //The powerdown tone should have lower priority than UI tones priority = AM_AUDIO_PRIORITY_MM_PLAY; } else if(isPowerupdownTone(current->ToneEvent.fields.id)) { priority = AM_AUDIO_PRIORITY_PUPD; } else { priority = AM_AUDIO_PRIORITY_UI_KEY; } break; case AM_AUDIO_PATH_ID_KEY_LITE: priority = AM_AUDIO_PRIORITY_KEY; break; case AM_AUDIO_PATH_ID_NETWORK_LITE: priority = AM_AUDIO_PRIORITY_NETWORK; break; case AM_AUDIO_PATH_ID_MULTIMEDIA_PLAY: if(isPowerupdownTone(current->ToneEvent.fields.id)) { priority = AM_AUDIO_PRIORITY_PUPD; } else { priority = AM_AUDIO_PRIORITY_MM_PLAY; } break; case AM_AUDIO_PATH_ID_MULTIMEDIA_CAPTURE: priority = AM_AUDIO_PRIORITY_MM_CAPTURE; break;#if ( (MAKE_FTR_VR == TRUE) || (MAKE_FTR_VA == TRUE) ) case AM_AUDIO_PATH_ID_VA_VR_NON_AUDIO: priority = AM_AUDIO_PRIORITY_VA_VR_NON_AUDIO; break; case AM_AUDIO_PATH_ID_VA_VR_IO: priority = AM_AUDIO_PRIORITY_VA_VR_IO; break; case AM_AUDIO_PATH_ID_VA_IO: priority = AM_AUDIO_PRIORITY_VA_IO; break; case AM_AUDIO_PATH_ID_VR_IO: priority = AM_AUDIO_PRIORITY_VR_IO; break;#endif case AM_AUDIO_PATH_ID_FUNLIGHTS: priority = AM_AUDIO_PRIORITY_FUNLIGHTS; break; case AM_AUDIO_PATH_ID_VA_VR_OUTPUT: priority = AM_AUDIO_PRIORITY_VA_VR_OUTPUT; break; case AM_AUDIO_PATH_ID_VT_VOICE: case AM_AUDIO_PATH_ID_VOICE: priority = AM_AUDIO_PRIORITY_VCALL; break; case AM_AUDIO_PATH_ID_DATA: priority = AM_AUDIO_PRIORITY_DATA; break; case AM_AUDIO_PATH_ID_EXT_GEN_AUDIO: priority = AM_AUDIO_PRIORITY_EXT_GEN_AUDIO; break; case AM_AUDIO_PATH_ID_MULTIMEDIA_VIDEO: priority = AM_AUDIO_PRIORITY_MM_VIDEO; break; case AM_AUDIO_PATH_ID_PHANTOM_TONE: priority = AM_AUDIO_PRIORITY_PHANTOM; break; case AM_AUDIO_PATH_ID_INVALID_TONE: case AM_AUDIO_PATH_ID_UNUSED_TONE: priority = AM_AUDIO_PRIORITY_INVALID; break; } } return priority;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?