Debian Codegraph @

include/engine/locking.h

raw symbols SCIP
1 /* fre:ac - free audio converter
2 * Copyright (C) 2001-2018 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 #ifndef H_FREAC_LOCKING
14 #define H_FREAC_LOCKING
15
16 #include <smooth.h>
17 #include <boca.h>
18
19 using namespace smooth;
20
21 namespace freac
22 {
23 class Locking
24 {
25 private:
26 static Int allocatedThreads;
27
28 static Array<Bool> deviceLocked;
29 static Array<Bool> outputLocked;
30
31 static Threads::Mutex managementMutex;
32 public:
33 static Bool AllocateThread();
34 static Bool FreeThread();
35
36 static Bool LockDeviceForTrack(const BoCA::Track &);
37 static Bool UnlockDeviceForTrack(const BoCA::Track &);
38
39 static Bool LockOutputForTrack(const BoCA::Track &);
40 static Bool UnlockOutputForTrack(const BoCA::Track &);
41 };
42 };
43
44 #endif