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

📄 cckey.c

📁 ct952 source code use for Digital Frame Photo
💻 C
📖 第 1 页 / 共 5 页
字号:
// ** TCH1.24a; Move Some APIs to this files. It's a extenstion of CC Module// ** TCH0.60; Build CC_KEY.C for Key Processing.// The file "winav.h" must be included in first line#include "winav.h"#include "ctkav.h"  // ** TCH0.60; #include    <string.h>// Micky2.80p, declare malloc.h into platform.h#include "initial.h"#include "utl.h"#include "hal.h"#include "SrcFilter.h"#include "input.h"#include "chips.h"#include "thumb.h"#include "comutl.h"//#include "amp.h"#include "gdi.h" //CoCo.CT909#include "osdmm.h" //CoCo.CT909#include "setup.h"#include "navigate.h"#include "cell.h"#include "dvdinfo.h"    #include "infofilter.h"#include "vcd20.h"#include "digest.h"#include "cc.h"#include "osd.h"#include "panel.h" #include "linear.h"#include "monitor.h"//#include "sysdebug.h" #ifndef NO_MP3#include "Mmanager.h" //   "mp3.h"#endif#include "disp.h"#include "parser.h"//#include "mpeg2dec.h"#include "subpict.h"#ifdef SUPPORT_CHAR_SUBPICTURE#include "par_sptx.h"#include "char_subpict.h"  //Alan1.10, support char-based subpicture#endif// Micky0.62-909#include    "media.h"#include    "osdsrch.h"// #include "logoaddr.h"#include "aploader.h"#define NULL_0      0   // ** TCH0.60; // wyc1.02a-909, add SP1 & SP2 debug information.//#define CCKEY_SP_DEBUG// ** TCH0.60; begin...  extern  BYTE            __bAutoScans;   extern  BIT             __btPlayFromBegin;// Told F/W it should play Track-Begin firstextern  BIT             __btFromStopMode;// GOTO position comes from a "STOP" mode// ** TCH0.60; end... //CoCo1.07, for auto-test#ifdef AUTO_TESTextern WORD aDVDRule[];extern WORD aCDROMRule[];extern DWORD __dwAutoTestTime;extern BYTE __bRuleIndex;extern BYTE __bAutoTest;extern WORD *_wpRule;#endif// Micky0.62-909, process number key, then convert as KEY_NUMBERWORD    __wNumberQueue;// The number need time out controlBYTE    bNumberTimeOut=FALSE;//the time that the number key was pressedDWORD   _dwTimeNumber;// Micky0.72, change number to DWORD to avoid overflow.DWORD    __dwNumberPrevious;DWORD   __dwTimeKey;// Micky0.62-909, process number key, then convert as KEY_NUMBER// __dwTimeKey  : record the time that the last KEY_N10/N20_PLUS was pressed(NULL means none)//              : used for number calculation only instead of time out.// __dwNumberPrevious:   The current value// __wNumberQueue !=0, means has number input.// __dwTimeNumber: Used for number time out.// each ProcessKey must DO:// When the value out of max. value, and reset to default, must call CC_NumberUtility(NUMBER_CLEAR)// When the value out of max. digits, must call CC_NumberUtility(NUMBER_SHIFT) to discard the first input number// DVD_161Micky, add key arrays for release still state// whenever a new key for release is added, must update// !!! only physical keys are allowed(compound keys are not allowed)// RELEASE_STILL_KEY_NUMBER and _bReleaseStillKeys[]#define RELEASE_STILL_KEY_NUMBER    2BYTE    code _bReleaseStillKeys[RELEASE_STILL_KEY_NUMBER] =        {            KEY_PLAY, KEY_PAUSE        };// wyc2.37-909s, replace NO_DVD to NO_DISC_MODE#ifndef NO_DISC_MODE //CoCo2.37pBYTE    _CC_ReleaseStillTrigger(void);#endif //#ifndef NO_DISC_MODE //CoCo2.37p// Brian.170//  *********************************************************************//  Function    :   _AutoVocal()//  Description :   Accoding to the __sbMICDetect to turn on/off the vocal//  Arguments   :   bValidKey//  Return      :   bValidKey//  Side Effect ://  *********************************************************************// This part of code is moved from the main loop, to simplify the flow and for easy reading#ifdef  ENABLE_AUTOVOCALBYTE _AutoVocal(BYTE bValidKey){    // DVD_104Micky, check mic control only when karaoke is on.    if (__SetupInfo.bAudioKaraoke == SETUP_AUDIO_KARAOKE_ON)    {    if (OS_GetSysTimer() - __dwMICDectectInterval> COUNT_100_MSEC)    {#ifdef  SW_MIC_DETECT        CHIPS_MICDetect();#endif        __dwMICDectectInterval = OS_GetSysTimer();        if (__sbMICDetect ==_btPreMICDetect)        {#ifdef  SUPPORT_MIC_DETECT_INV            if ( ! __sbMICDetect )#else            if ( __sbMICDetect )#endif                    _bMICOffCount++;        }        else        {            _bMICOffCount = 0;        }    if ( __bAutoVocal )    {#ifdef  SUPPORT_MIC_DETECT_INV      // ** TCH1.54; Active= HIGH. Mic has I/P.        if ( ! __sbMICDetect )  // ** TCH1.54; Active= 1.#else        if ( __sbMICDetect )  // ** TCH1.54; Active= 0.#endif        {   // NO MIC Input            // DVD_104Micky, enhance the vocal mode define            if ( __bVocal == VOCAL_OFF && _bMICOffCount > 10)            {                // DVD_103Micky, fix auto vocal won't have effect                {// DVD_172Micky, FLOW_CONTROL begin                    __bFWKey = KEY_VOCAL;                    __bKeyMessage=MSG_VOCAL;    // force the message to display// DVD_172Micky, FLOW_CONTROL end                    _bMICOffCount = 0;                }            }        }        else        {            // DVD_104Micky, enhance the vocal mode define//            if ( __btVocalON )            if ( __bVocal == VOCAL_ON)            // DVD_103Micky, fix auto vocal won't have effect            {// DVD_172Micky, FLOW_CONTROL begin                __bFWKey = KEY_VOCAL;                __bKeyMessage=MSG_VOCAL;    // force the message to display// DVD_172Micky, FLOW_CONTROL end            }        }    } // end if ( __bAutoVocal )        _btPreMICDetect = __sbMICDetect; // keep the previous detect result    } // end if (__dwCountSystem - __dwMICDectectInterval> COUNT_100_MSEC)    } // end if (__SetupInfo.bAudioKaraoke == SETUP_AUDIO_KARAOKE_ON)    return bValidKey;}#endif  // ENABLE_AUTOVOCAL// Micky2.81, put show IR map codes into a function.#ifdef  _SHOW_IR_MAPvoid _CC_ShowIRMap(){    if ( _bIRGet )    {        _bIRGet= FALSE;        COMUTL_BYTE2HexStr ( (__bMsgString ), _bIRMap[0] );        COMUTL_BYTE2HexStr ( (__bMsgString +3), _bIRMap[1] );        COMUTL_BYTE2HexStr ( (__bMsgString +6), _bIRMap[2] );        COMUTL_BYTE2HexStr ( (__bMsgString +9), _bIRMap[3] );        __bMsgString[2]= '-';        __bMsgString[5]= '-';        __bMsgString[8]= '-';        __bMsgString [11]= NULL_0;        OSD_Output ( MSG_STRING, NULL_0, 1 );        OS_DelayTime ( COUNT_1_SEC);    }}#endif  //#ifdef  _SHOW_IR_MAP// Micky1.05, add auto test for IC sorting by CoCo#ifdef AUTO_TESTvoid _CC_AutoTest(void){    if (__bAutoTest)    {                if (__wDiscType != NO_DISC_IN_DRIVE)        {            if (__wDiscType & BOOK_DVD)                _wpRule = aDVDRule;            else if (__wDiscType & BOOK_CDROM)                _wpRule = aCDROMRule;            else                __bAutoTest = FALSE;                        if (__bAutoTest)            {                if ((OS_GetSysTimer() - __dwAutoTestTime) > (DWORD)_wpRule[__bRuleIndex])                {                    if ((_wpRule[__bRuleIndex] == 0) && (_wpRule[__bRuleIndex+1] == 0))                    {                                            __bAutoTest = FALSE;                    }                       else                    {                              if (__bKey == KEY_NO_KEY)                        {                            __bRuleIndex++;                             __bISRKey = (BYTE)_wpRule[__bRuleIndex++];                                                        //__bISRKeyRead = TRUE;                             __dwAutoTestTime = OS_GetSysTimer();                                                    }                    }                }            }        }    }}void  CC_AutoTestInitial(void){   __bRuleIndex = 0;   __bAutoTest = FALSE;}#endifBYTE    _KeyGroupVideo(BYTE bKey){switch(bKey){// KEY_GROUP7, Video Keys    case    KEY_ZOOM:        // Micky2.80, accord cc.h ZOOM ID for HAL_Zoom.        if ( !HAL_Zoom(VIEW_ZOOM_SUPPORT) )            return INVALID_KEY;        if ( __wDiscType & BOOK_CDDA )  // ** 0.21;            return INVALID_KEY;        // wyc2.37-909s, fix MPEG-CD can zoom problem.#ifdef SUPPORT_FUSS_MPEG_CD        if (INFOFILTER_FUSSMPEGCD(IF_MODE_CHECK_MPEG_CD,0))            return INVALID_KEY;#endif// Micky1.20, 4M flash#ifndef NO_DIGEST        if ( __btDIGEST )            return INVALID_KEY;#endif        {            //initial factor no Zoom in)            switch(__bZoomFactor)            {            case    VIEW_NORMAL:                __bZoomFactor=VIEW_ZOOMX2;                // Micky2.80, accord cc.h ZOOM ID for HAL_Zoom.                if ( !HAL_Zoom(VIEW_ZOOMX2) )                    return INVALID_KEY;                break;            case    VIEW_ZOOMX2:                __bZoomFactor=VIEW_ZOOMX4;                // Micky2.80, accord cc.h ZOOM ID for HAL_Zoom.                if ( !HAL_Zoom(VIEW_ZOOMX4) )                    return INVALID_KEY;                break;            case    VIEW_ZOOMX4:                __bZoomFactor=VIEW_NORMAL;                // Micky2.80, accord cc.h ZOOM ID for HAL_Zoom.                if ( !HAL_Zoom(VIEW_NORMAL) )                    return INVALID_KEY;                break;            }        }        // Micky0.85, re-define the ZOOM ID.        __bTemp = __bZoomFactor;        if ( __bZoomFactor == VIEW_NORMAL )            __bTemp = VIEW_ZOOMX1;        // wyc2.30-909s, use new zoom message#ifdef SUPPORT_GRAPH_ZOOM        OSD_OUTPUT_MACRO ( MSG_ZOOM, __bTemp, 0x3 );#endif //        OSD_OUTPUT_MACRO ( MSG_ZOOM_TEXT, __bTemp, 0x3 );        break;    case    KEY_ZOOM_LEFT:        // Micky2.80, accord cc.h ZOOM ID for HAL_Zoom.        if ( !HAL_Zoom(VIEW_ZOOM_LEFT) )            return INVALID_KEY;        // Micky2.80, accord cc.h ZOOM ID for HAL_Zoom.        // MS_ZOOMMOVE will be removed.        /// OSD_Output(MSG_ZOOMMOVE, OSD_ZOOM_LEFT, 0x3);#ifdef SUPPORT_GRAPH_ZOOM        OSD_Output(MSG_ZOOM, VIEW_ZOOM_LEFT, 0x3);#endif //        OSD_Output(MSG_ZOOM_TEXT, VIEW_ZOOM_LEFT, 0x3);        break;    case    KEY_ZOOM_RIGHT:         // Micky2.80, accord cc.h ZOOM ID for HAL_Zoom.        if ( !HAL_Zoom(VIEW_ZOOM_RIGHT) )            return INVALID_KEY;        // Micky2.80, accord cc.h ZOOM ID for HAL_Zoom.        // MS_ZOOMMOVE will be removed.#ifdef SUPPORT_GRAPH_ZOOM        OSD_Output(MSG_ZOOM, VIEW_ZOOM_RIGHT, 0x3);#endif //        OSD_Output(MSG_ZOOM_TEXT, VIEW_ZOOM_RIGHT, 0x3);        break;    case    KEY_ZOOM_UP:        // Micky2.80, accord cc.h ZOOM ID for HAL_Zoom.        if ( !HAL_Zoom(VIEW_ZOOM_UP) )            return INVALID_KEY;        // Micky2.80, accord cc.h ZOOM ID for HAL_Zoom.        // MSG_ZOOMMOVE will be removed.#ifdef SUPPORT_GRAPH_ZOOM        OSD_Output(MSG_ZOOM, VIEW_ZOOM_UP, 0x3);#endif //        OSD_Output(MSG_ZOOM_TEXT, VIEW_ZOOM_UP, 0x3);        break;    case    KEY_ZOOM_DOWN:        // LLY.274p-3, use command debug 1 to readback SP buffer cnt        // And, using new method to output debug info.        // Micky2.80, accord cc.h ZOOM ID for HAL_Zoom.        if ( !HAL_Zoom(VIEW_ZOOM_DOWN) )            return INVALID_KEY;        // Micky2.80, accord cc.h ZOOM ID for HAL_Zoom.        // MSG_ZOOMMOVE will be removed.#ifdef SUPPORT_GRAPH_ZOOM        OSD_Output(MSG_ZOOM, VIEW_ZOOM_DOWN, 0x3);#endif //        OSD_Output(MSG_ZOOM_TEXT, VIEW_ZOOM_DOWN, 0x3);        break;    case    KEY_SPST_CTL:    		// Micky0.68, merge SP change into an API for navigator and key switch share use.    		// parameter 1 means by KEY_SPST_CTL    		// Micky0.76, must return the value.        	// Micky0.80,    		return CC_SPST_Change(CC_TOGGLE_SP1);    		break;       // Micky0.80, add SP2 control key    		

⌨️ 快捷键说明

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