?? o_program.c
字號:
case MS_OP_ENTER:
{
MSO_PROGRAM_TRACK __NEAR* pChapter = (MSO_PROGRAM_TRACK __NEAR*)pThis;
UINT16 wChapterNum = pChapter->moParam.mwTrack;
MSO_VLIST __NEAR* pTrackList = (MSO_VLIST __NEAR* )pThis->mpParent;
MSO_OBJECT __NEAR* pTrackVScrollList = (MSO_OBJECT __NEAR*)((MSO_OBJECT __NEAR*)pTrackList)->mpParent;
if (!wChapterNum)
{
MSO_OBJECT __NEAR* pObject = MS_GetObjectListPtr(pTrackList);
// Remove all items.
MS_SendOperation((MSO_OBJECT __NEAR*)pTrackList, MS_OP_EMPTY, 0);
pTrackList->moParam.mdwData = 0;
pTrackList->moParam.mwTotalItems = CoreAPI_GetTotalTitleGroupNum();
_AddItemsToTitleList((MSO_VLIST __NEAR*)pTrackList);
MS_ScreenSetFocusObject(pObject);
MS_DisplayAddObject((MSO_OBJECT __NEAR*)pTrackVScrollList);
}
else
{
UINT16 wTitleNum = (UINT16)(pTrackList->moParam.mdwData);
MSO_PROGRAM __NEAR* pProgram = (MSO_PROGRAM __NEAR*)pTrackVScrollList->mpParent;
UINT16 wItemNum = pProgram->moParam.mwProgramListItemsNum;
MSO_OBJECT __NEAR* pProgramListDisplay = (MSO_OBJECT __NEAR*)MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)pProgram, (MS_DESCRIPTOR*)&oProgramListDisplayDescriptor);
if (wItemNum < MAX_PROGRAM_NUM)
{
pProgram->moParam.mwProgramListItemsNum++;
pProgram->moParam.mwTrack[wItemNum] = wTitleNum;
pProgram->moParam.mwChapter[wItemNum] = wChapterNum;
MS_DisplayAddObject((MSO_OBJECT __NEAR*)pProgramListDisplay);
}
}
}
return MS_OP_NONE;
}
return MsOp;
}
/***************************************************************************************
* Function : _PlayButtonOperation
*
* In :
*
* Out :
*
* Desc : user operation function for oPlayButtonDescriptor.
****************************************************************************************/
STATIC MS_OP _PlayButtonOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_ENTER:
{
MSO_PROGRAM __NEAR* pProgram = (MSO_PROGRAM __NEAR*)pThis->mpParent;
pProgram->moParam.mbProgramPendingPlay = TRUE;
return MS_OP_CLOSE_PARENT;
}
}
return OBUTTON_Operation(pThis, MsOp, lParam);
}
/***************************************************************************************
* Function : _ClearButtonOperation
*
* In :
*
* Out :
*
* Desc : user operation function for oClearButtonDescriptor.
****************************************************************************************/
STATIC MS_OP _ClearButtonOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_ENTER:
{
MSO_PROGRAM __NEAR* pProgram = (MSO_PROGRAM __NEAR*)pThis->mpParent;
MSO_OBJECT __NEAR* pProgramListDisplay = (MSO_OBJECT __NEAR*)MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)pProgram, (MS_DESCRIPTOR*)&oProgramListDisplayDescriptor);
_ProgramListClearCurrent((MSO_PROGRAM __NEAR*)pProgram);
MS_DisplayAddObject((MSO_OBJECT __NEAR*)pProgramListDisplay);
return MS_OP_NONE;
}
}
return OBUTTON_Operation(pThis, MsOp, lParam);
}
/***************************************************************************************
* Function : _ClearAllButtonOperation
*
* In :
*
* Out :
*
* Desc : user operation function for oClearAllButtonDescriptor.
****************************************************************************************/
STATIC MS_OP _ClearAllButtonOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_ENTER:
{
MSO_PROGRAM __NEAR* pProgram = (MSO_PROGRAM __NEAR*)pThis->mpParent;
MSO_OBJECT __NEAR* pProgramListDisplay = (MSO_OBJECT __NEAR*)MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)pProgram, (MS_DESCRIPTOR*)&oProgramListDisplayDescriptor);
_ProgramListClearAll((MSO_PROGRAM __NEAR*)pProgram);
MS_DisplayAddObject((MSO_OBJECT __NEAR*)pProgramListDisplay);
return MS_OP_NONE;
}
}
return OBUTTON_Operation(pThis, MsOp, lParam);
}
/***************************************************************************************
* Display functions
****************************************************************************************/
/***************************************************************************************
* Function : _ProgramComponentFillOSDSeg
*
* In :
*
* Out :
*
* Desc : MSO_PROGRAM display function.
****************************************************************************************/
STATIC BOOL _ProgramComponentFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
MS_DESCRIPTOR_PROGRAM* pDescriptor = (MS_DESCRIPTOR_PROGRAM*)pThis->mpDescriptor;
OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, pAbsArea);
return FALSE;
}
/***************************************************************************************
* Function : _ProgramListDisplayFillOSDSeg
*
* In :
*
* Out :
*
* Desc : display function for oProgramListDisplayDescriptor.
****************************************************************************************/
STATIC BOOL _ProgramListDisplayFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
FORMATED_UNICODE_STRING oFormUniStr;
MS_DESCRIPTOR_PROGRAM_LIST_DISPLAY* pDescriptor = (MS_DESCRIPTOR_PROGRAM_LIST_DISPLAY*)pThis->mpDescriptor;
UINT16 wTextColor = pDescriptor->mwTextColor;
UINT16 wTrackColor = pDescriptor->mwTrackColor;
MSO_PROGRAM __NEAR* pProgram = (MSO_PROGRAM __NEAR*)pThis->mpParent;
UINT16 wTrackorTitle;
UINT16 wChapter;
UINT8 cBuffOffset;
UINT8 cLine;
UINT8 cColumn;
UINT8 cIndex;
INT16 sX;
INT16 sY = AREA_PROGRAM_LIST_DISPLAY_TOP_PADDING_Y;
OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, pAbsArea);
oFormUniStr.mtFontIndex = FONT_0;
for (cLine = 0; cLine < MAX_PROGRAM_DISPLAY_LINE; cLine++)
{
for (cColumn = 0; cColumn < 2; cColumn ++)
{
//Display the number label: 1,2,3,etc
STR_GenerateNumericValue(cLine * 2 + cColumn + 1, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX + 1);
if (0 == cColumn)
sX = AREA_PROGRAM_LIST_DISPLAY_LEFT_TEXT_X;
else
sX = AREA_PROGRAM_LIST_DISPLAY_RIGHT_TEXT_X;
OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
sX,
sY,
ALIGN_H_LEFT,
ALIGN_V_TOP,
wTextColor);
//Display the selected track: T1 C2,etc
cIndex = cLine*2 + cColumn;
wTrackorTitle = pProgram->moParam.mwTrack[cIndex];
wChapter = pProgram->moParam.mwChapter[cIndex];
cBuffOffset = 0;
if (INVALID_TRACK != wTrackorTitle)
{
oFormUniStr.mszUniStr[cBuffOffset++] = L'T';
cBuffOffset = STR_GenerateNumericValue(wTrackorTitle, oFormUniStr.mszUniStr, cBuffOffset, UNISTR_LENGTH_MAX + 1);
switch(CoreAPI_GetCurrentMediaType())
{
case MEDIA_TYPE_DVD_VIDEO:
oFormUniStr.mszUniStr[cBuffOffset++] = L' ';
oFormUniStr.mszUniStr[cBuffOffset++] = L'C';
cBuffOffset = STR_GenerateNumericValue(wChapter, oFormUniStr.mszUniStr, cBuffOffset, UNISTR_LENGTH_MAX + 1);
break;
}
OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr);
}
else
OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)S_NULL);
if (0 == cColumn)
sX = AREA_PROGRAM_LIST_DISPLAY_LEFT_TRACK_X;
else
sX = AREA_PROGRAM_LIST_DISPLAY_RIGHT_TRACK_X;
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
sX,
sY,
ALIGN_H_LEFT,
ALIGN_V_TOP,
wTrackColor);
}
sY += AREA_PROGRAM_LIST_DISPLAY_LINE_H;
}
return FALSE;
}
/***************************************************************************************
* Function : _TrackFillOSDSeg
*
* In :
*
* Out :
*
* Desc : display function for oProgramTrackDescriptor.
****************************************************************************************/
STATIC BOOL _TrackFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
FORMATED_UNICODE_STRING oFormUniStr;
MS_DESCRIPTOR_PROGRAM_TRACK* pDescriptor = (MS_DESCRIPTOR_PROGRAM_TRACK*)pThis->mpDescriptor;
MSO_PROGRAM_TRACK __NEAR* pProgramTrack = (MSO_PROGRAM_TRACK __NEAR*)pThis;
UINT16 wColor = pDescriptor->mwTextColor;
UINT8 cBuffOffset;
oFormUniStr.mtFontIndex = FONT_0;
cBuffOffset = STR_GenerateOSDMESSAGEString(S_TRACK, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX + 1);
oFormUniStr.mszUniStr[cBuffOffset++] = L' ';
STR_GenerateNumericValue(pProgramTrack->moParam.mwTrack, oFormUniStr.mszUniStr, cBuffOffset, UNISTR_LENGTH_MAX + 1);
OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
TRACK_LEFT_PADDING,
pAbsArea->mwH >> 1,
ALIGN_H_LEFT,
ALIGN_V_CENTER,
wColor);
if(MS_IsFocused(pThis))
OSDR_FillOsdSegBitmapFitArea(BMP_FG_FOCUS, pAbsArea);
return FALSE;
}
/***************************************************************************************
* Function : _TitleFillOSDSeg
*
* In :
*
* Out :
*
* Desc : display function for oProgramTitleDescriptor.
****************************************************************************************/
STATIC BOOL _TitleFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
FORMATED_UNICODE_STRING oFormUniStr;
MS_DESCRIPTOR_PROGRAM_TRACK* pDescriptor = (MS_DESCRIPTOR_PROGRAM_TRACK*)pThis->mpDescriptor;
MSO_PROGRAM_TRACK __NEAR* pProgramTrack = (MSO_PROGRAM_TRACK __NEAR*)pThis;
UINT16 wColor = pDescriptor->mwTextColor;
UINT8 cBuffOffset;
oFormUniStr.mtFontIndex = FONT_0;
cBuffOffset = STR_GenerateOSDMESSAGEString(S_TITLE, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX + 1);
oFormUniStr.mszUniStr[cBuffOffset++] = L' ';
STR_GenerateNumericValue(pProgramTrack->moParam.mwTrack, oFormUniStr.mszUniStr, cBuffOffset, UNISTR_LENGTH_MAX + 1);
OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
TRACK_LEFT_PADDING,
pAbsArea->mwH >> 1,
ALIGN_H_LEFT,
ALIGN_V_CENTER,
wColor);
if(MS_IsFocused(pThis))
OSDR_FillOsdSegBitmapFitArea(BMP_FG_FOCUS, pAbsArea);
return FALSE;
}
/***************************************************************************************
* Function : _ChapterFillOSDSeg
*
* In :
*
* Out :
*
* Desc : display function for oProgramChapterDescriptor.
****************************************************************************************/
STATIC BOOL _ChapterFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
FORMATED_UNICODE_STRING oFormUniStr;
MS_DESCRIPTOR_PROGRAM_TRACK* pDescriptor = (MS_DESCRIPTOR_PROGRAM_TRACK*)pThis->mpDescriptor;
MSO_PROGRAM_TRACK __NEAR* pProgramTrack = (MSO_PROGRAM_TRACK __NEAR*)pThis;
UINT16 wColor = pDescriptor->mwTextColor;
UINT8 cBuffOffset;
oFormUniStr.mtFontIndex = FONT_0;
if (pProgramTrack->moParam.mwTrack)
{
cBuffOffset = STR_GenerateOSDMESSAGEString(S_CHAPTER, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX + 1);
oFormUniStr.mszUniStr[cBuffOffset++] = L' ';
STR_GenerateNumericValue(pProgramTrack->moParam.mwTrack, oFormUniStr.mszUniStr, cBuffOffset, UNISTR_LENGTH_MAX + 1);
}
else
{
oFormUniStr.mszUniStr[0] = L'.';
oFormUniStr.mszUniStr[1] = L'.';
oFormUniStr.mszUniStr[2] = L'\0';
}
OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
TRACK_LEFT_PADDING,
pAbsArea->mwH >> 1,
ALIGN_H_LEFT,
ALIGN_V_CENTER,
wColor);
if(MS_IsFocused(pThis))
OSDR_FillOsdSegBitmapFitArea(BMP_FG_FOCUS, pAbsArea);
return FALSE;
}
/***************************************************************************************
* Function : OProgram_Open
*
* In : pParent = Pointer to the parent container.
*
* bPlay = TRUE: The playstate isn't stop before the program component is opened.
* FALSE: The playstate is stop before the program component is opened.
*
*
* Out : None.
*
* Return : Pointer to the Program component if opened successfully, otherwise NULL.
*
* Desc : Creates, and displays a Program component at a specified position.
****************************************************************************************/
MSO_OBJECT __NEAR* OProgram_Open(MSO_CONTAINER __NEAR* pParent, BOOL bPlay)
{
if(NULL != pParent)
{
MSO_OBJECT __NEAR* pProgramWnd = NULL;
pProgramWnd = (MSO_OBJECT __NEAR*)MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oProgramDescriptor, pParent);
if(NULL != pProgramWnd)
{
MSO_PROGRAM __NEAR* pProgram = (MSO_PROGRAM __NEAR*)pProgramWnd;
pProgram->moParam.mbIsPlayBeforeOpened = bPlay;
MS_DisplayAddObject(pProgramWnd);
}
return pProgramWnd;
}
return NULL;
}
#endif //D_GUI_COMPONENT_PROGRAM
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -