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()) {
726 unsigned int val = 0;
727 switch (transport_state) {
728 case JackTransportStopped:
731 case JackTransportRolling:
734 case JackTransportStarting:
741 last_midi_control = 24;
744 for (midi_controller_list::iterator i = ctr_list.begin(); i != ctr_list.end(); ++i) {
754 jack_midi_event_t in_event;
755 jack_nframes_t event_count = jack_midi_get_event_count(midi_input_port_buf);
757 for (i = 0; i < event_count; i++) {
758 jack_midi_event_get(&in_event, midi_input_port_buf, i);
760 if (channel_select>0) {
761 if ((channel_select) != (
int(in_event.buffer[0]&0x0f)+1)) {
765 if ((in_event.buffer[0] & 0xf0) == 0xc0 && ch) {
768 }
else if ((in_event.buffer[0] & 0xf0) == 0xb0 && ch) {
769 if (in_event.buffer[1]== 120) {
772 }
else if (in_event.buffer[1]== 32 && ch) {
776 set_ctr_val(in_event.buffer[1], in_event.buffer[2]);
779 }
else if ((in_event.buffer[0] & 0xf0) == 0x90 && ch) {
783 }
else if ((in_event.buffer[0] ) > 0xf0) {
784 if ((in_event.buffer[0] ) == 0xf8) {
785 clock_gettime(CLOCK_MONOTONIC, &ts1);
788 time0 = (ts1.tv_sec*1000000000.0)+(ts1.tv_nsec)+
789 (1000000000.0/(
double)(sr/(double)in_event.time));
794 }
else if ((in_event.buffer[0] ) == 0xfa) {
797 }
else if ((in_event.buffer[0] ) == 0xfb) {
799 }
else if ((in_event.buffer[0] ) == 0xfc) {
802 }
else if ((in_event.buffer[0] ) == 0xf2) {
815 insert(
"system",
N_(
"System"));
816 insert(
"ui",
N_(
"User Interface"));
817 insert(
"ui.amp",
N_(
"User Interface"));
818 insert(
"engine",
N_(
"Audio Engine"));
823 for (map<string, bool>::iterator i = used.begin(); i != used.end(); ++i) {
832 void ParameterGroups::group_exists(
const string&
id) {
833 if (groups.find(
id) == groups.end()) {
840 void ParameterGroups::group_is_new(
const string&
id) {
841 if (groups.find(
id) != groups.end()) {
847 for (map<string, string>::iterator i = groups.begin(); i != groups.end(); ++i) {
848 printf(
"PG %s: %s\n", i->first.c_str(), i->second.c_str());
862 return groups.
get(group_id);
864 return groups[group_id];
869 if (groups.find(
id) == groups.end()) {
899 if (!save_in_preset) {
906 : boost::noncopyable(),
914 save_in_preset(true),
943 "Parameter", Glib::ustring::compose(
"%1: unknown key: %2",
_id, jp.
current_value()));
953 bool Parameter::midi_set(
float n,
float high,
float llimit,
float ulimit) {
958 bool Parameter::midi_set_bpm(
float n,
float high,
float llimit,
float ulimit) {
963 void Parameter::trigger_changed() {
968 for (
int n = 0; ; n++) {
969 if (!vn[n].value_id) {
978 Glib::ustring::compose(_(
"parameter %1: value %2 out of range [%3, %4]"),
979 _id, value, lower, upper));
983 static const char *tpname[] = {
984 "float",
"int",
"bool",
"bool",
"filename",
"string",
"special"};
985 assert(0 <=
v_type and
v_type <
sizeof(tpname)/
sizeof(tpname[0]));
1011 if (p1->
_id != p2->
_id) {
1013 title, Glib::ustring::compose(
"Different ID's: %2 / %3",
1018 title, Glib::ustring::compose(
"[%1]: Different name: %2 / %3",
1023 title, Glib::ustring::compose(
"[%1]: Different group: %2 / %3",
1028 title, Glib::ustring::compose(
"[%1]: Different desc: %2 / %3",
1033 title, Glib::ustring::compose(
"[%1]: save_in_preset different: %2 / %3",
1038 title, Glib::ustring::compose(
"[%1]: controllable different: %2 / %3",
1043 title, Glib::ustring::compose(
"[%1]: used different: %2 / %3",
1048 title, Glib::ustring::compose(
"[%1]: c_type different: %2 / %3",
1053 title, Glib::ustring::compose(
"[%1]: v_type different: %2 / %3",
1062 title, Glib::ustring::compose(
"[%1]: value address different: %2 / %3",
1068 title, Glib::ustring::compose(
"[%1]: float lower different: %2 / %3",
1073 title, Glib::ustring::compose(
"[%1]: float upper different: %2 / %3",
1078 title, Glib::ustring::compose(
"[%1]: float step different: %2 / %3",
1083 title, Glib::ustring::compose(
"[%1]: float std value different: %2 / %3",
1089 title, Glib::ustring::compose(
"[%1]: float value different: %2 / %3",
1094 title, Glib::ustring::compose(
"[%1]: float json value different: %2 / %3",
1125 jw.
write_kv(
"std_value", std_value);
1130 :
Parameter(
jp_next(jp,
"Parameter")), json_value(0), value(&value_storage), std_value(0), lower(), upper(), step() {
1133 if (jp.
read_kv(
"lower", lower) ||
1136 jp.
read_kv(
"value", *value) ||
1137 jp.
read_kv(
"std_value", std_value)) {
1140 "FloatParameter", Glib::ustring::compose(
"%1: unknown key: %2",
_id, jp.
current_value()));
1151 float v =
min(
max(val, lower), upper);
1169 bool FloatParameter::midi_set(
float n,
float high,
float llimit,
float ulimit) {
1173 assert(n >= 0 && n <= high);
1174 v = llimit + (n / high) * (ulimit - llimit);
1177 v = (2*n > high ? 1.0 : 0.0);
1180 v = lower +
min(n, upper-lower);
1193 bool FloatParameter::midi_set_bpm(
float n,
float high,
float llimit,
float ulimit) {
1197 assert(n >= 0 && n <= high);
1198 if (high <= ulimit) {
1199 v =
max(llimit,
min(ulimit,n));
1201 v = llimit + (n / high) * (ulimit - llimit);
1205 v = (2*n > high ? 1.0 : 0.0);
1208 v = lower +
min(n, upper-lower);
1221 void FloatParameter::trigger_changed() {
1226 json_value = std_value;
1236 if (json_value < lower-std::abs(5*FLT_EPSILON*lower) || json_value > upper+std::abs(5*FLT_EPSILON*upper)) {
1238 json_value = std_value;
1243 return std::abs(json_value - *value) < 5*FLT_EPSILON;
1251 json_value = lower + (json_value - low) / (up - low) * (upper - lower);
1291 serializeValueNames(jw, value_names);
1296 float *v,
int sv,
int low,
bool ctrl,
bool no_init):
1297 FloatParameter(
id, name,
Enum, preset, v, sv, low, low+get_upper(vn), 1, ctrl, no_init),
1306 jw.
write(value_names[static_cast<int>(round(*value-lower))].value_id);
1310 int up =
static_cast<int>(round(upper));
1311 int low =
static_cast<int>(round(lower));
1313 for (; n <= up-low; n++) {
1314 if (v_id == value_names[n].value_id) {
1332 _(
"read parameter"), (boost::format(_(
"parameter %1%: unknown enum value: %2%"))
1347 jw.
write_kv(
"std_value", std_value);
1352 :
Parameter(
jp_next(jp,
"Parameter")), json_value(0), value(&value_storage), std_value(0), lower(), upper() {
1355 if (jp.
read_kv(
"lower", lower) ||
1357 jp.
read_kv(
"value", *value) ||
1358 jp.
read_kv(
"std_value", std_value)) {
1361 "IntParameter", Glib::ustring::compose(
"%1: unknown key: %2",
_id, jp.
current_value()));
1372 int v =
min(
max(val, lower), upper);
1390 bool IntParameter::midi_set(
float n,
float high,
float llimit,
float ulimit) {
1400 v = lower +
min(static_cast<int>(n), upper-lower);
1413 void IntParameter::trigger_changed() {
1418 json_value = std_value;
1428 if (json_value < lower || json_value > upper) {
1434 return json_value == *value;
1458 serializeValueNames(jw, value_names);
1463 int *v,
int sv,
bool ctrl):
1473 for (; n <= upper; n++) {
1474 if (v_id == value_names[n].value_id) {
1483 jw.
write(value_names[*value].value_id);
1497 _(
"read parameter"), (boost::format(_(
"parameter %1%: unknown enum value: %2%"))
1518 value_array.push_back(
id_label(value_id, value_label));
1523 "EnumValueNames", Glib::ustring::compose(
"unknown key: %1", jp.
current_value()));
1530 for (std::vector<id_label>::iterator i = value_array.begin(); i != value_array.end(); ++i) {
1540 std::vector<id_label> value_array;
1557 std::vector<id_label> value_array;
1587 if (jp.
read_kv(
"value", *value) || jp.
read_kv(
"std_value", std_value)) {
1590 "BoolParameter", Glib::ustring::compose(
"%1: unknown key: %2",
_id, jp.
current_value()));
1601 if (val != *value) {
1613 bool BoolParameter::midi_set(
float n,
float high,
float llimit,
float ulimit) {
1630 void BoolParameter::trigger_changed() {
1635 json_value = std_value;
1651 return json_value == *value;
1664 jw.
write_kv(
"value", value->get_path());
1665 jw.
write_kv(
"std_value", std_value->get_path());
1670 :
Parameter(
jp_next(jp,
"Parameter")), value(0), std_value(0), json_value(0) {
1681 "FileParameter", Glib::ustring::compose(
"%1: unknown key: %2",
_id, jp.
current_value()));
1689 Glib::RefPtr<Gio::File> v = Gio::File::create_for_path(path);
1707 std_value = Gio::File::create_for_path(filename);
1740 static string get_file_id(
const Glib::RefPtr<Gio::File>& f) {
1741 return f->query_info(G_FILE_ATTRIBUTE_ID_FILE)->get_attribute_string(G_FILE_ATTRIBUTE_ID_FILE);
1747 id = get_file_id(
value);
1748 }
catch(Gio::Error& ex) {
1752 id2 = get_file_id(v);
1753 }
catch(Gio::Error& ex) {
1760 return value->get_path();
1764 return value->get_parent()->get_path();
1768 return value->get_parse_name();
1772 return value->query_info(G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME)->get_display_name();
1776 value->copy(Gio::File::create_for_path(destination));
1794 if (jp.
read_kv(
"value", *value) || jp.
read_kv(
"std_value", std_value)) {
1797 "StringParameter", Glib::ustring::compose(
"%1: unknown key: %2",
_id, jp.
current_value()));
1808 if (val != *value) {
1817 return !value->empty();
1821 json_value = std_value;
1834 return json_value == *value;
1847 replace_mode(false) {
1851 for (
iterator i = id_map.begin(); i != id_map.end(); ++i) {
1859 jw.
write(
"FloatEnum");
1863 }
else if (p->
isInt()) {
1869 }
else if (p->
isBool()) {
1871 }
else if (p->
isFile()) {
1875 }
else if (dynamic_cast<JConvParameter*>(p) != 0) {
1877 }
else if (dynamic_cast<SeqParameter*>(p) != 0) {
1881 cerr <<
"skipping " << p->
id() << endl;
1890 for (
iterator i = id_map.begin(); i != id_map.end(); ++i) {
1918 "ParamMap", Glib::ustring::compose(
"unknown parameter type: %1", jp.
current_value()));
1933 void ParamMap::unique_id(
Parameter* param) {
1934 if (id_map.find(param->
id()) != id_map.end()) {
1939 void ParamMap::check_id(
const string&
id) {
1941 cerr <<
"string-id not found: " <<
id << endl;
1945 void ParamMap::check_p(
const char *p) {
1947 cerr <<
"char-id not found: " << p << endl;
1954 if (fmt ==
"json") {
1960 printf(
"parameter map dump\n");
1962 for (
iterator i = id_map.begin(); i != id_map.end(); ++i) {
1969 printf(
"---------------------\n");
1978 case None: jw->
write(
"None");
break;
1979 case Continuous: jw->
write(
"Cont");
break;
1980 case Switch: jw->
write(
"Swth");
break;
1981 case Enum: jw->
write(
"Enum");
break;
1982 default: assert(
false);
1984 if (save_in_preset) {
1985 jw->
write(
"preset");
1988 jw->
write(
"control");
1990 jw->
write(l_group());
1991 jw->
write(l_name());
2004 jw->
write(getLowerAsFloat());
2005 jw->
write(getUpperAsFloat());
2006 jw->
write(getStepAsFloat());
2010 for (
int n = 0; ; ++n) {
2011 if (!vn[n].value_id) {
2015 jw->
write(vn[n].value_id);
2016 jw->
write(vn[n].value_label ? vn[n].value_label : vn[n].value_id);
2024 printf(
"P: %s vt=%d ct=%d c=%d\n", _id.c_str(), v_type, c_type, controllable);
2031 map<string, Parameter*>::iterator ii = id_map.find(param->
id());
2032 if (ii != id_map.end()) {
2034 insert_remove(p,
false);
2040 id_map.insert(pair<string, Parameter*>(param->
id(), param));
2041 insert_remove(param,
true);
2049 insert_remove(p,
false);
2050 id_map.erase(p->
id());
2062 for (
iterator i = id_map.begin(); i != id_map.end(); ++i) {
2063 i->second->stdJSON_value();
2064 i->second->setJSON_value();
2068 static inline bool compare_groups(
const std::string&
id,
const char **groups) {
2072 for (
const char **g = groups; *g; g += 2) {
2079 if (strncmp(
id.c_str(), p, n) == 0 &&
id[n] ==
'.') {
2087 std::string group_id(pdef->
id);
2089 std::string on_off = group_id +
"on_off";
2090 std::string pp = group_id +
"pp";
2091 std::string position = group_id +
"position";
2093 if (i->first.compare(0, group_id.size(), group_id) == 0 || compare_groups(i->first, pdef->
groups)) {
2094 if (i->second->isInPreset()) {
2095 if (i->first != on_off && i->first != pp && i->first != position) {
2096 i->second->stdJSON_value();
2097 if (!i->second->compareJSON_value()) {
2110 std::string group_id(pdef->
id);
2112 std::string on_off = group_id +
"on_off";
2113 std::string pp = group_id +
"pp";
2114 std::string position = group_id +
"position";
2116 if (i->first.compare(0, group_id.size(), group_id) == 0 || compare_groups(i->first, pdef->
groups)) {
2117 if (i->second->isInPreset()) {
2118 if (i->first != on_off && i->first != pp && i->first != position) {
2119 i->second->stdJSON_value();
2120 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
void set_midi_channel(int s)
virtual void writeJSON(gx_system::JsonWriter &jw) const