Large commit for implementation of load&save of MixingGroups

This commit is contained in:
Bruno
2021-03-07 19:27:00 +01:00
parent 56f0165d75
commit 7656113dcc
22 changed files with 525 additions and 132 deletions

View File

@@ -4,6 +4,7 @@
#include <map>
#include "View.h"
#include "SourceList.h"
class LineLoop;
class Symbol;
@@ -15,29 +16,34 @@ public:
MixingGroup (SourceList sources);
~MixingGroup ();
// actions for update
typedef enum {
ACTION_NONE = 0,
ACTION_GRAB_ONE = 1,
ACTION_GRAB_ALL = 2,
ACTION_ROTATE_ALL = 3
} Action;
// actions for update
inline void setAction (Action a) { update_action_ = a; }
inline Action action () { return update_action_; }
inline void follow (Source *s) { updated_source_ = s; }
// get node to draw
// node to draw
inline Group *group () { return root_; }
// accept all kind of visitors
virtual void accept (Visitor& v);
// to update in Mixing View
void update (float dt);
inline bool active () const { return active_; }
void setActive (bool on);
// individual change of a source in the group
// Source list manipulation
SourceList::iterator begin ();
SourceList::iterator end ();
uint size ();
bool contains (Source *s);
void detach (Source *s);
void move (Source *s);
private:
@@ -46,10 +52,11 @@ private:
LineLoop *lines_;
Symbol *center_;
void createLineStrip();
void move (Source *s);
// properties linked to sources
glm::vec2 center_pos_;
std::vector<Source *> sources_;
glm::vec2 center_pos_;
SourceList sources_;
std::map< Source *, uint> index_points_;
// status and actions