index == 3 corresponds to Alt-Gr + Shift.
[wine] / include / multimedia.h
1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
2
3 /*****************************************************************************
4  * Copyright 1998, Luiz Otavio L. Zorzella
5  *
6  * File:      multimedia.h
7  * Purpose:   multimedia declarations
8  *
9  *****************************************************************************
10  */
11 #ifndef __WINE_MULTIMEDIA_H 
12 #define __WINE_MULTIMEDIA_H
13
14 #include "mmsystem.h"
15
16 #define MAX_MIDIINDRV   (16)
17 /* For now I'm making 16 the maximum number of midi devices one can
18  * have. This should be more than enough for everybody. But as a purist,
19  * I intend to make it unbounded in the future, as soon as I figure
20  * a good way to do so.
21  */
22 #define MAX_MIDIOUTDRV  (16)
23
24 #if defined(HAVE_SYS_SOUNDCARD_H)
25 # include <sys/soundcard.h>
26 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
27 # include <machine/soundcard.h>
28 #elif defined(HAVE_SOUNDCARD_H)
29 # include <soundcard.h>
30 #endif
31
32 #include <sys/errno.h>
33
34 #ifdef HAVE_OSS
35 #define MIDI_SEQ "/dev/sequencer"
36 #else
37 #define MIDI_DEV "/dev/midi"
38 #endif
39
40 #ifdef SOUND_VERSION
41 #define IOCTL(a,b,c)            ioctl(a,b,&c)
42 #else
43 #define IOCTL(a,b,c)            (c = ioctl(a,b,c))
44 #endif
45
46 typedef struct {
47         HDRVR16                 hDrv;
48         DRIVERPROC16            driverProc;
49         MCI_OPEN_DRIVER_PARMS16 modp;
50         MCI_OPEN_PARMS16        mop;
51         DWORD                   dwPrivate;
52         YIELDPROC               lpfnYieldProc;
53         DWORD                   dwYieldData;
54         BOOL                    bIs32;
55         HTASK16                 hCreatorTask;
56 } WINE_MCIDRIVER;
57
58 extern WINE_MCIDRIVER mciDrv[MAXMCIDRIVERS];
59
60 #define WINE_MMTHREAD_CREATED   0x4153494C      /* "BSIL" */
61 #define WINE_MMTHREAD_DELETED   0xDEADDEAD
62
63 typedef struct {
64        DWORD                    dwSignature;            /* 00 "BSIL" when ok, 0xDEADDEAD when being deleted */
65        DWORD                    dwCounter;              /* 04 */
66        HANDLE                   hThread;                /* 08 hThread */
67        DWORD                    dwThreadId;             /* 0C */
68        FARPROC16                fpThread;               /* 10 segmented address of thread proc */
69        DWORD                    dwThreadPmt;            /* 14 parameter to be called upon thread creation */
70        DWORD                    dwUnknown3;             /* 18 increment interlocked ? */
71        DWORD                    hEvent;                 /* 1C event */
72        DWORD                    dwUnknown5;             /* 20 */
73        DWORD                    dwStatus;               /* 24 0, 10, 20, 30 */
74        DWORD                    dwFlags;                /* 28 dwFlags upon creation */
75        HANDLE16                 hTask;                  /* 2C handle to created task */
76 } WINE_MMTHREAD;
77
78 #define MCI_GetDrv(wDevID)      (&mciDrv[MCI_DevIDToIndex(wDevID)])
79 #define MCI_GetOpenDrv(wDevID)  (&(MCI_GetDrv(wDevID)->mop))
80
81 /* function prototypes */
82 extern BOOL MULTIMEDIA_Init(void);
83
84 extern int                      MCI_DevIDToIndex(UINT16 wDevID);
85 extern UINT16                   MCI_FirstDevID(void);
86 extern UINT16                   MCI_NextDevID(UINT16 wDevID);
87 extern BOOL                     MCI_DevIDValid(UINT16 wDevID);
88
89 extern int                      MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam);
90 extern int                      MCI_UnMapMsg16To32A(WORD uDevTyp, WORD wMsg, DWORD lParam);
91
92 extern DWORD                    MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSA lpParms);
93 extern DWORD                    MCI_Close(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms);
94 extern DWORD                    MCI_SysInfo(UINT uDevID, DWORD dwFlags, LPMCI_SYSINFO_PARMSA lpParms);
95
96 typedef LONG                    (*MCIPROC16)(DWORD, HDRVR16,  WORD, DWORD, DWORD);
97 typedef LONG                    (*MCIPROC)(DWORD, HDRVR16, DWORD, DWORD, DWORD);
98
99 extern WORD                     MCI_GetDevType(LPCSTR str);
100 extern DWORD                    MCI_WriteString(LPSTR lpDstStr, DWORD dstSize, LPCSTR lpSrcStr);
101 extern const char*              MCI_CommandToString(UINT16 wMsg);
102
103 extern int                      mciInstalledCount;
104 extern int                      mciInstalledListLen;
105 extern LPSTR                    lpmciInstallNames;
106
107 extern UINT16                   MCI_DefYieldProc(UINT16 wDevID, DWORD data);
108
109 typedef struct {
110     WORD        uDevType;
111     char*       lpstrName;
112     MCIPROC     lpfnProc;
113 } MCI_WineDesc;
114
115 extern  MCI_WineDesc            MCI_InternalDescriptors[];
116
117 extern LRESULT                  MCI_CleanUp(LRESULT dwRet, UINT wMsg, DWORD dwParam2, BOOL bIs32);
118
119 extern DWORD                    MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2);
120 extern DWORD                    MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2, UINT size);
121
122 LONG                            MCIWAVE_DriverProc(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg, 
123                                                    DWORD dwParam1, DWORD dwParam2);
124 LONG                            MCIMIDI_DriverProc(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg, 
125                                                    DWORD dwParam1, DWORD dwParam2);
126 LONG                            MCICDAUDIO_DriverProc(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg, 
127                                                       DWORD dwParam1, DWORD dwParam2);
128 LONG                            MCIANIM_DriverProc(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg, 
129                                                    DWORD dwParam1, DWORD dwParam2);
130 LONG                            MCIAVI_DriverProc(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg, 
131                                                   DWORD dwParam1, DWORD dwParam2);
132
133 #endif /* __WINE_MULTIMEDIA_H */