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/waveinoutbase.cpp

    r10269 r21358  
    1212 */
    1313
    14 
    15 /****************************************************************************
    16  * Includes                                                                 *
    17  ****************************************************************************/
    18 
    19 
     14/******************************************************************************/
     15// Includes
     16/******************************************************************************/
    2017
    2118#define  INCL_BASE
     
    3532#include "dbglocal.h"
    3633
    37 VMutex wavemutex;
     34/******************************************************************************/
     35/******************************************************************************/
     36
     37VMutex      wavemutex;
     38WaveInOut * WaveInOut::head = NULL;
    3839
    3940/******************************************************************************/
     
    4142WaveInOut::WaveInOut(LPWAVEFORMATEX pwfx, ULONG fdwOpen, ULONG nCallback, ULONG dwInstance)
    4243{
    43     next            = NULL;
    44     wavehdr         = NULL;
    45     curhdr          = NULL;
    46     ulError         = 0;
    47     State           = STATE_STOPPED;
    48     queuedbuffers   = 0;
    49 
    50     BitsPerSample   = pwfx->wBitsPerSample;
    51     SampleRate      = pwfx->nSamplesPerSec;
    52     this->nChannels = pwfx->nChannels;
     44    SampleRate    = pwfx->nSamplesPerSec;
     45    BitsPerSample = pwfx->wBitsPerSample;
     46    nChannels     = pwfx->nChannels;
     47    OpenFlags     = fdwOpen;
     48    Callback      = nCallback;
     49    Instance      = dwInstance;
     50    State         = STATE_STOPPED;
     51    queuedbuffers = 0;
     52    wavehdr       = NULL;
     53    next          = NULL;
    5354
    5455    dprintf(("WaveInOutOpen: samplerate %d, numChan %d bps %d (%d), format %x", SampleRate, nChannels, BitsPerSample, pwfx->nBlockAlign, pwfx->wFormatTag));
    55 
    56     State    = STATE_STOPPED;
    5756
    5857    wavemutex.enter();
     
    7069    }
    7170    wavemutex.leave();
    72 
    73     this->fdwOpen = fdwOpen;
    74     dwCallback    = nCallback;
    75     this->dwInstance = dwInstance;
    7671}
    7772/******************************************************************************/
     
    10196{
    10297    dprintf(("WINMM:WaveInOut::callback type %x, callback 0x%x (HDRVR h=%08xh, UINT uMessage=%08xh, DWORD dwUser=%08xh, DWORD dw1=%08xh, DWORD dw2=%08xh)",
    103              fdwOpen, dwCallback, this, uMessage, dwInstance, dw1, dw2));
     98             OpenFlags, Callback, this, uMessage, Instance, dw1, dw2));
    10499
    105     switch(fdwOpen & CALLBACK_TYPEMASK) {
     100    switch(OpenFlags & CALLBACK_TYPEMASK) {
    106101    case CALLBACK_WINDOW:
    107         PostMessageA((HWND)dwCallback, uMessage, (WPARAM)this, dw1);
     102        PostMessageA((HWND)Callback, uMessage, (WPARAM)this, dw1);
    108103        break;
    109104
    110105    case CALLBACK_TASK: // == CALLBACK_THREAD
    111         PostThreadMessageA(dwCallback, uMessage, (WPARAM)this, dw1);
     106        PostThreadMessageA(Callback, uMessage, (WPARAM)this, dw1);
    112107        break;
    113108
     
    116111        USHORT selTIB = GetFS(); // save current FS selector
    117112        USHORT selCallback;
    118         LPDRVCALLBACK mthdCallback = (LPDRVCALLBACK)dwCallback;
     113        LPDRVCALLBACK mthdCallback = (LPDRVCALLBACK)Callback;
    119114
    120115        if(selTIB == SELECTOR_OS2_FS) {
     
    130125            //@@@PH 1999/12/28 Shockwave Flash seem to make assumptions on a
    131126            // specific stack layout. Do we have the correct calling convention here?
    132             mthdCallback((HDRVR)this, uMessage, dwInstance, dw1, dw2);
     127            mthdCallback((HDRVR)this, uMessage, Instance, dw1, dw2);
    133128            SetFS(selTIB);           // switch back to the saved FS selector
    134129        }
     
    140135
    141136    case CALLBACK_EVENT:
    142         SetEvent((HANDLE)dwCallback);
     137        SetEvent((HANDLE)Callback);
    143138        break;
    144139
     
    147142
    148143    default:
    149         dprintf(("WARNING: Unknown callback type %x %x", fdwOpen, dwCallback));
     144        dprintf(("WARNING: Unknown callback type %x %x", OpenFlags, Callback));
    150145        break;
    151146    } //switch
     
    187182/******************************************************************************/
    188183/******************************************************************************/
    189 WaveInOut *WaveInOut::head = NULL;
    190184
Note: See TracChangeset for help on using the changeset viewer.