⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 playback.c

📁 dz3000_51.0.0.4.rar
💻 C
📖 第 1 页 / 共 5 页
字号:
                         Play9_NowFileIndexBuf[i] = G_USR_SearchNowFileIndex;
                         Playback_GetMediaInfo(G_USR_SearchNowFileIndex);

                         if (G_USR_SearchPreFileIndex > 0)
                         {
                              G_USR_SearchNowFileIndex = G_USR_SearchPreFileIndex;
                         }
                         else //File stops here
                         {
                              //printf("File stops here\n");
                              break;
                         }

                         if (i == 0)
                         {
                              break;
                         }
                    }

                    G_NowPlayFileIndex = Play9_NowFileIndexBuf[G_SelCell];
                    G_PlayBackPageCount--;
               }

               break;

          case K_PageDeleteBackward:

               G_USR_SearchNowFileIndex = G_USR_LastFileIndex;

               if (G_USR_SearchNowFileIndex > 0)
               {
                    for (i = 0; i < 9; i++)
                    {
                         Play9_NowFileIndexBuf[i] = 0;
                    }

                    for (i = 8; i >= 0; i--)
                    {
                         Play9_NowFileIndexBuf[i] = G_USR_SearchNowFileIndex;
                         Playback_GetMediaInfo(G_USR_SearchNowFileIndex);

                         if (G_USR_SearchPreFileIndex > 0)
                         {
                              G_USR_SearchNowFileIndex = G_USR_SearchPreFileIndex;
                         }
                         else //File stops here
                         {
                              //printf("File stops here\n");
                              goto outloop;
                         }

                         if (i == 0)
                         {
                              goto outloop;
                         }
                    }
			outloop:
                    G_NowPlayFileIndex = Play9_NowFileIndexBuf[G_SelCell];
                    G_PlayBackPageCount--;
               }

               break;

          //version4.0@ada@0513 for Multi-Directory
          #if (SINGLE_DIRECTORY == 0)
          //patch4.4@ada@DirectoryIndexOrder begin
          case K_DirectoryForward:
               //printf("K_DirectoryForward\n");
          	//TempCountIndex = G_USR_Dir1CountIndex;
          	TempCountIndex = G_USR_Dir1Count;
               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_Dir1Count = TempCountIndex;

                    G_USR_Dir1Cluster = startCluster;

                    DOS_SetCurrDir(startCluster);

                    sts = USR_FileInitialize();

                    G_USR_FileIndex++;  //next file index

                    if ((sts) && (G_USR_FileCount > 0))
                    {
                         //printf("G_USR_FileCount = %d\n",G_USR_FileCount);
                         //printf("Changing directory %d\n",G_USR_Dir1Count);

                         //patch4.4@yichang@0624 for OSD begin
                         UI_PrintOSDString("                         ", 0, 0, UI_MENU_DEHIGHLIGHT_COLOR);
                         UI_PrintOSDString(CHANG_DERCT[G_Language], FOSD_H_num/2-8, FOSD_V_num/2, UI_MENU_DEHIGHLIGHT_COLOR);
                         UI_PrintOSDString("                         ", 0, FOSD_V_num - 1, UI_MENU_DEHIGHLIGHT_COLOR);
                         L2_CtrlScreen(1);
                         //patch4.4@yichang@0624 for OSD end

                         //patch4.4@ada@FOSD begin
                         DELAY_1s();
                         //patch4.4@ada@FOSD end

                         //patch5.04@Joe@2003.5.15 10:21 add begin
			 UI_PrintOSDString("                  ", FOSD_H_num/2-8, FOSD_V_num/2, UI_MENU_DEHIGHLIGHT_COLOR);
			 //patch5.04@Joe@2003.5.15 10:21 add end

                         //G_USR_Dir1CountIndex = TempCountIndex;

                         //version4.0@ada@0513 for DPOF
                         DPOF_DirInitialize();

                         Playback_InitialAfterChangePage();
                         break;
                    }

                    TempCount--;
               }

               if (G_USR_FileCount > 0)
               {
                    G_NowPlayFileIndex = Play9_NowFileIndexBuf[G_SelCell];
                    G_PlayBackPageCount = 0;
               }

               //patch4.4@yichang@0624 for OSD begin
               UI_PrintOSDString("                ", FOSD_H_num/2-8, FOSD_V_num/2, 0x00);
               //patch4.4@yichang@0624 for OSD end

               break;

          case K_DirectoryBackward:
               //printf("K_DirectoryBackward\n");
               //TempCountIndex = G_USR_Dir1CountIndex;
               TempCountIndex = G_USR_Dir1Count;
               TempCount = G_USR_TotalDirectory + 1;

               //Find a directory with file exists
               while (TempCount > 0)
               {
                    //printf("Switch backward directory Once\n");
                    L2_DRAMSetStartAddr((K_SDRAM_DcfDirBufAddr + (((ULONG)TempCountIndex) - 100) * 8 + 6),K_SDRAM_Prefetch);
                    L2_DRAMReadWord(&tmp1,&tmp2);
                    TempCountIndex = (USHORT)tmp1 | (((USHORT)tmp2) << 8);

                    //if (TempCountIndex > 1)
                    //{
                    //     TempCountIndex--;
                    //}
                    //else
                    //{
                    //     TempCountIndex = G_USR_TotalDirectory;
                    //}

                    if (TempCountIndex == 0)
                    {
                         TempCountIndex = G_USR_MaxDir1Count;
                    }

                    //printf("TempCountIndex = %d\n",TempCountIndex);

                    //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_Dir1Count = TempCountIndex;

                    G_USR_Dir1Cluster = startCluster;

                    DOS_SetCurrDir(startCluster);

                    sts = USR_FileInitialize();

                    G_USR_FileIndex++;  //next file index

                    if ((sts) && (G_USR_FileCount > 0))
                    {
                         //printf("Changing directory %d\n",G_USR_Dir1Count);
                         //printf("G_USR_FileCount = %d\n",G_USR_FileCount);

                         //patch4.4@yichang@0624 for OSD begin
                         UI_PrintOSDString("                         ", 0, 0, UI_MENU_DEHIGHLIGHT_COLOR);
                         UI_PrintOSDString(CHANG_DERCT[G_Language], FOSD_H_num/2-8, FOSD_V_num/2, UI_MENU_DEHIGHLIGHT_COLOR);
                         UI_PrintOSDString("                         ", 0, FOSD_V_num - 1, UI_MENU_DEHIGHLIGHT_COLOR);
                         L2_CtrlScreen(1);
                         //patch4.4@yichang@0624 for OSD end

                         //patch4.4@ada@FOSD begin
                         DELAY_1s();
                         //patch4.4@ada@FOSD end

                         //patch5.04@Joe@2003.5.15 10:21 add begin
			 UI_PrintOSDString("                  ", FOSD_H_num/2-8, FOSD_V_num/2, UI_MENU_DEHIGHLIGHT_COLOR);
			 //patch5.04@Joe@2003.5.15 10:21 add end

                         //G_USR_Dir1CountIndex = TempCountIndex;

                         //version4.0@ada@0513 for DPOF
                         DPOF_DirInitialize();
                         Playback_InitialAfterChangePage();

                         break;
                    }

                    TempCount--;
               }

               if (G_USR_FileCount > 0)
               {
                    G_USR_SearchNowFileIndex = G_USR_LastFileIndex;

                    for (i = 0; i < 9; i++)
                    {
                         Play9_NowFileIndexBuf[i] = 0;
                    }

                    for (i = (UCHAR)((G_USR_FileCount - 1) % 9); i >= 0; i--)
                    {
                         Play9_NowFileIndexBuf[i] = G_USR_SearchNowFileIndex;
                         ////printf("Play9_NowFileIndexBuf[%bd] = %d\n",i,G_USR_SearchNowFileIndex);
                         Playback_GetMediaInfo(G_USR_SearchNowFileIndex);

                         if (G_USR_SearchPreFileIndex > 0)
                         {
                              G_USR_SearchNowFileIndex = G_USR_SearchPreFileIndex;
                         }
                         else //File stops here
                         {
                              ////printf("File stops here\n");
                              break;
                         }

                         if (i == 0)
                         {
                              break;
                         }
                    }

                    G_SelCell = (G_USR_FileCount - 1) % 9;
                    G_NowPlayFileIndex = Play9_NowFileIndexBuf[G_SelCell];
                    G_PlayBackPageCount = (G_USR_FileCount - 1) / 9;
               }
               //printf("Change to last page of previous directory\n");

               //patch4.4@yichang@0624 for OSD begin
               UI_PrintOSDString("                ", FOSD_H_num/2-8, FOSD_V_num/2, 0x00);
               //patch4.4@yichang@0624 for OSD end

               break;
               //patch4.4@ada@DirectoryIndexOrder end
               #endif

          default:
               break;
     }

     //printf("G_NowPlayFileIndex  = %d\n",G_NowPlayFileIndex);
     //printf("G_SelCell = %bd\n",G_SelCell);

     sts = Playback_GetMediaInfo(G_NowPlayFileIndex);

     //if ((sts == L1K_SUCCESS) && (G_DefaultSnapNum-1))
     if ((sts) && (G_USR_FileCount > 0))
     {
          //patch4.4@yichang@0624 for OSD
          //USR_SetBaseName(name, G_playObject.FileIndex);
          //name[8] = '\0';
          //UI_PrintOSDString(name, 0, FOSD_V_num-1,UI_MENU_DEHIGHLIGHT_COLOR);

          if(G_playObject.mediaType == K_PLAYBACK_TYPE_JPG)
          {
                 //L2_SetDisplayType(G_DisplayType);
                L2_SetDisplaySrcImgSize(G_DSPHsize, G_DSPVsize, G_DisplayType);
                L2_SetAFBSize(G_DSPHsize,G_DSPVsize);
	        L2_SetBFBSize(G_DSPHsize,G_DSPVsize);
			
		//L2_CtrlScreen(3);
		UI_ClearFOSD(25, 8, 0x08);
		DELAY_100ms();
         	 L2_SetFOSDIndex(FOSD_V_num/2,FOSD_H_num/2-1,0x3a);
          	L2_SetFOSDAttr(FOSD_V_num/2,FOSD_H_num/2-1, UI_MENU_BG_COLOR_ON | UI_MENU_TITLE_TEXT_COLOR);
         	 L2_SetFOSDIndex(FOSD_V_num/2,FOSD_H_num/2,0x3b);
         	 L2_SetFOSDAttr(FOSD_V_num/2,FOSD_H_num/2, UI_MENU_BG_COLOR_ON | UI_MENU_TITLE_TEXT_COLOR);
		//patch5.04@Joe@2003.5.14 13:44 add end

		//patch4.5@ada@Record DCF file name begin
                L2_DRAMSetStartAddr((K_SDRAM_JPG_FdbParameterBufAddr + (((ULONG)G_playObject.FileIndex) - 1) * 10 + 6),K_SDRAM_Prefetch);

		for (i = 0; i < 4; i += 2)
		{
			L2_DRAMReadWord(&name[i],&name[i + 1]);
          	}

		TempFileIndex = G_playObject.FileIndex;

                for (i = 7; i > 3; i--)
        	{
                	ch = (UCHAR) (TempFileIndex % 10) + '0';
                	TempFileIndex /= 10;
                	name[i] = ch;
        	}

        	name[8]  = 'J';
                name[9]  = 'P';
        	name[10] = 'G';
        	name[11] = 0x20;

               //USR_SetJpgName(name, G_playObject.FileIndex);
			   //patch4.5@ada@Record DCF file name end

               //version4.0@ada@0513 for DCF

			   //patch4.5@ada@Record DCF file name begin

⌨️ 快捷键说明

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