2010-11-12 16:16:22 +01:00
|
|
|
#ifndef __BUFFER_H_
|
|
|
|
#define __BUFFER_H_
|
2010-11-12 21:37:12 +01:00
|
|
|
#include <string>
|
2010-11-12 16:16:22 +01:00
|
|
|
#include <glibmm.h>
|
|
|
|
#include "defines.h"
|
|
|
|
|
|
|
|
/* This is a threadsafe wrapper around the "frame_t" struct
|
|
|
|
which automates locking during get and set. */
|
|
|
|
|
2011-05-08 20:08:34 +02:00
|
|
|
/* TODO: add forced z value to buffer object so that we can override the
|
|
|
|
* senders buffer
|
|
|
|
*/
|
|
|
|
|
2010-11-12 16:16:22 +01:00
|
|
|
class Buffer : public sigc::trackable
|
|
|
|
{
|
|
|
|
public:
|
2010-11-12 21:37:12 +01:00
|
|
|
Buffer(std::string _id);
|
2010-11-12 16:16:22 +01:00
|
|
|
~Buffer();
|
2013-07-15 22:39:25 +02:00
|
|
|
|
2010-11-12 16:16:22 +01:00
|
|
|
void set(frame_t);
|
|
|
|
frame_t get();
|
2013-07-15 22:39:25 +02:00
|
|
|
|
2010-11-12 21:37:12 +01:00
|
|
|
std::string get_id();
|
|
|
|
void set_id(std::string id);
|
2013-07-15 22:39:25 +02:00
|
|
|
|
2011-05-08 20:08:34 +02:00
|
|
|
bool get_selected();
|
|
|
|
void set_selected(bool);
|
2013-07-15 22:39:25 +02:00
|
|
|
|
2010-11-12 16:16:22 +01:00
|
|
|
private:
|
2010-11-12 21:37:12 +01:00
|
|
|
std::string id;
|
2010-11-12 16:16:22 +01:00
|
|
|
frame_t frame;
|
2013-07-15 22:39:25 +02:00
|
|
|
|
2011-05-08 20:08:34 +02:00
|
|
|
bool selected;
|
2013-07-15 22:39:25 +02:00
|
|
|
|
|
|
|
Glib::Threads::Mutex mutex_;
|
2010-11-12 16:16:22 +01:00
|
|
|
};
|
|
|
|
#endif
|