1 /* PROJECT:         ReactOS sndrec32
2  * LICENSE:         GPL - See COPYING in the top level directory
3  * FILE:            base/applications/sndrec32/sndrec32.h
4  * PURPOSE:         Sound recording
5  * PROGRAMMERS:     Marco Pagliaricci (irc: rendar)
6  */
7 
8 #pragma once
9 
10 #include "resource.h"
11 #include "audio_api.hpp"
12 
13 #define MAX_LOADSTRING 100
14 
15 #define MAINWINDOW_W 350
16 #define MAINWINDOW_H 190
17 
18 #define CONTROLS_CX 10
19 
20 #define INITIAL_BUFREC_SECONDS 30.0f
21 
22 #define BUTSTART_ID 0
23 #define BUTEND_ID 1
24 #define BUTPLAY_ID 2
25 #define BUTSTOP_ID 3
26 #define BUTREC_ID 4
27 #define SLIDER_ID 5
28 #define WAVEBAR_ID 6
29 
30 #define BUTTONS_H 30
31 #define BUTTONS_W 60
32 #define BUTTONS_CY 100
33 #define BUTTONS_CX (CONTROLS_CX)
34 #define BUTTONS_SPACE 5
35 
36 #define SLIDER_CX CONTROLS_CX
37 #define SLIDER_CY 65
38 #define SLIDER_H 30
39 #define SLIDER_W 320
40 
41 #define STRPOS_X 240
42 #define STRPOS_Y 5
43 
44 #define STRDUR_X (STRPOS_X)
45 #define STRDUR_Y (STRPOS_Y + 13)
46 
47 #define STRBUF_X (STRDUR_X)
48 #define STRBUF_Y (STRDUR_Y + 13)
49 
50 #define STRFMT_X 10
51 #define STRFMT_Y (STRPOS_Y)
52 
53 #define STRCHAN_X (STRFMT_X)
54 #define STRCHAN_Y (STRFMT_Y + 13)
55 
56 #define WAVEBAR_X (CONTROLS_CX + 90)
57 #define WAVEBAR_Y (STRPOS_Y)
58 #define WAVEBAR_CX 130
59 #define WAVEBAR_CY 50
60 
61 #define WAVEBAR_TIMERID 2
62 #define WAVEBAR_TIMERTIME 80
63 
64 #define WAVEBAR_COLOR (RGB(0, 0, 255))
65 
66 #define REFRESHA_X (STRPOS_X)
67 #define REFRESHA_Y (STRPOS_Y)
68 #define REFRESHA_CX (REFRESHA_X + 100)
69 #define REFRESHA_CY (REFRESHA_Y + 55)
70 
71 #define REFRESHB_X (STRFMT_X)
72 #define REFRESHB_Y (STRFMT_Y)
73 #define REFRESHB_CX (REFRESHB_X + 85)
74 #define REFRESHB_CY (REFRESHB_Y + 55)
75 
76 struct riff_hdr
77 {
78     DWORD magic;
79     DWORD chunksize;
80     DWORD format;
81 };
82 
83 struct wave_hdr
84 {
85     DWORD Subchunkid;
86     DWORD Subchunk1Size;
87     WORD AudioFormat;
88     WORD NumChannels;
89     DWORD SampleRate;
90     DWORD ByteRate;
91     WORD BlockAlign;
92     WORD BitsPerSample;
93 };
94 
95 struct data_chunk
96 {
97     DWORD subc;
98     DWORD subc_size;
99     //unsigned char data[];
100 };
101 
102 /* Functions prototypes */
103 
104 LRESULT CALLBACK Buttons_proc(HWND, UINT, WPARAM, LPARAM);
105 
106 BOOL write_wav(TCHAR *);
107 BOOL open_wav(TCHAR *);
108 VOID enable_but(DWORD);
109 VOID disable_but(DWORD);
110 
111 void l_play_finished(void);
112 void l_audio_arrival(unsigned int);
113 void l_buffer_resized(unsigned int);
114