亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dswave.cpp

?? 赤壁之戰的游戲源代碼
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
        if (*ppwfxSrc != NULL)
                {
                GlobalFree(*ppwfxSrc);
                *ppwfxSrc = NULL;
                }

        if (*phmmio != NULL)
                {
                mmioClose(*phmmio, 0);
                *phmmio = NULL;
                }

        return(0);

}

/*      This routine will create a wave file for writing.  This will automatically overwrite any
        existing file with the same name, so be careful and check before hand!!!
        pszFileName     - Pointer to filename to write.
        phmmioOut               - Pointer to HMMIO handle that is used for further writes
        pwfxDest                - Valid waveformatex destination structure.
        pckOut                  - Pointer to be set with the MMCKINFO.
        pckOutRIFF              - Pointer to be set with the RIFF info.

*/
int WaveCreateFile(
                        char *pszFileName,                              // (IN)
                        HMMIO *phmmioOut,                               // (OUT)
                        WAVEFORMATEX *pwfxDest,                 // (IN)
                        MMCKINFO *pckOut,                               // (OUT)
                        MMCKINFO *pckOutRIFF                    // (OUT)

                        )
{
            
        int             nError;                         // Return value.
        DWORD           dwFactChunk;            // Contains the actual fact chunk. Garbage until WaveCloseWriteFile.
        MMCKINFO        ckOut1;

        dwFactChunk = (DWORD)-1;
        nError = 0;

        *phmmioOut = mmioOpen(pszFileName, NULL,
                        MMIO_ALLOCBUF | MMIO_READWRITE|MMIO_CREATE);

    if (*phmmioOut == NULL)
                {
                nError = ER_CANNOTWRITE;
        goto ERROR_CANNOT_WRITE;    // cannot save WAVE file
                }

    /* Create the output file RIFF chunk of form type 'WAVE'.
     */
    pckOutRIFF->fccType = mmioFOURCC('W', 'A', 'V', 'E');       
        pckOutRIFF->cksize = 0; 
    if ((nError = mmioCreateChunk(*phmmioOut, pckOutRIFF, MMIO_CREATERIFF)) != 0)
                {
        goto ERROR_CANNOT_WRITE;    // cannot write file, probably
                }

    /* We are now descended into the 'RIFF' chunk we just created.
     * Now create the 'fmt ' chunk. Since we know the size of this chunk,
     * specify it in the MMCKINFO structure so MMIO doesn't have to seek
     * back and set the chunk size after ascending from the chunk.
     */
    pckOut->ckid = mmioFOURCC('f', 'm', 't', ' ');
    pckOut->cksize = sizeof(PCMWAVEFORMAT);   // we know the size of this ck.
    if ((nError = mmioCreateChunk(*phmmioOut, pckOut, 0)) != 0)
                {
        goto ERROR_CANNOT_WRITE;    // cannot write file, probably
                }

    /* Write the PCMWAVEFORMAT structure to the 'fmt ' chunk if its that type. */
    if (pwfxDest->wFormatTag == WAVE_FORMAT_PCM)
                {
            if (mmioWrite(*phmmioOut, (HPSTR) pwfxDest, sizeof(PCMWAVEFORMAT))
                != sizeof(PCMWAVEFORMAT))
                        {
                        nError = ER_CANNOTWRITE;
                goto ERROR_CANNOT_WRITE;    // cannot write file, probably
                        }
                }
        
        else 
                {
                // Write the variable length size.
                if ((UINT)mmioWrite(*phmmioOut, (HPSTR) pwfxDest, sizeof(*pwfxDest)+pwfxDest->cbSize)
                != (sizeof(*pwfxDest)+pwfxDest->cbSize))
                        {
                        nError = ER_CANNOTWRITE;
                goto ERROR_CANNOT_WRITE;    // cannot write file, probably
                        } 

                }  

    /* Ascend out of the 'fmt ' chunk, back into the 'RIFF' chunk.
     */
    if ((nError = mmioAscend(*phmmioOut, pckOut, 0)) != 0)
                {
        goto ERROR_CANNOT_WRITE;    // cannot write file, probably
                }

        // Now create the fact chunk, not required for PCM but nice to have.  This is filled
        // in when the close routine is called.
        ckOut1.ckid = mmioFOURCC('f', 'a', 'c', 't');
        ckOut1.cksize = 0;
    if ((nError = mmioCreateChunk(*phmmioOut, &ckOut1, 0)) != 0)
                {
        goto ERROR_CANNOT_WRITE;    // cannot write file, probably
                }

        if (mmioWrite(*phmmioOut, (HPSTR)&dwFactChunk, sizeof(dwFactChunk)) != sizeof(dwFactChunk))
                {
                nError = ER_CANNOTWRITE;
                goto ERROR_CANNOT_WRITE;
                }

        // Now ascend out of the fact chunk...
    if ((nError = mmioAscend(*phmmioOut, &ckOut1, 0)) != 0)
                {
        nError = ER_CANNOTWRITE;        // cannot write file, probably
                goto ERROR_CANNOT_WRITE;
                }

         
   
        goto DONE_CREATE;

ERROR_CANNOT_WRITE:
        // Maybe delete the half-written file?  Ah forget it for now, its good to leave the
        // file there for debugging...

DONE_CREATE:
        return(nError);

}

