45 static struct midi_std_init {
49 { 0,
"Bank Select MSB"},
50 { 1,
"Modulation MSB"},
51 { 2,
"Breath Controller"},
53 { 4,
"Foot Controller MSB"},
54 { 5,
"Portamento Time MSB"},
55 { 6,
"Data Entry MSB"},
61 {12,
"Effect Control 1"},
62 {13,
"Effect Control 2"},
64 {22,
"Midi Beat Clock"},
65 {23,
"Clock start/stop"},
66 {24,
"Jack Transport"},
68 {32,
"Bank Select LSB"},
74 {68,
"Legato Footswitch"},
76 {70,
"Sound Contr. 1"},
77 {71,
"Sound Contr. 2"},
78 {72,
"Sound Contr. 3"},
79 {73,
"Sound Contr. 4"},
80 {74,
"Sound Contr. 5"},
81 {75,
"Sound Contr. 6"},
82 {76,
"Sound Contr. 7"},
83 {77,
"Sound Contr. 8"},
84 {78,
"Sound Contr. 9"},
85 {79,
"Sound Contr. 10"},
87 {84,
"Portamento Control"},
101 {120,
"All Sounds Off"},
102 {121,
"Controller Reset"},
103 {122,
"Local Control"},
104 {123,
"All Notes Off"},
107 {126,
"Mono On (Poly Off)"},
108 {127,
"Poly On (Mono Off)"},
111 string MidiStandardControllers::midi_to_note(
int ctr) {
112 static const char* notes[12] = {
"C",
"C#",
"D",
"D#",
"E",
"F",
"F#",
"G",
"G#",
"A",
"A#",
"B" };
113 int octave = (ctr / 12) - 1;
116 string p = b.str().substr(0, 1);
117 int index = (ctr % 12);
118 string note = notes[index];
122 string MidiStandardControllers::ctr_desc(
int ctr) {
123 string p = midi_to_note(ctr-200);
124 return "Note On ( " + p +
" )";
128 for (
unsigned int i = 0; i <
sizeof(midi_std_itab)/
sizeof(midi_std_itab[0]); i++) {
129 m.insert(pair<int, modstring>(midi_std_itab[i].ctrl, modstring(midi_std_itab[i].name)));
131 for (
unsigned int i = 0; i < 127; i++) {
132 const int mm = i + 200;
133 m.insert(pair<int, modstring>(mm, modstring(ctr_desc(mm).c_str())));
138 map<int, modstring>::iterator i = m.find(ctr);
141 if (i->second.modified) {
143 i->second.name = m[ctr].std;
144 m[ctr].modified =
false;
152 m[ctr] = modstring(name,
true, 0);
154 i->second.modified =
true;
155 i->second.name = name;
162 for (map<int, modstring>::const_iterator i = m.begin(); i != m.end(); ++i) {
163 if (i->second.modified) {
166 jw.
write_kv(ostr.str().c_str(), i->second.name);
195 jw.
write(param->id());
203 jw.
write(_toggle_behaviour);
212 if (!pmap.
hasId(
id)) {
214 _(
"unknown parameter: ") +
id);
219 float lower = 0, upper = 0;
221 int toggle_behaviour = 0;
244 }
else if (lower < pmin) {
251 }
else if (upper < pmin) {
288 _(
"recall MIDI state"),
289 _(
"invalid format, Parameter skipped: ") +
id);
294 _(
"recall MIDI state"),
295 _(
"Parameter range outside bounds, changed: ") +
id);
297 return new MidiController(pm, lower, upper, toggle, toggle_behaviour);
302 if (param->get_midi_blocked())
return ret;
304 switch (_toggle_behaviour) {
305 case Parameter::toggle_type::OnOff: {
306 bool s_o = (2*last_value > 127);
307 bool s_n = (2*n > 127);
309 if (param->on_off_value()) {
310 ret = param->midi_set(0, 127, _lower, _upper);
312 ret = param->midi_set(127, 127, _lower, _upper);
317 case Parameter::toggle_type::Constant: {
318 if (n == last_value || last_value == -1) {
319 if (param->on_off_value()) {
320 if (!update) ret = param->midi_set(0, n, _lower, _upper);
321 else ret = param->midi_set(127, n, _lower, _upper);
323 if (!update) ret = param->midi_set(127, n, _lower, _upper);
324 else ret = param->midi_set(0, n, _lower, _upper);
334 ret = param->midi_set(n, 127, _lower, _upper);
342 if (param->get_blocked())
return ret;
343 if (strcmp(param->id().c_str(),
"engine.mute")==0) {
344 if ( n == 0) n = 127;
347 ret = param->midi_set(n, 127, _lower, _upper);
353 if (param->get_blocked())
return ret;
355 bool s_o = (2*last_value > 360);
356 bool s_n = (2*n > 360);
358 if (param->on_off_value()) {
359 ret = param->midi_set_bpm(0, 360, _lower, _upper);
361 ret = param->midi_set_bpm(360, 360, _lower, _upper);
365 ret = param->midi_set_bpm(n, 360, _lower, _upper);
375 for (
unsigned int n = 0; n < array_size; n++) {
376 operator[](n).clear();
397 for (
unsigned int n = 0; n < array_size; n++) {
403 for (midi_controller_list::const_iterator i = cl.begin(); i != cl.end(); ++i)
412 for (ControllerArray::size_type n = 0; n < size(); ++n) {
414 for (midi_controller_list::const_iterator i = cl.begin(); i != cl.end(); ++i) {
415 if (i->hasParameter(param)) {
427 for (iterator pctr = begin(); pctr !=
end(); ++pctr) {
428 for (midi_controller_list::iterator i = pctr->begin(); i != pctr->end(); ++i) {
429 if (i->hasParameter(p)) {
454 if (f >= 0x1.0p23)
return (
unsigned int) f;
455 return (
unsigned int) (f + 0.49999997f);
461 if ((time-time1)> (1.05*time_diff) || (time-time1)*1.05 < (time_diff)) {
466 bpm_new = ((1000000000. / (time-time1) / 24) * 60);
470 if (collect >= (bpm_new*bpm_new*0.0002)+1) {
481 time_diff = time-time1;
492 last_midi_control_value(),
493 last_midi_control(-2),
494 changed_midi_control_value(),
509 midi_value_changed() {
511 last_midi_control_value[i] = -1;
512 changed_midi_control_value[i] = 0;
514 pgm_chg.connect(sigc::mem_fun(*
this, &MidiControllerList::on_pgm_chg));
515 mute_chg.connect(sigc::mem_fun(*
this, &MidiControllerList::on_mute_chg));
516 bank_chg.connect(sigc::mem_fun(*
this, &MidiControllerList::on_bank_chg));
517 val_chg.connect(sigc::mem_fun(*
this, &MidiControllerList::on_val_chg));
522 bool MidiControllerList::check_midi_values() {
525 if (changed_midi_control_value[n]) {
526 changed_midi_control_value[n] = 0;
527 saved_values[n] = last_midi_control_value[n];
528 midi_value_changed(n, saved_values[n]);
531 for (midi_controller_list::iterator i = ctr_list.begin(); i != ctr_list.end(); ++i) {
533 && i->toggle_behaviour() == Parameter::toggle_type::Constant) {
534 midi_value_changed(n, i->getParameter().on_off_value() * 127);
536 i->trigger_changed();
544 void MidiControllerList::on_val_chg() {
547 if (changed_midi_control_value[n]) {
548 changed_midi_control_value[n] = 0;
549 saved_values[n] = last_midi_control_value[n];
550 midi_value_changed(n, saved_values[n]);
553 for (midi_controller_list::iterator i = ctr_list.begin(); i != ctr_list.end(); ++i) {
555 && i->toggle_behaviour() == Parameter::toggle_type::Constant) {
556 midi_value_changed(n, i->getParameter().on_off_value() * 127);
558 i->trigger_changed();
570 for (midi_controller_list::iterator i = cl.begin(); i != cl.end(); ++i) {
571 i->set_midi(v, v,
true);
577 for (
unsigned int n = 0; n < map.size(); n++) {
582 void MidiControllerList::on_pgm_chg() {
587 if (pgm>=0) new_program(pgm);
590 void MidiControllerList::on_mute_chg() {
595 new_mute_state(mute);
598 void MidiControllerList::on_bank_chg() {
603 if (bk>=0) new_bank(bk);
609 last_midi_control = ctl;
611 last_midi_control = -2;
629 float lower,
float upper,
bool toggle,
int toggle_behaviour) {
636 if (last_midi_control < 0)
639 map[last_midi_control].push_front(
MidiController(param, lower, upper, toggle, toggle_behaviour));
646 int v = last_midi_control_value[n];
648 for (midi_controller_list::iterator i = ctr_list.begin(); i != ctr_list.end(); ++i) {
649 if (i->is_toggle()) {
650 v = i->getParameter().on_off_value() * 127;
652 midi_value_changed(n, v);
659 last_midi_control = ctr;
662 for (midi_controller_list::iterator i = ctr_list.begin(); i != ctr_list.end(); ++i) {
671 last_midi_control = 22;
674 for (midi_controller_list::iterator i = ctr_list.begin(); i != ctr_list.end(); ++i) {
695 std::set<Parameter*> pset;
696 for (
unsigned int i = 0; i < map.size(); i++) {
698 for (midi_controller_list::iterator j = ctr.begin(); j != ctr.end(); ++j) {
701 for (midi_controller_list::const_iterator jn = ctr_new.begin();
702 jn != ctr_new.end(); ++jn) {
703 if (j->getParameter() == jn->getParameter()) {
704 pset.insert(&j->getParameter());
709 pset.insert(&j->getParameter());
713 for (paramlist::iterator n = plist.begin(); n != plist.end(); ) {
714 paramlist::iterator n1 = n++;
715 if (pset.find(*n1) != pset.end()) {
722 unsigned int val = 0;
723 switch (transport_state) {
724 case JackTransportStopped:
727 case JackTransportRolling:
730 case JackTransportStarting:
737 last_midi_control = 24;
740 for (midi_controller_list::iterator i = ctr_list.begin(); i != ctr_list.end(); ++i) {
750 jack_midi_event_t in_event;
751 jack_nframes_t event_count = jack_midi_get_event_count(midi_input_port_buf);
753 for (i = 0; i < event_count; i++) {
754 jack_midi_event_get(&in_event, midi_input_port_buf, i);
755 if ((in_event.buffer[0] & 0xf0) == 0xc0) {
758 }
else if ((in_event.buffer[0] & 0xf0) == 0xb0) {
759 if (in_event.buffer[1]== 120) {
762 }
else if (in_event.buffer[1]== 32) {
766 set_ctr_val(in_event.buffer[1], in_event.buffer[2]);
769 }
else if ((in_event.buffer[0] & 0xf0) == 0x90) {
773 }
else if ((in_event.buffer[0] ) > 0xf0) {
774 if ((in_event.buffer[0] ) == 0xf8) {
775 clock_gettime(CLOCK_MONOTONIC, &ts1);
778 time0 = (ts1.tv_sec*1000000000.0)+(ts1.tv_nsec)+
779 (1000000000.0/(
double)(sr/(double)in_event.time));
784 }
else if ((in_event.buffer[0] ) == 0xfa) {
787 }
else if ((in_event.buffer[0] ) == 0xfb) {
789 }
else if ((in_event.buffer[0] ) == 0xfc) {
792 }
else if ((in_event.buffer[0] ) == 0xf2) {
805 insert(
"system",
N_(
"System"));
806 insert(
"ui",
N_(
"User Interface"));
807 insert(
"ui.amp",
N_(
"User Interface"));
808 insert(
"engine",
N_(
"Audio Engine"));
813 for (map<string, bool>::iterator i = used.begin(); i != used.end(); ++i) {
822 void ParameterGroups::group_exists(
const string&
id) {
823 if (groups.find(
id) == groups.end()) {
830 void ParameterGroups::group_is_new(
const string&
id) {
831 if (groups.find(
id) != groups.end()) {
837 for (map<string, string>::iterator i = groups.begin(); i != groups.end(); ++i) {
838 printf(
"PG %s: %s\n", i->first.c_str(), i->second.c_str());
852 return groups.
get(group_id);
854 return groups[group_id];
859 if (groups.find(
id) == groups.end()) {
889 if (!save_in_preset) {
896 : boost::noncopyable(),
904 save_in_preset(true),
933 "Parameter", Glib::ustring::compose(
"%1: unknown key: %2",
_id, jp.
current_value()));
943 bool Parameter::midi_set(
float n,
float high,
float llimit,
float ulimit) {
948 bool Parameter::midi_set_bpm(
float n,
float high,
float llimit,
float ulimit) {
953 void Parameter::trigger_changed() {
958 for (
int n = 0; ; n++) {
959 if (!vn[n].value_id) {
968 Glib::ustring::compose(_(
"parameter %1: value %2 out of range [%3, %4]"),
969 _id, value, lower, upper));
973 static const char *tpname[] = {
974 "float",
"int",
"bool",
"bool",
"filename",
"string",
"special"};
975 assert(0 <=
v_type and
v_type <
sizeof(tpname)/
sizeof(tpname[0]));
1001 if (p1->
_id != p2->
_id) {
1003 title, Glib::ustring::compose(
"Different ID's: %2 / %3",
1008 title, Glib::ustring::compose(
"[%1]: Different name: %2 / %3",
1013 title, Glib::ustring::compose(
"[%1]: Different group: %2 / %3",
1018 title, Glib::ustring::compose(
"[%1]: Different desc: %2 / %3",
1023 title, Glib::ustring::compose(
"[%1]: save_in_preset different: %2 / %3",
1028 title, Glib::ustring::compose(
"[%1]: controllable different: %2 / %3",
1033 title, Glib::ustring::compose(
"[%1]: used different: %2 / %3",
1038 title, Glib::ustring::compose(
"[%1]: c_type different: %2 / %3",
1043 title, Glib::ustring::compose(
"[%1]: v_type different: %2 / %3",
1052 title, Glib::ustring::compose(
"[%1]: value address different: %2 / %3",
1058 title, Glib::ustring::compose(
"[%1]: float lower different: %2 / %3",
1063 title, Glib::ustring::compose(
"[%1]: float upper different: %2 / %3",
1068 title, Glib::ustring::compose(
"[%1]: float step different: %2 / %3",
1073 title, Glib::ustring::compose(
"[%1]: float std value different: %2 / %3",
1079 title, Glib::ustring::compose(
"[%1]: float value different: %2 / %3",
1084 title, Glib::ustring::compose(
"[%1]: float json value different: %2 / %3",
1115 jw.
write_kv(
"std_value", std_value);
1120 :
Parameter(
jp_next(jp,
"Parameter")), json_value(0), value(&value_storage), std_value(0), lower(), upper(), step() {
1123 if (jp.
read_kv(
"lower", lower) ||
1126 jp.
read_kv(
"value", *value) ||
1127 jp.
read_kv(
"std_value", std_value)) {
1130 "FloatParameter", Glib::ustring::compose(
"%1: unknown key: %2",
_id, jp.
current_value()));
1141 float v =
min(
max(val, lower), upper);
1159 bool FloatParameter::midi_set(
float n,
float high,
float llimit,
float ulimit) {
1163 assert(n >= 0 && n <= high);
1164 v = llimit + (n / high) * (ulimit - llimit);
1167 v = (2*n > high ? 1.0 : 0.0);
1170 v = lower +
min(n, upper-lower);
1183 bool FloatParameter::midi_set_bpm(
float n,
float high,
float llimit,
float ulimit) {
1187 assert(n >= 0 && n <= high);
1188 if (high <= ulimit) {
1189 v =
max(llimit,
min(ulimit,n));
1191 v = llimit + (n / high) * (ulimit - llimit);
1195 v = (2*n > high ? 1.0 : 0.0);
1198 v = lower +
min(n, upper-lower);
1211 void FloatParameter::trigger_changed() {
1216 json_value = std_value;
1226 if (json_value < lower-std::abs(5*FLT_EPSILON*lower) || json_value > upper+std::abs(5*FLT_EPSILON*upper)) {
1228 json_value = std_value;
1233 return std::abs(json_value - *value) < 5*FLT_EPSILON;
1241 json_value = lower + (json_value - low) / (up - low) * (upper - lower);
1281 serializeValueNames(jw, value_names);
1286 float *v,
int sv,
int low,
bool ctrl,
bool no_init):
1287 FloatParameter(
id, name,
Enum, preset, v, sv, low, low+get_upper(vn), 1, ctrl, no_init),
1296 jw.
write(value_names[static_cast<int>(round(*value-lower))].value_id);
1300 int up =
static_cast<int>(round(upper));
1301 int low =
static_cast<int>(round(lower));
1303 for (; n <= up-low; n++) {
1304 if (v_id == value_names[n].value_id) {
1322 _(
"read parameter"), (boost::format(_(
"parameter %1%: unknown enum value: %2%"))
1337 jw.
write_kv(
"std_value", std_value);
1342 :
Parameter(
jp_next(jp,
"Parameter")), json_value(0), value(&value_storage), std_value(0), lower(), upper() {
1345 if (jp.
read_kv(
"lower", lower) ||
1347 jp.
read_kv(
"value", *value) ||
1348 jp.
read_kv(
"std_value", std_value)) {
1351 "IntParameter", Glib::ustring::compose(
"%1: unknown key: %2",
_id, jp.
current_value()));
1362 int v =
min(
max(val, lower), upper);
1380 bool IntParameter::midi_set(
float n,
float high,
float llimit,
float ulimit) {
1390 v = lower +
min(static_cast<int>(n), upper-lower);
1403 void IntParameter::trigger_changed() {
1408 json_value = std_value;
1418 if (json_value < lower || json_value > upper) {
1424 return json_value == *value;
1448 serializeValueNames(jw, value_names);
1453 int *v,
int sv,
bool ctrl):
1463 for (; n <= upper; n++) {
1464 if (v_id == value_names[n].value_id) {
1473 jw.
write(value_names[*value].value_id);
1487 _(
"read parameter"), (boost::format(_(
"parameter %1%: unknown enum value: %2%"))
1508 value_array.push_back(
id_label(value_id, value_label));
1513 "EnumValueNames", Glib::ustring::compose(
"unknown key: %1", jp.
current_value()));
1520 for (std::vector<id_label>::iterator i = value_array.begin(); i != value_array.end(); ++i) {
1530 std::vector<id_label> value_array;
1547 std::vector<id_label> value_array;
1577 if (jp.
read_kv(
"value", *value) || jp.
read_kv(
"std_value", std_value)) {
1580 "BoolParameter", Glib::ustring::compose(
"%1: unknown key: %2",
_id, jp.
current_value()));
1591 if (val != *value) {
1603 bool BoolParameter::midi_set(
float n,
float high,
float llimit,
float ulimit) {
1620 void BoolParameter::trigger_changed() {
1625 json_value = std_value;
1641 return json_value == *value;
1654 jw.
write_kv(
"value", value->get_path());
1655 jw.
write_kv(
"std_value", std_value->get_path());
1660 :
Parameter(
jp_next(jp,
"Parameter")), value(0), std_value(0), json_value(0) {
1671 "FileParameter", Glib::ustring::compose(
"%1: unknown key: %2",
_id, jp.
current_value()));
1679 Glib::RefPtr<Gio::File> v = Gio::File::create_for_path(path);
1697 std_value = Gio::File::create_for_path(filename);
1730 static string get_file_id(
const Glib::RefPtr<Gio::File>& f) {
1731 return f->query_info(G_FILE_ATTRIBUTE_ID_FILE)->get_attribute_string(G_FILE_ATTRIBUTE_ID_FILE);
1737 id = get_file_id(
value);
1738 }
catch(Gio::Error& ex) {
1742 id2 = get_file_id(v);
1743 }
catch(Gio::Error& ex) {
1750 return value->get_path();
1754 return value->get_parent()->get_path();
1758 return value->get_parse_name();
1762 return value->query_info(G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME)->get_display_name();
1766 value->copy(Gio::File::create_for_path(destination));
1784 if (jp.
read_kv(
"value", *value) || jp.
read_kv(
"std_value", std_value)) {
1787 "StringParameter", Glib::ustring::compose(
"%1: unknown key: %2",
_id, jp.
current_value()));
1798 if (val != *value) {
1807 return !value->empty();
1811 json_value = std_value;
1824 return json_value == *value;
1837 replace_mode(false) {
1841 for (
iterator i = id_map.begin(); i != id_map.end(); ++i) {
1849 jw.
write(
"FloatEnum");
1853 }
else if (p->
isInt()) {
1859 }
else if (p->
isBool()) {
1861 }
else if (p->
isFile()) {
1865 }
else if (dynamic_cast<JConvParameter*>(p) != 0) {
1867 }
else if (dynamic_cast<SeqParameter*>(p) != 0) {
1871 cerr <<
"skipping " << p->
id() << endl;
1880 for (
iterator i = id_map.begin(); i != id_map.end(); ++i) {
1908 "ParamMap", Glib::ustring::compose(
"unknown parameter type: %1", jp.
current_value()));
1923 void ParamMap::unique_id(
Parameter* param) {
1924 if (id_map.find(param->
id()) != id_map.end()) {
1929 void ParamMap::check_id(
const string&
id) {
1931 cerr <<
"string-id not found: " <<
id << endl;
1935 void ParamMap::check_p(
const char *p) {
1937 cerr <<
"char-id not found: " << p << endl;
1944 if (fmt ==
"json") {
1950 printf(
"parameter map dump\n");
1952 for (
iterator i = id_map.begin(); i != id_map.end(); ++i) {
1959 printf(
"---------------------\n");
1968 case None: jw->
write(
"None");
break;
1969 case Continuous: jw->
write(
"Cont");
break;
1970 case Switch: jw->
write(
"Swth");
break;
1971 case Enum: jw->
write(
"Enum");
break;
1972 default: assert(
false);
1974 if (save_in_preset) {
1975 jw->
write(
"preset");
1978 jw->
write(
"control");
1980 jw->
write(l_group());
1981 jw->
write(l_name());
1994 jw->
write(getLowerAsFloat());
1995 jw->
write(getUpperAsFloat());
1996 jw->
write(getStepAsFloat());
2000 for (
int n = 0; ; ++n) {
2001 if (!vn[n].value_id) {
2005 jw->
write(vn[n].value_id);
2006 jw->
write(vn[n].value_label ? vn[n].value_label : vn[n].value_id);
2014 printf(
"P: %s vt=%d ct=%d c=%d\n", _id.c_str(), v_type, c_type, controllable);
2021 map<string, Parameter*>::iterator ii = id_map.find(param->
id());
2022 if (ii != id_map.end()) {
2024 insert_remove(p,
false);
2030 id_map.insert(pair<string, Parameter*>(param->
id(), param));
2031 insert_remove(param,
true);
2039 insert_remove(p,
false);
2040 id_map.erase(p->
id());
2052 for (
iterator i = id_map.begin(); i != id_map.end(); ++i) {
2053 i->second->stdJSON_value();
2054 i->second->setJSON_value();
2058 static inline bool compare_groups(
const std::string&
id,
const char **groups) {
2062 for (
const char **g = groups; *g; g += 2) {
2069 if (strncmp(
id.c_str(), p, n) == 0 &&
id[n] ==
'.') {
2077 std::string group_id(pdef->
id);
2079 std::string on_off = group_id +
"on_off";
2080 std::string pp = group_id +
"pp";
2081 std::string position = group_id +
"position";
2083 if (i->first.compare(0, group_id.size(), group_id) == 0 || compare_groups(i->first, pdef->
groups)) {
2084 if (i->second->isInPreset()) {
2085 if (i->first != on_off && i->first != pp && i->first != position) {
2086 i->second->stdJSON_value();
2087 if (!i->second->compareJSON_value()) {
2100 std::string group_id(pdef->
id);
2102 std::string on_off = group_id +
"on_off";
2103 std::string pp = group_id +
"pp";
2104 std::string position = group_id +
"position";
2106 if (i->first.compare(0, group_id.size(), group_id) == 0 || compare_groups(i->first, pdef->
groups)) {
2107 if (i->second->isInPreset()) {
2108 if (i->first != on_off && i->first != pp && i->first != position) {
2109 i->second->stdJSON_value();
2110 i->second->setJSON_value();
ParameterV< float > FloatParameter
ParameterV< GxSeqSettings > SeqParameter
CmdConnection::msg_type end
int get_last_midi_control_value(unsigned int n)
void write_kv(const char *key, float v)
FloatEnumParameter(gx_system::JsonParser &jp)
virtual float getUpperAsFloat() const
virtual bool hasRange() const
virtual float getLowerAsFloat() const
virtual void readJSON_value(gx_system::JsonParser &jp)
bool set_bpm(int n, int last_value)
void begin_array(bool nl=false)
void modifyCurrent(Parameter ¶m, float lower, float upper, bool toggle, int toggle_behaviour)
int param2controller(Parameter ¶m, const MidiController **p)
ParameterV(const string &id, const string &name, ctrl_type ctp, bool preset, int *v, int sv, int lv, int uv, bool ctrl)
virtual bool hasRange() const
virtual int idx_from_id(string v_id)
void set_stream(ostream *o)
jack_nframes_t get_jack_sr()
MidiStandardControllers midi_std_ctr
map< string, Parameter * >::const_iterator iterator
Parameter(const string &id, const string &name, value_type vtp, ctrl_type ctp, bool preset, bool ctrl)
virtual void stdJSON_value()
string get_parse_name() const
virtual void serializeJSON(gx_system::JsonWriter &jw)
virtual void readJSON_value(gx_system::JsonParser &jp)
Parameter * readJSON_one(gx_system::JsonParser &jp)
friend void compare_parameter(const char *title, Parameter *p1, Parameter *p2, bool all)
list< Parameter * > paramlist
ParameterV< GxJConvSettings > JConvParameter
virtual void serializeJSON(gx_system::JsonWriter &jw)
void unregister(Parameter *p)
virtual bool hasRange() const
bool deleteParameter(Parameter &p)
void end_array(bool nl=false)
void set_config_mode(bool mode, int ctl=-1)
const string & name() const
void dump(const string &fmt)
virtual void readJSON_value(gx_system::JsonParser &jp)
virtual bool on_off_value()
void readJSON(gx_system::JsonParser &jp, ParamMap ¶m)
virtual bool compareJSON_value()
void range_warning(float value, float lower, float upper)
virtual bool on_off_value()
virtual void readJSON_value(gx_system::JsonParser &jp)
unsigned int rounded(float f)
virtual float getUpperAsFloat() const
bool set(const Glib::ustring &val) const
virtual float idx_from_id(string v_id)
virtual void writeJSON(gx_system::JsonWriter &jw) const
virtual void setJSON_value()
void writeJSON(gx_system::JsonWriter &jw)
string param_group(const string &group_id, bool nowarn=false)
virtual void writeJSON(gx_system::JsonWriter &jw) const
string get(const string &id)
virtual void stdJSON_value()
MidiStandardControllers()
virtual float getUpperAsFloat() const
virtual float getLowerAsFloat() const
virtual void writeJSON(gx_system::JsonWriter &jw) const
ctrl_type getControlType() const
void write_key(const char *p, bool nl=false)
void update_from_controllers()
virtual void setJSON_value()
void writeJSON(gx_system::JsonWriter &jw) const
int atomic_get(volatile int &p)
Glib::RefPtr< Gio::File > std_value
FloatEnumParameterD(gx_system::JsonParser &jp)
EnumParameter(gx_system::JsonParser &jp)
ParameterV< int > IntParameter
void compute_midi_in(void *midi_input_port_buf, void *arg)
sigc::signal< void > changed
virtual void serializeJSON(gx_system::JsonWriter &jw)
ParameterV< bool > BoolParameter
virtual float getStepAsFloat() const
#define debug_check(func,...)
void gx_print_error(const char *, const std::string &)
bool read_kv(const char *key, float &v)
virtual void readJSON_value(gx_system::JsonParser &jp)
virtual bool compareJSON_value()
void enum_parameter_load_values(gx_system::JsonParser &jp, std::vector< id_label > &value_array, const value_pair **value_names)
virtual float getLowerAsFloat() const
ParameterGroups & get_group_table()
bool time_to_bpm(double time, unsigned int *bpm_)
virtual void setJSON_value()
void check_expect(token expect)
const value_pair * value_names
void set_ctr_val(int ctr, int val)
virtual void serializeJSON(gx_system::JsonWriter &jw)
std::pair< std::string, std::string > id_label
virtual void serializeJSON(gx_system::JsonWriter &jw)
bool set_trans(int n, int last_value)
bool hasId(const string &id) const
virtual void stdJSON_value()
const char * get_typename() const
virtual bool compareJSON_value()
void begin_object(bool nl=false)
const value_pair * value_names
void writeJSON_one(gx_system::JsonWriter &jw, Parameter *p)
bool set_midi(int n, int last_value, bool update)
virtual bool on_off_value()
void update_from_controller(int ctr)
update all controlled parameters with last received value from MIDI controller ctr.
void set_controller_array(const ControllerArray &m)
virtual bool on_off_value()
virtual bool on_off_value()
FloatParameter & getFloat()
virtual void writeJSON(gx_system::JsonWriter &jw) const
void gx_print_warning(const char *, const std::string &)
list< MidiController > midi_controller_list
virtual const value_pair * getValueNames() const
virtual float getStepAsFloat() const
virtual void writeJSON(gx_system::JsonWriter &jw) const
void set_bpm_val(unsigned int val)
virtual bool compareJSON_value()
void writeJSON(gx_system::JsonWriter &jw) const
void atomic_set(volatile int *p, int v)
virtual void serializeJSON(gx_system::JsonWriter &jw)
static MidiController * readJSON(gx_system::JsonParser &jp, ParamMap ¶m)
virtual bool compareJSON_value()
Glib::RefPtr< Gio::File > value
string current_value() const
virtual float idx_from_id(string v_id)
virtual void readJSON_value(gx_system::JsonParser &jp)
bool atomic_compare_and_exchange(volatile int *p, int oldv, int newv)
void readJSON(gx_system::JsonParser &jp)
EnumParameterD(gx_system::JsonParser &jp)
virtual void stdJSON_value()
void process_trans(int transport_state)
static gx_system::JsonParser & jp_next(gx_system::JsonParser &jp, const char *key)
virtual int idx_from_id(string v_id)
void replace(int ctr, const string &name)
void set_standard(const string &filename)
void copy(const string &destination) const
FileParameter(const string &id, const string &filename, bool preset=false)
virtual void writeJSON(gx_system::JsonWriter &jw) const
ParameterV(const string &id, const string &name, ctrl_type ctp, bool preset, float *v, float sv, float lv, float uv, float tv, bool ctrl, bool no_init)
bool group_exist(const string &id)
ParameterV(const string &id, const string &name, Glib::ustring *v, const Glib::ustring &sv, bool preset=false)
void set_path(const string &path)
void writeJSON(gx_system::JsonWriter &jw) const
string get_directory_path() const
float current_value_float()
static const char * value_label(const value_pair &vp)
bool set(float val) const
ParameterV(const string &id, const string &name, ctrl_type ctp, bool preset, bool *v, bool sv, bool ctrl)
void deleteParameter(Parameter ¶m)
virtual void serializeJSON(gx_system::JsonWriter &jw)
virtual void setJSON_value()
token next(token expect=no_token)
ParameterV< Glib::ustring > StringParameter
void write(float v, bool nl=false)
bool unit_has_std_values(const PluginDef *pdef) const
Glib::RefPtr< Gio::File > json_value
const string & id() const
virtual const value_pair * getValueNames() const
void request_midi_value_update()
bool is_equal(const Glib::RefPtr< Gio::File > &v) const
void set_last_midi_control_value(unsigned int n, int v)
bool set(const Glib::RefPtr< Gio::File > &val)
string get_display_name() const
virtual void serializeJSON(gx_system::JsonWriter &jw)
void readJSON(gx_system::JsonParser &jp)
void convert_from_range(float low, float up)
void remove_controlled_parameters(paramlist &plist, const ControllerArray *m)
void end_object(bool nl=false)
void reset_unit(const PluginDef *pdef) const
virtual void readJSON_value(gx_system::JsonParser &jp)
virtual void setJSON_value()
void dump(gx_system::JsonWriter *jw)
virtual void stdJSON_value()
virtual const value_pair * getValueNames() const
virtual void writeJSON(gx_system::JsonWriter &jw) const