Ignore:
Timestamp:
Nov 27, 2010, 11:27:43 AM (15 years ago)
Author:
dmik
Message:

Get rid of dd_obj_base.h which duplicates obj_base.h creating unnecessary mess (symbol/define duplication) and conflicts when both the DDarw and other COM-related headers are included.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/dsound/OS2SNDBUFFER.CPP

    r5331 r21479  
    2121#include <string.h>
    2222
    23 #define INITGUID
     23#define CINTERFACE
    2424#include <dsound.h>
    2525
     
    5252   //This is the "normal" constructor
    5353   lpVtbl = &Vtbl;
    54    Vtbl.AddRef               = SoundBufAddRef;
    55    Vtbl.Release              = SoundBufRelease;
    56    Vtbl.QueryInterface       = SoundBufQueryInterface;
    57    Vtbl.GetCaps              = SoundBufGetCaps;
    58    Vtbl.GetFormat            = SoundBufGetFormat;
    59    Vtbl.GetVolume            = SoundBufGetVolume;
    60    Vtbl.GetStatus            = SoundBufGetStatus;
    61    Vtbl.GetCurrentPosition   = SoundBufGetCurrentPosition;
    62    Vtbl.GetPan               = SoundBufGetPan;
    63    Vtbl.GetFrequency         = SoundBufGetFrequency;
    64    Vtbl.Initialize           = SoundBufInitialize;
    65    Vtbl.Restore              = SoundBufRestore;
    66    Vtbl.SetFormat            = SoundBufSetFormat;
    67    Vtbl.SetVolume            = SoundBufSetVolume;
    68    Vtbl.SetCurrentPosition   = SoundBufSetCurrentPosition;
    69    Vtbl.SetPan               = SoundBufSetPan;
    70    Vtbl.SetFrequency         = SoundBufSetFrequency;
    71    Vtbl.Lock                 = SoundBufLock;
    72    Vtbl.Unlock               = SoundBufUnlock;
    73    Vtbl.Stop                 = SoundBufStop;
    74    Vtbl.Play                 = SoundBufPlay;
     54   Vtbl.fnAddRef               = SoundBufAddRef;
     55   Vtbl.fnRelease              = SoundBufRelease;
     56   Vtbl.fnQueryInterface       = SoundBufQueryInterface;
     57   Vtbl.fnGetCaps              = SoundBufGetCaps;
     58   Vtbl.fnGetFormat            = SoundBufGetFormat;
     59   Vtbl.fnGetVolume            = SoundBufGetVolume;
     60   Vtbl.fnGetStatus            = SoundBufGetStatus;
     61   Vtbl.fnGetCurrentPosition   = SoundBufGetCurrentPosition;
     62   Vtbl.fnGetPan               = SoundBufGetPan;
     63   Vtbl.fnGetFrequency         = SoundBufGetFrequency;
     64   Vtbl.fnInitialize           = SoundBufInitialize;
     65   Vtbl.fnRestore              = SoundBufRestore;
     66   Vtbl.fnSetFormat            = SoundBufSetFormat;
     67   Vtbl.fnSetVolume            = SoundBufSetVolume;
     68   Vtbl.fnSetCurrentPosition   = SoundBufSetCurrentPosition;
     69   Vtbl.fnSetPan               = SoundBufSetPan;
     70   Vtbl.fnSetFrequency         = SoundBufSetFrequency;
     71   Vtbl.fnLock                 = SoundBufLock;
     72   Vtbl.fnUnlock               = SoundBufUnlock;
     73   Vtbl.fnStop                 = SoundBufStop;
     74   Vtbl.fnPlay                 = SoundBufPlay;
    7575
    7676   dprintf(("DSOUND-OS2IDirectSoundBuffer::OS2IDirectSoundBuffer (buf=%X)", this));
     
    9494   // destroyed; moreover if the user didn't create  a primary buffer himself/herself,
    9595   // it will automatically get created and destroyed with the last secondary buffer
    96    primary->Vtbl.AddRef(primary);
     96   primary->Vtbl.fnAddRef(primary);
    9797
    9898   // Start playing the primary buffer
    9999   // TODO: only start playing the primary buffer when necessary!
    100    OS2IDirectSoundBuffer::primary->Vtbl.Play(OS2IDirectSoundBuffer::primary, 0, 0, DSBPLAY_LOOPING);
     100   OS2IDirectSoundBuffer::primary->Vtbl.fnPlay(OS2IDirectSoundBuffer::primary, 0, 0, DSBPLAY_LOOPING);
    101101
    102102   parentDS  = DSound;
     
    156156   //This is the constructor used for duplicating sound buffers
    157157   lpVtbl = &Vtbl;
    158    Vtbl.AddRef               = SoundBufAddRef;
    159    Vtbl.Release              = SoundBufRelease;
    160    Vtbl.QueryInterface       = SoundBufQueryInterface;
    161    Vtbl.GetCaps              = SoundBufGetCaps;
    162    Vtbl.GetFormat            = SoundBufGetFormat;
    163    Vtbl.GetVolume            = SoundBufGetVolume;
    164    Vtbl.GetStatus            = SoundBufGetStatus;
    165    Vtbl.GetCurrentPosition   = SoundBufGetCurrentPosition;
    166    Vtbl.GetPan               = SoundBufGetPan;
    167    Vtbl.GetFrequency         = SoundBufGetFrequency;
    168    Vtbl.Initialize           = SoundBufInitialize;
    169    Vtbl.Restore              = SoundBufRestore;
    170    Vtbl.SetFormat            = SoundBufSetFormat;
    171    Vtbl.SetVolume            = SoundBufSetVolume;
    172    Vtbl.SetCurrentPosition   = SoundBufSetCurrentPosition;
    173    Vtbl.SetPan               = SoundBufSetPan;
    174    Vtbl.SetFrequency         = SoundBufSetFrequency;
    175    Vtbl.Lock                 = SoundBufLock;
    176    Vtbl.Unlock               = SoundBufUnlock;
    177    Vtbl.Stop                 = SoundBufStop;
    178    Vtbl.Play                 = SoundBufPlay;
     158   Vtbl.fnAddRef               = SoundBufAddRef;
     159   Vtbl.fnRelease              = SoundBufRelease;
     160   Vtbl.fnQueryInterface       = SoundBufQueryInterface;
     161   Vtbl.fnGetCaps              = SoundBufGetCaps;
     162   Vtbl.fnGetFormat            = SoundBufGetFormat;
     163   Vtbl.fnGetVolume            = SoundBufGetVolume;
     164   Vtbl.fnGetStatus            = SoundBufGetStatus;
     165   Vtbl.fnGetCurrentPosition   = SoundBufGetCurrentPosition;
     166   Vtbl.fnGetPan               = SoundBufGetPan;
     167   Vtbl.fnGetFrequency         = SoundBufGetFrequency;
     168   Vtbl.fnInitialize           = SoundBufInitialize;
     169   Vtbl.fnRestore              = SoundBufRestore;
     170   Vtbl.fnSetFormat            = SoundBufSetFormat;
     171   Vtbl.fnSetVolume            = SoundBufSetVolume;
     172   Vtbl.fnSetCurrentPosition   = SoundBufSetCurrentPosition;
     173   Vtbl.fnSetPan               = SoundBufSetPan;
     174   Vtbl.fnSetFrequency         = SoundBufSetFrequency;
     175   Vtbl.fnLock                 = SoundBufLock;
     176   Vtbl.fnUnlock               = SoundBufUnlock;
     177   Vtbl.fnStop                 = SoundBufStop;
     178   Vtbl.fnPlay                 = SoundBufPlay;
    179179
    180180   dprintf(("DSOUND-OS2IDirectSoundBuffer::OS2IDirectSoundBuffer/Duplicate (buf=%X)", this));
     
    197197   // destroyed; moreover if the user didn't create  a primary buffer himself/herself,
    198198   // it will automatically get created and destroyed with the last secondary buffer
    199    primary->Vtbl.AddRef(primary);
     199   primary->Vtbl.fnAddRef(primary);
    200200
    201201   parentDS  = DSound;
     
    259259
    260260   // release the primary buffer too
    261    primary->Vtbl.Release(primary);
     261   primary->Vtbl.fnRelease(primary);
    262262
    263263   if (this == dsbroot)  // is this the first SoundBuffer?
     
    284284
    285285   if (primary != NULL)
    286       primary->Vtbl.Stop(primary);
     286      primary->Vtbl.fnStop(primary);
    287287
    288288   while (cur != NULL) {
     
    293293   dprintf(("DSOUND-OS2IDirectSoundBuffer::DestroyAllBuffers - %X", primary));
    294294   if (primary != NULL)
    295       primary->Vtbl.Release(primary);
     295      primary->Vtbl.fnRelease(primary);
    296296}
    297297
     
    306306   *ppvObj = NULL;
    307307
    308    if (IsEqualGUID(riid, IID_IDirectSoundBuffer)) {
     308   if (IsEqualGUID(riid, &IID_IDirectSoundBuffer)) {
    309309      *ppvObj = This;
    310310
     
    313313   }
    314314
    315    if (IsEqualGUID(riid, IID_IDirectSoundNotify)) {
     315   if (IsEqualGUID(riid, &IID_IDirectSoundNotify)) {
    316316      OS2IDirectSoundBuffer  *me     = (OS2IDirectSoundBuffer *)This;
    317317      OS2IDirectSoundNotify  *notify;
     
    319319      notify     = new OS2IDirectSoundNotify(me);
    320320      *ppvObj    = notify;
    321       notify->Vtbl.AddRef(notify);
     321      notify->Vtbl.fnAddRef(notify);
    322322      return DS_OK;
    323323   }
    324324
    325    if (IsEqualGUID(riid, IID_IDirectSound3DBuffer)) {
     325   if (IsEqualGUID(riid, &IID_IDirectSound3DBuffer)) {
    326326      OS2IDirectSoundBuffer   *me     = (OS2IDirectSoundBuffer *)This;
    327327      OS2IDirectSound3DBuffer *buffer3D;
     
    329329      buffer3D   = new OS2IDirectSound3DBuffer(me);
    330330      *ppvObj    = buffer3D;
    331       buffer3D->Vtbl.AddRef((IDirectSound3DBuffer *)buffer3D);
     331      buffer3D->Vtbl.fnAddRef((IDirectSound3DBuffer *)buffer3D);
    332332      return DS_OK;
    333333   }
Note: See TracChangeset for help on using the changeset viewer.