📄 playback.c
字号:
/********************************************************************************
Copyright (c) 2002 Sunplus Technology Co., Ltd.
Module Name: playback.c
Function : The playback related functions
Environment: Keil C51 Compiler
Creation : 2002/04/18 yichang
***********************************************************************************/
//version4.0@yichang@0513 for new UI of SPCA533 turnkey
#include "general.h"
#include "main.h"
#include "dosusr.h"
#include "cardlink.h"
#include "initio.h"
#include "img533.h"
#include "sdramhw.h"
#include "quantdef.h"
#include "dpof.h"
#include "lcdtv.h"
#include "audiorw.h"
#include "uiflow.h"
#include "playback.h"
//patch4.4@ada@MP3 begin
#if (MP3_OPTION)
#include "mp3.h"
#include "ui.h"
#endif
//patch4.4@ada@MP3 end
//patch4.4@ada@DPOF skip AVI & WAV begin
#include "timer.h"
//patch4.4@ada@DPOF skip AVI & WAV end
//Joe@2003.2.27 11:07 add begin
#include "JoeToEvb.h"
//wendy@2004/8/26
code unsigned char *CHANG_DERCT[]={
"Change Directory",
"Modifier le repertoire",
"Verzeichnis wechseln",
"Cambia direttorio",
"Cambia direttorio",
"Change Directory",//J
"Change Directory",//"\x36\x37\x8c\x8d\x01\xc0\x01\xc1",//CH 转移目录
"Change Directory"//TR
};
code unsigned char *PLAY_WAV[]={//Davis@2004/9/8
"Play wav",
"Lecture wav",
"wav abspielen",
"Play wav",
"Reprod. Wav",
"\x01\xe8\x01\xe9\x01\xea\x01\xeb\x01\x80\x01\x81\x01\x82\x01\x83\x01\x84\x01\x85\x01\x86\x01\x87\x01\x88\x01\x89\x01\x8a\x01\x8b\x3f",//J
"\x01\xdc\x01\xdd\x01\xde\x01\xdf\x01\x26\x01\x27\x01\xc2\x01\xc3",//CH播放声音
"\x01\xdc\x01\xdd\x01\xde\x01\xdf\x01\x26\x01\x27\x01\xc2\x01\xc3",// " \x01\xde\x01\xdf\x01\xc2\x01\xc3 "//TR
};
code unsigned char *PLAY_AVI[]={//Davis@2004/9/8
"Play Avi",
"Lecture Avi",
"Avi abspielen",
"Play Avi",
"Reprod. Avi",
"\x01\x96\x01\x97\x01\x3c\x01\x3d\x01\x80\x01\x81\x01\x82\x01\x83\x01\x84\x01\x85\x01\x86\x01\x87\x01\x88\x01\x89\x01\x8a\x01\x8b\x3f",//J
"\x01\xdc\x01\xdd\x01\xde\x01\xdf\x01\x86\x01\x87\x01\xaa\x01\xab",//CH播放视频
"\x01\xdc\x01\xdd\x01\xde\x01\xdf\x18\x19\x01\x20\x01\x21"//TR
};
//wendy@2004/8/26
//Joe@2003.2.27 11:08 add end
//=============================================================================
//Symbol
//=============================================================================
//-----------------------------------------------------------------------------
//Constant
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//Variable
//-----------------------------------------------------------------------------
xdata UCHAR G_SelCell;
xdata UCHAR G_Playback_Mode;
xdata USHORT G_defaultPlayID;
xdata PlaybackObj G_playObject;
xdata USHORT G_DPOF_Qty;
xdata USHORT G_Old_DPOF_Qty;
//version4.0@ada@0513 for Play Back
//xdata USHORT Play9_PreFileIndexBuf[9];
xdata USHORT Play9_NowFileIndexBuf[9];
//xdata USHORT Play9_NextFileIndexBuf[9];
xdata USHORT G_PlayBackPageCount;
xdata USHORT G_NowPlayFileIndex;
xdata UCHAR G_ChangePage;
//yichang@0501
xdata USHORT G_TmbWidth;
xdata USHORT G_TmbHeight;
xdata USHORT G_TmbHGap;
xdata USHORT G_TmbVGap;
//patch4.3@yichang@0612 for pan/zoom
xdata SHORT G_PanXoffset;
xdata SHORT G_PanYoffset;
//herb for TVoutput debug @03/04/18 start
extern xdata UCHAR SmallSizeAvi;
//herb for TVoutput debug @03/04/18 end
extern xdata USHORT G_usZoomOSDTimer;
extern xdata UCHAR PlaybackFlag;//wendy@2004/9/8
//herb for Playback bug @03/04/21 start
xdata UCHAR reset_display;
xdata UCHAR avi_play;
//herb for Playback bug @03/04/21 end
//UCHAR TTName[9];//wendy
extern void L2_TurnOnOffDisplayFrist(void);
//patch4.3@yichang@0611 for version B/C chip co-exist
sfr MemStretch = 0x8E;
//=============================================================================
//Playback_Initial
//=============================================================================
//version4.0@ada@0513 for Play Back
void Playback_Initial(void) USING_0
{
UCHAR i;
//version4.0@ada@0513 for Multi-Directory
#if (SINGLE_DIRECTORY == 0)
USHORT TempCountIndex;
USHORT TempCount;
UCHAR tmp1,tmp2;
USHORT startCluster;
UCHAR sts;
#endif
//patch4.4@ada@FOSD begin
UCHAR FOSD_V_num, FOSD_H_num;
//patch4.4@ada@FOSD end
XBYTE[0x20D0] = XBYTE[0x20D0] & 0xDF;// ylee@0320 : Turn off VD falling interrupt
//patch5.04@Joe@2003.5.14 9:18 add begin
// if(PlaybackFlag)
// L2_TurnOnOffDisplayFrist();//wendy@2004/9/8
// else
//L2_TurnOnOffDisplay(1);//wendy@2004/9/8 arlpha mask @050308 // XiaoAo mask
//patch5.04@Joe@2003.5.14 9:18 add end
UI_RefreshFileSystem();
UI_SetMenuPalette(); // XiaoAo add
//patch5.04@Joe@2003.5.13 20:21 add begin
//arlpha mask add @050308
//L2_CtrlScreen(1);
UI_ClearFOSD(25, 8, 0x08);
//03.16 DELAY_100ms();
//03.16 DELAY_100ms();
//arlpha mask end @050308
//patch5.04@Joe@2003.5.13 20:21 add end
//Davis@05.03.15 mask L1_InitPlayback();
/////////////////////////////////////////////////////////
L2_SetJPEGVscale(G_Vsize, G_Vsize); //turn off JPEG Vertical scaling function //cytsai@0219
L2_SetDisplayType(G_DisplayType);
L2_SetDisplaySrcImgSize(G_DSPHsize, G_DSPVsize, G_DisplayType);
L2_SetDisplayMode(0x00, 0x10);
//patch4.1@yichang@0516 reset to idle mode when Initial playback
XBYTE[0x2000]=0x00;
// set camera operation mode: playback
L1_InitSPCA533(5);
//L2_TurnOnOffDisplay (1); // Turn on display
/////////////////////////////////////////////////////////
L2_SetAFBSize(G_DSPHsize,G_DSPVsize);
L2_SetBFBSize(G_DSPHsize,G_DSPVsize);
ClearScreen(); //arlpha mask @050308
//patch4.4@yichang@0624 for OSD, begin
//03.16 DELAY_100ms();
//03.16 DELAY_100ms();
//Joe@2003.2.24 19:23 mask begin
//G_ExtCardStatus = 1;
//G_BatteryStatus = K_BATTERY_STATUS_MID;
//Joe@2003.2.24 19:23 mask end
//patch5.04@Joe@2003.5.14 9:13 modify begin
/*
UI_ClearFOSD(25,8,0x00);
L2_TurnOnOffDisplay(1);
*/
//arlpha mask add @050308
//L2_SetColorPalette(8, 0, 0, 255); //XiaoAo mask
//L2_CtrlScreen(1); // XiaoAo mask
//UI_ClearFOSD(25, 8, 0x00); // XiaoAo mask
//arlpha mask end @050308
//patch5.04@Joe@2003.5.14 9:13 modify end
// if(PlaybackFlag)
// L2_TurnOnOffDisplayFrist();//wendy@2004/9/8
// else
//Davis:patch3.01 L2_TurnOnOffDisplay(1);//wendy@2004/9/8 arlpha mask @050308
//patch4.4@yichang@0624 for OSD, end
for (i = 0; i < 9; i++)
{
//Play9_PreFileIndexBuf[i] = 0;
Play9_NowFileIndexBuf[i] = 0;
//Play9_NextFileIndexBuf[i] = 0;
}
//UI_SetMenuPalette(); // XiaoAo mask
G_UIStatus = K_UISTATUS_DSC_PLAY;
G_UIStatusH= K_UISTATUS_DSC_PLAY;
G_DisplayMode = K_DisplayModeOsdOn;
if(G_CameraOptions.PlayMode==0)
{
G_UIAction = K_UI_ACTION_PLAYONE_MOVE;
G_Playback_Mode = K_PLAYBACK_MODE_ONE;
}
else
{
G_UIAction = K_UI_ACTION_PLAYNINE_MOVE;
G_Playback_Mode = K_PLAYBACK_MODE_NINE;
}
//version4.0@ada@0513 for Multi-Directory
#if (SINGLE_DIRECTORY == 0)
//If this directory has no file, then change directory until find one
if ((G_USR_FileCount == 0) && (G_USR_TotalDirectory > 1))
{
//patch4.4@ada@DirectoryIndexOrder begin
//TempCountIndex = G_USR_Dir1CountIndex;
TempCountIndex = G_USR_Dir1Count;
//If all directory has no file,then switch back to the default directory.
TempCount = G_USR_TotalDirectory + 1;
//Find a directory with file exists
while (TempCount > 0)
{
//printf("Switch forward directory Once\n");
L2_DRAMSetStartAddr((K_SDRAM_DcfDirBufAddr + (((ULONG)TempCountIndex) - 100) * 8 + 7),K_SDRAM_Prefetch);
L2_DRAMReadWord(&tmp1,&tmp2);
TempCountIndex = (USHORT)tmp1 | (((USHORT)tmp2) << 8);
//if (TempCountIndex < G_USR_TotalDirectory)
//{
// TempCountIndex++;
//}
//else
//{
// TempCountIndex = 1;
//}
if (TempCountIndex == 0)
{
TempCountIndex = G_USR_MinDir1Count;
}
//L2_DRAMSetStartAddr((K_SDRAM_DcfDirBufAddr + ((ULONG)TempCountIndex - 1) * 7),K_SDRAM_Prefetch);
L2_DRAMSetStartAddr((K_SDRAM_DcfDirBufAddr + ((ULONG)TempCountIndex - 100) * 8),K_SDRAM_Prefetch);
//L2_DRAMReadWord(&tmp1,&tmp2);
//G_USR_Dir1Count = ((USHORT)tmp2 << 8) | (USHORT)tmp1;
L2_DRAMReadWord(&tmp1,&tmp2);
startCluster = ((USHORT)tmp2) << 8 | (USHORT)tmp1;
G_USR_Dir1Cluster = startCluster;
G_USR_Dir1Count = TempCountIndex;
DOS_SetCurrDir(startCluster);
sts = USR_FileInitialize();
G_USR_FileIndex++; //next file index
//Find directory with file in it
if ((sts) && (G_USR_FileCount > 0))
{
//printf("G_USR_FileCount = %d\n",G_USR_FileCount);
//printf("Changing directory %d\n",G_USR_Dir1Count);
//G_USR_Dir1CountIndex = TempCountIndex;
//version4.0@ada@0513 for DPOF
//patch4.4@ada@DPOF begin
//DPOF_DirInitialize();
//patch4.4@ada@DPOF end
break;
}
TempCount--;
}
}
//patch4.4@ada@DirectoryIndexOrder end
#endif
//patch4.4@ada@DPOF begin
DPOF_DirInitialize();
//patch4.4@ada@DPOF end
//If file exists in this directory
if (G_USR_FileCount > 0)
{
G_NowPlayFileIndex = G_USR_LastFileIndex;
G_USR_SearchNowFileIndex = G_USR_LastFileIndex;
for (i = (UCHAR)((G_USR_FileCount - 1) % 9); i >= 0; i--)
{
Play9_NowFileIndexBuf[i] = G_USR_SearchNowFileIndex;
//printf("Play9_NowFileIndexBuf[%bd] = %d\n",i,Play9_NowFileIndexBuf[i]);
Playback_GetMediaInfo(G_USR_SearchNowFileIndex);
if (G_USR_SearchPreFileIndex > 0)
{
G_USR_SearchNowFileIndex = G_USR_SearchPreFileIndex;
}
else //Image stops here
{
//printf("Image stops here\n");
break;
}
if (i == 0)
{
break;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -