📄 o_playmode.c
字号:
*
* Desc : The DVD Program Chapter Entry operation function.
****************************************************************************************/
#ifndef D_CUSTOM__DVDProgramChapterEntryOperation
STATIC MS_OP _DVDProgramChapterEntryOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MsOp = OTEXT_Operation(pThis, MsOp, lParam);
// Post-processing
switch(MsOp)
{
case MS_OP_INIT:
case MS_OP_ON_DEFROST:
{
MSO_DVD_PROGRAM_ENTRY __NEAR* pProgramEntry = (MSO_DVD_PROGRAM_ENTRY __NEAR*)MS_GetParentPtr(pThis);
MS_SendOperation(pThis, MS_OP_BUILD_TEXT_STRING, (UINT32)pProgramEntry->moParam.mwChapter);
}
return MS_OP_NONE;
case MS_OP_0: // Fall Through
case MS_OP_1: // Fall Through
case MS_OP_2: // Fall Through
case MS_OP_3: // Fall Through
case MS_OP_4: // Fall Through
case MS_OP_5: // Fall Through
case MS_OP_6: // Fall Through
case MS_OP_7: // Fall Through
case MS_OP_8: // Fall Through
case MS_OP_9:
{
MSO_DVD_PROGRAM_ENTRY __NEAR* pProgramEntry = (MSO_DVD_PROGRAM_ENTRY __NEAR*)MS_GetParentPtr(pThis);
UINT8 cValue = MsOp - MS_OP_0;
if(!MS_IsEntryNumberAppended(pThis)
||(INVALID_TRACK == pProgramEntry->moParam.mwChapter ))
{
pProgramEntry->moParam.mwChapter = cValue;
MS_SendOperation(pThis, MS_OP_BUILD_TEXT_STRING, (UINT32)pProgramEntry->moParam.mwChapter);
MS_DisplayAddObject(pThis);
MS_SetEntryNumberAppended(pThis);
}
else
{
pProgramEntry->moParam.mwChapter = (pProgramEntry->moParam.mwChapter * 10) + cValue;
pProgramEntry->moParam.mwChapter = (pProgramEntry->moParam.mwChapter) % 1000;
MS_SendOperation(pThis, MS_OP_BUILD_TEXT_STRING, (UINT32)pProgramEntry->moParam.mwChapter);
MS_DisplayAddObject(pThis);
}
}
return MS_OP_NONE;
case MS_OP_CLEAR:
{
MSO_DVD_PROGRAM_ENTRY __NEAR* pProgramEntry = (MSO_DVD_PROGRAM_ENTRY __NEAR*)MS_GetParentPtr(pThis);
if(INVALID_TRACK != pProgramEntry->moParam.mwChapter)
{
// Remove this item from the Program list.
pProgramEntry->moParam.mwChapter = INVALID_TRACK;
MS_SendOperation(pThis, MS_OP_BUILD_TEXT_STRING, (UINT32)pProgramEntry->moParam.mwChapter);
MS_DisplayAddObject(pThis);
}
}
return MS_OP_NONE;
case MS_OP_UP:
case MS_OP_DOWN:
case MS_OP_LEFT:
case MS_OP_RIGHT:
case MS_OP_ENTER:
MS_ClearEntryNumberAppended(pThis);
break;
default:
break;
}
return MsOp;
}
#endif //D_CUSTOM__DVDProgramChapterEntryOperation
/***************************************************************************************
* Function : _DVDProgramEntryOperation
*
* In :
*
* Out :
*
* Desc : The DVD Program item operation function.
****************************************************************************************/
#ifndef D_CUSTOM__DVDProgramEntryOperation
STATIC MS_OP _DVDProgramEntryOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
// Pre-processing
switch(MsOp)
{
case MS_OP_INIT: // Fall Through !!!
case MS_OP_ON_DEFROST:
{
UINT16 wValue;
MSO_DVD_PROGRAM_ENTRY __NEAR* pProgramEntry = (MSO_DVD_PROGRAM_ENTRY __NEAR*)pThis;
if(MS_OP_INIT == MsOp)
pProgramEntry->moParam.mwIndex = (UINT16)lParam;
wValue = _GetEntryFromUIProgramList(pProgramEntry->moParam.mwIndex);
pProgramEntry->moParam.mwTitle = (INVALID_TRACK == wValue) ? INVALID_TRACK : _GetTitleFromProgramEntry(wValue);
pProgramEntry->moParam.mwChapter = (INVALID_TRACK == wValue) ? INVALID_TRACK : _GetChapterFromProgramEntry(wValue);
}
break;
case MS_OP_LEFT: // Fall Through !!!
case MS_OP_RIGHT: // Fall Through !!!
case MS_OP_UP:
case MS_OP_DOWN:
case MS_OP_ENTER:
{
MSO_DVD_PROGRAM_ENTRY __NEAR* pProgramEntry = (MSO_DVD_PROGRAM_ENTRY __NEAR*)pThis;
UINT16 wCurUIValue = _ComposeDVDProgEntry(pProgramEntry->moParam.mwTitle, pProgramEntry->moParam.mwChapter);
if( _IsTitleChapterValid(pProgramEntry))
_ModifyUIProgramListEntry(pProgramEntry->moParam.mwIndex, wCurUIValue);
else
_RemoveEntryFromUIProgramList(pProgramEntry->moParam.mwIndex);
if(MS_OP_ENTER == MsOp)
return MS_OP_NONE;
}
break;
default:
break;
}
MsOp = MS_BasicContainerOperation(pThis, MsOp, lParam);
// Post Processsing.
switch(MsOp)
{
case MS_OP_INIT:
case MS_OP_ON_DEFROST:
{
MSO_DVD_PROGRAM_ENTRY __NEAR* pProgramEntry = (MSO_DVD_PROGRAM_ENTRY __NEAR*)pThis;
if(!_IsTitleChapterValid(pProgramEntry))
{
pProgramEntry->moParam.mwTitle = INVALID_TRACK;
pProgramEntry->moParam.mwChapter = INVALID_TRACK;
_RemoveEntryFromUIProgramList(pProgramEntry->moParam.mwIndex);
}
}
break;
default:
break;
}
return MsOp;
}
#endif//D_CUSTOM__DVDProgramEntryOperation
/***************************************************************************************
* Display functions
****************************************************************************************/
/***************************************************************************************
* Function : _PlaymodeFillOSDSeg
*
* In :
*
* Out :
*
* Desc : MSO_PLAYMODE display function.
****************************************************************************************/
#ifndef D_CUSTOM__PlaymodeFillOSDSeg
STATIC BOOL _PlaymodeFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
MS_DESCRIPTOR_PLAYMODE* pDescriptor = (MS_DESCRIPTOR_PLAYMODE*)pThis->mpDescriptor;
OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, pAbsArea);
return FALSE;
}
#endif//D_CUSTOM__PlaymodeFillOSDSeg
/***************************************************************************************
* Function : _ProgramEntryFillOSDSeg
*
* In :
*
* Out :
*
* Desc : MSO_PROGRAM_ENTRY display function.
****************************************************************************************/
#ifndef D_CUSTOM__ProgramEntryFillOSDSeg
STATIC BOOL _ProgramEntryFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
FORMATED_UNICODE_STRING oFormUniStr;
//MS_DESCRIPTOR_TEXT* pDescriptorText = (MS_DESCRIPTOR_TEXT*)pThis->mpDescriptor;
MSO_PROGRAM_ENTRY __NEAR* pProgramEntry = (MSO_PROGRAM_ENTRY __NEAR*)pThis;
UINT16 szBuffer[3];
STR_GenerateNumericValue((INT32)pProgramEntry->moParam.mwIndex, szBuffer, 0, sizeof(szBuffer));
OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)szBuffer);
// The Label
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
8,
(pAbsArea->mwH >> 1),
ALIGN_H_LEFT,
ALIGN_V_CENTER,
CIDX_6/*OTEXT_GetColorFromSet(pThis, pDescriptorText->mpColorSetText)*/);
return OTEXT_FillOSDSeg(pThis, pAbsArea);
}
#endif//D_CUSTOM__ProgramEntryFillOSDSeg
/***************************************************************************************
* Function : _DVDProgramEntryFillOSDSeg
*
* In :
*
* Out :
*
* Desc : MSO_DVD_PROGRAM_ENTRY display function.
****************************************************************************************/
#ifndef D_CUSTOM__DVDProgramEntryFillOSDSeg
#pragma argsused
STATIC BOOL _DVDProgramEntryFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
FORMATED_UNICODE_STRING oFormUniStr;
MS_DESCRIPTOR_DVD_PROGRAM_ENTRY* pDescriptor = (MS_DESCRIPTOR_DVD_PROGRAM_ENTRY*)pThis->mpDescriptor;
MSO_DVD_PROGRAM_ENTRY __NEAR* pProgramEntry = (MSO_DVD_PROGRAM_ENTRY __NEAR*)pThis;
UINT16 szBuffer[3];
STR_GenerateNumericValue((INT32)pProgramEntry->moParam.mwIndex, szBuffer, 0, sizeof(szBuffer));
OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)szBuffer);
// The Label
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
8,
(pAbsArea->mwH >> 1),
ALIGN_H_LEFT,
ALIGN_V_CENTER,
pDescriptor->mwTextColor);
// TODO: add color for D_GUI_2_BIT_PER_PIXEL_FONTS
return FALSE;
}
#endif//D_CUSTOM__DVDProgramEntryFillOSDSeg
/***************************************************************************************
* Choice item action functions
****************************************************************************************/
/***************************************************************************************
* Function : _PlayModeChoiceAction
*
* In : pthis = Pointer to the choice object.
* eType = Getting or Setting the value
* wValue = 0 if value to get, or value to be set
*
* Out : None
*
* Return : None
*
* Desc : The Play mode choice action function.
****************************************************************************************/
#ifndef D_CUSTOM__PlayModeChoiceAction
#pragma argsused
STATIC void _PlayModeChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;
MSO_PLAYMODE __NEAR* pPlayModeComponent = (MSO_PLAYMODE __NEAR*)MS_FindAncestor(pThis, &oPlaymodeDescriptor);
if(eMutatorGet == eType)
{
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, pPlayModeComponent->moParam.mwPlaymode);
}
else
{
if ((PLAYMODE_PROGRAM == wValue) && (PST_STOP != CoreAPI_GetPlayState())&&(0 == _GetUIProgramListSize()))
return;
if ((!CoreAPI_IsPBCAvailabe()) && (PLAYMODE_PBC == wValue))
return;
pPlayModeComponent->moParam.mwPlaymode = wValue;
#ifdef D_MUTUAL_EXCLUSIVE_PLAYMODE_AND_REPEAT
if (PLAYMODE_NORMAL != wValue)
{
pPlayModeComponent->moParam.mwRepeat = REPEAT_OFF;
MS_SEND_OP_OBJECT(MS_GetParentPtr(pThis), MS_OP_REFRESH, 0);
}
#endif//D_MUTUAL_EXCLUSIVE_PLAYMODE_AND_REPEAT
}
}
#endif//D_CUSTOM__PlayModeChoiceAction
/***************************************************************************************
* Function : _RepeatChoiceAction
*
* In : pthis = Pointer to the choice object.
* eType = Getting or Setting the value
* wValue = 0 if value to get, or value to be set
*
* Out : None
*
* Return : None
*
* Desc : The Repeat mode choice action function.
****************************************************************************************/
#ifndef D_CUSTOM__RepeatChoiceAction
#pragma argsused
STATIC void _RepeatChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;
MSO_PLAYMODE __NEAR* pPlayModeComponent = (MSO_PLAYMODE __NEAR*)MS_FindAncestor(pThis, &oPlaymodeDescriptor);
if(eMutatorGet == eType)
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, pPlayModeComponent->moParam.mwRepeat);
else
{
pPlayModeComponent->moParam.mwRepeat = wValue;
#ifdef D_MUTUAL_EXCLUSIVE_PLAYMODE_AND_REPEAT
if(REPEAT_OFF != wValue)
{
pPlayModeComponent->moParam.mwPlaymode = PLAYMODE_NORMAL;
MS_SEND_OP_OBJECT(MS_GetParentPtr(pThis), MS_OP_REFRESH, 0);
}
#endif//D_MUTUAL_EXLUSIVE_PLAYMODE_AND_REPEAT
}
}
#endif//D_CUSTOM__RepeatChoiceAction
/***************************************************************************************
* Public functions
****************************************************************************************/
/***************************************************************************************
* Function : OPLAYMODE_OpenAtPos
*
* In : pParent = Pointer to the parent container.
*
* wStartX = X position of the component. The default position (specified in the
* descriptor) is used in case this parameter is set to DEFAULT_POSITION.
*
* wStartY = Y position of the component.The default position (specified in the
* descriptor) is used in case this parameter is set to DEFAULT_POSITION.
*
* Out : None.
*
* Return : Pointer to the Playmode component if opened successfully, otherwise NULL.
*
* Desc : Creates, and displays a Playmode component at a specified position.
****************************************************************************************/
MSO_OBJECT __NEAR* OPLAYMODE_OpenAtPos(MSO_CONTAINER __NEAR* pParent, UINT16 wStartX, UINT16 wStartY)
{
if(NULL != pParent)
{
MSO_OBJECT __NEAR* pPlaymodeWnd = NULL;
pPlaymodeWnd = (MSO_OBJECT __NEAR*)MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oPlaymodeDescriptor, pParent);
if(NULL != pPlaymodeWnd)
{
if((DEFAULT_POSITION != wStartX) || (DEFAULT_POSITION != wStartY))
{
wStartX = (DEFAULT_POSITION == wStartX) ? pPlaymodeWnd->mpDescriptor->moArea.msX : wStartX;
wStartY = (DEFAULT_POSITION == wStartY) ? pPlaymodeWnd->mpDescriptor->moArea.msY : wStartY;
MS_ObjectMove(pPlaymodeWnd, wStartX, wStartY);
}
MS_DisplayAddObject(pPlaymodeWnd);
}
return pPlaymodeWnd;
}
return NULL;
}
#endif //D_GUI_COMPONENT_PLAYMODE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -