📄 timesearch.c
字号:
#include <comsub.h>
#include <pe.h>
#include <panel.h>
#include <osd.h>
#include <nv.h>
#include <ui.h>
#include <ui_sub.h>
#include <panel.h>
#include "../../cstm/fend/frntp.h"
#include "normal.h"
#include <stdio.h>
#include <stdlib.h>
#include <audio.h>
#include <rscstruc.h>
#include <resource.h>
#include <platform.h>
#include "uiosd.h"
#include "NMOSD.h"
void CloseTimeSearch(void);
void StopTimeSearch(void);
BYTE ItemState; /* 1: Normal state, 0: Edit state */
int bitcount;
BYTE timestr[16];
void UiSubFuncTimeSCRInit(void)
{
int i;
BYTE Defaultstr[] = {
0x00,'-',0x00,0x3a,
0x00,'-',0x00,'-',0x00,0x3a,
0x00,'-',0x00,'-',0x00,0x00
};
ClearRectArea(gui_hdc, GUITYPE_MODEGUI);
SetTimer( OSD6_TM_ID, ModeOSDOff, INFINITETIME);
SetTimer( SHOWINVALID_TM_ID, ShowInvalidTimer, INFINITETIME);
NextPrevStatus=0;
if (g_UiCrntSubFunc == UI_SUBFUNC_ZOOM)
gZoomFuncPlus = TRUE;
g_UiCrntSubFunc = UI_SUBFUNC_TIMESCR;
for(i=0;i<16;i++)
timestr[i]=Defaultstr[i];
bitcount=0;
ShowTimeSearch(timestr);
SetTimer(CONSOLE_TM_ID , CloseTimeSearch , _CONSOLE_AUTO_CLOSE_TIME*1000);
}
BYTE TimeSCRRespondFPKey(DWORD msgtype)
{
int time, hour, minute, second;
int totaltime, temp, i;
BOOL bRes;
static BYTE ch[5]="00000";
PLAYPOINT PlayPoint;
DWORD dwItemID;
totaltime=NVGetTotalTime();
switch(msgtype)
{
case V_KEY_ENTER:
if(bitcount!=0)
{
bitcount=0;
hour=((ch[0]>'0')?(ch[0]-'0'):0);
minute=((ch[1]>'0')?((ch[1]-'0')*10):0)+((ch[2]>'0')?(ch[2]-'0'):0);
second=((ch[3]>'0')?((ch[3]-'0')*10):0)+((ch[4]>'0')?(ch[4]-'0'):0);
time=hour*3600+minute*60+second;
//here we should make minute and second <60
hour=time/3600;
minute=(time/60)%60;
second=time%60;
ch[0]=hour+'0';
ch[1]=minute/10+'0';
ch[2]=minute%10+'0';
ch[3]=second/10+'0';
ch[4]=second%10+'0';
if (VirDiscType==C_VCD20)
totaltime = NVGetVCDTotalTimePBCON();
if((VirDiscType==C_SVCD) || (VirDiscType==C_VCD20 && (IsVCDSVCDStillPicture() || time>=totaltime)))
{
ShowDiscInfo(MSG_INVALID, MSG_NULL);
if(ItemState==EDIT_STATE)
for(i=0;i<5;i++)
ch[i]='-';
timestr[1]=ch[0];/*hour*/
timestr[5]=ch[1];
timestr[7]=ch[2];/*minute*/
timestr[11]=ch[3];
timestr[13]=ch[4];/*second*/
ShowTimeSearch(timestr);
return UI_IS_FUNC_MSG;
}
if ( (time<=totaltime)&&(totaltime!=0)&&(NVIsUOPPermit(UOP5)==TRUE) )
{
if ( (time != 0) || (DiscType == C_DVD)
|| (VirDiscType == C_VCD20) || (VirDiscType == C_VCD10) )
{
if (g_UiCoreState != UI_CORE_PLAY)
{
bActionCtl = 0;
g_UiCoreState = UI_CORE_PLAY;
SendVFDPart1Show();
NVPlayModeChg(C_NV_Play, 0);
}
if(DiscType==C_VCD10||DiscType==C_VCD20||DiscType==C_SVCD)
bRes = NVTimeSearch(time, 1/* current track search */);
else
bRes = NVTimeSearch(time, 0/* total disc search */);
}
else
{
PlayPoint.wTTN = 1;
PlayPoint.wPTTN=0;
PlayPoint.dwLBAAddr=0;
if (g_UiCoreState != UI_CORE_PLAY)
{
bActionCtl = 0;
g_UiCoreState = UI_CORE_PLAY;
SendVFDPart1Show();
NVPlayModeChg(C_NV_Play, 0);
}
bRes = NVPTTPlay(&PlayPoint, C_STOP_SKIPPG,KEY_TIMER);
}
}
else
bRes = FALSE;
if (bRes)
{
if((g_UiCoreState == UI_CORE_PAUSE)||(g_UiCoreState == UI_CORE_STEP))
{
g_UiCoreState = UI_CORE_PLAY;
SendVFDPart1Show();
NVPlayModeChg(C_NV_Play,0);
}
if((g_UiPlaybackRepeatRange==UI_PLAYBACKRANGE_REPEATAB &&NVIsInsideAB(time))
||(g_UiPlaybackRepeatRange==UI_PLAYBACKRANGE_REPEATONE&&NVIsInsideChapter(time))
||(g_UiPlaybackRepeatRange==UI_PLAYBACKRANGE_REPEATALL))
;
else
{
UiClearPlaybckMd();
SendVFDPart1Show();
}
break;
}
else// time search action not work
{
ShowDiscInfo(MSG_INVALID,MSG_NULL);
ch[0]='-';
ch[1]='-';
ch[2]='-';
ch[3]='-';
ch[4]='-';
ItemState=DISPLAY_STATE;
break;
}
}
StopTimeSearch();
return UI_IS_FUNC_MSG;
case V_KEY_0:
case V_KEY_1:
case V_KEY_2:
case V_KEY_3:
case V_KEY_4:
case V_KEY_5:
case V_KEY_6:
case V_KEY_7:
case V_KEY_8:
case V_KEY_9:
if(bitcount==0)
{
for(i=0;i<5;i++)
ch[i]='0';
}
temp=msgtype-V_KEY_0;
bitcount++;
for(i=0;i<4;i++)//left move
ch[i]=ch[i+1];
ch[4] = temp+'0';
break;
case V_KEY_CLEAR:
for (i = 0;i < 5;i++)
ch[i]='-';
bitcount=0;
break;
case V_KEY_CONSOLE:
StopTimeSearch();
return UI_IS_FUNC_MSG;
break;
case V_KEY_OPEN:
if(g_UiCrntSubFunc == UI_SUBFUNC_TIMESCR)
StopTimeSearch();
return UI_NOUSE_FUNC_MSG;
default:
StopTimeSearch();
return UI_NOUSE_FUNC_MSG;
}
timestr[1]=ch[0];/*hour*/
timestr[5]=ch[1];
timestr[7]=ch[2];/*minute*/
timestr[11]=ch[3];
timestr[13]=ch[4];/*second*/
ShowTimeSearch(timestr);
SetTimer(CONSOLE_TM_ID , CloseTimeSearch , _CONSOLE_AUTO_CLOSE_TIME*1000);
return UI_IS_FUNC_MSG;
}
void CloseTimeSearch(void)
{
g_UiCrntSubFunc = UI_SUBFUNC_BASAL;
ClearTimeSearch();
#ifdef _MUTE_ENABLE_
// if(GetMuteVolumeStatus() == MUTEVOLUME_STATUS_MUTE)
ptr_GetMuteVolumeStatus = GetMuteVolumeStatus;//chena
if((*ptr_GetMuteVolumeStatus)() == MUTEVOLUME_STATUS_MUTE)
{
g_UiCrntSubFunc = UI_SUBFUNC_MUTEVOLUME;
// RecoverMuteIcon();
ptr_RecoverMuteIcon=RecoverMuteIcon;
(*ptr_RecoverMuteIcon)();
}
#endif
}
void StopTimeSearch(void)
{
SetTimer(CONSOLE_TM_ID , CloseTimeSearch , INFINITETIME);
CloseTimeSearch();
}
BYTE UiSubFuncTimeSCRProc(WORD MsgType, DWORD MsgInput)
{
switch (MsgType)
{
case C_FP_KEY:
return TimeSCRRespondFPKey(MsgInput);
default:
return UI_NOUSE_FUNC_MSG;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -