📄 am_device_layer_interface.cc
字号:
msgptr->sequence_number = sequence; msgptr->tone_type = tone_type; suSendMessage(msgptr, (SU_PORT_HANDLE)suFindName(DL_PORT_NAME_AUDIO_SP, 10000, &err), NULL);}/***************************************************************************** FUNCTION: aud_dl_aud_cnf DESCRIPTION: This function send message to device layer. INPUTS The pointer to the message . OUTPUTS None. IMPORTANT NOTES None*****************************************************************************/void aud_dl_aud_cnf(UINT32 msg_id, void *msg, UINT32 msg_size){ SU_RET_STATUS err; void *msgptr = NULL; if(msg == NULL) { msg_size = 0; } msgptr = (void *)suCreateMessage(msg_size, msg_id, SU_INVALID_HANDLE, NULL); memcpy(msgptr, msg, msg_size); suSendMessage(msgptr, (SU_PORT_HANDLE)suFindName(DL_PORT_NAME_AUDIO_SP, 10000, &err), NULL);}/***************************************************************************** FUNCTION: AM_FindInQueue DESCRIPTION: This function find media tone in the queue. INPUTS The pointer to the tone ptr . OUTPUTS None. IMPORTANT NOTES None*****************************************************************************/BOOL AM_FindInQueue( AUD_TONE_REQ * tone_ptr ){ Tone_Item * head_ptr = eventqueuehandler.GetCurrent(); BOOL found = FALSE; while ( head_ptr != NULL ) { TD_AUD_TONE_UNION_T tone = head_ptr->ToneEvent; if ( tone.fields.media == 1 ) { if ( tone_ptr != NULL ) { tone_ptr->tone = head_ptr->ToneEvent; tone_ptr->vibrate_type = head_ptr->VibrateType; tone_ptr->sequence_number = head_ptr->SequenceID; tone_ptr->uplink = head_ptr->Uplink; tone_ptr->vol_step = head_ptr->VolumeStep; tone_ptr->media_info = head_ptr->MediaInfo; } found = TRUE; break; } head_ptr = head_ptr->Next; } return found;}BOOL AM_FindInQueueWithSeq( AUD_TONE_REQ * tone_ptr, UINT32 seq ){ Tone_Item* head_ptr = eventqueuehandler.FindItem(seq); BOOL found = FALSE; if (head_ptr != NULL) { if ( tone_ptr != NULL ) { tone_ptr->tone = head_ptr->ToneEvent; tone_ptr->vibrate_type = head_ptr->VibrateType; tone_ptr->sequence_number = head_ptr->SequenceID; tone_ptr->uplink = head_ptr->Uplink; tone_ptr->vol_step = head_ptr->VolumeStep; tone_ptr->media_info = head_ptr->MediaInfo; } found = TRUE; } return found;}/*================================================================================================== VST VR FUNCTIONS==================================================================================================*//*==================================================================================================FUNCTION: Send2DeviceLayer_vst_capture_cnf_msgDESCRIPTION: Send CNF message to DL for capture init statusARGUMENTS PASSED: UINT8 dl_status_code = (DL_MEDIA_OK or DL_MEDIA_ERROR)RETURN VALUE: NoneRETURN MESSAGE: AUD_START_AUDIO_CAPTURE_CNF_IDPRE-CONDITIONS: NonePOST-CONDITIONS: NoneIMPORTANT NOTES: None==================================================================================================*/void Send2DeviceLayer_vst_capture_cnf_msg(UINT8 dl_status_code){ SU_PORT_HANDLE dest_phandle = (SU_PORT_HANDLE)suFindName(DL_PORT_NAME_MEDIA_VR_SP, SU_WAIT_FOREVER, NULL); AUD_START_AUDIO_CAPTURE_CNF_T* msgptr = NULL; /* Confirm the receipt of the message from VST with pass/fail status. */ msgptr = (AUD_START_AUDIO_CAPTURE_CNF_T*)suCreateMessage((UINT32)sizeof(AUD_START_AUDIO_CAPTURE_CNF_T), (UINT32)AUD_START_AUDIO_CAPTURE_CNF_ID, SU_INVALID_HANDLE, NULL); msgptr->status_code = dl_status_code; /* send message */ suSendMessage(msgptr, dest_phandle, NULL); return;}/*==================================================================================================FUNCTION: Send2DeviceLayer_vst_stop_audio_capture_cnf_msgDESCRIPTION: Confirmation to the VST audio software when the audio capture has been stopped. The DL is notified with a return message that the aud_stop_vr_audio_capture_req() has been completed.ARGUMENTS PASSED: UINT8 dl_status_code = (DL_MEDIA_OK or DL_MEDIA_ERROR)RETURN VALUE: NoneRETURN MESSAGE: AUD_STOP_AUDIO_CAPTURE_CNF_IDPRE-CONDITIONS: NonePOST-CONDITIONS: NoneIMPORTANT NOTES: None==================================================================================================*/void Send2DeviceLayer_vst_stop_audio_capture_cnf_msg(UINT8 dl_status_code){ SU_PORT_HANDLE dest_phandle = (SU_PORT_HANDLE)suFindName(DL_PORT_NAME_MEDIA_VR_SP, SU_WAIT_FOREVER, NULL); AUD_STOP_AUDIO_CAPTURE_CNF_T* msgptr; if(audVstParams.abort_activity == FALSE) { /* Confirm the completion of the action to VST */ msgptr = (AUD_STOP_AUDIO_CAPTURE_CNF_T*) suCreateMessage((UINT32)sizeof(AUD_STOP_AUDIO_CAPTURE_CNF_T), (UINT32)AUD_STOP_AUDIO_CAPTURE_CNF_ID, SU_INVALID_HANDLE, NULL); msgptr->status_code = dl_status_code; /* send message */ suSendMessage(msgptr, dest_phandle, NULL); } else { void * unavail_ptr = NULL; unavail_ptr = suCreateMessage((UINT32)0, AM_VR_UNAVAILABLE_IND, SU_INVALID_HANDLE, NULL); suSendMessage(unavail_ptr, dest_phandle, NULL); } return;}/*==================================================================================================FUNCTION: Send2DeviceLayer_vst_buffer_playback_cnf_msgDESCRIPTION: Send CNF message to DL for playback buffer statusARGUMENTS PASSED: UINT8 dl_status_code = (DL_MEDIA_OK or DL_MEDIA_ERROR)RETURN VALUE: NoneRETURN MESSAGE: AUD_PLAY_AUDIO_BUFFER_CNF_IDPRE-CONDITIONS: NonePOST-CONDITIONS: NoneIMPORTANT NOTES: None==================================================================================================*/void Send2DeviceLayer_vst_buffer_playback_cnf_msg(UINT8 dl_status_code){ SU_PORT_HANDLE dest_phandle = (SU_PORT_HANDLE)suFindName(DL_PORT_NAME_MEDIA_VR_SP, SU_WAIT_FOREVER, NULL); AUD_PLAY_AUDIO_BUFFER_CNF_T* msgptr; /* Confirm the receipt of the message from VST with pass/fail status.*/ msgptr = (AUD_PLAY_AUDIO_BUFFER_CNF_T*)suCreateMessage((UINT32)sizeof(AUD_PLAY_AUDIO_BUFFER_CNF_T), (UINT32)AUD_PLAY_AUDIO_BUFFER_CNF_ID, SU_INVALID_HANDLE, NULL); msgptr->status_code = dl_status_code; /* send message */ suSendMessage(msgptr, dest_phandle, NULL); return;}/*==================================================================================================FUNCTION: Send2DeviceLayer_vst_flash_playback_cnf_msgDESCRIPTION: Send CNF message to DL for playback flash statusARGUMENTS PASSED: UINT8 dl_status_code = (DL_MEDIA_OK or DL_MEDIA_ERROR)RETURN VALUE: NoneRETURN MESSAGE: AUD_PLAY_AUDIO_FLASH_CNF_IDPRE-CONDITIONS: NonePOST-CONDITIONS: NoneIMPORTANT NOTES: None==================================================================================================*/void Send2DeviceLayer_vst_flash_playback_cnf_msg(UINT8 dl_status_code){ SU_PORT_HANDLE dest_phandle = (SU_PORT_HANDLE)suFindName(DL_PORT_NAME_MEDIA_VR_SP, SU_WAIT_FOREVER, NULL); AUD_PLAY_AUDIO_FLASH_CNF_T* msgptr; /* Confirm the receipt of the message from VST with pass/fail status. */ msgptr = (AUD_PLAY_AUDIO_FLASH_CNF_T*)suCreateMessage((UINT32)sizeof(AUD_PLAY_AUDIO_FLASH_CNF_T), (UINT32)AUD_PLAY_AUDIO_FLASH_CNF_ID, SU_INVALID_HANDLE, NULL); msgptr->status_code = dl_status_code; /* send message */ suSendMessage(msgptr, dest_phandle, NULL); return;}/*==================================================================================================FUNCTION: Send2DeviceLayer_vst_playback_complete_msgDESCRIPTION: Notifies DL that the requested playback (buffered prompts or flashed vocoder data) is complete.ARGUMENTS PASSED: UINT8 dl_status_code = (DL_MEDIA_OK or DL_MEDIA_ERROR)RETURN VALUE: NoneRETURN MESSAGE: AUD_AUDIO_PLAYBACK_COMPLETE_CNF_IDPRE-CONDITIONS: NonePOST-CONDITIONS: NoneIMPORTANT NOTES: None==================================================================================================*/void Send2DeviceLayer_vst_playback_complete_msg(UINT8 dl_status_code){ SU_PORT_HANDLE dest_phandle = (SU_PORT_HANDLE)suFindName(DL_PORT_NAME_MEDIA_VR_SP, SU_WAIT_FOREVER, NULL); // if the VR SP is NOT currently in the process of trying to STOP Playback, // send the "complete" confirmation message to the VR SP. // The STOP Playback message (TD_VA_COMMAND_STOP_PLAY) is in the queue for // the AM to process next (or sometime later). If audVstParams.activity // were set to AUD_VST_IDLE here, the stop confirmation would NOT be sent // to the VR SP. if (audVstParams.activity != AUD_VST_STOP_PLAYBACK) { AUD_AUDIO_PLAYBACK_COMPLETE_CNF_T* msgptr; audVstParams.activity = AUD_VST_IDLE; /* Confirm the receipt of the message from VST */ msgptr = (AUD_AUDIO_PLAYBACK_COMPLETE_CNF_T*)suCreateMessage((UINT32)sizeof(AUD_AUDIO_PLAYBACK_COMPLETE_CNF_T), (UINT32)AUD_AUDIO_PLAYBACK_COMPLETE_CNF_ID, SU_INVALID_HANDLE, NULL); msgptr->status_code = dl_status_code; /* send message */ suSendMessage(msgptr, dest_phandle, NULL); } // free malloc'd data used by playback... if (audVstParams.audio_data_address != NULL) { suFreeMem(audVstParams.audio_data_address); audVstParams.audio_data_address = NULL; } return;}/*==================================================================================================FUNCTION: Send2DeviceLayer_vst_stop_audio_playback_cnf_msgDESCRIPTION: Callback to VST audio software when the audio playback has been stopped. The DL is notified with a return message that the aud_stop_audio_playback_req() has been completed.ARGUMENTS PASSED: UINT8 dl_status_code = (DL_MEDIA_OK or DL_MEDIA_ERROR)RETURN VALUE: NoneRETURN MESSAGE: AUD_STOP_AUDIO_PLAYBACK_CNF_IDPRE-CONDITIONS: NonePOST-CONDITIONS: NoneIMPORTANT NOTES: None==================================================================================================*/void Send2DeviceLayer_vst_stop_audio_playback_cnf_msg (UINT8 dl_status_code){ SU_PORT_HANDLE dest_phandle = (SU_PORT_HANDLE)suFindName(DL_PORT_NAME_MEDIA_VR_SP, SU_WAIT_FOREVER, NULL); AUD_STOP_AUDIO_PLAYBACK_CNF_T* msgptr; audVstParams.activity = AUD_VST_IDLE; if(audVstParams.abort_activity == FALSE) { /* Confirm the receipt of the message from VST */ msgptr = (AUD_STOP_AUDIO_PLAYBACK_CNF_T*)suCreateMessage((UINT32)sizeof(AUD_STOP_AUDIO_PLAYBACK_CNF_T), (UINT32)AUD_STOP_AUDIO_PLAYBACK_CNF_ID, SU_INVALID_HANDLE, NULL); msgptr->status_code = dl_status_code; /* send message */ suSendMessage(msgptr, dest_phandle, NULL); } else { void * unavail_ptr = NULL; unavail_ptr = suCreateMessage((UINT32)0, AM_VR_UNAVAILABLE_IND, SU_INVALID_HANDLE, NULL); suSendMessage(unavail_ptr, dest_phandle, NULL); } // free malloc'd data used by playback... if (audVstParams.audio_data_address != NULL) { suFreeMem(audVstParams.audio_data_address); audVstParams.audio_data_address = NULL; } return;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -