📄 o_bookmark.c
字号:
PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
return MS_OP_NONE;
}
// Send message to clips menu
if (MS_OP_NONE != MS_SendOp(MS_OP_MENU_BOOK_MARK_TO_PLAY, (UINT32)(pBookmark->moParam.mwBookmarkID)))
{ // Go to the bookmark.
CoreAPI_GotoBookMark((UINT16)pBookmark->moParam.mwBookmarkID);
return MS_OP_CLOSE_PARENT;
}
else
return MS_OP_NONE;
}
else
{
// The bookmark is empty, set it if we are playing.
if(PST_STOP != gcs.pstate)
{
// For unsupport book mark track playing will return MS_OP_NONE
if (MS_OP_NONE != MS_SendOp(MS_OP_MENU_BOOK_MARK_TO_SET, (UINT32)(pBookmark->moParam.mwBookmarkID)))
{
CoreAPI_SetBookMark((UINT16)pBookmark->moParam.mwBookmarkID);
}
MS_SendOperation(pThis, MS_OP_BUILD_TEXT_STRING, (UINT32)pBookmark->moParam.mwBookmarkID);
MS_DisplayAddObject(pThis);
}
}
}
return MS_OP_NONE;
case MS_OP_CLEAR:
{
MSO_BOOKMARK_VALUE __NEAR* pBookmark = (MSO_BOOKMARK_VALUE __NEAR*)pThis;
// Clear the current bookmark
BM_CLEAR_BOOKMARK((UINT8)pBookmark->moParam.mwBookmarkID);
CoreAPI_ClearBookMark((UINT16)pBookmark->moParam.mwBookmarkID);
MS_SendOperation(pThis, MS_OP_BUILD_TEXT_STRING, (UINT32)pBookmark->moParam.mwBookmarkID);
MS_DisplayAddObject(pThis);
}
return MS_OP_NONE;
default:
break;
}
return MsOp;
}
/***************************************************************************************
* Function : _BookmarkComponentOperation
*
* In :
*
* Out :
*
* Desc : Operation function.
****************************************************************************************/
STATIC MS_OP _BookmarkComponentOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
if (!CoreAPI_IsMenuAllowedBookmark() && (!MS_IsToBeRemoved(pThis)))
{
MsOp = MS_OP_CLOSE_PARENT;
}
switch(MsOp)
{
case MS_OP_INIT:
{
MS_ComponentInitFocus((MSO_COMPONENT __NEAR*)pThis);
}
break;
case MS_OP_BOOKMARK:
MsOp = MS_OP_CLOSE_PARENT;
break;
case MS_OP_SETUP: // Fall through !!!
case MS_OP_EJECT: // Fall through !!!
case MS_OP_SKIPF: // Fall through !!!
case MS_OP_SKIPB: // Fall through !!!
case MS_OP_LR: // Fall through !!!
case MS_OP_KARAOKE: // Fall through !!!
case MS_OP_STOP: // Fall through !!!
case MS_OP_SLOWF: // Fall through !!!
case MS_OP_SLOWB: // Fall through !!!
case MS_OP_FASTF: // Fall through !!!
case MS_OP_FASTB: // Fall through !!!
case MS_OP_PAUSE: // Fall through !!!
case MS_OP_MARKAB: // Fall through !!!
case MS_OP_PLAY_MODE: // Fall through !!!
case MS_OP_TITLE: // Fall through !!!
case MS_OP_MENU: // Fall through !!!
case MS_OP_PBC:
MS_SendOperation(pThis, MS_OP_CLOSE_PARENT, 0);
break;
default:
break;
}
return MS_ComponentBasicOperation(pThis, MsOp, lParam);
}
/***************************************************************************************
* Function : _BookmarkKitOperation
*
* In :
*
* Out :
*
* Desc : The bookmark kit operation function.
****************************************************************************************/
#pragma argsused
STATIC MS_OP _BookmarkKitOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
//Pre-processing
// TODO : if any
MsOp = VScrollListOperation(pThis, MsOp, lParam);
// Post-processing
switch(MsOp)
{
case MS_OP_REFRESH:
{
MSO_VLIST __NEAR* pList = (MSO_VLIST __NEAR*)MS_GetObjectListPtr(pThis);
MS_ASSERT(NULL != pList);
if(pList->moParam.mwTotalItems > pList->moParam.mcNumVisibleItems)
{
// Remove all items.
MS_SendOperation((MSO_OBJECT __NEAR*)pList, MS_OP_EMPTY, 0);
_AddItemsToBookmarkKit(pList);
MS_DisplayAddObject(pThis);
// Set focus to the appropriate list item.
if(MS_IsFocused(pList))
{
MSO_OBJECT __NEAR* pObject = MS_GetObjectListPtr(pList);
if(!MS_IS_FOCUS_ON_LASTITEM(pList))
MS_ScreenSetFocusObject(pObject);
else
{
// Make sure we do not set focus on the Value VScroll list.
while(NULL != pObject->mpNext)
pObject = pObject->mpNext;
MS_ScreenSetFocusObject(pObject);
}
}
}
}
return MS_OP_NONE;
default:
break;
}
return MsOp;
}
/***************************************************************************************
* Function : _BookmarkkitVlistOperation
*
* In :
*
* Out :
*
* Desc : The Bookmark kit VLIST operation function.
****************************************************************************************/
#pragma argsused
STATIC MS_OP _BookmarkkitVlistOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_INIT:
return MS_OP_NONE;
case MS_OP_OPEN:
_AddItemsToBookmarkKit((MSO_VLIST __NEAR*)pThis);
break;
default:
break;
}
return VListOperation(pThis, MsOp, lParam);
}
/***************************************************************************************
* Display functions
****************************************************************************************/
/***************************************************************************************
* Function : _BookmarkComponentFillOSDSeg
*
* In :
*
* Out :
*
* Desc : MSO_BOOKMARK display function.
****************************************************************************************/
STATIC BOOL _BookmarkComponentFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
MS_DESCRIPTOR_BOOKMARK* pDescriptor = (MS_DESCRIPTOR_BOOKMARK*)pThis->mpDescriptor;
OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, pAbsArea);
return FALSE;
}
/***************************************************************************************
* Function : OBOOKMARK_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 Bookmark component if opened successfully, otherwise NULL.
*
* Desc : Creates, and displays the Bookmark component.
****************************************************************************************/
extern MSO_OBJECT __NEAR* OBOOKMARK_OpenAtPos(MSO_CONTAINER __NEAR* pParent, UINT16 wStartX, UINT16 wStartY)
{
if(NULL != pParent && CoreAPI_IsMenuAllowedBookmark())
{
MSO_OBJECT __NEAR* pBookmarkWnd = NULL;
pBookmarkWnd = (MSO_OBJECT __NEAR*)MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oBookmarkDescriptor, pParent);
if(NULL != pBookmarkWnd)
{
if((DEFAULT_POSITION != wStartX) || (DEFAULT_POSITION != wStartY))
{
wStartX = (DEFAULT_POSITION == wStartX) ? pBookmarkWnd->mpDescriptor->moArea.msX : wStartX;
wStartY = (DEFAULT_POSITION == wStartY) ? pBookmarkWnd->mpDescriptor->moArea.msY : wStartY;
MS_ObjectMove(pBookmarkWnd, wStartX, wStartY);
}
MS_DisplayAddObject(pBookmarkWnd);
}
return pBookmarkWnd;
}
return NULL;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -