hostif_high.c

来自「本程序为ST公司开发的源代码」· C语言 代码 · 共 2,071 行 · 第 1/5 页

C
2,071
字号
          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }        if ((trackNr > CountFilesForVolume(1 /*DEV_CD_ID*/,SEARCH_PLAYABLE)) || (trackNr == 0))         {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }          if (TRACK_TYPE_DATA == TOC_TRACK_TYPE(trackNr))    //temporary solution - Visteon requests this functionality         {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }                                }      else                          //data      {        //check playlist content                 if ((player_playlist.enabled) && (player_playlist.parsed) && (trackNr > player_playlist.array_items ))            {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }              if ((trackNr > CountFilesForDevice(player_params.device,b_FALSE,SEARCH_PLAYABLE)) || (trackNr == 0))        {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }                }              }    if (PLAYER_PAUSE_AT_EOS)    {  		report_msg_error_mode(ERM_NA_STATE_ERROR);	    		report_msg_player_mode(player_mode, player_transition_state, player_current_resume_info_available, player_seek.speed);      return PCMD_NONE;        }    //MsgContinue    hostifAppSendMsgOneParameter(&response_msg[0], HOSTIF_GROUP_MSG_PLAYER_FUNC, MSG_CONTINUE, (cancel_previous==1?0:1));		return PCMD_PLAY_CONTINUE;	}	else 	{			report_msg_error_mode(ERM_NA_STATE_ERROR);	  		report_msg_player_mode(player_mode, player_transition_state, player_current_resume_info_available, player_seek.speed);	}		return PCMD_NONE;}/************************************************** * * process_cmd_play_resume() *  * Parameters: *  TBD, *  * Description: *  **************************************************/uint8 process_cmd_play_resume(uint8 *current_pos){  if (b_FALSE == check_preconditions())    return PCMD_NONE;    else if (player_current_resume_info_available == b_FALSE)  {        if ((player_mode == PLM_PLAY)       || (player_mode == PLM_FAST_FW)        || (player_mode == PLM_FAST_BW))    {   		report_msg_player_mode(player_mode, player_transition_state, player_current_resume_info_available, player_seek.speed);      return PCMD_NONE;     }    else if (player_mode == PLM_PAUSE)   //only clear pause     {      *current_pos = CMD_PARAM_CURRENT_POSITION;    //preset for case, that player in pause and there's requested to continue playback from current position       		report_msg_player_mode(PLM_PLAY, PLTS_RUNNING, player_current_resume_info_available, 0);      return PCMD_PLAY;          }    else if (player_mode == PLM_STOP)    //will start from 1st song on media (this case should occur just afer start)  	{   	  //check if there are playable items on media  	  if ((player_current_resume_info_available == b_FALSE) && (0 == CountFilesForDevice(player_params.device,b_TRUE,SEARCH_PLAYABLE)))  	  {  	      	    report_msg_error_mode(ERM_NA_STATE_ERROR);    		report_msg_player_mode(player_mode, player_transition_state, player_current_resume_info_available, player_seek.speed);  	      	  }  	  else  	  {  	        		report_msg_player_mode(PLM_PLAY, PLTS_RUNNING, player_current_resume_info_available, 0);    		return PCMD_PLAY_RESUME;  	  }  	}  }  else if (player_current_resume_info_available == b_TRUE)	{		report_msg_player_mode(PLM_PLAY, PLTS_RUNNING, player_current_resume_info_available, 0);		return PCMD_PLAY_RESUME;	}  		return PCMD_NONE;}/************************************************** * * process_cmd_pause() *  * Parameters: *  TBD, *  * Description: *  **************************************************/uint8 process_cmd_pause(uint8 position, uint8 data_tracks, uint16 trackNr, uint8 Second){  if (b_FALSE == check_preconditions())    return PCMD_NONE;    else if  ((player_mode == PLM_PLAY)         || (player_mode == PLM_FAST_FW)          || (player_mode == PLM_FAST_BW)         || (player_mode == PLM_STOP)         || ((player_mode == PLM_PAUSE) && (position == 0)))	{		    if ((position == CMD_PARAM_TIME_POSITION) || (position == CMD_PARAM_LBA_POSITION))     //pause at specific params track, MS info    {           if (0 == data_tracks)       //audio      {        if ((player_playlist.enabled) || (player_params.device != DEV_CD_ID))   //requesting audio file when playlist enabled not allowed        {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }              if ((trackNr > CountFilesForVolume(1 /*DEV_CD_ID*/,SEARCH_PLAYABLE)) || (trackNr == 0))        {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }                            if (TRACK_TYPE_DATA == TOC_TRACK_TYPE(trackNr))    //temporary solution - Visteon requests this functionality         {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }              }      else                        //data      {        //check playlist content                 if ((player_playlist.enabled) && (player_playlist.parsed) && (trackNr > player_playlist.array_items ))            {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }        if ((trackNr > CountFilesForDevice(player_params.device,b_FALSE,SEARCH_PLAYABLE)) || (trackNr == 0))        {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }                        }           if (Second > 59)    		        {                report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);  		  return PCMD_NONE;      }	  }/*    else if ((position == 2) && (player_mode != PLM_STOP))                                  {         		report_msg_player_mode(PLM_PAUSE, PLTS_RUNNING, player_resume_info.available, 0 );  //immediate pause    }*/        if ((position == CMD_PARAM_CURRENT_POSITION) && (player_mode == PLM_STOP))     //plm stop and pause at curr postition is not allowed    {  		report_msg_error_mode(ERM_NA_STATE_ERROR);  		report_msg_player_mode(player_mode, player_transition_state, player_current_resume_info_available, player_seek.speed);    		return PCMD_NONE;          }    else        {   		report_msg_player_mode(PLM_PAUSE, PLTS_RUNNING, player_current_resume_info_available, 0 );  //immediate pause        		return PCMD_PAUSE;    }	}	else if (player_mode == PLM_PAUSE)	{		report_msg_player_mode(player_mode, player_transition_state, player_current_resume_info_available, player_seek.speed);	  		return PCMD_PAUSE; //JS send commmand anyway (task priorities vs. global vars)	}	else	{		report_msg_error_mode(ERM_NA_STATE_ERROR);		report_msg_player_mode(player_mode, player_transition_state, player_current_resume_info_available, player_seek.speed);	  	}	return PCMD_NONE;}/************************************************** * * process_cmd_search_fw() *  * Parameters: *  TBD, *  * Description: *  **************************************************/uint8 process_cmd_search_fw(uint8 current, uint8 data_tracks, uint16 trackNr, uint8 Second){  if (b_FALSE == check_preconditions())    return PCMD_NONE;    else if   ((player_mode == PLM_PLAY)	       || (player_mode == PLM_PAUSE)         || (player_mode == PLM_FAST_FW)          || (player_mode == PLM_FAST_BW)         || (player_mode == PLM_STOP))  {    if ((current == CMD_PARAM_TIME_POSITION) || (current == CMD_PARAM_LBA_POSITION))    {      if (0 == data_tracks)      //audio      {        if ((player_playlist.enabled) || (player_params.device != DEV_CD_ID))    //requesting audio file when playlist enabled not allowed        {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }        if ((trackNr > CountFilesForVolume(1 /*DEV_CD_ID*/,SEARCH_PLAYABLE)) || (trackNr == 0))        {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }           if (TRACK_TYPE_DATA == TOC_TRACK_TYPE(trackNr))    //temporary solution - Visteon requests this functionality         {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }              }      else                          //data      {        //check playlist content                 if ((player_playlist.enabled) && (player_playlist.parsed) && (trackNr > player_playlist.array_items ))            {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }                if ((trackNr > CountFilesForDevice(player_params.device,b_FALSE,SEARCH_PLAYABLE)) || (trackNr == 0))        {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }                        }      if (Second > 59)      {                    report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);  		  return PCMD_NONE;      }  		report_msg_player_mode(PLM_FAST_FW, PLTS_RUNNING, player_current_resume_info_available, player_seek.speed);  		return PCMD_SEARCH_FW;    }    else if (current == CMD_PARAM_CURRENT_POSITION)  //current position     {      //check num of files on device       if ((0 == player_song) && (0 == CountFilesForDevice(player_params.device,b_TRUE,SEARCH_PLAYABLE)))  //check playable items on media      {      	report_msg_error_mode(ERM_NA_STATE_ERROR);    		report_msg_player_mode(player_mode, player_transition_state, player_current_resume_info_available, player_seek.speed);        return PCMD_NONE;          }  		report_msg_player_mode(PLM_FAST_FW, PLTS_RUNNING, player_current_resume_info_available, player_seek.speed);  		return PCMD_SEARCH_FW;    }      }	else	{  			report_msg_error_mode(ERM_NA_STATE_ERROR);		report_msg_player_mode(player_mode, player_transition_state, player_current_resume_info_available, player_seek.speed);	}	return PCMD_NONE;}/************************************************** * * process_cmd_search_bw() *  * Parameters: *  TBD, *  * Description: *  **************************************************/uint8 process_cmd_search_bw(uint8 current, uint8 data_tracks, uint16 trackNr, uint8 Second){  if (b_FALSE == check_preconditions())    return PCMD_NONE;    else if   ((player_mode == PLM_PLAY)	       || (player_mode == PLM_PAUSE)         || (player_mode == PLM_FAST_FW)          || (player_mode == PLM_FAST_BW)         || (player_mode == PLM_STOP))  {    if ((current == CMD_PARAM_TIME_POSITION) || (current == CMD_PARAM_LBA_POSITION) || (current == CMD_PARAM_END_OF_FILE_POSITION))    {      if (0 == data_tracks)      //audio      {        if ((player_playlist.enabled)  || (player_params.device != DEV_CD_ID))   //requesting audio file when playlist enabled not allowed        {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }              if ((trackNr > CountFilesForVolume(1 /*DEV_CD_ID*/,SEARCH_PLAYABLE)) || (trackNr == 0))        {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }           if (TRACK_TYPE_DATA == TOC_TRACK_TYPE(trackNr))    //temporary solution - Visteon requests this functionality         {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }              }      else                          //data      {              //check playlist content                 if ((player_playlist.enabled) && (player_playlist.parsed) && (trackNr > player_playlist.array_items ))            {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }        if ((trackNr > CountFilesForDevice(player_params.device,b_FALSE,SEARCH_PLAYABLE)) || (trackNr == 0))        {          report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    		  return PCMD_NONE;        }                        }      if (Second > 59)      {                    report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);  		  return PCMD_NONE;      }  		report_msg_player_mode(PLM_FAST_BW, PLTS_RUNNING, player_current_resume_info_available, player_seek.speed);  		return PCMD_SEARCH_BW;    }    else if (current == CMD_PARAM_CURRENT_POSITION)    {      //check num of files on device       if ((0 == player_song) && (0 == CountFilesForDevice(player_params.device,b_TRUE,SEARCH_PLAYABLE)))  //check playable items on media      {      	report_msg_error_mode(ERM_NA_STATE_ERROR);    		report_msg_player_mode(player_mode, player_transition_state, player_current_resume_info_available, player_seek.speed);        return PCMD_NONE;          }      		report_msg_player_mode(PLM_FAST_BW, PLTS_RUNNING, player_current_resume_info_available, player_seek.speed);  		return PCMD_SEARCH_BW;    }      }	else	{  			report_msg_error_mode(ERM_NA_STATE_ERROR);    report_msg_player_mode(player_mode, player_transition_state, player_current_resume_info_available, player_seek.speed);	}	return PCMD_NONE;}/************************************************** * * process_cmd_play_next() *  * Parameters: *  TBD, *  * Description: *  **************************************************/extern uint16 player_song; //JS addeduint8 process_cmd_play_next(uint8 type){	if (type == 0)    //type reserved	{    report_msg_player_mode(player_mode, player_transition_state, player_current_resume_info_available, player_seek.speed);		return PCMD_NONE;	}	else if (type > 2) //not allowed param	{    report_msg_error_mode(ERM_INVALID_PARAMETER_ERROR);    report_msg_player_mode(player_mode, player_transition_state, player_curre

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?