📄 o_sacd.c
字号:
// Display the active item if the HD area was switched.
if(_IsHDAreaSwitched())
{
UINT16 wCurentItem = CoreAPI_GetCurrentChapterTrackNum() - 1;
pList->moParam.mwFirstDisplayItem = wCurentItem - (wCurentItem % pList->moParam.mcNumVisibleItems);
_ResetHDAreaChangedFlag();
}
// Set list parameters.
pList->moParam.mwTotalItems = CoreAPI_GetTotalChapterTrackNum(0);
cNumItemsToDisplay = MIN((pList->moParam.mwTotalItems - pList->moParam.mwFirstDisplayItem), pList->moParam.mcNumVisibleItems);
// Start from 1 because track numbers in the SACD navigator start from 1.
for(cCount = 1; cCount <= cNumItemsToDisplay; cCount++)
{
pObject = OVLIST_CreateAndAppendItem(pList, &oListItemDescriptor);
MS_SendOperation(pObject, MS_OP_OPEN, pList->moParam.mwFirstDisplayItem + cCount);
MS_SendOperation(pObject, MS_OP_INIT, 0);
}
MS_DisplayAddObject(pThis);
// Set focus to the appropriate list item.
if(MS_IsFocused(pList))
{
pObject = MS_GetObjectListPtr(pList);
if(MS_IS_FOCUS_ON_LASTITEM(pList))
{
while(NULL != pObject->mpNext)
pObject = pObject->mpNext;
}
MS_ScreenSetFocusObject(pObject);
}
}
return MsOp;
default:
break;
}
return MsOp;
}
/***************************************************************************************
* Function : _HelpTextOperation
*
* In :
*
* Out :
*
* Desc : Operation function of the SACD help text.
****************************************************************************************/
STATIC MS_OP _HelpTextOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
// Pre-processing
switch(MsOp)
{
case MS_OP_TICK:
{
MSO_SACD_HELPTEXT __NEAR* pHelpText = (MSO_SACD_HELPTEXT __NEAR*)pThis;
UINT16 wCurItemNum = CoreAPI_GetCurrentChapterTrackNum();
MSO_MULTILINE_TEXT __NEAR* pMultiLineText = (MSO_MULTILINE_TEXT __NEAR*)pThis;
if((0 == wCurItemNum) && (0 != pMultiLineText->moParam.moEntryTable.mcTableEntryCount)) // We are in Full stop state.
{
MS_SendOperation(pThis, MS_OP_EMPTY, 0);
MS_SendOperation(pThis, MS_OP_REFRESH, 0);
}
else if(wCurItemNum != pHelpText->moParam.mwCurrentTrack)
{
pHelpText->moParam.mwCurrentTrack = wCurItemNum;
MS_SendOperation(pThis, MS_OP_BUILD_TEXT_TABLE, 0);
}
}
break;
case MS_OP_POPULATE_TEXT_TABLE:
{
UINT8 cWordsWritten = 0;
OSD_MESSAGES osdAvailableChannels = S_NULL;
FORMATED_UNICODE_STRING oFormUniStr;
MSO_SACD_HELPTEXT __NEAR* pHelpText = (MSO_SACD_HELPTEXT __NEAR*)pThis;
((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount = 0;
// Disc Name
cWordsWritten = STR_GenerateOSDMESSAGEString(S_DISC, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX);
// Tag a colon, and a space on the end.
oFormUniStr.mszUniStr[cWordsWritten++] = L':';
oFormUniStr.mszUniStr[cWordsWritten++] = UNICODE_SPACE;
CoreAPI_GetDiscName(&oFormUniStr.mszUniStr[cWordsWritten], (INT8)((UNISTR_LENGTH_MAX - cWordsWritten) * sizeof(WCHAR)));
// Remove any extra spacing on the end.
STR_AppendPaddingSpace(oFormUniStr.mszUniStr, MIN(wcslen(oFormUniStr.mszUniStr),UNISTR_LENGTH_MAX), UNISTR_LENGTH_MAX, SACD_INFO_PADDING_SPACES);
oFormUniStr.mtFontIndex = (((MS_DESCRIPTOR_TEXT *)((MS_DESCRIPTOR_MULTILINE_TEXT *)pThis->mpDescriptor))->mtFontIndex);
OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR *)&oFormUniStr);
OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
((MULTILINE_TEXT_TABLE*)lParam)->mwEntries[((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount]);
((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount++;
// Track Title
cWordsWritten = STR_GenerateOSDMESSAGEString(S_TRACK, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX);
// Tag a colon, and a space on the end.
oFormUniStr.mszUniStr[cWordsWritten++] = L':';
oFormUniStr.mszUniStr[cWordsWritten++] = UNICODE_SPACE;
CoreAPI_GetTrackOrTitleName((pHelpText->moParam.mwCurrentTrack - 1),
&oFormUniStr.mszUniStr[cWordsWritten], (INT8)((UNISTR_LENGTH_MAX - cWordsWritten) * sizeof(WCHAR)));
// Remove any extra spacing on the end.
STR_AppendPaddingSpace(oFormUniStr.mszUniStr, MIN(wcslen(oFormUniStr.mszUniStr),UNISTR_LENGTH_MAX), UNISTR_LENGTH_MAX, SACD_INFO_PADDING_SPACES);
oFormUniStr.mtFontIndex = (((MS_DESCRIPTOR_TEXT *)((MS_DESCRIPTOR_MULTILINE_TEXT *)pThis->mpDescriptor))->mtFontIndex);
OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR *)&oFormUniStr);
OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
((MULTILINE_TEXT_TABLE*)lParam)->mwEntries[((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount]);
((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount++;
// Artist Name
cWordsWritten = STR_GenerateOSDMESSAGEString(S_ARTIST, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX);
// Tag a colon, and a space on the end.
oFormUniStr.mszUniStr[cWordsWritten++] = L':';
oFormUniStr.mszUniStr[cWordsWritten++] = UNICODE_SPACE;
CoreAPI_GetArtistName(&oFormUniStr.mszUniStr[cWordsWritten], (INT8)((UNISTR_LENGTH_MAX - cWordsWritten) * sizeof(WCHAR)));
// Remove any extra spacing on the end.
STR_AppendPaddingSpace(oFormUniStr.mszUniStr, MIN(wcslen(oFormUniStr.mszUniStr),UNISTR_LENGTH_MAX), UNISTR_LENGTH_MAX, SACD_INFO_PADDING_SPACES);
oFormUniStr.mtFontIndex = (((MS_DESCRIPTOR_TEXT *)((MS_DESCRIPTOR_MULTILINE_TEXT *)pThis->mpDescriptor))->mtFontIndex);
OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR *)&oFormUniStr);
OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
((MULTILINE_TEXT_TABLE*)lParam)->mwEntries[((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount]);
((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount++;
// Available Area
cWordsWritten = STR_GenerateOSDMESSAGEString(S_SACD_AVAILABLE_AREA, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX);
// Tag a colon, and a space on the end.
oFormUniStr.mszUniStr[cWordsWritten++] = L':';
oFormUniStr.mszUniStr[cWordsWritten++] = UNICODE_SPACE;
if(CoreAPI_IsTwoChannelAreaAvailable() && CoreAPI_IsMultiChannelAreaAvailable())
osdAvailableChannels = S_SACD_TWO_AND_MULTI_CHANNEL;
else if(CoreAPI_IsTwoChannelAreaAvailable())
osdAvailableChannels = S_SACD_TWO_CHANNEL;
else if(CoreAPI_IsMultiChannelAreaAvailable())
osdAvailableChannels = S_SACD_MULTI_CHANNEL;
STR_GenerateOSDMESSAGEString(osdAvailableChannels, &oFormUniStr.mszUniStr[cWordsWritten], 0, (UNISTR_LENGTH_MAX - cWordsWritten));
// Remove any extra spacing on the end
STR_AppendPaddingSpace(oFormUniStr.mszUniStr, MIN(wcslen(oFormUniStr.mszUniStr),UNISTR_LENGTH_MAX), UNISTR_LENGTH_MAX, SACD_INFO_PADDING_SPACES);
oFormUniStr.mtFontIndex = (((MS_DESCRIPTOR_TEXT *)((MS_DESCRIPTOR_MULTILINE_TEXT *)pThis->mpDescriptor))->mtFontIndex);
OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR *)&oFormUniStr);
OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
((MULTILINE_TEXT_TABLE*)lParam)->mwEntries[((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount]);
((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount++;
// Active Area.
cWordsWritten = STR_GenerateOSDMESSAGEString(S_SACD_ACTIVE_AREA, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX);
// Tag a colon, and a space on the end.
oFormUniStr.mszUniStr[cWordsWritten++] = L':';
oFormUniStr.mszUniStr[cWordsWritten++] = UNICODE_SPACE;
osdAvailableChannels = CoreAPI_IsCurrentAreaMultiChannel() ? S_SACD_MULTI_CHANNEL : S_SACD_TWO_CHANNEL;
STR_GenerateOSDMESSAGEString(osdAvailableChannels, &oFormUniStr.mszUniStr[cWordsWritten], 0, (UNISTR_LENGTH_MAX - cWordsWritten));
// Remove any extra spacing on the end
STR_AppendPaddingSpace(oFormUniStr.mszUniStr, MIN(wcslen(oFormUniStr.mszUniStr),UNISTR_LENGTH_MAX), UNISTR_LENGTH_MAX, SACD_INFO_PADDING_SPACES);
oFormUniStr.mtFontIndex = (((MS_DESCRIPTOR_TEXT *)((MS_DESCRIPTOR_MULTILINE_TEXT *)pThis->mpDescriptor))->mtFontIndex);
OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR *)&oFormUniStr);
OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
((MULTILINE_TEXT_TABLE*)lParam)->mwEntries[((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount]);
((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount++;
}
return MS_OP_NONE;
default:
break;
}
MsOp = OHSCROLLTEXT_Operation(pThis, MsOp, lParam);
// Post-processing.
switch(MsOp)
{
case MS_OP_ON_DEFROST: // Fall Through !!!
case MS_OP_INIT:
{
MSO_SACD_HELPTEXT __NEAR* pHelpText = (MSO_SACD_HELPTEXT __NEAR*)pThis;
pHelpText->moParam.mwCurrentTrack = CoreAPI_GetCurrentChapterTrackNum();
if(pHelpText->moParam.mwCurrentTrack)
{
MS_SendOperation(pThis, MS_OP_BUILD_TEXT_TABLE, 0);
MS_DisplayAddObject(pThis);
}
}
break;
default:
break;
}
return MsOp;
}
/***************************************************************************************
* Function : _SACDOperation
*
* In :
*
* Out :
*
* Desc : MSO_SACD user operation function.
****************************************************************************************/
STATIC MS_OP _SACDOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
// Pre-processing.
switch(MsOp)
{
case MS_OP_INIT:
{
MSO_SACD __NEAR* pSACDWnd = (MSO_SACD __NEAR*)pThis;
MS_ComponentInitFocus((MSO_COMPONENT __NEAR*)pThis);
pSACDWnd->moParam.mbFocusActiveItem = FALSE;
pSACDWnd->moParam.mbHDAreaChanged = FALSE;
}
break;
case MS_OP_CORE_SACD_TRACK_UPDATE:
{
MSO_SACD __NEAR* pSACDWnd = (MSO_SACD __NEAR*)pThis;
pSACDWnd->moParam.mbFocusActiveItem = TRUE;
}
break;
case MS_OP_CORE_SACD_AREA_CHANGED:
{
MSO_SACD __NEAR* pSACDWnd = (MSO_SACD __NEAR*)pThis;
pSACDWnd->moParam.mbFocusActiveItem = FALSE;
pSACDWnd->moParam.mbHDAreaChanged = TRUE;
MS_SendOpObject(pThis, MS_OP_REFRESH, 0);
MS_SendOp(MS_OP_MSG_SYS_SACD_AREA_CHANGED, 0);
}
break;
default:
break;
}
MsOp = MS_ComponentBasicOperation(pThis, MsOp, lParam);
// Post-processing
switch(MsOp)
{
case MS_OP_MENU_SWITCH_SACD_LAYER:
{
MS_SendOp(MS_OP_MSG_SYS_SACD_LAYER_CHANGED, S_SACD_SWITCHING_TO_CD_LAYER);
MS_SendOperation(pThis, MS_OP_CLOSE_PARENT, 0);
}
break;
case MS_OP_POWER: // Fall Through !!!
case MS_OP_EJECT:
{
// Indicate that the component is to be closed.
MS_SendOperation(pThis, MS_OP_CLOSE_PARENT, 0);
}
break;
default:
break;
}
if(MS_IS_USER_OP(MsOp))
{
switch(MsOp)
{
case MS_OP_MENU: // Fall Through!!!
case MS_OP_TITLE: // Fall Through!!!
case MS_OP_AUDIO: // Fall Through!!!
case MS_OP_SUBTITLE: // Fall Through!!!
case MS_OP_ANGLE: // Fall Through!!!
case MS_OP_KARAOKE: // Fall Through!!!
case MS_OP_EQUALIZER: // Fall Through!!!
case MS_OP_SPECTRUM: // Fall Through!!!
case MS_OP_PROLOGIC: // Fall Through!!!
case MS_OP_ZOOM: // Fall Through!!!
#ifdef D_GUI_COMPONENT_DISPLAY
case MS_OP_DISPLAY: // Fall Through!!!
#endif // D_GUI_COMPONENT_DISPLAY
case MS_OP_DD_EX: // Fall Through!!!
case MS_OP_BASS_MGR:
#ifdef EZVIEW_ENABLED
case MS_OP_EZVIEW:
#endif // EZVIEW_ENABLED
PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
return MS_OP_NONE;
default:
break;
}
}
return MsOp;
}
/***************************************************************************************
* Display functions
****************************************************************************************/
/***************************************************************************************
* Function : _ListItemFillOSDSeg
*
* In :
*
* Out :
*
* Desc : MSO_SACD_LISTITEM display function.
****************************************************************************************/
STATIC BOOL _ListItemFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
FORMATED_UNICODE_STRING oFormUniStr;
MSO_SACD_LISTITEM __NEAR* pListItem = (MSO_SACD_LISTITEM __NEAR*)pThis;
MS_DESCRIPTOR_TEXT* pDescriptorText = (MS_DESCRIPTOR_TEXT*)pThis->mpDescriptor;
OSDR_FillOsdSegBitmap(BMP_SACD_AUDIO_FILE, pAbsArea, SACD_LISTITEM_TYPE_ICON_XPOS, SACD_LISTITEM_TYPE_ICON_YPOS,
ALIGN_H_LEFT, ALIGN_V_CENTER, NULL_EXPANSION, NULL_EXPANSION);
OSDR_GetFormUniStr_ScFormatted((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)(((MSO_TEXT __NEAR*)pThis)->moParam.wScFormUniStr));
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
SACD_LISTITEM_TEXT_XPOS,
(pAbsArea->mwH >> 1) ,
ALIGN_H_LEFT,
ALIGN_V_CENTER,
(pListItem->moParam.mbIsPlaying) ? CIDX_ACTIVE_LISTITEM : OTEXT_GetColorFromSet(pThis, pDescriptorText->mpColorSetText));
if(MS_IsFocused(pThis))
OSDR_FillOsdSegBitmapFitArea(BMP_FG_FOCUS, pAbsArea);
return FALSE;
}
/***************************************************************************************
* Function : _SACDFillOSDSeg
*
* In :
*
* Out :
*
* Desc : MSO_SACD display function.
****************************************************************************************/
STATIC BOOL _SACDFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
MS_AREA oAbsArea;
MS_DESCRIPTOR_SACD* pDescriptor = (MS_DESCRIPTOR_SACD*)pThis->mpDescriptor;
oAbsArea.msX = pAbsArea->msX;
oAbsArea.msY = pAbsArea->msY;
oAbsArea.mwW = pAbsArea->mwW;
oAbsArea.mwH = AREA_SACD_H;
OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, (MS_AREA __NEAR*)&oAbsArea);
return FALSE;
}
/***************************************************************************************
* Public functions
****************************************************************************************/
/***************************************************************************************
* Function : OSACD_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 SACD component if opened successfully, otherwise NULL.
*
* Desc : Creates, and displays a SACD component at a specified position.
****************************************************************************************/
MSO_OBJECT __NEAR* OSACD_OpenAtPos(MSO_CONTAINER __NEAR* pParent, UINT16 wStartX, UINT16 wStartY)
{
if(NULL != pParent)
{
MSO_OBJECT __NEAR* pSACDWnd = NULL;
pSACDWnd = (MSO_OBJECT __NEAR*)MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oSACDDescriptor, pParent);
if(NULL != pSACDWnd)
{
if((DEFAULT_POSITION != wStartX) || (DEFAULT_POSITION != wStartY))
{
wStartX = (DEFAULT_POSITION == wStartX) ? pSACDWnd->mpDescriptor->moArea.msX : wStartX;
wStartY = (DEFAULT_POSITION == wStartY) ? pSACDWnd->mpDescriptor->moArea.msY : wStartY;
MS_ObjectMove(pSACDWnd, wStartX, wStartY);
}
MS_DisplayAddObject(pSACDWnd);
}
return pSACDWnd;
}
return NULL;
}
#endif //D_SUPPORT_SACD
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -