ReactOS 0.4.16-dev-258-g81860b4
sndrec32.cpp File Reference
#include "stdafx.h"
#include <commctrl.h>
#include <commdlg.h>
#include <winnls.h>
#include "sndrec32.h"
#include "shellapi.h"
Include dependency graph for sndrec32.cpp:

Go to the source code of this file.

Macros

#define gprintf   _snprintf
 

Functions

ATOM MyRegisterClass (HINSTANCE hInstance)
 
ATOM MyRegisterClass_wave (HINSTANCE hInstance)
 
BOOL InitInstance (HINSTANCE, int)
 
BOOL InitInstance_wave (HWND, HINSTANCE, int)
 
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM)
 
LRESULT CALLBACK WndProc_wave (HWND, UINT, WPARAM, LPARAM)
 
int APIENTRY _tWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
 
void l_play_finished (void)
 
void l_audio_arrival (unsigned int samples_arrival)
 
void l_buffer_resized (unsigned int new_size)
 
VOID enable_but (DWORD id)
 
VOID disable_but (DWORD id)
 
BOOL open_wav (TCHAR *f)
 
BOOL write_wav (TCHAR *f)
 

Variables

HINSTANCE hInst
 
TCHAR szTitle [MAX_LOADSTRING]
 
TCHAR szWindowClass [MAX_LOADSTRING]
 
BOOL win_first
 
BOOL wout_first
 
HWND main_win
 
HWND wave_win
 
HWND slider
 
HWND buttons [5]
 
HBITMAP butbmps [5]
 
HBITMAP butbmps_dis [5]
 
WNDPROC buttons_std_proc
 
BOOL butdisabled [5]
 
BOOL stopped_flag
 
BOOL isnew
 
BOOL display_dur
 
DWORD slider_pos
 
WORD slider_min
 
WORD slider_max
 
DWORD samples_max
 
OPENFILENAME ofn
 
TCHAR file_path [MAX_PATH]
 
TCHAR str_pos [MAX_LOADSTRING]
 
TCHAR str_dur [MAX_LOADSTRING]
 
TCHAR str_buf [MAX_LOADSTRING]
 
TCHAR str_fmt [MAX_LOADSTRING]
 
TCHAR str_chan [MAX_LOADSTRING]
 
TCHAR str_mono [10]
 
TCHAR str_stereo [10]
 
BOOL path_set
 
snd::audio_membuffer * AUD_BUF
 
snd::audio_waveout * AUD_OUT
 
snd::audio_wavein * AUD_IN
 
BOOL s_recording
 
NONCLIENTMETRICS s_info
 
RECT text_rect
 
RECT text2_rect
 
RECT cli
 

Macro Definition Documentation

◆ gprintf

#define gprintf   _snprintf

Definition at line 19 of file sndrec32.cpp.

Function Documentation

◆ _tWinMain()

int APIENTRY _tWinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPTSTR  lpCmdLine,
int  nCmdShow 
)

Definition at line 83 of file sndrec32.cpp.

87{
88 UNREFERENCED_PARAMETER(hPrevInstance);
89 UNREFERENCED_PARAMETER(lpCmdLine);
90
91 MSG msg;
92 HACCEL hAccelTable;
93
94 s_info.cbSize = sizeof( NONCLIENTMETRICS );
95
97
99 {
102 break;
103
104 default:
105 break;
106 }
107
109
114
119
120 /* Retrieving default system font, and others system informations */
121 SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
122 sizeof(NONCLIENTMETRICS),
123 &s_info,
124 0);
125
126 /* Set font size */
127 s_info.lfMenuFont.lfHeight = 14;
128
129 /* Inits buttons bitmaps */
130
136
142
143 /* Inits audio devices and buffers */
144
145 snd::audio_membuffer AUD_buffer(snd::A44100_16BIT_STEREO);
146 snd::audio_waveout AUD_waveout(snd::A44100_16BIT_STEREO, AUD_buffer);
147 snd::audio_wavein AUD_wavein(snd::A44100_16BIT_STEREO, AUD_buffer);
148
149 AUD_buffer.play_finished = l_play_finished;
150 AUD_buffer.audio_arrival = l_audio_arrival;
151 AUD_buffer.buffer_resized = l_buffer_resized;
152
153 AUD_buffer.alloc_seconds(INITIAL_BUFREC_SECONDS);
154
155 AUD_IN = &AUD_wavein;
156 AUD_OUT = &AUD_waveout;
157 AUD_BUF = &AUD_buffer;
158
159 /* Inits slider default parameters */
160
161 slider_pos = 0;
162 slider_min = 0;
164
166 path_set = FALSE;
167 isnew = TRUE;
169
170 samples_max = AUD_buffer.total_samples();
171
172 s_recording = false;
173
174 /* Inits strings */
184
185 /* Registers sndrec32 window class */
188
189 if (!InitInstance(hInstance, nCmdShow))
190 {
191 MessageBox(0, TEXT("CreateWindow() Error!"), TEXT("ERROR"), MB_ICONERROR);
192 return FALSE;
193 }
194
195 /* Loads key accelerators */
197
198 /* Starts main loop */
199 while (GetMessage(&msg, NULL, 0, 0))
200 {
201 if (!TranslateAccelerator(main_win, hAccelTable, &msg))
202 {
205 }
206 }
207
208 if (wout_first)
209 {
210 AUD_waveout.close();
211 }
212
213 if (win_first)
214 {
215 AUD_wavein.close();
216 }
217
218 AUD_buffer.clear();
219
220 return (int)msg.wParam;
221}
#define msg(x)
Definition: auth_time.c:54
#define IDS_APP_TITLE
Definition: resource.h:10
#define IDS_STRCHAN
Definition: resource.h:38
#define IDS_STRBUF
Definition: resource.h:33
#define IDC_REACTOS_SNDREC32
Definition: resource.h:13
#define IDS_STRSTEREO
Definition: resource.h:36
#define IDB_BITMAP2_END_DIS
Definition: resource.h:26
#define IDS_STRFMT
Definition: resource.h:34
#define IDB_BITMAP2_PLAY_DIS
Definition: resource.h:27
#define IDS_STRMONO
Definition: resource.h:35
#define IDB_BITMAP2_STOP_DIS
Definition: resource.h:4
#define IDS_STRPOS
Definition: resource.h:31
#define IDB_BITMAP2_REC
Definition: resource.h:22
#define IDB_BITMAP2_END
Definition: resource.h:19
#define IDS_STRDUR
Definition: resource.h:32
#define IDB_BITMAP2_START_DIS
Definition: resource.h:29
#define IDB_BITMAP2_STOP
Definition: resource.h:21
#define IDB_BITMAP2_START
Definition: resource.h:18
#define IDB_BITMAP2_PLAY
Definition: resource.h:20
#define IDB_BITMAP2_REC_DIS
Definition: resource.h:28
HINSTANCE hInstance
Definition: charmap.c:19
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:870
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LANGID WINAPI GetUserDefaultUILanguage(void)
Definition: locale.c:1375
#define MAX_LOADSTRING
Definition: fontview.h:3
#define TEXT(s)
Definition: k32.h:26
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LANG_HEBREW
Definition: nls.h:67
#define SUBLANG_DEFAULT
Definition: nls.h:168
TCHAR szTitle[MAX_LOADSTRING]
Definition: sndrec32.cpp:25
snd::audio_waveout * AUD_OUT
Definition: sndrec32.cpp:70
HWND main_win
Definition: sndrec32.cpp:37
RECT text_rect
Definition: sndrec32.cpp:77
BOOL stopped_flag
Definition: sndrec32.cpp:46
TCHAR str_dur[MAX_LOADSTRING]
Definition: sndrec32.cpp:59
TCHAR str_fmt[MAX_LOADSTRING]
Definition: sndrec32.cpp:61
TCHAR str_buf[MAX_LOADSTRING]
Definition: sndrec32.cpp:60
RECT text2_rect
Definition: sndrec32.cpp:78
TCHAR str_mono[10]
Definition: sndrec32.cpp:64
BOOL win_first
Definition: sndrec32.cpp:35
WORD slider_min
Definition: sndrec32.cpp:51
BOOL s_recording
Definition: sndrec32.cpp:73
BOOL InitInstance(HINSTANCE, int)
Definition: sndrec32.cpp:246
BOOL isnew
Definition: sndrec32.cpp:47
BOOL display_dur
Definition: sndrec32.cpp:48
snd::audio_wavein * AUD_IN
Definition: sndrec32.cpp:71
BOOL path_set
Definition: sndrec32.cpp:67
WORD slider_max
Definition: sndrec32.cpp:52
HBITMAP butbmps_dis[5]
Definition: sndrec32.cpp:42
snd::audio_membuffer * AUD_BUF
Definition: sndrec32.cpp:69
TCHAR str_pos[MAX_LOADSTRING]
Definition: sndrec32.cpp:58
NONCLIENTMETRICS s_info
Definition: sndrec32.cpp:75
TCHAR str_chan[MAX_LOADSTRING]
Definition: sndrec32.cpp:62
ATOM MyRegisterClass_wave(HINSTANCE hInstance)
Definition: sndrec32.cpp:277
ATOM MyRegisterClass(HINSTANCE hInstance)
Definition: sndrec32.cpp:224
TCHAR str_stereo[10]
Definition: sndrec32.cpp:65
TCHAR szWindowClass[MAX_LOADSTRING]
Definition: sndrec32.cpp:26
void l_buffer_resized(unsigned int new_size)
Definition: sndrec32.cpp:907
void l_play_finished(void)
Definition: sndrec32.cpp:890
DWORD slider_pos
Definition: sndrec32.cpp:50
BOOL wout_first
Definition: sndrec32.cpp:35
DWORD samples_max
Definition: sndrec32.cpp:54
void l_audio_arrival(unsigned int samples_arrival)
Definition: sndrec32.cpp:902
HBITMAP butbmps[5]
Definition: sndrec32.cpp:41
#define REFRESHB_X
Definition: sndrec32.h:71
#define INITIAL_BUFREC_SECONDS
Definition: sndrec32.h:20
#define SLIDER_W
Definition: sndrec32.h:39
#define REFRESHA_Y
Definition: sndrec32.h:67
#define REFRESHA_CX
Definition: sndrec32.h:68
#define REFRESHB_CY
Definition: sndrec32.h:74
#define REFRESHA_CY
Definition: sndrec32.h:69
#define REFRESHB_Y
Definition: sndrec32.h:72
#define REFRESHB_CX
Definition: sndrec32.h:73
#define REFRESHA_X
Definition: sndrec32.h:66
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
BOOL WINAPI SetProcessDefaultLayout(DWORD dwDefaultLayout)
Definition: window.c:1691
#define LAYOUT_RTL
Definition: wingdi.h:1371
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define LoadBitmap
Definition: winuser.h:5823
#define MB_ICONERROR
Definition: winuser.h:790
#define GetMessage
Definition: winuser.h:5802
#define LoadString
Definition: winuser.h:5831
#define MessageBox
Definition: winuser.h:5834
#define DispatchMessage
Definition: winuser.h:5777
#define SystemParametersInfo
Definition: winuser.h:5870
#define TranslateAccelerator
Definition: winuser.h:5872
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define LoadAccelerators
Definition: winuser.h:5822

◆ disable_but()

VOID disable_but ( DWORD  id)

Definition at line 917 of file sndrec32.cpp.

918{
921}
GLuint id
Definition: glext.h:5910
BOOL butdisabled[5]
Definition: sndrec32.cpp:45
HWND buttons[5]
Definition: sndrec32.cpp:40
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define IMAGE_BITMAP
Definition: winuser.h:211
#define BM_SETIMAGE
Definition: winuser.h:1925
#define SendMessage
Definition: winuser.h:5855

Referenced by WndProc().

◆ enable_but()

VOID enable_but ( DWORD  id)

Definition at line 911 of file sndrec32.cpp.

Referenced by l_play_finished(), open_wav(), and WndProc().

◆ InitInstance()

BOOL InitInstance ( HINSTANCE  hInstance,
int  nCmdShow 
)

Definition at line 246 of file sndrec32.cpp.

247{
248 HWND hWnd;
249
251
253 szTitle,
259 NULL,
260 NULL,
261 hInstance,
262 NULL);
263 if (!hWnd)
264 {
265 return FALSE;
266 }
267
268 ShowWindow(hWnd, nCmdShow);
270
271 main_win = hWnd;
272
273 return TRUE;
274}
HWND hWnd
Definition: settings.c:17
#define WS_CAPTION
Definition: pedump.c:624
#define WS_OVERLAPPED
Definition: pedump.c:615
#define WS_SYSMENU
Definition: pedump.c:629
#define WS_MINIMIZEBOX
Definition: pedump.c:631
HINSTANCE hInst
Definition: sndrec32.cpp:24
#define MAINWINDOW_H
Definition: sndrec32.h:16
#define MAINWINDOW_W
Definition: sndrec32.h:15
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define CreateWindow
Definition: winuser.h:5766
BOOL WINAPI UpdateWindow(_In_ HWND)
#define CW_USEDEFAULT
Definition: winuser.h:225

Referenced by _tWinMain().

◆ InitInstance_wave()

BOOL InitInstance_wave ( HWND  f,
HINSTANCE  hInstance,
int  nCmdShow 
)

Definition at line 299 of file sndrec32.cpp.

302{
303 HWND hWnd;
304
306
308 TEXT("sndrec32_wave"),
309 TEXT(""),
311 WAVEBAR_X,
312 WAVEBAR_Y,
315 f,
316 (HMENU)8,
317 hInstance,
318 0);
319
320 if (!hWnd )
321 {
322 return FALSE;
323 }
324
325 ShowWindow(hWnd, nCmdShow);
327
328 wave_win = hWnd;
329
330 return TRUE;
331}
GLfloat f
Definition: glext.h:7540
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
HWND wave_win
Definition: sndrec32.cpp:38
#define WAVEBAR_X
Definition: sndrec32.h:56
#define WAVEBAR_CY
Definition: sndrec32.h:59
#define WAVEBAR_Y
Definition: sndrec32.h:57
#define WAVEBAR_CX
Definition: sndrec32.h:58
#define CreateWindowEx
Definition: winuser.h:5767
#define WS_EX_STATICEDGE
Definition: winuser.h:403

Referenced by WndProc().

◆ l_audio_arrival()

void l_audio_arrival ( unsigned int  samples_arrival)

Definition at line 902 of file sndrec32.cpp.

903{
904 slider_pos += (DWORD)((slider_max * samples_arrival) / samples_max);
905}
#define DWORD
Definition: nt_native.h:44

Referenced by _tWinMain().

◆ l_buffer_resized()

void l_buffer_resized ( unsigned int  new_size)

Definition at line 907 of file sndrec32.cpp.

908{
909}

Referenced by _tWinMain().

◆ l_play_finished()

void l_play_finished ( void  )

Definition at line 890 of file sndrec32.cpp.

891{
892 stopped_flag = true;
893
898
900}
VOID enable_but(DWORD id)
Definition: sndrec32.cpp:911
#define BUTREC_ID
Definition: sndrec32.h:26
#define BUTPLAY_ID
Definition: sndrec32.h:24
#define BUTEND_ID
Definition: sndrec32.h:23
#define BUTSTART_ID
Definition: sndrec32.h:22
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

Referenced by _tWinMain().

◆ MyRegisterClass()

ATOM MyRegisterClass ( HINSTANCE  hInstance)

Definition at line 224 of file sndrec32.cpp.

225{
226 WNDCLASSEX wcex;
227
228 wcex.cbSize = sizeof(WNDCLASSEX);
229
230 wcex.style = CS_HREDRAW | CS_VREDRAW;
231 wcex.lpfnWndProc = WndProc;
232 wcex.cbClsExtra = 0;
233 wcex.cbWndExtra = 0;
234 wcex.hInstance = hInstance;
241
242 return RegisterClassEx(&wcex);
243}
#define IDR_MENU1
Definition: resource.h:6
#define IDI_SNDREC32
Definition: resource.h:11
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM)
Definition: sndrec32.cpp:422
int cbClsExtra
Definition: winuser.h:3207
HINSTANCE hInstance
Definition: winuser.h:3209
HCURSOR hCursor
Definition: winuser.h:3211
LPCSTR lpszMenuName
Definition: winuser.h:3213
HICON hIconSm
Definition: winuser.h:3215
UINT style
Definition: winuser.h:3205
int cbWndExtra
Definition: winuser.h:3208
UINT cbSize
Definition: winuser.h:3204
WNDPROC lpfnWndProc
Definition: winuser.h:3206
LPCSTR lpszClassName
Definition: winuser.h:3214
HICON hIcon
Definition: winuser.h:3210
HBRUSH hbrBackground
Definition: winuser.h:3212
#define CS_VREDRAW
Definition: winuser.h:658
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define CS_HREDRAW
Definition: winuser.h:653
#define IDC_ARROW
Definition: winuser.h:687
#define RegisterClassEx
Definition: winuser.h:5849
#define LoadIcon
Definition: winuser.h:5825
#define LoadCursor
Definition: winuser.h:5824
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5731
#define COLOR_BTNFACE
Definition: winuser.h:931

Referenced by _tWinMain().

◆ MyRegisterClass_wave()

ATOM MyRegisterClass_wave ( HINSTANCE  hInstance)

Definition at line 277 of file sndrec32.cpp.

278{
279 WNDCLASSEX wcex;
280
281 wcex.cbSize = sizeof(WNDCLASSEX);
282
283 wcex.style = CS_HREDRAW | CS_VREDRAW;
285 wcex.cbClsExtra = 0;
286 wcex.cbWndExtra = 0;
287 wcex.hInstance = hInstance;
288 wcex.hIcon = 0;
291 wcex.lpszMenuName = 0;
292 wcex.lpszClassName = TEXT("sndrec32_wave");
293 wcex.hIconSm = 0;
294
295 return RegisterClassEx(&wcex);
296}
LRESULT CALLBACK WndProc_wave(HWND, UINT, WPARAM, LPARAM)
Definition: sndrec32.cpp:335
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define BLACK_BRUSH
Definition: wingdi.h:896

Referenced by _tWinMain().

◆ open_wav()

BOOL open_wav ( TCHAR f)

Definition at line 923 of file sndrec32.cpp.

924{
925 HANDLE file;
926
927 riff_hdr r;
928 wave_hdr w;
930
931 BOOL b;
932
933 DWORD bytes_recorded_in_wav = 0;
934 DWORD is_read = 0;
935
936 file = CreateFile(f,
938 0,
939 0,
942 0);
943 if (!file)
944 {
946 TEXT("Cannot open file. CreateFile() error."),
947 TEXT("ERROR"),
949
950 return FALSE;
951 }
952
953 b = ReadFile(file, (LPVOID)&r, sizeof(r), &is_read, 0);
954 if (!b)
955 {
957 TEXT("Cannot read RIFF header."),
958 TEXT("ERROR"),
960
962 return FALSE;
963 }
964
965 b = ReadFile(file, (LPVOID)&w, sizeof(w), &is_read, 0);
966 if (!b)
967 {
969 TEXT("Cannot read WAVE header."),
970 TEXT("ERROR"),
972
974 return FALSE;
975 }
976
977 b = ReadFile(file, (LPVOID)&d, sizeof(d), &is_read, 0);
978 if (!b)
979 {
981 TEXT("Cannot read WAVE subchunk."),
982 TEXT("ERROR"),
984
986 return FALSE;
987 }
988
989 bytes_recorded_in_wav = r.chunksize - 36;
990 if (bytes_recorded_in_wav == 0)
991 {
993 TEXT("Cannot read file. No audio data."),
994 TEXT("ERROR"),
996
998 return FALSE;
999 }
1000
1001 snd::audio_format openfmt(w.SampleRate, w.BitsPerSample, w.NumChannels);
1002
1003 AUD_BUF->clear();
1004 AUD_BUF->alloc_bytes(bytes_recorded_in_wav);
1005
1006 b = ReadFile(file,
1007 (LPVOID)AUD_BUF->audio_buffer(),
1008 bytes_recorded_in_wav,
1009 &is_read,
1010 0);
1011
1012 AUD_BUF->set_b_received(bytes_recorded_in_wav);
1013
1014 if ((!b) || (is_read != bytes_recorded_in_wav))
1015 {
1017 TEXT("Cannot read file. Error reading audio data."),
1018 TEXT("ERROR"),
1020
1022
1023 AUD_BUF->reset();
1024 return FALSE;
1025 }
1026
1028
1034
1035 samples_max = AUD_BUF->samples_received();
1036
1037 isnew = FALSE;
1038
1039 return TRUE;
1040}
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define GENERIC_READ
Definition: compat.h:135
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
#define d
Definition: ke_i.h:81
#define b
Definition: ke_i.h:79
#define BUTSTOP_ID
Definition: sndrec32.h:25
Definition: fci.c:127
#define CreateFile
Definition: winbase.h:3774
#define MB_OK
Definition: winuser.h:793

Referenced by WndProc().

◆ WndProc()

LRESULT CALLBACK WndProc ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 422 of file sndrec32.cpp.

426{
427 int wmId;
428 TCHAR str_tmp[MAX_LOADSTRING];
429 PAINTSTRUCT ps;
430 HDC hdc;
431 HFONT font;
432 HFONT oldfont;
433 long long slid_samp = 0;
434 WCHAR szAppName[100];
435
436 /* Checking for global pointers to buffer and io audio devices */
437 if ((!AUD_IN) || (!AUD_OUT) || (!AUD_BUF))
438 {
439 MessageBox(0, TEXT("Buffer Error"), 0, 0);
440 return 1;
441 }
442
443 switch (message)
444 {
445 case WM_CREATE:
446 /* Creating the wave bar */
448 {
449 MessageBox(0, TEXT("InitInstance_wave() Error!"), TEXT("ERROR"), MB_ICONERROR);
450 return FALSE;
451 }
452
453 /* Creating ALL the buttons */
454 for (int i = 0; i < 5; ++i)
455 {
456 buttons[i] = CreateWindow(TEXT("button"),
457 TEXT(""),
459 BUTTONS_CX + (i * (BUTTONS_W + ((i == 0) ? 0 : BUTTONS_SPACE))),
461 BUTTONS_W,
462 BUTTONS_H,
463 hWnd,
465 hInst,
466 0);
467 if (!buttons[i])
468 {
469 MessageBox(0, 0, TEXT("CreateWindow() Error!"), 0);
470 return FALSE;
471 }
472
473 /* Realize the button bmp image */
476 disable_but(i);
477 }
478
479 /* Creating the SLIDER window */
481 TEXT(""),
483 SLIDER_CX,
484 SLIDER_CY,
485 SLIDER_W,
486 SLIDER_H,
487 hWnd,
489 hInst,
490 0);
491 if (!slider)
492 {
493 MessageBox(0, 0, TEXT( "CreateWindow() Error!" ), 0);
494 return FALSE;
495 }
496
497 /* Sets slider limits */
500 (WPARAM)TRUE,
502
506 break;
507
508 /* Implements slider logic */
509 case WM_HSCROLL:
510 {
511 switch (LOWORD(wParam))
512 {
513 case SB_ENDSCROLL:
514 break;
515 case SB_PAGERIGHT:
516 case SB_PAGELEFT:
517 case TB_THUMBTRACK:
518 /* If the user touch the slider bar, set the
519 audio start position properly */
521 slid_samp = (__int64)slider_pos * (__int64)samples_max;
522 AUD_BUF->set_position(AUD_BUF->audinfo().bytes_in_samples((unsigned int)(slid_samp / (__int64)slider_max)));
524 break;
525 }
526 break;
527 }
528
529 case WM_COMMAND:
530 wmId = LOWORD(wParam);
531 if ((wmId >= 0) && (wmId < 5) && (butdisabled[wmId] != FALSE))
532 break;
533
534 switch (wmId)
535 {
536 case ID_FILE_NEW:
537 if (!isnew)
538 {
539 if (AUD_IN->current_status() == snd::WAVEIN_RECORDING)
540 AUD_IN->stop_recording();
541
542 if ((AUD_OUT->current_status() == snd::WAVEOUT_PLAYING) ||
543 (AUD_OUT->current_status() == snd::WAVEOUT_PAUSED))
544 AUD_OUT->stop();
545
546 AUD_BUF->reset();
547
553
554 samples_max = AUD_BUF->total_samples();
555 slider_pos = 0;
556
558
561
562 isnew = TRUE;
564
566
568
571 }
572 break;
573
574 case ID_FILE_OPEN:
575 ZeroMemory(&ofn, sizeof(ofn));
576
577 ofn.lStructSize = sizeof(ofn);
579 ofn.lpstrFilter = TEXT("Audio Files (*.wav)\0*.wav\0All Files (*.*)\0*.*\0");
583 ofn.lpstrDefExt = TEXT("wav");
584
585 if (GetOpenFileName(&ofn))
586 {
590
592 }
593
596 break;
597
598 case ID_ABOUT:
602 break;
603
604 case ID_FILE_SAVEAS:
605 ZeroMemory(&ofn, sizeof(ofn));
606
607 ofn.lStructSize = sizeof(ofn);
608 ofn.hwndOwner = hWnd ;
610 ofn.lpstrFilter = TEXT("Audio Files (*.wav)\0*.wav\0All Files (*.*)\0*.*\0");
613
614 ofn.lpstrDefExt = TEXT("wav");
615
616 if (GetSaveFileName (&ofn))
617 {
620 }
621 break;
622
623
625 ShellExecute(NULL, NULL, _T("rundll32.exe"), _T("shell32.dll,Control_RunDLL mmsys.cpl,ShowAudioPropertySheet"), NULL, SW_SHOWNORMAL);
626 break;
627
628 case ID_FILE_EXIT:
630 break;
631
632 /* Sndrec32 buttons routines */
633 case BUTSTART_ID:
634 AUD_BUF->set_position_start();
635 slider_pos = 0;
637 break;
638
639 case BUTEND_ID:
641 break;
642
643 case BUTPLAY_ID:
644 if (wout_first == false)
645 {
646 AUD_OUT->open();
647 wout_first = true;
648 }
649
650 AUD_OUT->play();
651
656
657 SetTimer(hWnd, 1, 250, 0);
659
660 break;
661
662 case BUTSTOP_ID:
663 if (s_recording)
664 {
666
667 AUD_IN->stop_recording();
668
669 /* Resetting slider position */
670 slider_pos = 0;
672
673 samples_max = AUD_BUF->samples_received();
674
676
681
684
686
687 AUD_BUF->truncate();
688
691
692 }
693 else
694 {
695 AUD_OUT->pause();
696
701
702 }
703
704 KillTimer(hWnd, 1);
706
708
709 break;
710
711 case BUTREC_ID:
712 if (win_first == false)
713 {
714 AUD_IN->open();
715 win_first = true;
716 }
717
719
720 samples_max = AUD_BUF->total_samples();
721
722 AUD_IN->start_recording();
723
725
730
731 isnew = FALSE;
732
734
735 SetTimer(hWnd, 1, 150, 0);
737
738 break;
739
740 default:
742 }
743 break;
744
745 case WM_TIMER:
746 switch (wParam)
747 {
748 case 1:
749 if (stopped_flag)
750 {
751 KillTimer(hWnd, 1);
753 slider_pos = 0;
756 }
757
760 break;
761
762 case WAVEBAR_TIMERID:
765 break;
766 }
767 break;
768
769 case WM_PAINT:
770 hdc = BeginPaint(hWnd, &ps);
771 font = CreateFontIndirect(&s_info.lfMenuFont);
772 oldfont = (HFONT) SelectObject(hdc, font);
774
775 if (AUD_IN->current_status() == snd::WAVEIN_RECORDING)
776 {
777 gprintf(str_tmp,
779 str_pos,
780 (float)((float)AUD_BUF->bytes_recorded() / (float)AUD_BUF->audinfo().byte_rate()));
781
782 }
783 else if (AUD_OUT->current_status() == snd::WAVEOUT_PLAYING)
784 {
785 gprintf(str_tmp,
787 str_pos,
788 (float)((float)AUD_BUF->bytes_played() / (float)AUD_BUF->audinfo().byte_rate()));
789 }
790 else
791 {
792 gprintf(str_tmp,
794 str_pos,
795 (float)((((float)slider_pos * (float)samples_max) / (float)slider_max) / (float)AUD_BUF->audinfo().sample_rate()));
796 }
797
799 STRPOS_X,
800 STRPOS_Y,
801 0,
802 0,
803 str_tmp,
804 _tcslen(str_tmp),
805 0);
806
807 if (display_dur)
808 {
809 gprintf(str_tmp,
811 str_dur,
812 AUD_BUF->fseconds_total());
813 }
814 else
815 {
816 gprintf(str_tmp,
818 str_dur,
819 AUD_BUF->fseconds_recorded());
820 }
821
823 STRDUR_X,
824 STRDUR_Y,
825 0,
826 0,
827 str_tmp,
828 _tcslen(str_tmp),
829 0);
830
831 gprintf(str_tmp,
833 str_buf,
834 (float)((float)AUD_BUF->mem_size() / 1024.0f));
835
837 STRBUF_X,
838 STRBUF_Y,
839 0,
840 0,
841 str_tmp,
842 _tcslen(str_tmp),
843 0);
844
845 gprintf(str_tmp,
847 str_fmt,
848 (float)((float)AUD_BUF->audinfo().sample_rate() / 1000.0f),
849 AUD_BUF->audinfo().bits(),
850 AUD_BUF->audinfo().channels() == 2 ? str_mono : str_stereo);
851
853 STRFMT_X,
854 STRFMT_Y,
855 0,
856 0,
857 str_tmp,
858 _tcslen(str_tmp),
859 0);
860
861 gprintf(str_tmp,
863 str_chan,
864 AUD_BUF->audinfo().channels() == 2 ? str_stereo : str_mono);
865
867 STRCHAN_X,
868 STRCHAN_Y,
869 0,
870 0,
871 str_tmp,
872 _tcslen(str_tmp),
873 0);
874
875 SelectObject(hdc, oldfont);
877 EndPaint(hWnd, &ps);
878 break;
879
880 case WM_DESTROY:
882 break;
883 default:
885 }
886
887 return 0;
888}
#define IDI_REACTOS_SNDREC32
Definition: resource.h:9
#define ID_FILE_EXIT
Definition: resource.h:46
#define ID_FILE_OPEN
Definition: resource.h:41
#define ID_FILE_SAVEAS
Definition: resource.h:43
#define ID_FILE_NEW
Definition: resource.h:40
#define ID_FILE_SAVE
Definition: resource.h:42
#define ID_EDIT_AUDIOPROPS
Definition: resource.h:55
#define __int64
Definition: basetyps.h:16
#define ID_ABOUT
Definition: charmap.c:17
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define OFN_OVERWRITEPROMPT
Definition: commdlg.h:116
#define GetSaveFileName
Definition: commdlg.h:666
#define OFN_EXPLORER
Definition: commdlg.h:104
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
#define GetOpenFileName
Definition: commdlg.h:665
#define MAX_PATH
Definition: compat.h:34
#define UlongToPtr(u)
Definition: config.h:106
pKey DeleteObject()
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
Definition: mk_font.cpp:20
#define LOWORD(l)
Definition: pedump.c:82
#define TBM_GETPOS
Definition: commctrl.h:2036
#define TBS_HORZ
Definition: commctrl.h:2022
#define TBS_ENABLESELRANGE
Definition: commctrl.h:2029
#define TBM_SETRANGE
Definition: commctrl.h:2042
#define TB_THUMBTRACK
Definition: commctrl.h:2083
#define TBS_NOTICKS
Definition: commctrl.h:2028
#define TBM_SETPOS
Definition: commctrl.h:2041
#define TRACKBAR_CLASS
Definition: commctrl.h:2018
#define DefWindowProc
Definition: ros2win.h:31
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
#define ShellExecute
Definition: shellapi.h:693
BOOL InitInstance_wave(HWND, HINSTANCE, int)
Definition: sndrec32.cpp:299
BOOL write_wav(TCHAR *f)
Definition: sndrec32.cpp:1043
HWND slider
Definition: sndrec32.cpp:39
VOID disable_but(DWORD id)
Definition: sndrec32.cpp:917
OPENFILENAME ofn
Definition: sndrec32.cpp:56
BOOL open_wav(TCHAR *f)
Definition: sndrec32.cpp:923
#define gprintf
Definition: sndrec32.cpp:19
TCHAR file_path[MAX_PATH]
Definition: sndrec32.cpp:57
#define STRBUF_Y
Definition: sndrec32.h:48
#define BUTTONS_W
Definition: sndrec32.h:31
#define STRCHAN_Y
Definition: sndrec32.h:54
#define SLIDER_CY
Definition: sndrec32.h:37
#define SLIDER_CX
Definition: sndrec32.h:36
#define STRBUF_X
Definition: sndrec32.h:47
#define STRDUR_Y
Definition: sndrec32.h:45
#define WAVEBAR_TIMERID
Definition: sndrec32.h:61
#define STRFMT_Y
Definition: sndrec32.h:51
#define BUTTONS_CY
Definition: sndrec32.h:32
#define STRFMT_X
Definition: sndrec32.h:50
#define BUTTONS_CX
Definition: sndrec32.h:33
#define WAVEBAR_TIMERTIME
Definition: sndrec32.h:62
#define BUTTONS_SPACE
Definition: sndrec32.h:34
#define STRCHAN_X
Definition: sndrec32.h:53
#define STRPOS_X
Definition: sndrec32.h:41
#define SLIDER_ID
Definition: sndrec32.h:27
#define STRPOS_Y
Definition: sndrec32.h:42
#define STRDUR_X
Definition: sndrec32.h:44
#define SLIDER_H
Definition: sndrec32.h:38
#define BUTTONS_H
Definition: sndrec32.h:30
#define _countof(array)
Definition: sndvol32.h:70
TCHAR szAppName[128]
Definition: solitaire.cpp:18
Definition: tftpd.h:60
LPCSTR lpstrDefExt
Definition: commdlg.h:345
HWND hwndOwner
Definition: commdlg.h:330
LPSTR lpstrFile
Definition: commdlg.h:336
DWORD Flags
Definition: commdlg.h:342
DWORD lStructSize
Definition: commdlg.h:329
LPCSTR lpstrFilter
Definition: commdlg.h:332
DWORD nMaxFile
Definition: commdlg.h:337
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define _T(x)
Definition: vfdio.h:22
#define ZeroMemory
Definition: winbase.h:1737
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define TRANSPARENT
Definition: wingdi.h:950
#define ExtTextOut
Definition: wingdi.h:4454
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
#define CreateFontIndirect
Definition: wingdi.h:4444
#define SW_SHOWNORMAL
Definition: winuser.h:773
#define WM_PAINT
Definition: winuser.h:1623
#define BS_BITMAP
Definition: winuser.h:258
#define WM_HSCROLL
Definition: winuser.h:1746
#define WM_CREATE
Definition: winuser.h:1611
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define SB_PAGERIGHT
Definition: winuser.h:571
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_COMMAND
Definition: winuser.h:1743
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define MF_ENABLED
Definition: winuser.h:128
#define WM_TIMER
Definition: winuser.h:1745
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define WM_USER
Definition: winuser.h:1898
#define SB_ENDSCROLL
Definition: winuser.h:574
#define WM_DESTROY
Definition: winuser.h:1612
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2127
HMENU WINAPI GetMenu(_In_ HWND)
#define SB_PAGELEFT
Definition: winuser.h:570
#define MF_GRAYED
Definition: winuser.h:129
char TCHAR
Definition: xmlstorage.h:189
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _tcslen
Definition: xmlstorage.h:198

Referenced by MyRegisterClass().

◆ WndProc_wave()

LRESULT CALLBACK WndProc_wave ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 335 of file sndrec32.cpp.

339{
340 PAINTSTRUCT ps;
341 HDC hdc;
342 HPEN pen;
343 HPEN oldpen;
344
345 unsigned int max_h = (cli.bottom / 2);
346 unsigned int samples;
347 unsigned int x, line_h;
348
349 switch (message)
350 {
351 case WM_CREATE:
353 break;
354
355 case WM_PAINT:
356 /* Initialize hdc objects */
357 hdc = BeginPaint(hWnd, &ps);
358 pen = (HPEN)CreatePen(PS_SOLID, 1, WAVEBAR_COLOR);
359 oldpen = (HPEN) SelectObject(hdc, (HBRUSH)pen);
360 if (AUD_OUT->current_status() == snd::WAVEOUT_PLAYING)
361 {
362 samples = AUD_OUT->tot_samples_buf();
363 for (unsigned int i = 0; i < WAVEBAR_CX; ++i)
364 {
365 x = (i * samples) / WAVEBAR_CX;
366 line_h = (AUD_OUT->nsample(x) * max_h) / AUD_OUT->samplevalue_max();
367 if (line_h)
368 {
369 MoveToEx(hdc, i, max_h, 0);
370 LineTo(hdc, i, max_h - (line_h * 2));
371 LineTo(hdc, i, max_h + (line_h * 2));
372 }
373 else
374 {
375 SetPixel(hdc, i, max_h, WAVEBAR_COLOR);
376 }
377 }
378 }
379 else if (AUD_IN->current_status() == snd::WAVEIN_RECORDING)
380 {
381 samples = AUD_IN->tot_samples_buf();
382 for (unsigned int i = 0; i < WAVEBAR_CX; ++i)
383 {
384 x = (i * samples) / WAVEBAR_CX;
385 line_h = (AUD_IN->nsample(x) * max_h) / AUD_IN->samplevalue_max();
386 if (line_h)
387 {
388 MoveToEx(hdc, i, max_h, 0);
389 LineTo(hdc, i, max_h - (line_h * 2));
390 LineTo(hdc, i, max_h + (line_h * 2));
391 }
392 else
393 {
394 SetPixel( hdc, i, max_h, WAVEBAR_COLOR );
395 }
396 }
397 }
398 else
399 {
400 /* In standby mode draw a simple line */
401 MoveToEx(hdc, 0, cli.bottom / 2, 0);
403 }
404
405 SelectObject(hdc, oldpen);
406 DeleteObject( pen );
407 EndPaint( hWnd, &ps );
408 break;
409
410 case WM_USER:
411 break;
412
413 default:
415 }
416
417 return 0;
418}
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
Definition: arm.h:55
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLsizei samples
Definition: glext.h:7006
RECT cli
Definition: sndrec32.cpp:79
#define WAVEBAR_COLOR
Definition: sndrec32.h:64
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
#define PS_SOLID
Definition: wingdi.h:586
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

Referenced by MyRegisterClass_wave().

◆ write_wav()

BOOL write_wav ( TCHAR f)

Definition at line 1043 of file sndrec32.cpp.

1044{
1045 HANDLE file;
1046 DWORD written;
1047 BOOL is_writ;
1048 int i;
1049 riff_hdr r;
1050 wave_hdr w;
1051 data_chunk d;
1052
1054 if (!file)
1055 {
1057 TEXT("File already exist. Overwrite it?"),
1058 TEXT("Warning"),
1060
1061 if (i == IDYES)
1062 {
1064 if (!file)
1065 {
1067 TEXT("File Error, CreateFile() failed."),
1068 TEXT("ERROR"),
1070
1071 return FALSE;
1072 }
1073
1074 } else
1075 return FALSE;
1076 }
1077
1078 r.magic = 0x46464952;
1079 r.format = 0x45564157;
1080 r.chunksize = 36 + AUD_BUF->bytes_recorded();
1081
1082 w.Subchunkid = 0x20746d66;
1083 w.Subchunk1Size = 16;
1084 w.AudioFormat = 1;
1085 w.NumChannels = AUD_BUF->audinfo().channels();
1086 w.SampleRate = AUD_BUF->audinfo().sample_rate();
1087 w.ByteRate = AUD_BUF->audinfo().byte_rate();
1088 w.BlockAlign = AUD_BUF->audinfo().block_align();
1089 w.BitsPerSample = AUD_BUF->audinfo().bits();
1090
1091 d.subc = 0x61746164;
1092 d.subc_size = AUD_BUF->bytes_recorded();
1093
1094 /* Writing headers */
1095 is_writ = WriteFile(file, (LPCVOID)&r, sizeof(r), &written, 0);
1096 if (!is_writ)
1097 {
1099 TEXT("File Error, WriteFile() failed."),
1100 TEXT("ERROR"),
1102
1104 return FALSE;
1105 }
1106
1107 is_writ = WriteFile(file, (LPCVOID)&w, sizeof(w), &written, 0);
1108 if (!is_writ)
1109 {
1111 TEXT("File Error, WriteFile() failed."),
1112 TEXT("ERROR"),
1114
1116 return FALSE;
1117 }
1118
1119 is_writ = WriteFile(file, (LPCVOID)&d, sizeof(d), &written, 0);
1120 if (!is_writ)
1121 {
1123 TEXT("File Error, WriteFile() failed."),
1124 TEXT("ERROR"),
1126
1128 return FALSE;
1129 }
1130
1131 is_writ = WriteFile(file,
1132 (LPCVOID)AUD_BUF->audio_buffer(),
1133 AUD_BUF->bytes_recorded(),
1134 &written,
1135 0);
1136 if (!is_writ)
1137 {
1139 TEXT("File Error, WriteFile() failed."),
1140 TEXT("ERROR"),
1142
1144 return FALSE;
1145 }
1146
1148 return TRUE;
1149}
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define CREATE_ALWAYS
Definition: disk.h:72
#define CREATE_NEW
Definition: disk.h:69
#define GENERIC_WRITE
Definition: nt_native.h:90
CONST void * LPCVOID
Definition: windef.h:191
#define MB_YESNO
Definition: winuser.h:820
#define MB_ICONQUESTION
Definition: winuser.h:792
#define IDYES
Definition: winuser.h:838

Referenced by WndProc().

Variable Documentation

◆ AUD_BUF

snd::audio_membuffer* AUD_BUF

Definition at line 69 of file sndrec32.cpp.

Referenced by _tWinMain(), open_wav(), WndProc(), and write_wav().

◆ AUD_IN

snd::audio_wavein* AUD_IN

Definition at line 71 of file sndrec32.cpp.

Referenced by _tWinMain(), WndProc(), and WndProc_wave().

◆ AUD_OUT

snd::audio_waveout* AUD_OUT

Definition at line 70 of file sndrec32.cpp.

Referenced by _tWinMain(), WndProc(), and WndProc_wave().

◆ butbmps

HBITMAP butbmps[5]

Definition at line 41 of file sndrec32.cpp.

Referenced by _tWinMain(), enable_but(), and WndProc().

◆ butbmps_dis

HBITMAP butbmps_dis[5]

Definition at line 42 of file sndrec32.cpp.

Referenced by _tWinMain(), and disable_but().

◆ butdisabled

BOOL butdisabled[5]

Definition at line 45 of file sndrec32.cpp.

Referenced by disable_but(), enable_but(), and WndProc().

◆ buttons

◆ buttons_std_proc

WNDPROC buttons_std_proc

Definition at line 43 of file sndrec32.cpp.

◆ cli

RECT cli

Definition at line 79 of file sndrec32.cpp.

Referenced by WndProc_wave().

◆ display_dur

BOOL display_dur

Definition at line 48 of file sndrec32.cpp.

Referenced by _tWinMain(), and WndProc().

◆ file_path

◆ hInst

HINSTANCE hInst

Definition at line 24 of file sndrec32.cpp.

Referenced by InitInstance(), InitInstance_wave(), and WndProc().

◆ isnew

BOOL isnew

Definition at line 47 of file sndrec32.cpp.

Referenced by _tWinMain(), open_wav(), and WndProc().

◆ main_win

HWND main_win

Definition at line 37 of file sndrec32.cpp.

Referenced by _tWinMain(), InitInstance(), open_wav(), and write_wav().

◆ ofn

◆ path_set

BOOL path_set

Definition at line 67 of file sndrec32.cpp.

Referenced by _tWinMain().

◆ s_info

NONCLIENTMETRICS s_info

Definition at line 75 of file sndrec32.cpp.

Referenced by _tWinMain(), and WndProc().

◆ s_recording

BOOL s_recording

Definition at line 73 of file sndrec32.cpp.

Referenced by _tWinMain(), and WndProc().

◆ samples_max

DWORD samples_max

Definition at line 54 of file sndrec32.cpp.

Referenced by _tWinMain(), l_audio_arrival(), open_wav(), and WndProc().

◆ slider

HWND slider

Definition at line 39 of file sndrec32.cpp.

Referenced by BtrfsDeviceResize::DeviceResizeDlgProc(), and WndProc().

◆ slider_max

WORD slider_max

Definition at line 52 of file sndrec32.cpp.

Referenced by _tWinMain(), l_audio_arrival(), and WndProc().

◆ slider_min

WORD slider_min

Definition at line 51 of file sndrec32.cpp.

Referenced by _tWinMain(), and WndProc().

◆ slider_pos

DWORD slider_pos

Definition at line 50 of file sndrec32.cpp.

Referenced by _tWinMain(), l_audio_arrival(), and WndProc().

◆ stopped_flag

BOOL stopped_flag

Definition at line 46 of file sndrec32.cpp.

Referenced by _tWinMain(), l_play_finished(), and WndProc().

◆ str_buf

Definition at line 60 of file sndrec32.cpp.

Referenced by _tWinMain(), test_sorting(), testScreenBuffer(), and WndProc().

◆ str_chan

TCHAR str_chan[MAX_LOADSTRING]

Definition at line 62 of file sndrec32.cpp.

Referenced by _tWinMain(), and WndProc().

◆ str_dur

Definition at line 59 of file sndrec32.cpp.

Referenced by _tWinMain(), and WndProc().

◆ str_fmt

Definition at line 61 of file sndrec32.cpp.

Referenced by _tWinMain(), and WndProc().

◆ str_mono

TCHAR str_mono[10]

Definition at line 64 of file sndrec32.cpp.

Referenced by _tWinMain(), and WndProc().

◆ str_pos

Definition at line 58 of file sndrec32.cpp.

Referenced by _tWinMain(), and WndProc().

◆ str_stereo

TCHAR str_stereo[10]

Definition at line 65 of file sndrec32.cpp.

Referenced by _tWinMain(), and WndProc().

◆ szTitle

Definition at line 25 of file sndrec32.cpp.

Referenced by _tWinMain(), and InitInstance().

◆ szWindowClass

TCHAR szWindowClass[MAX_LOADSTRING]

Definition at line 26 of file sndrec32.cpp.

Referenced by _tWinMain(), InitInstance(), and MyRegisterClass().

◆ text2_rect

RECT text2_rect

Definition at line 78 of file sndrec32.cpp.

Referenced by _tWinMain(), and WndProc().

◆ text_rect

RECT text_rect

Definition at line 77 of file sndrec32.cpp.

Referenced by _tWinMain(), MONTHCAL_PaintTodayTitle(), and WndProc().

◆ wave_win

HWND wave_win

Definition at line 38 of file sndrec32.cpp.

Referenced by InitInstance_wave(), l_play_finished(), and WndProc().

◆ win_first

BOOL win_first

Definition at line 35 of file sndrec32.cpp.

Referenced by _tWinMain(), and WndProc().

◆ wout_first

BOOL wout_first

Definition at line 35 of file sndrec32.cpp.

Referenced by _tWinMain(), and WndProc().