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

📄 macro.c

📁 代码有点长,需细心阅读,仅供影音视听类产品的开发人员参考
💻 C
字号:
/*
** FILE
** macro.c
**
** DESCRIPTION
**
*/
#include "auctrl.h"
#include "config.h"

#include "global.h"
#include "memmap.h"
#include "cd.h"
#include "macro.h"
#include "osd.h"
#include "func.h"
#include "dma.h"
#include "vpp.h"
#include "cdxa.h"
#include "hwsetup.h"
#include "dsa.h"
#include "cdfunc.h"
#include "ircmd.h"
#include "util.h"
#include "fs9660.h"
#include "framebuf.h"

//#define MONE_START_UP_MSF

#if 0                                                       //jhuang use AVAPI interface
//test #define AudioMute()     {/*audio_volume |= 0x80;*/ au_mute(1);}
//test #define AudioDemute()   {/*audio_volume &= ~0x80;*/ au_mute(0);}
#endif

//in framebuf.c
extern void SetupDigestBackground(void);

//in hwsetup.c
extern void reset_sup(void);

//in svcd.c
extern int get_size_map(int);
extern UINT32 get_entry(int);
extern UINT32 get_segment(int);
extern UINT32 get_segment_msf(int);
extern int get_segment_length(int s);

//in cd.c
extern int do_cd_reset(int);
extern int do_cd_play(int);

//in mpegsys.c
extern void restart_audio_engine(void);
extern void resync_video_engine(void);
extern void setup_pal_motion();
extern void setup_ntsc_motion();

//in ogt.c
extern void reset_ogt(void);

/*
** Abort()
**
** HIGH PRIORITY.  IMMEDIATE
*/
void MacroAbort()
{
    AVD_state = STATE_IDLE;
    AVD_state_flags = 0;
    SetIntrMask(0);
    SetIntrFlag(0);
}

/*
** Sync()
**
** HIGH PRIORITY.  IMMEDIATE
*/
void MacroSync()
{
    while(IsRPicStart || !IsVPicEnd)
        ;
}

/*
** Pause()
**
** Cause the player to PAUSE and stop.
**
*/
void MacroPause()
{
    BYTE    item;

    item = MacroParam.Pause.factor;
    if(item)
    {
        /* issue pause situation */
        AVD_SetPaused();

        if(item == 1)             /*ignore P_frame all pause(2),only for AP call pause(1)*/
            pause_audio(1, 0);    /*pause audio kernel*/
                                                                    /*for SONY test disc last 2 CDDA trk*/
        if((cd_type_loaded == CDDA) || (cd_type_loaded == CDROM) || ((gettrkcna(cd_trk_now)&0x40)==0))
        {                                                           
            
            AVAPI_control(C_WRITE, AVAPI_MUTE, C_ON);

            //?audio_volume|=0x80;
            //?au_mute(1);
            if(cd_type_loaded == CDDA && !cd_pause_ss)
            	cd_pause_ss = cd_disp_ss;
            cd_func_pause(1);
        }
        else
            do_cd_pause();


        if(item != 2)
        {
            /* play state setting */
            UISetState(VCD_STATE_PAUSE);
            //PrintOsdMsg(STR_OS_PAUSE,REGION1,0,0,CH_N);//reduce to ReShowState()
            ReShowState();                      //jhuang 2002/4/29
        }
    }
    else
    {
        //  I_Cnt_On = 1;
        /*1.solve VCD (continue)step don't release voice jhuang 2001/8/6 */
        /*P_frame==1 will execute AVD_SetPaused()in kernel */

        if(user_mute == OFF)
            //test AudioDemute();//jhuang 2-6-16 use AVAPI interface
            AVAPI_control(C_WRITE, AVAPI_MUTE, C_OFF);

        pause_audio(0, 0);                  //release audio kernel

        AVD_SetNoPaused();
        cd_func_pause(0);
        //?continue_audio();
        /* play state setting */
        UISetState(VCD_STATE_NORMAL);
        cd_pause_ss = 0;
    }
}

/*
** Continue()
**
** Release from PAUSE status and continue playback.
** STC and other timers should be reset and resynced according to incoming
** bitstream.
**
*/
void MacroContinue()
{
#if 0                                                       //reduce 11,no used
    /*
     ** I Only want to handle with only one situations.
     ** 1.Step->step release
     */

    /*1.solve VCD (continue)step don't release voice jhuang 2001/8/6 */
    /*P_frame==1 will execute AVD_SetPaused()in kernel */
    if(IsAVDPaused())
    {
        AVD_SetNoPaused();
    }

    cd_func_pause(0);

    if(P_frame == 0)
    {
        AVD_SetNoStepped();
        UISetState(VCD_STATE_NORMAL);
        PrintOsdMsg(STR_OS_PLAY, REGION1, 1, 0, CH_N);
    }
#endif
}

/*
** MACRO
** DisplayPreviewBackground()
**
** Display the background for preview.
** Also set display picture id to 2 (if we want to display I/P)
**/
void MacroDisplayPreviewBackground(void)
{
    vpp_zoom = 1;
    vpp_zoom_x = 0;
    vpp_zoom_y = 0;

    preset_framebuffer(MEM_CONFIG_DIGEST);
#ifdef MONE_START_UP_MSF
    epp_write_wait("MacroDisplayPreview...\n");
#endif
    //vpp_set_mode(VPP_AUTOEXP);
    #if CONFIG == CONFIG_COMBO_SVCD
    if(cd_type_loaded == CDSVCD)
        vpp_set_pic(480, 480);
    else
    #endif
        vpp_set_pic(352, 240);

    //charles 2002/11/7 for stop->9frame, 俐丁厚

⌨️ 快捷键说明

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