Subversion Repositories DIN Is Noise

Rev

Rev 2009 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1528 jag 1
/*
2
* point_modulator.h
2097 jag 3
* DIN Is Noise is copyright (c) 2006-2024 Jagannathan Sampath
1713 jag 4
* DIN Is Noise is released under GNU Public License 2.0
1528 jag 5
* For more information, please visit https://dinisnoise.org/
6
*/
7
 
8
#ifndef __point_modulator
9
#define __point_modulator
10
 
11
#include "label.h"
12
#include "arrow_button.h"
13
#include "filled_button.h"
14
#include "checkbutton.h"
15
#include "cross_button.h"
16
#include "state_button.h"
17
#include "modulator.h"
18
#include "plus_button.h"
19
#include "utils.h"
20
#include "spinner.h"
21
#include "hit.h"
22
 
23
#include <map>
24
 
25
struct mod_dat {
26
  hit_t hit;
27
  state_button* sb;
28
  modulator mod;
29
  point<float> init;
30
  mod_dat (hit_t& h, state_button* _sb, float _bpm);
31
  mod_dat ();
32
};
33
 
34
struct curve_editor;
35
struct point_modulator : widget, click_listener, change_listener<field>, state_listener, move_listener {
36
 
37
  curve_editor* ed;
38
 
39
  label title;
40
  void set_title ();
41
 
42
  int folded;
43
  arrow_button fold;
44
 
45
  arrow_button play;
46
  cross_button kill;
47
  button all, none, invert;
48
  plus_button plus;
49
 
50
  struct {
51
    spinner<float> depth;
52
    spinner<float> bpm;
53
  } x, y;
54
 
55
  spinner<float> scrub;
56
  int scrubbed;
57
 
58
  button sync;
59
  int synced;
60
 
61
  int sbx, sby;
62
 
63
  std::vector<mod_dat> lst;
64
  int nlst;
65
 
66
  int nsel;
67
  sel _sel;
68
  desel _desel;
69
  togg _togg;
70
  int multisel;
71
  void on_lst (const item_op& o);
72
 
73
  void setup (curve_editor* _ed);
74
  int handle_input ();
75
  void moved ();
76
  void draw ();
77
 
78
  state_button* add (hit_t& h);
79
  void rearrange ();
80
  void remove (const hit_t& h = hit_t ());
81
  void ensure_hit_ids ();
82
  void validate ();
83
 
84
  void clicked (button& b);
85
  void changed (checkbutton& cb);
86
  void changed (field& f);
87
 
88
  void bg ();
89
 
90
  static int ref;
91
  point_modulator ();
92
  ~point_modulator ();
93
 
94
  void load ();
95
  void save ();
96
 
97
  int hit (hit_t& h);
98
 
99
  void update_solvers (int i);
100
 
101
  void set_ui ();
102
 
103
};
104
 
105
#endif