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

📄 guicommands.cpp.svn-base

📁 sigmadesign smp8623 gui source code ,bingo
💻 SVN-BASE
📖 第 1 页 / 共 5 页
字号:
	{	case TV_NTSC_COMMAND:		RMDBGLOG((GUIDBG, "TV Standard = NTSC\n"));		break;	case TV_PAL_COMMAND:		RMDBGLOG((GUIDBG, "TV Standard = PAL\n"));		break;	default:		RMDBGLOG((GUIDBG, "TV Standard = UNKNOWN\n"));		break;	}	switch (settings.tvType)	{	case TV_4_3LETTERBOX_COMMAND:		RMDBGLOG((GUIDBG, "TV Type = 4:3 Letter Box\n"));		break;	case TV_4_3PANSCAN_COMMAND:		RMDBGLOG((GUIDBG, "TV Type = 4:3 PanScan\n"));		break;	case TV_16_9_COMMAND:		RMDBGLOG((GUIDBG, "TV Type = 16:9\n"));		break;	default:		RMDBGLOG((GUIDBG, "TV Type = UNKNOWN\n"));		break;	}	RMDBGLOG((GUIDBG, "forceNoHDMI = %s\n", settings.forceNoHDMI ? "True" : "False"));	if (settings.dvdParentalLevel == PARENTAL_LEVELOFF_COMMAND)		RMDBGLOG((GUIDBG, "DVD parental level = OFF\n"));	else if ((settings.dvdParentalLevel > PARENTAL_LEVELOFF_COMMAND) || (settings.dvdParentalLevel < PARENTAL_LEVEL1_COMMAND))		RMDBGLOG((GUIDBG, "DVD parental level = UNKNOWN\n"));	else		RMDBGLOG((GUIDBG, "DVD parental level = %d\n", ((settings.dvdParentalLevel-PARENTAL_LEVEL1_COMMAND)+1)));}void RMcuracaoGui::make_crc_table(void){	RMuint32 c;	RMuint16 n, k;	for (n = 0; n < 256; n++)	{		c = (RMuint32) n;		for (k = 0; k < 8; k++)		{			if (c & 1)				c = 0xedb88320L ^ (c >> 1);			else				c = c >> 1;		}		m_crc_table[n] = c;	}	m_crc_table_computed = TRUE;}RMuint32 RMcuracaoGui::update_crc(RMuint32 crc, RMuint8 *buf, RMuint32 len){	RMuint32 c = crc;	RMuint32 n;	if (!m_crc_table_computed)		make_crc_table();	for (n = 0; n < len; n++)	{		c = m_crc_table[(c ^ buf[n]) & 0xff] ^ (c >> 8);	}	return c;}RMuint32 RMcuracaoGui::CalculateCRC(RMuint8 *buffer, RMuint32 size){	return update_crc(0xffffffffL, buffer, size) ^ 0xffffffffL;}RMstatus RMcuracaoGui::SetDVIHDMIAutoEDID(RMuint32 commandId, RMbool edid_change){	RMbool auto_edid;	switch (commandId)	{	case SET_HDMI_AUTO_ON_COMMAND:		auto_edid = 1;		break;#ifdef GUI_REFID_2		case SET_HDMI_AUTO_OFF_COMMAND:#endif	default:		auto_edid = 0;		break;	}	if (m_context->decoder)	{		RMDBGLOG((GUIDBG, "SetDVIHDMIAutoEDID called (change = %d)...\n", edid_change));		m_context->decoder->SetDVIHDMIAutoEDID(auto_edid); // Could fail... doesn't matter		m_pnav->SetMenuItemText(commandId);	}	return (auto_edid ? RM_OK : RM_ERROR);}RMstatus RMcuracaoGui::GetDvdParameters(typeCuracaoDvdParameters *params){#ifndef WITH_CSS_MENU	// force protection	if (m_settings.dvdRegion == 0)		m_settings.dvdRegion = 1;	m_settings.macrovisionOn = TRUE;#endif	params->regionCode = m_settings.dvdRegion;	params->parentalLevel = m_settings.dvdParentalLevel - PARENTAL_LEVEL1_COMMAND + 1;	params->macrovisionEnabled = m_settings.macrovisionOn;	params->tvType = m_settings.tvType - TV_4_3LETTERBOX_COMMAND;	params->preferredLanguage = RM_LANGUAGE_ENGLISH;	params->countryCodeForParentalLevel = RM_COUNTRY_UNITED_STATES;#ifdef GUI_REFID_3	params->preferredLanguage = (RMdvdLanguageCode)m_settings.menuLanguage;	params->countryCodeForParentalLevel = (RMdvdCountryCode)m_settings.country;	params->macrovisionEnabled = TRUE;#endif	return RM_OK;}RMstatus RMcuracaoGui::GetVcdParameters(typeCuracaoVcdParameters *params){	params->pbcOn = (m_settings.vcdPBC == VCD_PBC_ON_COMMAND);	return RM_OK;}RMstatus RMcuracaoGui::ClearScreen(){	m_isDiscDetected = FALSE;	//	m_discType = RM_NO_DISC;	return m_pnav->ClearDisplay();}RMstatus RMcuracaoGui::EnableSPU(RMbool bEnable){	RMstatus status = RM_OK;	if (!m_initialized)	{		RMDBGLOG((GUIDBG, "GUI not initialised !!\n"));		return RM_ERROR;	}	// enable disable spu according to osd being displayed or not	if (m_context->decoder)	{		//workaround if Nero with subtitles, enabling the SPU will make subtitles fail		if (bEnable && m_isNeroMP4)			return RM_OK;		RMDBGLOG((GUIDBG, "%s SPU\n", bEnable ? "enabling" : "disabling"));		//printf("%s SPU\n", bEnable ? "enabling" : "disabling");		status = m_context->decoder->EnableSPUSurface(bEnable);	}	return status;}RMstatus RMcuracaoGui::SendKey(RMremoteKey c){	RMstatus status = RM_OK;	status = InterpretCommand(c);	if (status == RM_UNKNOWN_KEY && m_context->player != 0)	{		status = m_context->player->InterpretCommand(c, NULL);	}	return status;}RMstatus RMcuracaoGui::SendEvent(RMguiEvent event){	return RM_ERROR;}RMascii *RMcuracaoGui::GetFile(){	return (RMascii*) NULL;}RMstatus RMcuracaoGui::Close(){	// clear play list	ClearIsoPlayList();	if (m_pnav)	{		delete m_pnav;		m_pnav = NULL;	}	SavePlayerSettings();	return RM_OK;}void RMcuracaoGui::ConvertToTime(RMuint32 *totalSeconds, RMuint32 *hours, RMuint32 *minutes, RMuint32 *seconds){	*seconds = (RMuint32) (*totalSeconds % 60);	*minutes = (RMuint32) (*totalSeconds / 60);	*hours = (RMuint32) (*minutes / 60);	*minutes = (RMuint32) (*minutes % 60);}void RMcuracaoGui::ConvertToSeconds(RMuint32 *totalSeconds, RMascii *hhmmss){	RMuint32 hours, mins, secs;	// hhmmss must have 00:00:00 format!!!	hours = (RMuint32) ((hhmmss[0] - '0') * 10 + (hhmmss[1] - '0'));	mins = (RMuint32) ((hhmmss[3] - '0') * 10 + (hhmmss[4] - '0'));	secs = (RMuint32) ((hhmmss[6] - '0') * 10 + (hhmmss[7] - '0'));	*totalSeconds = hours * 3600 + mins * 60 + secs;}// timeout in secondsRMstatus RMcuracaoGui::SetTimer(RMguiTimerType timer, RMuint8 dynamic_timeout /*=0*/){	if (m_context->needToExit == TRUE)		return RM_ERROR;	RMstatus status = RM_OK;	if (timer >= MAX_GUI_TIMERS)		return RM_ERROR;	switch (timer)	{	case TIMER_EVENT:		g_timer[timer] = dynamic_timeout ? dynamic_timeout : EVENT_TIMEOUT;		break;	case TIMER_SLIDER:		g_timer[timer] = SLIDER_TIMEOUT;		break;	case TIMER_ERRORMESSAGE:		g_timer[timer] = (dynamic_timeout ? dynamic_timeout : ERRORMESSAGE_TIMEOUT);		break;	case TIMER_SLIDESHOW:		g_timer[timer] = SLIDESHOW_TIMEOUT;		break;	case TIMER_PICTUREERRORMESSAGE:		g_timer[timer] = PICTUREERROR_TIMEOUT;		break;	case TIMER_MEDIA:		g_timer[timer] = dynamic_timeout;		break;	case TIMER_VIDEOOUTCHANGE:		g_timer[timer] = VIDEOOUTCHANGE_TIMEOUT;		break;	case TIMER_SAVESETTINGS:		g_timer[timer] = SAVESETTINGS_TIMEOUT;		break;	case TIMER_PLAYER_NUMERIC_INPUT:		if(dynamic_timeout)			g_timer[timer] = dynamic_timeout;		else			g_timer[timer] = PLAYER_NUMERICINPUT_TIMEOUT;		break;	case TIMER_REMOVEPOPUP:		g_timer[timer] = dynamic_timeout;		break;	case TIMER_GENERIC:		g_timer[timer] = dynamic_timeout;		break;	case TIMER_WAIT_ANIMATION:		RMEnterCriticalSection(cs);		animate = dynamic_timeout;		RMLeaveCriticalSection(cs);		break;	default:		status = RM_ERROR;		break;	}	return status;}RMstatus RMcuracaoGui::KillTimer(RMguiTimerType timer, RMbool bAll/* = FALSE*/){	if (bAll)		RMMemset(g_timer, 0, sizeof(g_timer));	else if (timer == TIMER_WAIT_ANIMATION)	{		RMEnterCriticalSection(cs);		animate = 0;		RMLeaveCriticalSection(cs);	}	else		g_timer[timer] = 0;	return RM_OK;}RMstatus RMcuracaoGui::SetVolumeCommand(RMuint32 commandId){	RMstatus status = RM_ERROR;	RMuint32 value;	guiSliderType* slider = NULL;	RMuint8 index = 0;	if (!m_initialized)	{		RMDBGLOG((GUIDBG, "GUI not initialised !!\n"));		return RM_ERROR;	}	for (RMuint8 i = 0; i < 3; i++)	{		if (m_pnav->m_mediaControls->panels[i]->slider && m_pnav->m_mediaControls->panels[i]->slider->id == VOLUME_CONTROL)		{			slider = m_pnav->m_mediaControls->panels[i]->slider;			status = RM_OK;			index = i;		}	}	// find volume slider	//	status = m_pnav->GetSlider(VOLUME_CONTROL, &slider);	//	if(RMFAILED(status))	//		return status;	if (commandId == SET_VOLUME_UP_COMMAND)	{		if (slider->object.stepnumber < slider->object.steps - 1)		{			value = VolumeLevels[slider->object.stepnumber + 1];			status = SetVolume(value);			if (RMSUCCEEDED(status))			{				m_settings.volume = value;			}		}	}	else if (commandId == SET_VOLUME_DOWN_COMMAND)	{		if (slider->object.stepnumber > 0)		{			value = VolumeLevels[slider->object.stepnumber - 1];			status = SetVolume(value);			if (RMSUCCEEDED(status))			{				m_settings.volume = value;			}		}	}	slider->object.stepnumber = m_pnav->GetSliderStep(VOLUME_CONTROL, index, m_settings.volume);	//	slider->object.redraw = TRUE;	m_infoShow = m_infoOn;	m_infoOn = 1;	if(m_numericInput[0] != 0)	{		ResetNumericInput(TRUE);	}	DisplayFileInfo(PROGRESS_CONTROL, TRUE);	ResetMute();	if (m_context->player->GetState() == STATE_PLAY)		SetTimer(TIMER_SLIDER);	//	if(RMSUCCEEDED(status)){	//		status = m_pnav->DisplaySlider(VOLUME_CONTROL, m_settings.volume);	//		ResetMute();	//	}	//	{	//		RMPanelObject* panels[3];	//		RMSliderObject* sliders[3];	//		RMButtonObject* buttons[MAX_GUI_BUTTONS];	//	//		RMuint8 numSliders = 0, numButtons = 0;	//	//		for(RMuint8 i = 0; i < 3; i ++)	//		{	//			panels[i] = &m_pnav->m_mediaControls->panels[i]->object;	//	//			if(m_pnav->m_mediaControls->panels[i]->slider)	//			{	//				sliders[numSliders] = &m_pnav->m_mediaControls->panels[i]->slider->object;	//				numSliders ++;	//			}	//	//			if(m_pnav->m_mediaControls->panels[i]->nbButtons)	//			{	//				for(RMuint8 j = 0; j < m_pnav->m_mediaControls->panels[i]->nbButtons; j++)	//				{	//					buttons[numButtons] = &m_pnav->m_mediaControls->panels[i]->buttons[j]->object;	//					numButtons++;	//				}	//			}	//		}	//	//		DrawMediaControls(m_pRua, panels, 3, buttons, numButtons, sliders, numSliders);	//		ResetMute();	//	}	return status;}RMstatus RMcuracaoGui::SetBCSCommand(RMuint32 commandId){	RMstatus status = RM_OK;	RMint32 value = 0;	guiSliderType* slider = NULL;	if (!m_initialized)	{		RMDBGLOG((GUIDBG, "GUI not initialised !!\n"));		return RM_ERROR;	}	// find slider	status = m_pnav->GetSlider(m_pnav->SelectedObjectId(), &slider);	if (RMFAILED(status))		return status;	switch (slider->id)	{	case BRIGHTNESS_CONTROL:		if (commandId == SET_VOLUME_UP_COMMAND)		{			if (slider->object.stepnumber < slider->object.steps - 1)			{				value = m_settings.brightness + (256 / slider->object.steps);				if (value > MaxRMint8)					return RM_OK;				status = SetBrightness(value);				if (RMSUCCEEDED(status))				{					m_settings.brightness = value;					status = m_pnav->DisplaySlider(slider->id, m_settings.brightness);				}			}		}		else if (commandId == SET_VOLUME_DOWN_COMMAND)		{			if (slider->object.stepnumber > 0)			{				value = m_settings.brightness - (256 / slider->object.steps);				if (value < MinRMint8)					return RM_OK;				status = SetBrightness(value);				if (RMSUCCEEDED(status))				{					m_settings.brightness = value;					status = m_pnav->DisplaySlider(slider->id, m_settings.brightness);				}

⌨️ 快捷键说明

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