/*      This routine has to be called before any data is written to the wave output file, via wavewritefile.  This
        sets up the data to write, and creates the data chunk.
*/

int WaveStartDataWrite(
                                HMMIO *phmmioOut,                               // (IN)
                                MMCKINFO *pckOut,                               // (IN)
                                MMIOINFO *pmmioinfoOut                  // (OUT)
                                )
{

        int             nError;

        nError = 0;
 /* Create the 'data' chunk that holds the waveform samples.  */
    pckOut->ckid = mmioFOURCC('d', 'a', 't', 'a');
        pckOut->cksize = 0;
    if ((nError = mmioCreateChunk(*phmmioOut, pckOut, 0)) != 0)
                {
        goto ERROR_CANNOT_WRITE;    // cannot write file, probably
                }

        if ((nError = mmioGetInfo(*phmmioOut, pmmioinfoOut, 0)) != 0)
                {
        goto ERROR_CANNOT_WRITE;
        }

        goto CLEANUP;
ERROR_CANNOT_WRITE:     

CLEANUP:
        return(nError);
}

/* This routine will write out data to a wave file. 
        hmmioOut                - Handle to hmmioOut filled by WaveCreateFile
        cbWrite                 - # of bytes to write out.
        pbSrc                   - Pointer to source.
        pckOut                  - pointer to ckOut filled by WaveCreateFile
        cbActualWrite   - # of actual bytes written.
        pmmioinfoOut    - Pointer to mmioinfoOut filled by WaveCreateFile.

        Returns 0 if successful, else the error code.

 */


int WaveWriteFile(
                HMMIO hmmioOut,                         // (IN)
                UINT cbWrite,                           // (IN)
                BYTE *pbSrc,                            // (IN)
                MMCKINFO *pckOut,                       // (IN)
                UINT *cbActualWrite,            // (OUT)
                MMIOINFO *pmmioinfoOut          // (IN)
                )
{
                
        
        int                     nError;
        UINT            cT;

        nError = 0;
        
        *cbActualWrite = 0;

        for (cT=0; cT < cbWrite; cT++)
                {       
                if (pmmioinfoOut->pchNext == pmmioinfoOut->pchEndWrite)
                {
                pmmioinfoOut->dwFlags |= MMIO_DIRTY;
                if ((nError = mmioAdvance(hmmioOut, pmmioinfoOut, MMIO_WRITE)) != 0)
                                {
                    goto ERROR_CANNOT_WRITE;
                                }
                }
                *((BYTE*)pmmioinfoOut->pchNext) = *((BYTE*)pbSrc+cT);
				(*((BYTE*)pmmioinfoOut->pchNext))++;
                (*cbActualWrite)++;
                }
        
        
ERROR_CANNOT_WRITE:
        // What to do here?  Well, for now, nothing, just return that error.  (maybe delete the
        // file later?

        return(nError);

}



