Files
gui/winport/include/mmsystem.h
T
Claude f354ab01d0 Build the Windows app for Linux and macOS over clang-retro MFC's Win32 layer
First pass: TCP and SSH. With -DDMODEM_GUI_WINPORT=ON and CLANG_RETRO_MFC
set to a clang-retro MFC checkout, winport/ builds libwinport.a with the
MFC Makefile, converts app.rc with res2cpp.py, and links the same Win32
sources (now listed once, in windows/sources.cmake) as dmodem-win32.

The layer does not have serial ports, pipes or audio yet: winport/include
and winport/src/stubs.cpp supply stand-ins that fail, to remove when the
layer gets these functions. DMODEM_WINPORT blocks in the app: the settings
in ~/.config/D-Modem, TCP as the default line, ~/.ssh and '/' for SSH,
Unicode marks in the path view (no Wingdings), and group boxes put under
the other controls (the layer's hit test stops at HTTRANSPARENT).

CI builds it on Linux and macOS, and on Linux starts it in Xvfb against
a test modem on the TCP port (winport/test/smoke.sh).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRhKGCaYUyYtH7Boap
2026-11-20 13:58:32 +00:00

78 lines
2.2 KiB
C

/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright (C) 2026 D-Modem Authors
*
* mmsystem.h - the part of the multimedia API that the app's sound
* (audio.cpp, voice.cpp) uses, which the Win32 layer does not
* have. First pass: the functions are in src/stubs.cpp and
* answer MMSYSERR_NODRIVER (no sound device).
*/
#ifndef DMODEM_WINPORT_MMSYSTEM_H
#define DMODEM_WINPORT_MMSYSTEM_H
#include <windows.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef UINT MMRESULT;
typedef struct dmodem_hwaveout *HWAVEOUT;
typedef struct dmodem_hwavein *HWAVEIN;
#define MMSYSERR_NOERROR 0
#define MMSYSERR_ERROR 1
#define MMSYSERR_BADDEVICEID 2
#define MMSYSERR_NODRIVER 6
#define WAVE_MAPPER ((UINT)-1)
#define CALLBACK_WINDOW 0x00010000L
#define MM_WOM_DONE 0x3BD
#define MM_WIM_DATA 0x3C0
#define WHDR_DONE 0x00000001
#define WHDR_PREPARED 0x00000002
#define WAVE_FORMAT_PCM 1
#pragma pack(push, 1)
typedef struct tWAVEFORMATEX {
WORD wFormatTag;
WORD nChannels;
DWORD nSamplesPerSec;
DWORD nAvgBytesPerSec;
WORD nBlockAlign;
WORD wBitsPerSample;
WORD cbSize;
} WAVEFORMATEX, *PWAVEFORMATEX, *LPWAVEFORMATEX;
#pragma pack(pop)
typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
typedef struct wavehdr_tag {
LPSTR lpData;
DWORD dwBufferLength;
DWORD dwBytesRecorded;
DWORD_PTR dwUser;
DWORD dwFlags;
DWORD dwLoops;
struct wavehdr_tag *lpNext;
DWORD_PTR reserved;
} WAVEHDR, *PWAVEHDR, *LPWAVEHDR;
MMRESULT WINAPI waveOutOpen(HWAVEOUT *, UINT, LPCWAVEFORMATEX, DWORD_PTR,
DWORD_PTR, DWORD);
MMRESULT WINAPI waveOutClose(HWAVEOUT);
MMRESULT WINAPI waveOutPrepareHeader(HWAVEOUT, LPWAVEHDR, UINT);
MMRESULT WINAPI waveOutUnprepareHeader(HWAVEOUT, LPWAVEHDR, UINT);
MMRESULT WINAPI waveOutWrite(HWAVEOUT, LPWAVEHDR, UINT);
MMRESULT WINAPI waveOutReset(HWAVEOUT);
MMRESULT WINAPI waveInOpen(HWAVEIN *, UINT, LPCWAVEFORMATEX, DWORD_PTR,
DWORD_PTR, DWORD);
MMRESULT WINAPI waveInClose(HWAVEIN);
MMRESULT WINAPI waveInPrepareHeader(HWAVEIN, LPWAVEHDR, UINT);
MMRESULT WINAPI waveInUnprepareHeader(HWAVEIN, LPWAVEHDR, UINT);
MMRESULT WINAPI waveInAddBuffer(HWAVEIN, LPWAVEHDR, UINT);
MMRESULT WINAPI waveInStart(HWAVEIN);
MMRESULT WINAPI waveInReset(HWAVEIN);
#ifdef __cplusplus
}
#endif
#endif