Changeset 5358 for trunk/src


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

Rewrite for DirectAudio interface

Location:
trunk/src/winmm
Files:
11 added
4 deleted
6 edited

Legend:

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

    r5334 r5358  
    1 /* $Id: dbglocal.cpp,v 1.4 2001-03-19 19:28:37 sandervl Exp $ */
     1/* $Id: dbglocal.cpp,v 1.5 2001-03-23 16:23:42 sandervl Exp $ */
    22
    33/*
     
    2323"os2timer",
    2424"waveout",
    25 "dwaveout",
     25"waveoutdart",
    2626"time",
    2727"wavein",
     
    4040"joyos2",
    4141"resource",
    42 "dwavein"
     42"waveindart",
     43"waveoutdaud",
     44"waveoutbase",
     45"waveinoutbase"
    4346};
    4447//******************************************************************************
  • trunk/src/winmm/dbglocal.h

    r5334 r5358  
    1 /* $Id: dbglocal.h,v 1.4 2001-03-19 19:28:38 sandervl Exp $ */
     1/* $Id: dbglocal.h,v 1.5 2001-03-23 16:23:42 sandervl Exp $ */
    22
    33/*
     
    2222#define DBG_os2timer        0
    2323#define DBG_waveout         1
    24 #define DBG_dwaveout        2
     24#define DBG_waveoutdart     2
    2525#define DBG_time            3
    2626#define DBG_wavein          4
     
    3939#define DBG_joyos2          17
    4040#define DBG_resource        18
    41 #define DBG_dwavein         19
    42 #define DBG_MAXFILES        20
     41#define DBG_waveindart      19
     42#define DBG_waveoutdaud     20
     43#define DBG_waveoutbase     21
     44#define DBG_waveinoutbase   22
     45#define DBG_MAXFILES        23
    4346
    4447extern USHORT DbgEnabled[DBG_MAXFILES];
  • trunk/src/winmm/mixer.cpp

    r5090 r5358  
    1 /* $Id: mixer.cpp,v 1.8 2001-02-11 10:33:29 sandervl Exp $ */
     1/* $Id: mixer.cpp,v 1.9 2001-03-23 16:23:44 sandervl Exp $ */
    22
    33/*
     
    3030#include <misc.h>
    3131
    32 #include "dwaveout.h"
     32#include "waveoutdart.h"
    3333#include "winmm.h"
    3434
  • trunk/src/winmm/os2timer.cpp

    r4480 r5358  
    1 /* $Id: os2timer.cpp,v 1.17 2000-10-10 21:28:56 sandervl Exp $ */
     1/* $Id: os2timer.cpp,v 1.18 2001-03-23 16:23:44 sandervl Exp $ */
    22
    33/*
     
    2222#include <process.h>
    2323#include <win32type.h>
     24#include <win32api.h>
    2425#include <wprocess.h>
    2526#include <misc.h>
     
    3536 * Structures                                                               *
    3637 ****************************************************************************/
    37 
    38 
    39 /***********************************
    40  * PH: fixups for missing os2win.h *
    41  ***********************************/
    42 
    43 extern "C"
    44 {
    45   typedef DWORD (* CALLBACK LPTHREAD_START_ROUTINE)(LPVOID);
    46  
    47   DWORD WIN32API GetLastError();
    48  
    49   HANDLE WIN32API CreateThread(LPSECURITY_ATTRIBUTES lpsa,
    50                                DWORD cbStack,
    51                                LPTHREAD_START_ROUTINE lpStartAddr,
    52                                LPVOID lpvThreadParm,
    53                                DWORD fdwCreate,
    54                                LPDWORD lpIDThread);
    55  
    56   VOID WIN32API ExitThread(DWORD dwExitCode);
    57  
    58   BOOL WIN32API TerminateThread(HANDLE hThread,
    59                                 DWORD dwExitCode);
    60  
    61   BOOL WIN32API SetEvent   (HANDLE hEvent);
    62    
    63   BOOL WIN32API PulseEvent (HANDLE hEvent);
    64    
    65 }
     38 
    6639
    6740/****************************************************************************
     
    6942 ****************************************************************************/
    7043
    71 static DWORD _System TimerHlpHandler(LPVOID timer);
     44static DWORD WIN32API TimerHlpHandler(LPVOID timer);
    7245
    7346
     
    282255  hTimerThread = CreateThread(NULL,
    283256                              0x4000,
    284                               (LPTHREAD_START_ROUTINE)TimerHlpHandler,
     257                              TimerHlpHandler,
    285258                              (LPVOID)this,
    286259                              0, // thread creation flags
     
    476449//******************************************************************************
    477450//******************************************************************************
    478 //static void _Optlink TimerHlpHandler(void *timer)
    479 static DWORD _System TimerHlpHandler(LPVOID timer)
     451static DWORD WIN32API TimerHlpHandler(LPVOID timer)
    480452{
    481453  ((OS2Timer *)timer)->TimerHandler();
    482454
    483   //_endthread(); isn't really required
    484455  return 0;
    485456}
  • trunk/src/winmm/wavein.cpp

    r5334 r5358  
    1 /* $Id: wavein.cpp,v 1.8 2001-03-19 19:28:38 sandervl Exp $ */
     1/* $Id: wavein.cpp,v 1.9 2001-03-23 16:23:44 sandervl Exp $ */
    22
    33/*
     
    2828
    2929#include "winmm.h"
    30 #include "dwavein.h"
     30#include "waveindart.h"
    3131
    3232#define DBG_LOCALLOG    DBG_wavein
     
    4848  MMRESULT rc;
    4949
    50   if(pwfx == NULL)
     50    if(pwfx == NULL)
    5151        return(WAVERR_BADFORMAT);
    5252
    53   if(fdwOpen == WAVE_FORMAT_QUERY) {
     53    if(fdwOpen == WAVE_FORMAT_QUERY) {
    5454        if(DartWaveIn::queryFormat(pwfx->wFormatTag, pwfx->nChannels, pwfx->nSamplesPerSec,
    5555                                   pwfx->wBitsPerSample) == TRUE) {
     
    5757        }
    5858        else    return(WAVERR_BADFORMAT);
    59   }
    60 
    61   if(phwi == NULL)
     59    }
     60
     61    if(phwi == NULL)
    6262        return(MMSYSERR_INVALPARAM);
    6363
    64   if(fdwOpen == CALLBACK_WINDOW) {
    65         *phwi = (HWAVEOUT)new DartWaveIn(pwfx, (HWND)dwCallback);
    66   }
    67   else
    68   if(fdwOpen == CALLBACK_FUNCTION)
    69   {
    70         *phwi = (HWAVEOUT)new DartWaveIn(pwfx, dwCallback, dwInstance);
    71   }
    72   else  *phwi = (HWAVEOUT)new DartWaveIn(pwfx);
    73 
    74   if(*phwi == NULL) {
     64    *phwi = (HWAVEOUT)new DartWaveIn(pwfx, fdwOpen, dwCallback, dwInstance);
     65
     66    if(*phwi == NULL) {
    7567        return(MMSYSERR_NODRIVER);
    76   }
    77 
    78   rc = ((DartWaveIn *)*phwi)->getError();
    79   if(rc != MMSYSERR_NOERROR) {
     68    }
     69
     70    rc = ((DartWaveIn *)*phwi)->getError();
     71    if(rc != MMSYSERR_NOERROR) {
    8072        delete (DartWaveIn *)*phwi;
    8173        return(rc);
    82   }
    83   return(MMSYSERR_NOERROR);
     74    }
     75    return(MMSYSERR_NOERROR);
    8476}
    8577/******************************************************************************/
  • 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.