aboutsummaryrefslogtreecommitdiff
path: root/src/recorder.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-10-03 16:26:24 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-10-03 16:26:24 +0200
commitbb65f0fc2176b2ebf0f1be682008609e8bd2cb0a (patch)
treed0070ad2ef70b1a7c2ed77cec098d03402d0871f /src/recorder.h
parent920067622e7ba72dd6947eb8e7875719315872b9 (diff)
downloadosc-graphics-bb65f0fc2176b2ebf0f1be682008609e8bd2cb0a.tar.gz
simplified mutex locking idiom by introducing Mutex class (wrapper around SDL_mutex)
* can be instantiated * can derive from class Mutex to inherit the lock()/unlock() methods also fixed LayerList destructor
Diffstat (limited to 'src/recorder.h')
-rw-r--r--src/recorder.h18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/recorder.h b/src/recorder.h
index b2ee5e6..591312e 100644
--- a/src/recorder.h
+++ b/src/recorder.h
@@ -2,29 +2,15 @@
#define __RECORDER_H
#include <SDL.h>
-#include <SDL_thread.h>
#include <SDL/SDL_ffmpeg.h>
#include "osc_graphics.h"
-class Recorder {
+class Recorder : Mutex {
SDL_ffmpegFile *file;
- SDL_mutex *mutex;
-
- inline void
- lock()
- {
- SDL_LockMutex(mutex);
- }
- inline void
- unlock()
- {
- SDL_UnlockMutex(mutex);
- }
-
public:
- Recorder() : file(NULL), mutex(SDL_CreateMutex()) {}
+ Recorder() : Mutex(), file(NULL) {}
~Recorder();
void register_methods();