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

📄 waveout.h

📁 EP931X系列的WinCE声卡驱动源代码
💻 H
字号:
//**********************************************************************
//                                                                      
// Filename: waveout.h
//                                                                      
// Description: Contains routines for the waveout
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Use of this source code is subject to the terms of the Cirrus end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to 
// use this source code. For a copy of the EULA, please see the 
// LICENSE.RTF on your install media.
//
// Copyright(c) Cirrus Logic Corporation 2003, All Rights Reserved                       
//                                                                      
//**********************************************************************

#ifndef _H_WAVEOUT
#define _H_WAVEOUT

//
// Convert data between one type and another.
//
typedef void WAVECOPY(PUCHAR, PUCHAR, ULONG);

typedef void WaveOutConversionFunc(void *, void *, ULONG);

class WaveOut
{
    public:
        WaveOut();
        ~WaveOut();
        
        MMRESULT Initialize(CodecInterface *c);
        
        MMRESULT Open
        (
            DWORD        *  pdwUser,
            WAVEOPENDESC *  pOpenDesc,
            DWORD           dwFlags
        );

        MMRESULT Close( );
        
        MMRESULT BreakLoop();
        
        MMRESULT GetDevCaps
        (
            PWAVEOUTCAPS    pCaps,
            DWORD          dwSize
        );
        
        DWORD GetNumDev()
        {
            return  1;
        }
        
        MMRESULT GetPitch()
        {
            return MMSYSERR_NOTSUPPORTED;
        }  
        
        MMRESULT SetPitch()
        {
            return MMSYSERR_NOTSUPPORTED;
        }
                    
        MMRESULT GetPlaybackRate()
        {
            return MMSYSERR_NOTSUPPORTED;
        }
        

        MMRESULT SetPlaybackRate()
        {
            return MMSYSERR_NOTSUPPORTED;
        }


        MMRESULT GetPosition
        (
            MMTIME  * pTime,
            DWORD   dwSize
        );            
        
        
        MMRESULT GetVolume
        (
            DWORD   *pdwVolume,
            UINT    uDeviceId   
        );
        
        MMRESULT Pause();
        
        MMRESULT Prepare()
        {
            return MMSYSERR_NOTSUPPORTED;
        }
        
        MMRESULT Reset();
        
        MMRESULT Restart();
        
        MMRESULT SetVolume
        (
            DWORD           dwUser,
            DWORD           dwVolume,
            UINT            uDeviceId
        );
        
        
        MMRESULT UnPrepare()
        {
            return MMSYSERR_NOTSUPPORTED;
        }
        
        MMRESULT Write
        (
            WAVEHDR *   pWaveHDR,
            DWORD       dwSize
        );
        
    private:
    
        MMRESULT            AddBuffer(PWAVEHDR pWave);
        void                RemoveCompleteBlocks();
        void                FillDMABuffer
        (
            DWORD   dwStartPos,
            DWORD   dwEndPos
        );
        
        static void InterruptHandler(void *Handle, BOOL bLastHalf);
        
        //
        // Play State information.
        //
        PingPongDma         m_Dma;        
        BOOL                m_bLock;
        BOOL                m_bIsPlaying;
        BOOL                m_bIsPaused;
        BOOL                m_bStopAtNextInterrupt;
        DWORD               m_dwLoopCount;
        DWORD               m_dwBytePosition;
        DWORD               m_dwPreviousStart;
        DWORD               m_dwPreviousEnd;
        WAVEHDR *           m_pWaveHead;
        WAVEHDR *           m_pWaveNext;
        
        void *              m_pBuffer;
        CRITICAL_SECTION    m_CriticalSection;
        WAVEFORMATEX        m_WaveFormat;
        DRVCALLBACK*        m_pfnCallback;
        HANDLE              m_hCallback;
        DWORD               m_dwInstance;
        USHORT              m_usRightVolume;
        USHORT              m_usLeftVolume;
        USHORT              m_usMasterRightVolume;
        USHORT              m_usMasterLeftVolume;

        CodecInterface *    m_pCodec;

        WaveOutConversionFunc *    m_pfnConversion;
        ULONG               m_ulBufferShift;
        ULONG               m_ulDMASampleSize;
        ULONG               m_ulDmaBufferSize;

};
#endif  //_H_WAVEOUT

⌨️ 快捷键说明

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