Ignore:
Timestamp:
Feb 22, 2010, 2:44:21 PM (16 years ago)
Author:
rlwalsh
Message:

add FlashWaveOut class to winmm - see Ticket #2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/winmm/waveout.cpp

    r10173 r21358  
    11/* $Id: waveout.cpp,v 1.27 2003-07-16 15:47:24 sandervl Exp $ */
    2 //#undef DEBUG
     2
    33/*
    44 * Wave out MM apis
     
    1313 */
    1414
    15 
    16 /****************************************************************************
    17  * Includes                                                                 *
    18  ****************************************************************************/
     15/******************************************************************************/
     16// Includes
     17/******************************************************************************/
    1918
    2019#include <os2win.h>
     
    2928#include "waveoutdart.h"
    3029#include "waveoutdaud.h"
     30#include "waveoutflash.h"
    3131#include "misc.h"
    3232#include "winmm.h"
     
    3636#include "dbglocal.h"
    3737
    38 
    3938/******************************************************************************/
    4039/******************************************************************************/
     
    4241                            DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen)
    4342{
    44   MMRESULT rc;
    45 
    46     if(fMMPMAvailable == FALSE) return MMSYSERR_NODRIVER;
    47 
    48     if(pwfx == NULL)
     43    MMRESULT rc;
     44
     45    if (fMMPMAvailable == FALSE)
     46        return MMSYSERR_NODRIVER;
     47
     48    if (pwfx == NULL)
    4949        return(WAVERR_BADFORMAT);
    5050
    51     if(fdwOpen & WAVE_FORMAT_QUERY)
    52     {
    53         if(DartWaveOut::queryFormat(pwfx->wFormatTag, pwfx->nChannels, pwfx->nSamplesPerSec,
    54                                     pwfx->wBitsPerSample) == TRUE) {
    55                 return(MMSYSERR_NOERROR);
    56         }
    57         else    return(WAVERR_BADFORMAT);
    58     }
    59 
    60     if(phwo == NULL)
     51    if (fdwOpen & WAVE_FORMAT_QUERY) {
     52        if (WaveOut::queryFormat(pwfx->wFormatTag, pwfx->nChannels,
     53                                pwfx->nSamplesPerSec,
     54                                 pwfx->wBitsPerSample) == TRUE) {
     55            return (MMSYSERR_NOERROR);
     56        }
     57        return (WAVERR_BADFORMAT);
     58    }
     59
     60    if (phwo == NULL)
    6161        return(MMSYSERR_INVALPARAM);
    6262
    63     if(DAudioWaveOut::isDirectAudioAvailable()) {
    64          *phwo = (HWAVEOUT)new DAudioWaveOut(pwfx, fdwOpen, dwCallback, dwInstance);
    65     }
    66     else *phwo = (HWAVEOUT)new DartWaveOut(pwfx, fdwOpen, dwCallback, dwInstance);
    67 
    68     if(*phwo == NULL) {
     63    if (ODIN_IsFlashAudioEnabled())
     64        *phwo = (HWAVEOUT)new FlashWaveOut(pwfx, fdwOpen, dwCallback, dwInstance);
     65    else
     66    if (DAudioWaveOut::isDirectAudioAvailable())
     67        *phwo = (HWAVEOUT)new DAudioWaveOut(pwfx, fdwOpen, dwCallback, dwInstance);
     68    else
     69        *phwo = (HWAVEOUT)new DartWaveOut(pwfx, fdwOpen, dwCallback, dwInstance);
     70
     71    if(*phwo == NULL)
    6972        return(MMSYSERR_NODRIVER);
    70     }
    71 
    72     rc = ((WaveOut *)*phwo)->getError();
    73     if(rc != MMSYSERR_NOERROR) {
     73
     74    rc = ((WaveOut *)*phwo)->open();
     75    if (rc != MMSYSERR_NOERROR)
    7476        delete (WaveOut *)*phwo;
    75         return(rc);
    76     }
    77     return(MMSYSERR_NOERROR);
     77
     78    return rc;
    7879}
    7980/******************************************************************************/
Note: See TracChangeset for help on using the changeset viewer.