Ignore:
Timestamp:
Mar 23, 2001, 5:23:47 PM (24 years ago)
Author:
sandervl
Message:

Rewrite for DirectAudio interface

File:
1 edited

Legend:

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

    r5348 r5358  
    1 /* $Id: waveout.cpp,v 1.19 2001-03-21 12:33:22 sandervl Exp $ */
     1/* $Id: waveout.cpp,v 1.20 2001-03-23 16:23:45 sandervl Exp $ */
    22//#undef DEBUG
    33/*
     
    2727#include <unicode.h>
    2828
    29 #include "dwaveout.h"
     29#include "waveoutdart.h"
    3030#include "misc.h"
    3131#include "winmm.h"
     
    6767        return(MMSYSERR_INVALPARAM);
    6868
    69   if(fdwOpen == CALLBACK_WINDOW) {
    70         *phwo = (HWAVEOUT)new DartWaveOut(pwfx, (HWND)dwCallback);
    71   }
    72   else
    73   if(fdwOpen == CALLBACK_FUNCTION)
    74   {
    75         *phwo = (HWAVEOUT)new DartWaveOut(pwfx, dwCallback, dwInstance);
    76   }
    77   else  *phwo = (HWAVEOUT)new DartWaveOut(pwfx);
     69  *phwo = (HWAVEOUT)new DartWaveOut(pwfx, fdwOpen, dwCallback, dwInstance);
    7870
    7971  if(*phwo == NULL) {
     
    8173  }
    8274
    83   rc = ((DartWaveOut *)*phwo)->getError();
     75  rc = ((WaveOut *)*phwo)->getError();
    8476  if(rc != MMSYSERR_NOERROR) {
    85         delete (DartWaveOut *)*phwo;
     77        delete (WaveOut *)*phwo;
    8678        return(rc);
    8779  }
     
    9587              UINT, cbwh)
    9688{
    97   DartWaveOut *dwave = (DartWaveOut *)hwo;
    98 
    99   if(DartWaveOut::find(dwave) == TRUE)
     89  WaveOut *dwave = (WaveOut *)hwo;
     90
     91  if(WaveOut::find(dwave) == TRUE)
    10092  {
    10193        if(!(pwh->dwFlags & WHDR_PREPARED) || pwh->lpData == NULL)
     
    118110              HWAVEOUT, hwaveout)
    119111{
    120   DartWaveOut *dwave = (DartWaveOut *)hwaveout;
    121 
    122   if(DartWaveOut::find(dwave) == TRUE)
     112  WaveOut *dwave = (WaveOut *)hwaveout;
     113
     114  if(WaveOut::find(dwave) == TRUE)
    123115        return(dwave->reset());
    124116  else  return(MMSYSERR_INVALHANDLE);
     
    129121              HWAVEOUT, hwaveout)
    130122{
    131   DartWaveOut *dwave = (DartWaveOut *)hwaveout;
     123  WaveOut *dwave = (WaveOut *)hwaveout;
    132124
    133125  dprintf(("WINMM:waveOutBreakLoop (implemented as reset) %X\n", hwaveout));
    134   if(DartWaveOut::find(dwave) == TRUE)
     126  if(WaveOut::find(dwave) == TRUE)
    135127        return(dwave->reset());
    136128  else  return(MMSYSERR_INVALHANDLE);
     
    141133              HWAVEOUT, hwaveout)
    142134{
    143   DartWaveOut *dwave = (DartWaveOut *)hwaveout;
    144 
    145   if(DartWaveOut::find(dwave) == TRUE)
     135  WaveOut *dwave = (WaveOut *)hwaveout;
     136
     137  if(WaveOut::find(dwave) == TRUE)
    146138  {
    147139        if(dwave->getState() == STATE_PLAYING)
     
    158150              HWAVEOUT, hwaveout)
    159151{
    160   DartWaveOut *dwave = (DartWaveOut *)hwaveout;
    161 
    162   if(DartWaveOut::find(dwave) == TRUE)
     152  WaveOut *dwave = (WaveOut *)hwaveout;
     153
     154  if(WaveOut::find(dwave) == TRUE)
    163155        return(dwave->pause());
    164156  else  return(MMSYSERR_INVALHANDLE);
     
    169161              HWAVEOUT, hwaveout)
    170162{
    171   DartWaveOut *dwave = (DartWaveOut *)hwaveout;
    172 
    173   if(DartWaveOut::find(dwave) == TRUE)
     163  WaveOut *dwave = (WaveOut *)hwaveout;
     164
     165  if(WaveOut::find(dwave) == TRUE)
    174166        return(dwave->restart());
    175167  else  return(MMSYSERR_INVALHANDLE);
     
    182174              UINT, cbwh)
    183175{
    184   DartWaveOut *dwave = (DartWaveOut *)hwo;
    185 
    186   if(DartWaveOut::find(dwave) == TRUE)
     176  WaveOut *dwave = (WaveOut *)hwo;
     177
     178  if(WaveOut::find(dwave) == TRUE)
    187179  {
    188180        if(pwh->dwFlags & WHDR_INQUEUE)
     
    203195              UINT, cbwh)
    204196{
    205   DartWaveOut *dwave = (DartWaveOut *)hwo;
    206 
    207   if(DartWaveOut::find(dwave) == TRUE)
     197  WaveOut *dwave = (WaveOut *)hwo;
     198
     199  if(WaveOut::find(dwave) == TRUE)
    208200  {
    209201        if(pwh->dwFlags & WHDR_INQUEUE)
     
    223215              UINT, cbmmt)
    224216{
    225   DartWaveOut *dwave = (DartWaveOut *)hwo;
     217  WaveOut *dwave = (WaveOut *)hwo;
    226218
    227219  if(pmmt == NULL)
    228220        return MMSYSERR_INVALPARAM;
    229221
    230   if(DartWaveOut::find(dwave) == TRUE)
     222  if(WaveOut::find(dwave) == TRUE)
    231223  {
    232224   ULONG position;
     
    278270              UINT, cbwoc)
    279271{
    280   if(DartWaveOut::getNumDevices() == 0) {
     272  if(WaveOut::getNumDevices() == 0) {
    281273        memset(pwoc, 0, sizeof(*pwoc));
    282274        return MMSYSERR_NODRIVER;
     
    308300              UINT, cbwoc)
    309301{
    310   if(DartWaveOut::getNumDevices() == 0) {
     302  if(WaveOut::getNumDevices() == 0) {
    311303        memset(pwoc, 0, sizeof(*pwoc));
    312304        return MMSYSERR_NODRIVER;
     
    334326ODINFUNCTION0(UINT, waveOutGetNumDevs)
    335327{
    336   return DartWaveOut::getNumDevices();
     328  return WaveOut::getNumDevices();
    337329}
    338330/******************************************************************************/
     
    380372              LPUINT, puDeviceID)
    381373{
    382   DartWaveOut *dwave = (DartWaveOut *)hwo;
    383   if(DartWaveOut::find(dwave) == TRUE)
     374  WaveOut *dwave = (WaveOut *)hwo;
     375  if(WaveOut::find(dwave) == TRUE)
    384376  {
    385377        *puDeviceID = 1;
     
    394386              LPDWORD, pdwPitch)
    395387{
    396   DartWaveOut *dwave = (DartWaveOut *)hwo;
    397   if(DartWaveOut::find(dwave) == TRUE)
     388  WaveOut *dwave = (WaveOut *)hwo;
     389  if(WaveOut::find(dwave) == TRUE)
    398390        return MMSYSERR_NOTSUPPORTED;
    399391  else  return(MMSYSERR_INVALHANDLE);
     
    405397              DWORD, dwPitch)
    406398{
    407   DartWaveOut *dwave = (DartWaveOut *)hwo;
    408   if(DartWaveOut::find(dwave) == TRUE)
     399  WaveOut *dwave = (WaveOut *)hwo;
     400  if(WaveOut::find(dwave) == TRUE)
    409401        return MMSYSERR_NOTSUPPORTED;
    410402  else  return(MMSYSERR_INVALHANDLE);
     
    416408              LPDWORD, pdwVolume)
    417409{
    418   DartWaveOut *dwave = (DartWaveOut *)hwo;
    419   if(DartWaveOut::find(dwave) == TRUE)
     410  WaveOut *dwave = (WaveOut *)hwo;
     411  if(WaveOut::find(dwave) == TRUE)
    420412  {
    421413        if(pdwVolume!=NULL)
     
    433425              DWORD, dwVolume)
    434426{
    435   DartWaveOut *dwave = (DartWaveOut *)hwo;
    436   if(DartWaveOut::find(dwave) == TRUE)
     427  WaveOut *dwave = (WaveOut *)hwo;
     428  if(WaveOut::find(dwave) == TRUE)
    437429  {
    438430    return(dwave->setVolume(dwVolume));
    439431  }
    440432  if(hwo == NULL) {
    441     DartWaveOut::setDefaultVolume(dwVolume);
     433      WaveOut::setDefaultVolume(dwVolume);
    442434  }
    443435  return MMSYSERR_NOERROR;
     
    450442              LPDWORD, pdwRate)
    451443{
    452   DartWaveOut *dwave = (DartWaveOut *)hwo;
    453   if(DartWaveOut::find(dwave) == TRUE)
     444  WaveOut *dwave = (WaveOut *)hwo;
     445  if(WaveOut::find(dwave) == TRUE)
    454446  {
    455447        return MMSYSERR_NOTSUPPORTED;
     
    463455              DWORD, dwRate)
    464456{
    465   DartWaveOut *dwave = (DartWaveOut *)hwo;
    466   if(DartWaveOut::find(dwave) == TRUE)
     457  WaveOut *dwave = (WaveOut *)hwo;
     458  if(WaveOut::find(dwave) == TRUE)
    467459  {
    468460        return MMSYSERR_NOTSUPPORTED;
     
    478470              DWORD, dw2)
    479471{
    480   DartWaveOut *dwave = (DartWaveOut *)hwo;
    481   if(DartWaveOut::find(dwave) == TRUE)
     472  WaveOut *dwave = (WaveOut *)hwo;
     473  if(WaveOut::find(dwave) == TRUE)
    482474  {
    483475    return MMSYSERR_NOTSUPPORTED;
Note: See TracChangeset for help on using the changeset viewer.