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

📄 digest_m.c

📁 Zoran VP2K731 DVD源代码,极具参考价值!
💻 C
📖 第 1 页 / 共 3 页
字号:
  	SAFELY_DELETE(MEMBER(m_pmssMenuICON3));
  	SAFELY_DELETE(MEMBER(m_pmssMenuICON4));
  #endif
  SAFELY_DELETE(MEMBER(m_pmssFrameNumber));

  if ( MEMBER(m_bClosedByUser) == FALSE )
  {
#ifdef NO_C_STDLIB
	  rtouts("\n on_digest_close: Sending IE_CORE_DIGEST_STOP");
#endif
	  ie_send( IE_CORE_DIGEST_STOP );
  }

#ifdef NO_C_STDLIB
	rtouts("\nDigest screen closed");
#endif
}



static void layout (void)
{

	go_CurrentLayout.m_bBigMemMap = 1;//USE_BIGMEMMAP_WHEN_REQUIRED;
	go_CurrentLayout.m_cPixRes = 0;
	go_CurrentLayout.m_wOriginX = MS_W_ORIGIN_X;

// <<< ZORAN CDE0808 : Fix hole problem
#ifdef DISABLE
	go_CurrentLayout.m_wOriginY = MS_LINE_2;
#else
	go_CurrentLayout.m_wOriginY = DIGEST_ORIGIN_Y - HEIGHT_AHEAD_ICON;
#endif // DISABLE

	go_CurrentLayout.m_wWidth = NBRPIX_PER_LINE;

// <<< ZORAN CDE0808 : Fix hole problem
#ifdef DISABLE
	go_CurrentLayout.m_wHeight = 416;//360;
#else
	go_CurrentLayout.m_wHeight = DIGEST_SCREEN_HEIGHT - DIGEST_GRID_Y_SPACING + DIGEST_ICON_HEIGHT + HEIGHT_AHEAD_ICON;	//DM1115 add for space of ICON
#endif // DISABLE
// ZORAN CDE0808 >>>

// <<< ZORAN CDE0808 : Fix hole problem
#ifdef DISABLE
	go_CurrentLayout.m_cNbrHole = 3;

	go_CurrentLayout.m_oHolePos[0].m_wLineNbr = 100;
	go_CurrentLayout.m_oHolePos[0].m_wHeight = 8;

	go_CurrentLayout.m_oHolePos[1].m_wLineNbr = 144;
	go_CurrentLayout.m_oHolePos[1].m_wHeight = 136;

	go_CurrentLayout.m_oHolePos[2].m_wLineNbr = 312;
	go_CurrentLayout.m_oHolePos[2].m_wHeight = 120;
#else
	go_CurrentLayout.m_cNbrHole = 3;

	{
	  // Start at the top of the screen -- this will be modified at the end of the block
	  WORD wLine = DIGEST_ORIGIN_Y;
	  WORD wHeight = DIGEST_FIRST_LABEL_LINE;

	  go_CurrentLayout.m_oHolePos[0].m_wLineNbr = wLine;
	  go_CurrentLayout.m_oHolePos[0].m_wHeight = wHeight;

	  // Skip over the hole and the label
	  wLine += (wHeight + DIGEST_LABEL_HEIGHT);
	  wHeight = DIGEST_HOLE_HEIGHT;

	  go_CurrentLayout.m_oHolePos[1].m_wLineNbr = wLine;
	  go_CurrentLayout.m_oHolePos[1].m_wHeight = wHeight;

	  wLine += (wHeight + DIGEST_LABEL_HEIGHT);
	  go_CurrentLayout.m_oHolePos[2].m_wLineNbr = wLine;
	  go_CurrentLayout.m_oHolePos[2].m_wHeight = wHeight;
	}

	// Update the first hole so it will start after the menu title
	go_CurrentLayout.m_oHolePos[0].m_wLineNbr += (MSS_MENU_TITLE_Y + DIGEST_LABEL_HEIGHT);
	go_CurrentLayout.m_oHolePos[0].m_wHeight -= (MSS_MENU_TITLE_Y + DIGEST_LABEL_HEIGHT);
#endif // DISABLE
// ZORAN CDE0808 >>>

// ZORAN CDE0808 : Fix hole problem
	go_CurrentLayout.m_cInitColor = MS_INIT_COLOR /*0*/;
	go_CurrentLayout.m_cNbrColor = 16;
	go_CurrentLayout.m_pColorPalette = (OSD_Palette *)MenuBitmapColor;

	// ZORAN CDE0802 : Accommodate line-doubling
	MS_adjust_layout();
	
	OSDSetLayout();
	OSDSetFont(0);

	dbouts("\nDIGEST LAYOUT");
}

void user_close_menu(void)
{
#ifdef JPG_DIGEST_ENABLED	//DM1120
	if(g_disc_type == DEC_DISC_TYPE_JPG)
	{
		BYTE timeout =100;
		//Dm1120 Wait until Core cmd finished
		while( (DigestNotify) && timeout ){
			usleep(10000);
			timeout--;
		}
		if (!timeout)
			printf("can't get core state finished for JPG Digest\n");
	}
#endif
	g_ms_bMustClose = TRUE;
	MEMBER(m_bClosedByUser) = TRUE;
}

// ZORAN CDE0809 : Moved from customer.c
MS_UOP digest_screen_user_op( MS_WIDGET *pmsw, MS_UOP uop, char param )
{
	switch( uop )
	// ZORAN CDE0808 >>>
		{
		case MS_UOP_1:	
		case MS_UOP_2:
		case MS_UOP_3:
		case MS_UOP_4:
		case MS_UOP_5:
		case MS_UOP_6:
		case MS_UOP_7:
		case MS_UOP_8:
		case MS_UOP_9:
#ifdef ENABLE_DIGEST_NUMBER_SELECTION
				//check_in_play_state();
			ie_send_ex(IE_CORE_DIGEST_NUMBER_SELECT,(void *)((uop)-MS_UOP_1+1));
#ifdef D_PICTURE_CD_ENABLED	//DM1120
			set_picture_open(TRUE);
#endif
			user_close_menu();
#endif
			break;
//DM1105 add arrow selection for jpg digest
		case MS_UOP_UP:
			if(MEMBER(m_ucPrevFrameNumber)>MIN_IMAGE_NUM_UP)
			{
#ifdef ICON_IN_THUMBNAIL_MENU	//DM1115 for space of ICON
				if((DIGEST_MAX_NUMBER>DigestDisplayNum)&&(MEMBER(m_ucPrevFrameNumber) >DIGEST_MAX_NUMBER))
					digestdisplaynum((((DigestDisplayNum-2)/NUM_IMAGE_EACHLINE*NUM_IMAGE_EACHLINE+(MEMBER(m_ucPrevFrameNumber)-1)%NUM_IMAGE_EACHLINE+1) > DigestDisplayNum)?
										(DigestDisplayNum-1):((DigestDisplayNum-2)/NUM_IMAGE_EACHLINE*NUM_IMAGE_EACHLINE+(MEMBER(m_ucPrevFrameNumber)-1)%NUM_IMAGE_EACHLINE+1));
				else
#endif
					digestdisplaynum(MEMBER(m_ucPrevFrameNumber) - NUM_IMAGE_EACHLINE);
			}
			break;
		case MS_UOP_DOWN:
			if((MEMBER(m_ucPrevFrameNumber)<MAX_IMAGE_NUM_DOWN)&&((MEMBER(m_ucPrevFrameNumber) + (NUM_IMAGE_EACHLINE+1))<=(DigestDisplayNum+NUM_OF_ICON)))
			{
#ifdef ICON_IN_THUMBNAIL_MENU	//DM1115 for space of ICON
				if((DIGEST_MAX_NUMBER >= (MEMBER(m_ucPrevFrameNumber) + NUM_IMAGE_EACHLINE))&&((MEMBER(m_ucPrevFrameNumber) + (NUM_IMAGE_EACHLINE+1)) >DigestDisplayNum))
					digestdisplaynum((((MEMBER(m_ucPrevFrameNumber)-1)%NUM_IMAGE_EACHLINE + 1 + DIGEST_MAX_NUMBER) > (DIGEST_MAX_NUMBER + NUM_OF_ICON)?
									(DIGEST_MAX_NUMBER + NUM_OF_ICON):(MEMBER(m_ucPrevFrameNumber)-1)%NUM_IMAGE_EACHLINE + 1 + DIGEST_MAX_NUMBER));
				else
#endif
					digestdisplaynum(MEMBER(m_ucPrevFrameNumber) + NUM_IMAGE_EACHLINE);
			}
			else{
				if (MEMBER(m_ucPrevFrameNumber) != (DIGEST_MAX_NUMBER+NUM_OF_ICON))
					digestdisplaynum(DIGEST_MAX_NUMBER+NUM_OF_ICON);
			}
			break;
		case MS_UOP_LEFT:
			if(MEMBER(m_ucPrevFrameNumber)%NUM_IMAGE_EACHLINE != 1)
				digestdisplaynum(MEMBER(m_ucPrevFrameNumber) - 1);
			break;
		case MS_UOP_RIGHT:
#ifdef ICON_IN_THUMBNAIL_MENU	//DM1115 for space of ICON
			if((MEMBER(m_ucPrevFrameNumber)%NUM_IMAGE_EACHLINE != 0)
				&&((MEMBER(m_ucPrevFrameNumber) + 1)<=(DIGEST_MAX_NUMBER+NUM_OF_ICON))
				&&(MEMBER(m_ucPrevFrameNumber) > DIGEST_MAX_NUMBER))
				digestdisplaynum(MEMBER(m_ucPrevFrameNumber) + 1);
			else
#endif
			if((MEMBER(m_ucPrevFrameNumber)%NUM_IMAGE_EACHLINE != 0)&&((MEMBER(m_ucPrevFrameNumber) + 2)<=(DigestDisplayNum+NUM_OF_ICON)))
				digestdisplaynum(MEMBER(m_ucPrevFrameNumber) + 1);
			break;
		case MS_UOP_ENTER:
			if(DigestDisplayNum)	//DM1120 safeway to send event
			{
#ifdef ICON_IN_THUMBNAIL_MENU	//DM1115 for space of ICON
				if(MEMBER(m_ucPrevFrameNumber) > DIGEST_MAX_NUMBER)
					
					icon_action(MEMBER(m_ucPrevFrameNumber));
				else
#endif
				{
				ie_send_ex(IE_CORE_DIGEST_NUMBER_SELECT,(void *)(MEMBER(m_ucPrevFrameNumber)));
#ifdef D_PICTURE_CD_ENABLED	//DM1120
				set_picture_open(TRUE);
#endif
				user_close_menu();
				}
			}
			break;
//DM1105
		case MS_UOP_PLAY:
			if(DigestDisplayNum)	//DM1120 safeway to send event
			{
				ie_send_ex(IE_CORE_DIGEST_NUMBER_SELECT,(void *)(1));
#ifdef D_PICTURE_CD_ENABLED	//DM1120
				set_picture_open(TRUE);
#endif
				user_close_menu();
			}
			break;

		case MS_UOP_STOP:
#ifdef D_PICTURE_CD_ENABLED	//DM1120
			//set_picture_open(FALSE);
			break;
#endif			
		case MS_UOP_POWER:
			OSD_TurnOff();	//DM1114 avoid display garbage
#ifdef D_PICTURE_CD_ENABLED	//DM1120
			set_picture_open(FALSE);
#endif
			ie_send( IE_CORE_DIGEST_STOP ); // to close digest
			user_close_menu();
			break;

		case MS_UOP_EJECT:	
			ie_send( IE_CORE_DIGEST_EJECT );
			user_close_menu();
			break;

       	case MS_UOP_SKIPF:
#if MP3_JPG_TOGETHER
#ifdef ICON_IN_THUMBNAIL_MENU	//DM1115 for space of ICON
			// DZ1122 Block the "Next" action if on No. 1 pages.
			if( DigestCounter >= file_list_get_max_jpg() )
			{
				break;
			}
			if( ((DigestPage+1) * DIGEST_MAX_NUMBER +1 ) > file_list_get_max_jpg())
			{
				break ;
			}
		// DZ1122 End
			OSD_TurnOff();	//DM1114 avoid display garbage
			
#endif

#else
#ifdef ICON_IN_THUMBNAIL_MENU	//DM1115 for space of ICON
			// DZ1122 Block the "Next" action if on No. 1 pages.
			if( DigestCounter >= file_list_get_max() )
			{
				break;
			}
			if( ((DigestPage+1) * DIGEST_MAX_NUMBER +1 ) > file_list_get_max())
			{
				break ;
			}
		// DZ1122 End
			OSD_TurnOff();	//DM1114 avoid display garbage
			
#endif
#endif
			ie_send(IE_CORE_DIGEST_NEXT);
			break;

       	case MS_UOP_SKIPB:	
#ifdef ICON_IN_THUMBNAIL_MENU	//DM1115 for space of ICON
			// DZ1122 Block the "Previous" action if on No. 1 pages.
			if( DigestPage == 0 )
			{
				break;
			}
		// DZ1122 End
			OSD_TurnOff();	//DM1114 avoid display garbage
#endif
			ie_send(IE_CORE_DIGEST_PREVIOUS);
			break;

		default:
			return dialog_user_op( pmsw, uop, param );
		}

	return MS_UOP_NOP;

}

void open_digest(void)
{
	int testmsg=0;
	OSD_MESSAGES msg = S_NULL;
#ifdef ICON_IN_THUMBNAIL_MENU	
	BOOL gPALMode = gPalMode;
#endif	
	MEMBER(m_pmssMenuTitle) = NULL;
	MEMBER(m_pmssFrameNumber) = NULL;
	strcpy(MEMBER(m_szFrameNumber), "");
	MEMBER(m_ucPrevFrameNumber) = 0;
	MEMBER(m_bClosedByUser) = FALSE;
	if(gPALMode)
		screen = MS_create_screen((MS_POS *)&digest_screen_pos_pal,SETUP_SCREEN_COLOR,MS_NO_BACKGROUND,on_digest_close,layout);
	else	
		screen = MS_create_screen((MS_POS *)&digest_screen_pos,SETUP_SCREEN_COLOR,MS_NO_BACKGROUND,on_digest_close,layout);
	MS_override_user_op( (MS_WIDGET*) screen, digest_screen_user_op );

#ifdef DISABLE
if(testmsg)
{
	sc_Write(SC_TMP_MSG_ADDR,1,(Sc_cont *)&msg);
	sc_SetBytes(SC_TMP_STR_ADDR, 0, 2, (BYTE *)"");
	sc_SetBytes(SC_CURRENT_TIME_MSG_ADDR, 0, 2, (BYTE*)"" );
	sc_Write(SC_PERMANENT_MSG_ADDR,1,(Sc_cont *)&msg);
	sc_Write(SC_MUTE_MSG_ADDR,1,(Sc_cont *)&msg);
}
#endif // DISABLE

#ifdef DISABLE
if(testmsg)
	MS_add_item((MS_DIALOG*)screen,(MS_WIDGET*)&permanent_msg1, !C_FOCUSED);
#endif // DISABLE

#ifdef DISABLE
if(testmsg)	
	MS_add_item((MS_DIALOG*)screen,(MS_WIDGET*)&tmp_msg1, !C_FOCUSED);
if(testmsg)
	MS_add_item((MS_DIALOG*)screen,(MS_WIDGET*)&tmp_string1, !C_FOCUSED);
if(testmsg)
	MS_add_item((MS_DIALOG*)screen,(MS_WIDGET*)&mute_msg1, !C_FOCUSED);
if(testmsg)	
	MS_add_item((MS_DIALOG*)screen,(MS_WIDGET*)&c_time_stat, !C_FOCUSED);
#endif // DISABLE
	
#ifndef ICON_IN_THUMBNAIL_MENU	//DM1115 for space of ICON
#ifdef DISABLE
	//MS_add_item((MS_DIALOG*)screen,(MS_WIDGET*)&digest_string, !C_FOCUSED);
	MS_add_item((MS_DIALOG*)screen,(MS_WIDGET*)&mssMenuTitle, !C_FOCUSED);

⌨️ 快捷键说明

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