📄 mm_ui.c
字号:
}
OSDMM_Update(OSDMM_MSG_CLEAR_HIGHLIGHT, 0);
MM_PreparePage(MM_PREPARE_FILEPAGE,__MMSelectCursor.wDirID, __bMMExtFilterMode, __bMMSortMethod);
#ifndef SUPPORT_FM_CURSOR_RING_SAME_DIRECTORY
_bMMAcrossDirType = MM_UP_DOWN_ACROSS_DIR;
_MM_SimulateChangeDir();
__MMSelectCursor.bPosition=POS_FILE_LIST;
// wyc1.07, when no files or dirs in this active dir, then move the select cursor to dir list.
// wyc0.70, need to use queny file num after filtering.
if (_MM_QueryInfo2(MM_QUERY2_TOTAL_SORT_FILTER_ITEM,__MMSelectCursor.wDirID) == 0)
{
_MM_SetCursorToActiveDirPos();
}
else
#endif //SUPPORT_FM_CURSOR_RING_SAME_DIRECTORY
{
if (bKey == KEY_UP)
{
__MMSelectCursor.wIndex = _MM_QueryInfo2(MM_QUERY2_TOTAL_SORT_FILTER_ITEM,__MMSelectCursor.wDirID)-1;
}
else
{
__MMSelectCursor.wIndex = 0;
}
}
OSDMM_Update(OSDMM_MSG_UPDATE_HIGHLIGHT, 0);
}
else
{
if (bKey == KEY_UP)
{
// clear selection cursor first
OSDMM_Update(OSDMM_MSG_CLEAR_HIGHLIGHT, 0);
// decrease the index by '1'
__MMSelectCursor.wIndex--;
}
else
{
// clear selection cursor first
OSDMM_Update(OSDMM_MSG_CLEAR_HIGHLIGHT, 0);
// increase the index by '1'
__MMSelectCursor.wIndex++;
}
}
if (MM_JPEGPreview())
{
return KEY_NO_KEY;
}
}
}
else if (__MMSelectCursor.bPosition == POS_PROG_LIST)
{
if (bKey == KEY_UP)
{
if (__MMSelectCursor.wIndex == 0)
{
return KEY_INVALID;
}
OSDMM_Update(OSDMM_MSG_CLEAR_HIGHLIGHT,0);
__MMSelectCursor.wIndex--;
}
else if (bKey == KEY_DOWN)
{
if (__MMSelectCursor.wIndex == (__bProgramMaxEntry-1))
{
return KEY_INVALID;
}
OSDMM_Update(OSDMM_MSG_CLEAR_HIGHLIGHT,0);
__MMSelectCursor.wIndex++;
}
MM_JPEGPreview();
}
else if (__MMSelectCursor.bPosition == POS_DLG_ITEM)
{
bMMRet = MM_RETURN_NONE;
OSDMM_Update(OSDMM_MSG_CLEAR_HIGHLIGHT,0);
if (__bMMPopMenuID == MM_POP_MENU_FILTER)
{
if (bKey == KEY_UP)
{
if ((__MMSelectCursor.wIndex % OSDMM_FILTER_DLG_ROW_NUM) == 0)
{
bMMRet = MM_RETURN_INVALID;
}
else
{
__MMSelectCursor.wIndex--;
}
}
else
{
if ((__MMSelectCursor.wIndex % OSDMM_FILTER_DLG_ROW_NUM) == (OSDMM_FILTER_DLG_ROW_NUM-1))
{
__MMSelectCursor.bPosition = POS_BUTTON_LIST;
OSDMM_Update(OSDMM_MSG_UPDATE_HIGHLIGHT,0);
}
else
{
// wyc1.05, fix when MAX_EXTENSION_NO lenn than 8, then the un-supported file will appear after move cursor
// to its index.
if ((__MMSelectCursor.wIndex+1) < MAX_EXTENSION_NO)
{
__MMSelectCursor.wIndex++;
}
else
{
__MMSelectCursor.bPosition = POS_BUTTON_LIST;
OSDMM_Update(OSDMM_MSG_UPDATE_HIGHLIGHT,0);
}
}
}
}
else if (__bMMPopMenuID == MM_POP_MENU_SORT)
{
if (bKey == KEY_UP)
{
if (__MMSelectCursor.wIndex == 0)
{
bMMRet = MM_RETURN_INVALID;
}
else
{
__MMSelectCursor.wIndex--;
}
}
else
{
if (__MMSelectCursor.wIndex == (MM_SORT_TYPE + 2 -1)) // increase 2 is adding ascending/descending.
{
__MMSelectCursor.bPosition = POS_BUTTON_LIST;
}
else if (__MMSelectCursor.wIndex == (MM_SORT_TYPE - 1))
{
__MMSelectCursor.bPosition = POS_BUTTON_LIST;
}
else
{
__MMSelectCursor.wIndex++;
}
}
}
OSDMM_Update(OSDMM_MSG_UPDATE_HIGHLIGHT,0);
if (bMMRet == MM_RETURN_INVALID)
{
return KEY_INVALID;
}
}
else if (__MMSelectCursor.bPosition == POS_BUTTON_LIST)
{
if ((bKey == KEY_UP) && (__bMMPopMenuID != MM_POP_MENU_NONE))
{
OSDMM_Update(OSDMM_MSG_CLEAR_HIGHLIGHT, 0);
__MMSelectCursor.bPosition = POS_DLG_ITEM;
if (__bMMPopMenuID == MM_POP_MENU_SORT)
{
__MMSelectCursor.wIndex = MM_SORT_TYPE+2-1; // increase 2 is because adding ascending & descending items.
}
else
{
__MMSelectCursor.wIndex = MAX_EXTENSION_NO-1;
}
}
else
{
return KEY_INVALID;
}
}
// wyc1.05, need to update active color when move up/down.
OSDMM_Update(OSDMM_MSG_UPDATE_HIGHLIGHT, 0);
// return no key because all thing done
return KEY_NO_KEY;
break;
// LLY2.81, re-adjust the procedure to consider if support runtime selection cursor
case KEY_LEFT:
case KEY_RIGHT:
// wyc0.85, because current solution support JPG preview, so need to reset this value when move cursor. Otherwise the state
// will be wrong state from JPG preview when cursor stay in other files.
if (__dwMMTriggerMode == MM_IMAGE_TRIGGER_MODE)
{
__bMMStage = MM_STAGE_NONE;
__btPlaying = FALSE;
__dwMMJPEGPreview = FALSE;
}
// selection cursor @ directory list
if (__MMSelectCursor.bPosition == POS_VOL_DIR_LIST)
{
if (bKey == KEY_LEFT)
{
#ifndef NO_MM_BUTTON
if (__bMMMenuID == MM_MENU_NORMAL)
{
// wyc1.10-909, if we allow entering sirt/filter dialog in pause mode, then user can re-arrange the file and it will happen
// problem because playing file maybe filter out. So we don't allow entering sort/filter function in pause mode.
if ((__btPlaying == TRUE) || (__btPause))
{
return KEY_INVALID;
}
// clear the selection cursor
OSDMM_Update(OSDMM_MSG_CLEAR_HIGHLIGHT,0);
__MMSelectCursor.wIndex=MM_BTN_FILTER;
}
else if (__bMMMenuID == MM_MENU_EDITPROG)
{
// wyc2.35-909S, add code to support disable program list mode when playing mode.
// clear the selection cursor
OSDMM_Update(OSDMM_MSG_CLEAR_HIGHLIGHT,0);
if (__btPlaying)
{
__MMSelectCursor.wIndex = MM_BTN_PLAY;
}
else
{
__MMSelectCursor.wIndex = MM_BTN_PROG_LIST;
}
}
else if (__bMMMenuID == MM_MENU_PROGLIST)
{
if (__bProgramMaxEntry == 0)
{
return INVALID_KEY;
}
// clear the selection cursor
OSDMM_Update(OSDMM_MSG_CLEAR_HIGHLIGHT,0);
__MMSelectCursor.wIndex=MM_BTN_DELETE_ALL;
}
// update cursor @ control button list's 1st positon
__MMSelectCursor.bPosition=POS_BUTTON_LIST;
#else
#ifdef SUPPORT_COPY_FILE_IN_MM_UI
if (__bMMMenuID == MM_MENU_ENCODE_FILE)
{
OSDMM_Update(OSDMM_MSG_CLEAR_HIGHLIGHT,0);
__MMSelectCursor.wIndex=MM_BTN_SAVE;
__MMSelectCursor.bPosition=POS_BUTTON_LIST;
}
else
#endif //SUPPORT_COPY_FILE_IN_MM_UI
return INVALID_KEY;
#endif //NO_MM_BUTTON
}
else // KEY_RIGHT
{
// if cursor @ UP_DIR, don't allow to move right
if (_bMMExistUpDir && (__MMSelectCursor.wIndex==0x1))
{
return INVALID_KEY;
}
// Othewise, can go following procedure
// check if exist item within file list window
if (_MM_QueryInfo2(MM_QUERY2_TOTAL_SORT_FILTER_ITEM,__MMSelectCursor.wDirID))
{
// clear the selection cursor first
OSDMM_Update(OSDMM_MSG_CLEAR_HIGHLIGHT, 0);
// Update cursor @ 1st file ID
__MMSelectCursor.bPosition = POS_FILE_LIST;
__MMSelectCursor.wIndex = __wOSDMMStartDrawItem;
if (MM_JPEGPreview())
{
return KEY_NO_KEY;
}
}
else
{
return INVALID_KEY;
}
}
// Update final cursor on menu
OSDMM_Update(OSDMM_MSG_UPDATE_HIGHLIGHT, 0); //CoCo.CT909, OSDMM_Update needs two parameters.
}
// selection cursor @ file list
else if(__MMSelectCursor.bPosition == POS_FILE_LIST)
{
// wyc1.05-2, record the file highlight position when lighlight is in file field. Record the value for press "play button" usage.
if(bKey==KEY_LEFT)
{
// clear the selection cursor first
OSDMM_Update(OSDMM_MSG_CLEAR_HIGHLIGHT, 0); //CoCo.CT909, OSDMM_Update needs two parameters.
// go to the active directory position
_MM_SetCursorToActiveDirPos();
}
else // KEY_RIGHT
{
// wyc2.38-909s, support no button code.
#ifndef NO_MM_BUTTON
if (__bMMMenuID == MM_MENU_NORMAL)
{
// wyc1.10-909, if we allow entering sirt/filter dialog in pause mode, then user can re-arrange the file and it will happen
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -