📄 o_sacd.c
字号:
}
break;
default:
break;
}
return MsOp;
}
/***************************************************************************************
* Function : _PlayTimeOperation
*
* In :
*
* Out :
*
* Desc : MSO_SACD user operation function.
****************************************************************************************/
STATIC MS_OP _PlayTimeOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MsOp = OTEXT_Operation(pThis, MsOp, lParam);
// Post-processing.
switch(MsOp)
{
case MS_OP_TICK:
{
MSO_SACD_PLAYTIME __NEAR* pPlayTime = (MSO_SACD_PLAYTIME __NEAR*)pThis;
// Do not display elapsed time in full stop state.
if((PST_STOP == CoreAPI_GetPlayState()) && (!CoreAPI_IsResumeStop()))
{
if(!MS_IsInvisible(pThis))
{
MS_SetInvisible(pThis);
MS_DisplayAddObject(pThis);
}
}
else
{
UINT16 wElapsedTime = CoreAPI_GetElapseTime();
MS_ClearInvisible(pThis);
if(wElapsedTime != pPlayTime->moParam.mwElapsedTime)
{
pPlayTime->moParam.mwElapsedTime = wElapsedTime;
MS_SendOperation(pThis, MS_OP_BUILD_TEXT_STRING, pPlayTime->moParam.mwElapsedTime);
MS_DisplayAddObject(pThis);
}
}
}
break;
default:
break;
}
return MsOp;
}
/***************************************************************************************
* Function : _BtnSwitchCDLayerOperation
*
* In :
*
* Out :
*
* Desc : Operation function of the "HD Area" button.
****************************************************************************************/
STATIC MS_OP _BtnSwitchCDLayerOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
if((MS_OP_ENTER == MsOp) &&(!CoreAPI_IsHybridSACD() || !CoreAPI_IsSACDLayerSwitchingAllowed()))
{
PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
return MS_OP_NONE;
}
return OBUTTON_Operation(pThis, MsOp, lParam);
}
/***************************************************************************************
* Function : _BtnSwitchHDAreaOperation
*
* In :
*
* Out :
*
* Desc : Operation function of the "HD Area" button.
****************************************************************************************/
STATIC MS_OP _BtnSwitchHDAreaOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
// Pre-processing
switch(MsOp)
{
case MS_OP_ENTER:
{
if(CoreAPI_SwitchActiveArea())
{
// There is no guarantee that tracks available in one area are also available in the other HD
// area. Hence the mode must be reset to Normal to avoid undefined behavior.
if(CoreAPI_IsProgramPlayback())
{
CoreAPI_SetPlaybackMode(PM_PLAYBACK_NORMAL);
CoreAPI_ChangePlaybackMode();
}
}
else
PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
}
return MS_OP_NONE;
default:
break;
}
MsOp = OBUTTON_Operation(pThis, MsOp, lParam);
// Post-processing
switch(MsOp)
{
case MS_OP_ON_DEFROST: // Fall Through !!!
case MS_OP_INIT: // Fall Through !!!
case MS_OP_CORE_SACD_AREA_CHANGED:
{
lParam = CoreAPI_IsCurrentAreaMultiChannel() ? oTwoChannelText.mParam : oMultiChannelText.mParam;
MS_SEND_OP_OBJECT(pThis, MS_OP_BUILD_TEXT_STRING, lParam);
// Re-draw the button if necessary.
if(MsOp == MS_OP_CORE_SACD_AREA_CHANGED)
MS_DisplayAddObject(pThis);
}
break;
default:
break;
}
return MsOp;
}
/***************************************************************************************
* Function : _ToolkitVlistOperation
*
* In :
*
* Out :
*
* Desc : The MSO_VLIST user operation function.
****************************************************************************************/
STATIC MS_OP _ToolkitVlistOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_OPEN:
_AddTools((MSO_VLIST __NEAR*)pThis);
break;
default:
break;
}
return VListOperation(pThis, MsOp, lParam);
}
/***************************************************************************************
* Function : _ToolKitOperation
*
* In :
*
* Out :
*
* Desc : The MSO_VSCROLL_LIST user operation function.
****************************************************************************************/
STATIC MS_OP _ToolKitOperation(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);
_AddTools(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))
{
while(NULL != pObject->mpNext)
pObject = pObject->mpNext;
}
MS_ScreenSetFocusObject(pObject);
}
}
}
return MS_OP_NONE;
default:
break;
}
return MsOp;
}
/***************************************************************************************
* Function : _ListItemOperation
*
* In :
*
* Out :
*
* Desc : The MSO_LIST_TEM user operation function.
****************************************************************************************/
#pragma argsused
STATIC MS_OP _ListItemOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_ENTER:
{
MSO_SACD_LISTITEM __NEAR* pListItem = (MSO_SACD_LISTITEM __NEAR*)pThis;
// <<< WARNING: This is a temporary solution, and would be nuked when "Program View" is implemented.
// Reset the play mode to normal.
if(CoreAPI_IsProgramPlayback())
{
CoreAPI_SetPlaybackMode(PM_PLAYBACK_NORMAL);
CoreAPI_ChangePlaybackMode();
}
// >>> WARNING:
if(CoreAPI_GotoEntry(0, pListItem->moParam.mcIndex))
MS_SendOp(MS_OP_MSG_PLAYSTATE_PLAY, 0);
}
return MS_OP_NONE;
case MS_OP_PLAY:
{
MSO_SACD_LISTITEM __NEAR* pListItem = (MSO_SACD_LISTITEM __NEAR*)pThis;
if(pListItem->moParam.mcIndex != CoreAPI_GetCurrentChapterTrackNum())
{
// <<< WARNING: This is a temporary solution, and would be nuked when "Program View" is implemented.
// Reset the play mode to normal.
if(CoreAPI_IsProgramPlayback())
{
CoreAPI_SetPlaybackMode(PM_PLAYBACK_NORMAL);
CoreAPI_ChangePlaybackMode();
}
// >>> WARNING:
if(CoreAPI_GotoEntry(0, pListItem->moParam.mcIndex))
MS_SendOp(MS_OP_MSG_PLAYSTATE_PLAY, 0);
return MS_OP_NONE;
}
}
break;
default:
break;
}
MsOp = OTEXT_Operation(pThis, MsOp, lParam);
// Post-processing.
switch(MsOp)
{
case MS_OP_OPEN:
{
MSO_SACD_LISTITEM __NEAR* pListItem = (MSO_SACD_LISTITEM __NEAR*)pThis;
pListItem->moParam.mcIndex = (UINT8)lParam;
pListItem->moParam.mbIsPlaying = (pListItem->moParam.mcIndex == CoreAPI_GetCurrentChapterTrackNum());
}
break;
case MS_OP_ON_DEFROST: // Fall Through !!!
case MS_OP_INIT:
{
MSO_SACD_LISTITEM __NEAR* pListItem = (MSO_SACD_LISTITEM __NEAR*)pThis;
MS_SendOperation(pThis, MS_OP_BUILD_TEXT_STRING, (pListItem->moParam.mcIndex - 1));
MS_DisplayAddObject(pThis);
}
break;
case MS_OP_FOCUS_CHANGE:
MS_DisplayAddObject(pThis);
break;
default:
break;
}
return MsOp;
}
/***************************************************************************************
* Function : _BrowserVListOperation
*
* In :
*
* Out :
*
* Desc : Operation function of the SACD track browser vlist.
****************************************************************************************/
STATIC MS_OP _BrowserVListOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_TICK:
{
MSO_OBJECT __NEAR* pFocusedObject;
MSO_OBJECT __NEAR* pHiLitedItem;
MSO_SACD __NEAR* pSACDWnd = (MSO_SACD __NEAR*)MS_FindAncestor(pThis, &oSACDDescriptor);
UINT16 wCurItemNum = CoreAPI_GetCurrentChapterTrackNum(); // This function returns 0 in full stop state.
// Find the hi-lighted item.
pHiLitedItem = MS_GetObjectListPtr(pThis);
while(NULL != pHiLitedItem)
{
if(((MSO_SACD_LISTITEM __NEAR*)pHiLitedItem)->moParam.mbIsPlaying)
break;
pHiLitedItem = pHiLitedItem->mpNext;
}
pFocusedObject = MS_GetFocusInContainer((MSO_CONTAINER __NEAR*)pThis);
if((NULL != pFocusedObject) && (0 != wCurItemNum) && ((pFocusedObject == pHiLitedItem) || (TRUE == pSACDWnd->moParam.mbFocusActiveItem)))
{
MSO_OBJECT __NEAR* pObject;
UINT16 wCurDisplayedItemIndex;
UINT16 wFirstDisplayItem;
// TODO: Add function in o_vlist.c to do this operation (LATER)
wCurDisplayedItemIndex = wCurItemNum - 1;
wFirstDisplayItem = wCurDisplayedItemIndex - (wCurDisplayedItemIndex % ((MSO_VLIST __NEAR*)pThis)->moParam.mcNumVisibleItems);
if(((MSO_VLIST __NEAR*)pThis)->moParam.mwFirstDisplayItem != wFirstDisplayItem)
{
((MSO_VLIST __NEAR*)pThis)->moParam.mwFirstDisplayItem = wFirstDisplayItem;
MS_SEND_OP_OBJECT(pThis->mpParent, MS_OP_REFRESH, REFRESH_LIST_DISPLAY_NEXT_ITEM);
}
// Find the list item corresponding to the active track number.
pObject = MS_GetObjectListPtr(pThis);
while(NULL != pObject)
{
if(wCurItemNum == ((MSO_SACD_LISTITEM __NEAR*)pObject)->moParam.mcIndex)
break;
pObject = pObject->mpNext;
}
MS_ScreenSetFocusObject(pObject);
pSACDWnd->moParam.mbFocusActiveItem = FALSE;
}
// Clear hi-lite from the previously playing item.
if((NULL != pHiLitedItem) && (wCurItemNum != ((MSO_SACD_LISTITEM __NEAR*)pHiLitedItem)->moParam.mcIndex))
{
((MSO_SACD_LISTITEM __NEAR*)pHiLitedItem)->moParam.mbIsPlaying = FALSE;
MS_DisplayAddObject(pHiLitedItem);
}
pHiLitedItem = MS_GetObjectListPtr(pThis);
while(NULL != pHiLitedItem)
{
if(wCurItemNum == ((MSO_SACD_LISTITEM __NEAR*)pHiLitedItem)->moParam.mcIndex)
break;
pHiLitedItem = pHiLitedItem->mpNext;
}
if(NULL != pHiLitedItem)
{
((MSO_SACD_LISTITEM __NEAR*)pHiLitedItem)->moParam.mbIsPlaying = TRUE;
MS_DisplayAddObject(pHiLitedItem);
}
}
break;
default:
break;
}
return VListOperation(pThis, MsOp, lParam);
}
/***************************************************************************************
* Function : _BrowserScrollListOperation
*
* In :
*
* Out :
*
* Desc : Operation function of the SACD track browser scroll list.
****************************************************************************************/
STATIC MS_OP _BrowserScrollListOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MsOp = VScrollListOperation(pThis, MsOp, lParam);
// Post processing
switch(MsOp)
{
case MS_OP_INIT: // Fall Through !!!
case MS_OP_REFRESH: // Fall Through !!!
//case MS_OP_CORE_SACD_TRACK_UPDATE:
{
UINT8 cNumItemsToDisplay, cCount;
MSO_VLIST __NEAR* pList;
MSO_OBJECT __NEAR* pObject;
MS_DESCRIPTOR_VSCROLL_LIST* pScrollListDescriptor;
pScrollListDescriptor = (MS_DESCRIPTOR_VSCROLL_LIST*)MS_GetDescriptorPtr(pThis);
pList = (MSO_VLIST __NEAR*)MS_FindDescendant(pThis, pScrollListDescriptor->mpDescriptorVList);
// Remove all existing items in the browser list.
MS_SendOperation((MSO_OBJECT __NEAR*)pList, MS_OP_EMPTY, 0);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -