22 |
|
|
23 |
#include "compat.h" |
#include "compat.h" |
24 |
|
|
25 |
|
#if USE_GTKMM_GRID |
26 |
|
# include <gtkmm/grid.h> |
27 |
|
#else |
28 |
|
# include <gtkmm/table.h> |
29 |
|
#endif |
30 |
|
|
31 |
VelocityCurve::VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t)) : |
VelocityCurve::VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t)) : |
32 |
getter(getter), dimreg(0) { |
getter(getter), dimreg(0) { |
33 |
set_size_request(80, 80); |
set_size_request(80, 80); |
443 |
); |
); |
444 |
|
|
445 |
for (int i = 0 ; i < 7 ; i++) { |
for (int i = 0 ; i < 7 ; i++) { |
446 |
|
#if USE_GTKMM_GRID |
447 |
|
table[i] = new Gtk::Grid; |
448 |
|
table[i]->set_column_spacing(7); |
449 |
|
#else |
450 |
table[i] = new Gtk::Table(3, 1); |
table[i] = new Gtk::Table(3, 1); |
451 |
table[i]->set_col_spacings(7); |
table[i]->set_col_spacings(7); |
452 |
|
#endif |
453 |
|
|
454 |
} |
} |
455 |
|
|
456 |
// set tooltips |
// set tooltips |
635 |
|
|
636 |
Gtk::Frame* frame = new Gtk::Frame; |
Gtk::Frame* frame = new Gtk::Frame; |
637 |
frame->add(crossfade_curve); |
frame->add(crossfade_curve); |
638 |
|
#if USE_GTKMM_GRID |
639 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
640 |
|
#else |
641 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
642 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
643 |
|
#endif |
644 |
rowno++; |
rowno++; |
645 |
|
|
646 |
eCrossfade_in_start.signal_value_changed().connect( |
eCrossfade_in_start.signal_value_changed().connect( |
714 |
|
|
715 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
716 |
frame->add(cutoff_curve); |
frame->add(cutoff_curve); |
717 |
|
#if USE_GTKMM_GRID |
718 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
719 |
|
#else |
720 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
721 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
722 |
|
#endif |
723 |
rowno++; |
rowno++; |
724 |
|
|
725 |
addProp(eVCFResonance); |
addProp(eVCFResonance); |
820 |
|
|
821 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
822 |
frame->add(velocity_curve); |
frame->add(velocity_curve); |
823 |
|
#if USE_GTKMM_GRID |
824 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
825 |
|
#else |
826 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
827 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
828 |
|
#endif |
829 |
rowno++; |
rowno++; |
830 |
|
|
831 |
addHeader(_("Release Velocity Response")); |
addHeader(_("Release Velocity Response")); |
840 |
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
841 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
842 |
frame->add(release_curve); |
frame->add(release_curve); |
843 |
|
#if USE_GTKMM_GRID |
844 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
845 |
|
#else |
846 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
847 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
848 |
|
#endif |
849 |
rowno++; |
rowno++; |
850 |
|
|
851 |
addProp(eReleaseTriggerDecay); |
addProp(eReleaseTriggerDecay); |
940 |
Gtk::Entry*& widget) |
Gtk::Entry*& widget) |
941 |
{ |
{ |
942 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
943 |
|
#if HAS_GTKMM_ALIGNMENT |
944 |
label->set_alignment(Gtk::ALIGN_START); |
label->set_alignment(Gtk::ALIGN_START); |
945 |
|
#else |
946 |
|
label->set_halign(Gtk::Align::START); |
947 |
|
#endif |
948 |
|
|
949 |
|
#if USE_GTKMM_GRID |
950 |
|
table[pageno]->attach(*label, 1, rowno); |
951 |
|
#else |
952 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
953 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
954 |
|
#endif |
955 |
|
|
956 |
widget = new Gtk::Entry(); |
widget = new Gtk::Entry(); |
957 |
|
|
958 |
|
#if USE_GTKMM_GRID |
959 |
|
table[pageno]->attach(*widget, 2, rowno); |
960 |
|
#else |
961 |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
962 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
963 |
|
#endif |
964 |
|
|
965 |
rowno++; |
rowno++; |
966 |
} |
} |
969 |
Gtk::Entry*& widget, Gtk::Button*& button) |
Gtk::Entry*& widget, Gtk::Button*& button) |
970 |
{ |
{ |
971 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
972 |
|
#if HAS_GTKMM_ALIGNMENT |
973 |
label->set_alignment(Gtk::ALIGN_START); |
label->set_alignment(Gtk::ALIGN_START); |
974 |
|
#else |
975 |
|
label->set_halign(Gtk::Align::START); |
976 |
|
#endif |
977 |
|
|
978 |
|
#if USE_GTKMM_GRID |
979 |
|
table[pageno]->attach(*label, 1, rowno); |
980 |
|
#else |
981 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
982 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
983 |
|
#endif |
984 |
|
|
985 |
widget = new Gtk::Entry(); |
widget = new Gtk::Entry(); |
986 |
button = new Gtk::Button(); |
button = new Gtk::Button(); |
987 |
|
|
988 |
Gtk::HBox* hbox = new Gtk::HBox; |
HBox* hbox = new HBox; |
989 |
hbox->pack_start(*widget); |
hbox->pack_start(*widget); |
990 |
hbox->pack_start(*button, Gtk::PACK_SHRINK); |
hbox->pack_start(*button, Gtk::PACK_SHRINK); |
991 |
|
|
992 |
|
#if USE_GTKMM_GRID |
993 |
|
table[pageno]->attach(*hbox, 2, rowno); |
994 |
|
#else |
995 |
table[pageno]->attach(*hbox, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(*hbox, 2, 3, rowno, rowno + 1, |
996 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
997 |
|
#endif |
998 |
|
|
999 |
rowno++; |
rowno++; |
1000 |
} |
} |
1004 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1005 |
{ |
{ |
1006 |
Gtk::Label* filler = new Gtk::Label(" "); |
Gtk::Label* filler = new Gtk::Label(" "); |
1007 |
|
#if USE_GTKMM_GRID |
1008 |
|
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1009 |
|
#else |
1010 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1011 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1012 |
|
#endif |
1013 |
} |
} |
1014 |
Glib::ustring str = "<b>"; |
Glib::ustring str = "<b>"; |
1015 |
str += text; |
str += text; |
1016 |
str += "</b>"; |
str += "</b>"; |
1017 |
Gtk::Label* label = new Gtk::Label(str); |
Gtk::Label* label = new Gtk::Label(str); |
1018 |
label->set_use_markup(); |
label->set_use_markup(); |
1019 |
|
#if HAS_GTKMM_ALIGNMENT |
1020 |
label->set_alignment(Gtk::ALIGN_START); |
label->set_alignment(Gtk::ALIGN_START); |
1021 |
|
#else |
1022 |
|
label->set_halign(Gtk::Align::START); |
1023 |
|
#endif |
1024 |
|
#if USE_GTKMM_GRID |
1025 |
|
table[pageno]->attach(*label, 0, rowno, 3); |
1026 |
|
#else |
1027 |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
1028 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1029 |
|
#endif |
1030 |
rowno++; |
rowno++; |
1031 |
firstRowInBlock = rowno; |
firstRowInBlock = rowno; |
1032 |
return label; |
return label; |
1037 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1038 |
{ |
{ |
1039 |
Gtk::Label* filler = new Gtk::Label(" "); |
Gtk::Label* filler = new Gtk::Label(" "); |
1040 |
|
#if USE_GTKMM_GRID |
1041 |
|
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1042 |
|
#else |
1043 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1044 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1045 |
|
#endif |
1046 |
} |
} |
1047 |
pageno++; |
pageno++; |
1048 |
rowno = 0; |
rowno = 0; |
1051 |
|
|
1052 |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
1053 |
{ |
{ |
1054 |
|
#if USE_GTKMM_GRID |
1055 |
|
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1056 |
|
#else |
1057 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1058 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1059 |
|
#endif |
1060 |
rowno++; |
rowno++; |
1061 |
} |
} |
1062 |
|
|
1063 |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
1064 |
{ |
{ |
1065 |
|
#if USE_GTKMM_GRID |
1066 |
|
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1067 |
|
#else |
1068 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1069 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1070 |
|
#endif |
1071 |
rowno++; |
rowno++; |
1072 |
} |
} |
1073 |
|
|
1074 |
void DimRegionEdit::addProp(LabelWidget& prop) |
void DimRegionEdit::addProp(LabelWidget& prop) |
1075 |
{ |
{ |
1076 |
|
#if USE_GTKMM_GRID |
1077 |
|
table[pageno]->attach(prop.label, 1, rowno); |
1078 |
|
table[pageno]->attach(prop.widget, 2, rowno); |
1079 |
|
#else |
1080 |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
1081 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1082 |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
1083 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1084 |
|
#endif |
1085 |
rowno++; |
rowno++; |
1086 |
} |
} |
1087 |
|
|
1088 |
void DimRegionEdit::addLine(Gtk::HBox& line) |
void DimRegionEdit::addLine(HBox& line) |
1089 |
{ |
{ |
1090 |
|
#if USE_GTKMM_GRID |
1091 |
|
table[pageno]->attach(line, 1, rowno, 2); |
1092 |
|
#else |
1093 |
table[pageno]->attach(line, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(line, 1, 3, rowno, rowno + 1, |
1094 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1095 |
|
#endif |
1096 |
rowno++; |
rowno++; |
1097 |
} |
} |
1098 |
|
|
1099 |
void DimRegionEdit::addRightHandSide(Gtk::Widget& widget) |
void DimRegionEdit::addRightHandSide(Gtk::Widget& widget) |
1100 |
{ |
{ |
1101 |
|
#if USE_GTKMM_GRID |
1102 |
|
table[pageno]->attach(widget, 2, rowno); |
1103 |
|
#else |
1104 |
table[pageno]->attach(widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(widget, 2, 3, rowno, rowno + 1, |
1105 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1106 |
|
#endif |
1107 |
rowno++; |
rowno++; |
1108 |
} |
} |
1109 |
|
|