⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 thumb.c

📁 ct952 source code use for Digital Frame Photo
💻 C
📖 第 1 页 / 共 5 页
字号:
                {                    _THUMB_UpdateHighlight(THUMB_UPDATE_HIGHLIGHT_CLEAR);                    _wTHUMBIndex++;                    _THUMB_UpdateHighlight(THUMB_UPDATE_HIGHLIGHT_DRAW);                    _THUMB_ShowGeneralHelp((BYTE)(_wTHUMBIndex % THUMB_TOTAL_NUM_IN_PAGE));                }            }        }        else //The cursor is at the button.        {            if (_bTHUMBButtonIndex == 0)            {                //Recover the original highlight button to normal state.                _THUMB_DrawButton(_bTHUMBButtonIndex, THUMB_BUTTON_STATE_ENABLE);                //Update new highlight button.                _bTHUMBButtonIndex++;                _THUMB_DrawButton(_bTHUMBButtonIndex, THUMB_BUTTON_STATE_HIGHLIGHT);            }            else                return INVALID_KEY;        }        break;    case KEY_UP:    //move the cursor to up item        if (_bTHUMBCursorType == THUMB_CURSOR_PICTURE)        {            if (_THUMB_CheckUpBoundary())            {                return INVALID_KEY; //exceed the up item.            }            else            {                _THUMB_UpdateHighlight(THUMB_UPDATE_HIGHLIGHT_CLEAR);                _wTHUMBIndex -= THUMB_COLUMN_NUM;                _THUMB_UpdateHighlight(THUMB_UPDATE_HIGHLIGHT_DRAW);                _THUMB_ShowGeneralHelp((BYTE)(_wTHUMBIndex % THUMB_TOTAL_NUM_IN_PAGE));            }        }        else //move the cursor from the button to the thumbnail        {            //No thumbnails in this page. The cursor is not allowed in the thumbnail part.            if (_wTHUMBTotalFiles == 0)                return INVALID_KEY;#ifdef SUPPORT_THUMB_PROGRAM            //There is no programmed thumbnail or all thumbnails has been deleted in this page.            if ((_bTHUMBSubMode == THUMB_SUBMODE_PROGRAM_LIST) && (_wTHUMBTotalFiles <= (_bTHUMBProgramListPageNo * THUMB_TOTAL_NUM_IN_PAGE)))                return INVALID_KEY;#endif //#ifdef SUPPORT_THUMB_PROGRAM            //change the type of the cursor.            _bTHUMBCursorType = THUMB_CURSOR_PICTURE;            _THUMB_UpdateHighlight(THUMB_UPDATE_HIGHLIGHT_DRAW);            //Change the state of the button from "HIGHLIGHT" state to "ENABLE" state            _THUMB_DrawButton(_bTHUMBButtonIndex, THUMB_BUTTON_STATE_ENABLE);        }        break;    case KEY_DOWN:  //move the cursor to down item        if (_bTHUMBCursorType == THUMB_CURSOR_PICTURE)        {            if (_THUMB_CheckDownBoundary()) //exceed the down item==>go to the button part.            {                if (!_bTHUMBStop)                    return INVALID_KEY;                else                {                    _THUMB_UpdateHighlight(THUMB_UPDATE_HIGHLIGHT_CLEAR);                    _bTHUMBCursorType = THUMB_CURSOR_BUTTON;                    _THUMB_DrawButton(_bTHUMBButtonIndex, THUMB_BUTTON_STATE_HIGHLIGHT);                }            }            else //not exceed the down item.            {                if (!_bTHUMBStop)                {                    if (_wTHUMBPlayIndex <= (_wTHUMBIndex + THUMB_COLUMN_NUM)) //CoCo1.05, don't move the highlight when the picture is not decoded.                        return INVALID_KEY;                }                _THUMB_UpdateHighlight(THUMB_UPDATE_HIGHLIGHT_CLEAR);                _wTHUMBIndex += THUMB_COLUMN_NUM;                _THUMB_UpdateHighlight(THUMB_UPDATE_HIGHLIGHT_DRAW);                _THUMB_ShowGeneralHelp((BYTE)(_wTHUMBIndex % THUMB_TOTAL_NUM_IN_PAGE));            }        }        else //The cursor is at the button now.            return INVALID_KEY;        break;#ifdef SUPPORT_PHOTO_BROWSE_MODE    case KEY_BROWSE:        if ((_bTHUMBSubMode == THUMB_SUBMODE_GENERAL) && (_bTHUMBCursorType == THUMB_CURSOR_PICTURE))        {            _THUMB_ToSlideShow(THUMB_PLAY_CURRENT);        }        else        {            _THUMB_ToSlideShow(THUMB_PLAY_START);        }        return KEY_BYPASS;#endif //SUPPORT_PHOTO_BROWSE_MODE    case KEY_PROGRAM:#ifdef SUPPORT_THUMB_PROGRAM        if (__btProgram)        {            if (_bTHUMBSubMode == THUMB_SUBMODE_PROGRAM)            {                if (_bTHUMBStop)                {                    //Return to general mode                    _bTHUMBSubMode = THUMB_SUBMODE_GENERAL;                    //CoCo1.10, Fix the bug about the programmed items are not cleard when KEY_PROGRAM==>KEY_PROGRAM.                    LINEAR_Program(LINEAR_PROGRAM_CLEAR, (BYTE)NULL);                    //update frame                    if (_bTHUMBStop)                        _THUMB_UpdateThumbnailFrame(THUMB_UPDATE_FRAME_PROGRAM_TO_GENERAL);                    _THUMB_EnterNewMode();                }                else                    return INVALID_KEY;            }            else                return INVALID_KEY;        }        else        {            if (_bTHUMBSubMode == THUMB_SUBMODE_GENERAL)            {                if (_bTHUMBStop)                {                    //Enter Program mode                    _bTHUMBSubMode = THUMB_SUBMODE_PROGRAM;                    __btProgram = TRUE;                    __btInputProgram = TRUE;                    //update frame                    if (_bTHUMBStop)                        _THUMB_UpdateThumbnailFrame(THUMB_UPDATE_FRAME_GENERAL_TO_PROGRAM);                    _THUMB_EnterNewMode();                }                else                    return INVALID_KEY;            }            else                return INVALID_KEY;        }#else        return INVALID_KEY;#endif //#ifdef SUPPORT_THUMB_PROGRAM        break;    case KEY_PLAY_PAUSE:        if (__btPlaying) // within playing mode        {            __bKey = KEY_PAUSE;            return KEY_BYPASS;        }    case KEY_ENTER:    case KEY_PLAY:        if (__btPause)            return KEY_BYPASS;        else            return _THUMB_ProcessEnterKey();    case KEY_RANDOM:#ifdef SUPPORT_DELETE_FILE_IN_THUMB_UI        if (__bTHUMBMainMode == THUMB_MAIN_MODE_EDIT)            return INVALID_KEY;#endif //SUPPORT_DELETE_FILE_IN_THUMB_UI        __btRandom = FALSE;		__btPause = FALSE;#if (DRAM_CONFIGURATION_TYPE_DVD == DRAM_SIZE_16)        DISP_DisplayCtrl(DISP_MAINVIDEO, FALSE);#endif        THUMB_NormalExit();    default:        return KEY_BYPASS;    }    return KEY_NO_KEY;}//*********************************************************************************************************//  Function    :   _THUMB_Start//  Abstract    :   Start to play a thumbnail.//  Arguments   :   none.//  Return		:   none.//  Side Effect :   none.//  Notes       ://*********************************************************************************************************void _THUMB_Start(void){    if (_bTHUMBSubMode == THUMB_SUBMODE_PROGRAM_LIST)    {#ifdef SUPPORT_THUMB_PROGRAM        //clear the OSD in the frame to prevent remenent "MP3".        _THUMB_ClearFileExtInProgramList((BYTE)(_wTHUMBPlayIndex%THUMB_TOTAL_NUM_IN_PAGE));        if (__pMMProgContent[_wTHUMBPlayIndex].bExtID != EXTNAME_JPG)        {            //draw frame            _THUMB_DrawFrame((BYTE)(_wTHUMBPlayIndex%THUMB_TOTAL_NUM_IN_PAGE), THUMB_FRAME_NORMAL);            _THUMB_ShowFileExtInProgramList((BYTE)(_wTHUMBPlayIndex%THUMB_TOTAL_NUM_IN_PAGE));            _THUMB_ChangeToNextPic();            return;        }        else        {            //get the programmed file from __ProgIdxList[];            //update the playing dir for executing the playing dir.            __MMPlayingItem.wDirID = __ProgIdxList[_wTHUMBPlayIndex].bMainIndex;            //CoCo1.06, the temporal solution to fix the thumbnails can't be decoded completely.            if (__SF_SourceGBL[__dwSFStreamID].bSourceIndex == SOURCE_USB0_0) // USB            {                // wyc1.07-909, delay 100 ms is better in some platform USB mode.                // wyc1.11-909, don't need to delay 100ms when issuing CC_KeyCommand(KEY_STOP) here.                //UTL_DelayTime(COUNT_100_MSEC, FALSE);            }            // wyc1.11-909, need to issue stop command, otherwise thumbnail will decode failed in some USB disk. The reason is unknown            // and maybe relative to timing issue.            CC_KeyCommand(KEY_STOP);            UTL_PlayItem((WORD)(__ProgIdxList[_wTHUMBPlayIndex].wSubIndex), 0);            _THUMB_ParseHeader();            //Access the file status to set correct operation            MM_AccessJPGStatus(MM_GET_JPG_STATUS, (WORD)(__ProgIdxList[_wTHUMBPlayIndex].wSubIndex));        }#endif //#ifdef SUPPORT_THUMB_PROGRAM    }#ifdef SUPPORT_DELETE_FILE_IN_THUMB_UI    else if ((_bTHUMBSubMode == THUMB_SUBMODE_EDIT_MODE) || (_bTHUMBSubMode == THUMB_SUBMODE_DELETE_MODE) || (_bTHUMBSubMode == THUMB_SUBMODE_SORT_MODE))    {        UTL_PlayItem((WORD)(_wTHUMBStartPlayItem+_wTHUMBPlayIndex+1), 0);        _THUMB_ParseHeader();             MM_AccessJPGStatus(MM_GET_JPG_STATUS, _wTHUMBStartPlayItem+_wTHUMBPlayIndex+1);                __HALJPEGSetting.bOperation = __bMMJPGStatus;        _wTHUMBStartTime = OS_GetSysTimer();        _bTHUMBStage = THUMB_STAGE_PARSEHEADER;        return;    }#endif //SUPPORT_DELETE_FILE_IN_THUMB_UI    else //general mode    {        //update the playing dir for executing the playing dir. In general case, it is equal to __bFMActiveDir.#ifndef CT950_STYLE        __MMPlayingItem.wDirID = __MMSelectCursor.wDirID;#endif //CT950_STYLE        //CoCo1.06, the temporal solution to fix the thumbnails can't be decoded completely.        if (__SF_SourceGBL[__dwSFStreamID].bSourceIndex == SOURCE_USB0_0) // USB        {            // wyc1.11-909, don't need to delay 100ms when issuing CC_KeyCommand(KEY_STOP) here.            //UTL_DelayTime(COUNT_100_MSEC, FALSE);        }        // wyc1.11-909, need to issue stop command, otherwise thumbnail will decode failed in some USB disk. The reason is unknown        // and maybe relative to timing issue.        CC_KeyCommand(KEY_STOP);#ifdef CT950_STYLE		if (_bTHUMBDecodeMode == THUMB_DECODE_ONE)		{			_THUMB_CheckDumpFileRecord(TRUE);		}		else		{			_THUMB_CheckDumpFileRecord(FALSE);		}		_wTHUMBPlayItemInFolder = _THUMB_GetPlayIndex();        UTL_PlayItem(_wTHUMBPlayItemInFolder, 0);#else        UTL_PlayItem((WORD)(_wTHUMBStartPlayItem+_wTHUMBPlayIndex+1), 0);#endif //CT950_STYLE                _THUMB_ParseHeader();        //Access the file status to set correct operation#ifdef CT950_STYLE		MM_AccessJPGStatus(MM_GET_JPG_STATUS, _wTHUMBPlayItemInFolder);#else        MM_AccessJPGStatus(MM_GET_JPG_STATUS, (WORD)(_wTHUMBStartPlayItem+_wTHUMBPlayIndex+1));#endif //CT950_STYLE    }    __HALJPEGSetting.bOperation = __bMMJPGStatus;    _wTHUMBStartTime = OS_GetSysTimer();    _bTHUMBStage = THUMB_STAGE_PARSEHEADER;    //__btPlayEnd= FALSE; //--CoCo0.91, remove it by LLY's suggestion.}//*********************************************************************************************************//  Function    :   _THUMB_GetTotalFiles//  Abstract    :   Call this function to get total files aaccording to _bTHUMBSubMode.//  Arguments   :   none.//  Return		:   none.//  Side Effect :   none.//  Notes       ://*********************************************************************************************************void _THUMB_GetTotalFiles(void){    _bTHUMBTemp = FALSE;#ifdef SUPPORT_THUMB_PROGRAM    if (_bTHUMBSubMode == THUMB_SUBMODE_PROGRAM_LIST)    {        //We show all kinds of files in the program list not only thumbnail.        _wTHUMBTotalFiles = __bProgramMaxEntry;    }    else#endif //#ifdef SUPPORT_THUMB_PROGRAM    {        _wTHUMBTotalFiles = 0;        //Picture CD only have one valid directory and it index is 1.        if (__wDiscType & CDROM_PICTURECD)            __MMSelectCursor.wDirID = 1;        // wyc0.50-909, remove it because of bDirExtAttr field is removed now.        /* --CoCo, remove it because mmanager doesn't keep the special file attribute info.        //CDINFO will parse the file's attribute and put it in bDirExtAttr        if (!(__pMMDirNameList[__MMSelectCursor.wDirID].bDirExtAttr & EXTNAME_JPG)) //No JPEG files            return;            */        // wyc0.85a, use new pointer to support sort/filter function.        //Dump total files from the first files of this directory.        MM_TriggerDumping(MM_ID_RelativeToAbsolute(__MMSelectCursor.wDirID, 0), __pMMFilterFilesOfDir[__MMSelectCursor.wDirID]);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -