Debian Codegraph @

components/output/waveout/waveout.h

raw symbols SCIP
1 /* BoCA - BonkEnc Component Architecture
2 * Copyright (C) 2007-2017 Robert Kausch <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation, either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
10 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
12
13 #include <boca.h>
14 #include <windows.h>
15
16 BoCA_BEGIN_COMPONENT(OutputWaveOut)
17
18 namespace BoCA
19 {
20 class OutputWaveOut : public CS::OutputComponent
21 {
22 private:
23 HWAVEOUT hWaveOut;
24 Array<WAVEHDR *, Void *> headers;
25
26 Threads::Thread *thread;
27 Bool stop;
28
29 CRITICAL_SECTION sync;
30
31 HANDLE hEvent;
32 char *buffer;
33 UINT buf_size, buf_size_used;
34 UINT data_written, write_ptr;
35 UINT minblock, maxblock, avgblock;
36 DWORD last_time;
37 DWORD p_time;
38
39 UINT n_playing;
40 Bool paused;
41 Bool needplay;
42 Bool newpause;
43
44 Void WorkerThread();
45 public:
46 static const String &GetComponentSpecs();
47
48 OutputWaveOut();
49 ~OutputWaveOut();
50
51 Bool Activate();
52 Bool Deactivate();
53
54 Int WriteData(Buffer<UnsignedByte> &);
55
56 Int CanWrite();
57
58 Int SetPause(Bool);
59 Bool IsPlaying();
60 };
61 };
62
63 BoCA_DEFINE_OUTPUT_COMPONENT(OutputWaveOut)
64
65 BoCA_END_COMPONENT(OutputWaveOut)