/*      This routine will close a wave file used for writing.  Returns 0 if successful, else
        the error code.
        phmmioOut       - Pointer to mmio handle for saving.
        pckOut          - Pointer to the MMCKINFO for saving.
        pckOutRiff      - Pointer to the riff MMCKINFO for saving.
        pmmioinfoOut- Pointer to mmioinfo for saving.
        cSamples        - # of samples saved, for the fact chunk.  For PCM, this isn't used but
                                  will be written anyway, so this can be zero as long as programs ignore
                                  this field when they load PCM formats.



*/
int WaveCloseWriteFile(
                        HMMIO *phmmioOut,               // (IN)
                        MMCKINFO *pckOut,               // (IN)
                        MMCKINFO *pckOutRIFF,   // (IN)
                        MMIOINFO *pmmioinfoOut, // (IN)
                        DWORD cSamples                  // (IN)
                        )
{
                
        int                     nError;                         
                                                                
        nError = 0;

        if (*phmmioOut == NULL)
                return(0);

        pmmioinfoOut->dwFlags |= MMIO_DIRTY;
    if ((nError = mmioSetInfo(*phmmioOut, pmmioinfoOut, 0)) != 0)
                {
                // cannot flush, probably...
        goto ERROR_CANNOT_WRITE;                                
                }

         /* Ascend the output file out of the 'data' chunk -- this will cause
     * the chunk size of the 'data' chunk to be written.
     */
    if ((nError = mmioAscend(*phmmioOut, pckOut, 0)) != 0)
        goto ERROR_CANNOT_WRITE;    // cannot write file, probably


        // Do this here instead...
        if ((nError = mmioAscend(*phmmioOut, pckOutRIFF, 0)) != 0)
        goto ERROR_CANNOT_WRITE;    // cannot write file, probably


        nError = mmioSeek(*phmmioOut, 0, SEEK_SET);
        if ((nError = (int)mmioDescend(*phmmioOut, pckOutRIFF, NULL, 0)) != 0)
                {
                goto ERROR_CANNOT_WRITE;
                }

        nError = 0;
        pckOut->ckid = mmioFOURCC('f', 'a', 'c', 't');
        if ((nError = mmioDescend(*phmmioOut, pckOut, pckOutRIFF, MMIO_FINDCHUNK)) == 0)
                {
                // If it didn't fail, write the fact chunk out, if it failed, not critical, just
                // assert (below).
            nError = mmioWrite(*phmmioOut, (HPSTR)&cSamples, sizeof(DWORD));
                nError = mmioAscend(*phmmioOut, pckOut, 0); 
                nError = 0;
                }
        else 
                {
                nError = 0;
                Assert(FALSE);
                }

// CANTWRITEFACT:
    /* Ascend the output file out of the 'RIFF' chunk -- this will cause
     * the chunk size of the 'RIFF' chunk to be written.
     */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美午夜免费电影| 欧美情侣在线播放| 欧美妇女性影城| 国产精品乱码人人做人人爱| 日韩精品一二区| 不卡在线视频中文字幕| 日韩一区二区免费高清| 国产精品黄色在线观看| 国产高清无密码一区二区三区| 欧美精选在线播放| 亚洲精品一卡二卡| 国产夫妻精品视频| 欧美大白屁股肥臀xxxxxx| 亚洲国产你懂的| 91在线免费看| 国产精品毛片高清在线完整版| 美腿丝袜亚洲一区| 欧美电影一区二区三区| 亚洲免费av高清| 91免费看片在线观看| 中文字幕免费在线观看视频一区| 蜜臀久久久99精品久久久久久| 欧美在线观看视频在线| 亚洲日本丝袜连裤袜办公室| 成人久久视频在线观看| 久久久久亚洲综合| 国产麻豆精品theporn| 精品免费视频.| 久久精品噜噜噜成人av农村| 日韩视频免费观看高清完整版| 午夜精品福利在线| 欧美精品18+| 日韩激情在线观看| 6080午夜不卡| 美女视频第一区二区三区免费观看网站| 在线免费观看视频一区| 亚洲精品成人a在线观看| 欧美主播一区二区三区美女| 亚洲欧美偷拍卡通变态| 色成人在线视频| 亚洲综合一二区| 欧美群妇大交群中文字幕| 偷窥国产亚洲免费视频| 4438x亚洲最大成人网| 奇米在线7777在线精品 | 成人免费视频在线观看| 91色|porny| 伊人夜夜躁av伊人久久| 欧美日韩精品欧美日韩精品一| 偷窥少妇高潮呻吟av久久免费| 欧美一级午夜免费电影| 国产综合色产在线精品| 国产精品三级在线观看| 欧美中文字幕一区二区三区亚洲| 天天操天天干天天综合网| 日韩一区二区三区免费看| 国产麻豆精品视频| 亚洲欧美日韩久久精品| 欧美日韩一区二区三区视频| 毛片av一区二区三区| 国产偷v国产偷v亚洲高清| 91麻豆精品一区二区三区| 亚洲高清三级视频| 久久精品亚洲麻豆av一区二区| 成人黄色软件下载| 亚洲成a人片综合在线| 欧美电影免费观看高清完整版在线观看| 国产精品69久久久久水密桃| 亚洲精品自拍动漫在线| 欧美刺激午夜性久久久久久久| 9久草视频在线视频精品| 视频一区在线播放| 欧美高清在线视频| 欧美久久久久久蜜桃| 色婷婷激情久久| 老司机午夜精品99久久| 中文字幕中文字幕一区| 678五月天丁香亚洲综合网| 成人福利视频网站| 日韩高清国产一区在线| 国产精品剧情在线亚洲| 欧美一区二区精品久久911| k8久久久一区二区三区| 另类成人小视频在线| 一区二区三区不卡视频在线观看 | 一区二区三区日韩欧美| 精品久久久久久久人人人人传媒| 91小宝寻花一区二区三区| 久久精品国产99久久6| 国产精品一二一区| 9191久久久久久久久久久| 国产老肥熟一区二区三区| 亚洲高清在线精品| 亚洲丝袜精品丝袜在线| 国产婷婷色一区二区三区在线| 欧美精品在线观看一区二区| 不卡视频在线观看| 国产一区二区三区在线观看免费视频| 亚洲成人av中文| 一区在线中文字幕| 久久精品夜色噜噜亚洲aⅴ| 欧美mv日韩mv国产网站| 3atv一区二区三区| 67194成人在线观看| 欧美综合色免费| 欧美伊人久久大香线蕉综合69 | 日韩av在线播放中文字幕| 一区二区三区在线视频观看| 中日韩免费视频中文字幕| 久久久精品一品道一区| 日韩欧美中文字幕公布| 7777精品伊人久久久大香线蕉最新版| 日本高清不卡一区| 91久久精品一区二区三| 99久久久精品| www..com久久爱| av网站免费线看精品| 风间由美一区二区三区在线观看| 国产精品一卡二卡在线观看| 国产精品一级在线| 成人av资源在线观看| 99久久精品一区二区| 色婷婷亚洲一区二区三区| 色综合天天综合网天天狠天天| 91在线国产观看| 欧美性欧美巨大黑白大战| 欧美私模裸体表演在线观看| 精品视频免费在线| 欧美一区二区免费视频| 日韩欧美成人午夜| 国产亚洲精品bt天堂精选| 中文字幕欧美激情一区| 亚洲精品国产视频| 婷婷综合久久一区二区三区| 久久se精品一区二区| 成人动漫一区二区三区| 91麻豆国产福利在线观看| 欧美网站大全在线观看| 欧美成人精品二区三区99精品| 久久久美女毛片| 日韩一区欧美一区| 丝袜脚交一区二区| 国产一区二区三区视频在线播放| 成人性视频免费网站| 欧美亚洲一区二区三区四区| 91精品国产免费| 欧美激情艳妇裸体舞| 亚洲成人av资源| 国产成a人亚洲精| 欧美手机在线视频| 久久亚洲综合色| 亚洲一区二区三区影院| 久99久精品视频免费观看| 成人精品gif动图一区| 欧美日韩高清一区二区| 久久精品视频在线免费观看 | 8v天堂国产在线一区二区| 精品国产髙清在线看国产毛片| 国产精品久久久一区麻豆最新章节| 亚洲一区av在线| 风间由美一区二区三区在线观看| 欧美日韩精品一区二区三区| 久久久99精品免费观看| 亚洲国产欧美另类丝袜| 成人午夜激情在线| 这里只有精品99re| 亚洲欧美视频一区| 大胆欧美人体老妇| 日韩欧美aaaaaa| 亚洲妇熟xx妇色黄| a4yy欧美一区二区三区| 久久精品无码一区二区三区| 奇米777欧美一区二区| 色一情一伦一子一伦一区| 亚洲国产精品99久久久久久久久 | 麻豆91精品91久久久的内涵| 色拍拍在线精品视频8848| 国产欧美日韩精品a在线观看| 日本亚洲三级在线| 欧美特级限制片免费在线观看| 18成人在线视频| 成人福利在线看| 国产蜜臀av在线一区二区三区| 日本午夜精品一区二区三区电影| 色哟哟国产精品免费观看| 中文字幕一区二区三区精华液 | av在线播放不卡| 精品国产一二三区| 亚洲福利一区二区三区| 色素色在线综合| 国产精品嫩草影院com| 日本va欧美va欧美va精品| 欧美一二三在线| 亚洲国产乱码最新视频 | 国产成人精品三级麻豆| 在线观看91av| 亚洲欧美国产77777| 91影视在线播放| 中文字幕中文字幕一区| 国产精品香蕉一区二区三区|