/[svn]/gigedit/trunk/src/gigedit/dimregionedit.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/dimregionedit.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2991 by schoenebeck, Sat Sep 24 15:08:37 2016 UTC revision 3408 by schoenebeck, Fri Jan 19 19:17:41 2018 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (C) 2006-2016 Andreas Persson   * Copyright (C) 2006-2017 Andreas Persson
3   *   *
4   * This program is free software; you can redistribute it and/or   * This program is free software; you can redistribute it and/or
5   * modify it under the terms of the GNU General Public License as   * modify it under the terms of the GNU General Public License as
# Line 17  Line 17 
17   * 02110-1301 USA.   * 02110-1301 USA.
18   */   */
19    
20    #include "global.h"
21  #include "dimregionedit.h"  #include "dimregionedit.h"
22    
 #include "global.h"  
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);
# Line 147  void CrossfadeCurve::draw_one_curve(cons Line 153  void CrossfadeCurve::draw_one_curve(cons
153  }  }
154    
155    
156    EGStateOptions::EGStateOptions() : HBox(),
157        label(_("May be cancelled: ")),
158        checkBoxAttack(_("Attack")),
159        checkBoxAttackHold(_("Attack Hold")),
160        checkBoxDecay1(_("Decay 1")),
161        checkBoxDecay2(_("Decay 2")),
162        checkBoxRelease(_("Release"))
163    {
164        set_spacing(6);
165    
166        pack_start(label);
167        pack_start(checkBoxAttack, Gtk::PACK_SHRINK);
168        pack_start(checkBoxAttackHold, Gtk::PACK_SHRINK);
169        pack_start(checkBoxDecay1, Gtk::PACK_SHRINK);
170        pack_start(checkBoxDecay2, Gtk::PACK_SHRINK);
171        pack_start(checkBoxRelease, Gtk::PACK_SHRINK);
172    
173        checkBoxAttack.set_tooltip_text(_(
174            "If checked: a note-off aborts the 'attack' stage."
175        ));
176        checkBoxAttackHold.set_tooltip_text(_(
177            "If checked: a note-off aborts the 'attack hold' stage."
178        ));
179        checkBoxDecay1.set_tooltip_text(_(
180            "If checked: a note-off aborts the 'decay 1' stage."
181        ));
182        checkBoxDecay2.set_tooltip_text(_(
183            "If checked: a note-off aborts the 'decay 2' stage."
184        ));
185        checkBoxRelease.set_tooltip_text(_(
186            "If checked: a note-on reverts back from the 'release' stage."
187        ));
188    }
189    
190    
191  DimRegionEdit::DimRegionEdit() :  DimRegionEdit::DimRegionEdit() :
192      velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation),      velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation),
193      release_curve(&gig::DimensionRegion::GetVelocityRelease),      release_curve(&gig::DimensionRegion::GetVelocityRelease),
# Line 238  DimRegionEdit::DimRegionEdit() : Line 279  DimRegionEdit::DimRegionEdit() :
279      eGain(_("Gain"), -96, 0, 2, -655360),      eGain(_("Gain"), -96, 0, 2, -655360),
280      eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360),      eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360),
281      eSampleLoopEnabled(_("Enabled")),      eSampleLoopEnabled(_("Enabled")),
282      eSampleLoopStart(_("Loop start positon")),      eSampleLoopStart(_("Loop start position")),
283      eSampleLoopLength(_("Loop size")),      eSampleLoopLength(_("Loop size")),
284      eSampleLoopType(_("Loop type")),      eSampleLoopType(_("Loop type")),
285      eSampleLoopInfinite(_("Infinite loop")),      eSampleLoopInfinite(_("Infinite loop")),
# Line 266  DimRegionEdit::DimRegionEdit() : Line 307  DimRegionEdit::DimRegionEdit() :
307              &gig::DimensionRegion::EG1ControllerDecayInfluence);              &gig::DimensionRegion::EG1ControllerDecayInfluence);
308      connect(eEG1ControllerReleaseInfluence,      connect(eEG1ControllerReleaseInfluence,
309              &gig::DimensionRegion::EG1ControllerReleaseInfluence);              &gig::DimensionRegion::EG1ControllerReleaseInfluence);
310        {
311            ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.AttackCancel));
312            connect(eEG1StateOptions.checkBoxAttack, mp.pmember);
313        }
314        {
315            ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.AttackHoldCancel));
316            connect(eEG1StateOptions.checkBoxAttackHold, mp.pmember);
317        }
318        {
319            ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.Decay1Cancel));
320            connect(eEG1StateOptions.checkBoxDecay1, mp.pmember);
321        }
322        {
323            ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.Decay2Cancel));
324            connect(eEG1StateOptions.checkBoxDecay2, mp.pmember);
325        }
326        {
327            ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.ReleaseCancel));
328            connect(eEG1StateOptions.checkBoxRelease, mp.pmember);
329        }
330      connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency);      connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency);
331      connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth);      connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth);
332      connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth);      connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth);
# Line 287  DimRegionEdit::DimRegionEdit() : Line 348  DimRegionEdit::DimRegionEdit() :
348              &gig::DimensionRegion::EG2ControllerDecayInfluence);              &gig::DimensionRegion::EG2ControllerDecayInfluence);
349      connect(eEG2ControllerReleaseInfluence,      connect(eEG2ControllerReleaseInfluence,
350              &gig::DimensionRegion::EG2ControllerReleaseInfluence);              &gig::DimensionRegion::EG2ControllerReleaseInfluence);
351        {
352            ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.AttackCancel));
353            connect(eEG2StateOptions.checkBoxAttack, mp.pmember);
354        }
355        {
356            ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.AttackHoldCancel));
357            connect(eEG2StateOptions.checkBoxAttackHold, mp.pmember);
358        }
359        {
360            ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.Decay1Cancel));
361            connect(eEG2StateOptions.checkBoxDecay1, mp.pmember);
362        }
363        {
364            ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.Decay2Cancel));
365            connect(eEG2StateOptions.checkBoxDecay2, mp.pmember);
366        }
367        {
368            ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.ReleaseCancel));
369            connect(eEG2StateOptions.checkBoxRelease, mp.pmember);
370        }
371      connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency);      connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency);
372      connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth);      connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth);
373      connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth);      connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth);
# Line 362  DimRegionEdit::DimRegionEdit() : Line 443  DimRegionEdit::DimRegionEdit() :
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    // on Gtk 3 there is absolutely no margin by default
455    #if GTKMM_MAJOR_VERSION >= 3
456    # if GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION < 12
457            table[i]->set_margin_left(12);
458            table[i]->set_margin_right(12);
459    # else
460            table[i]->set_margin_start(12);
461            table[i]->set_margin_end(12);
462    # endif
463    #endif
464      }      }
465    
466      // set tooltips      // set tooltips
# Line 514  DimRegionEdit::DimRegionEdit() : Line 611  DimRegionEdit::DimRegionEdit() :
611      addProp(eEG1ControllerAttackInfluence);      addProp(eEG1ControllerAttackInfluence);
612      addProp(eEG1ControllerDecayInfluence);      addProp(eEG1ControllerDecayInfluence);
613      addProp(eEG1ControllerReleaseInfluence);      addProp(eEG1ControllerReleaseInfluence);
614        addLine(eEG1StateOptions);
615    
616      nextPage();      nextPage();
617    
# Line 547  DimRegionEdit::DimRegionEdit() : Line 645  DimRegionEdit::DimRegionEdit() :
645    
646      Gtk::Frame* frame = new Gtk::Frame;      Gtk::Frame* frame = new Gtk::Frame;
647      frame->add(crossfade_curve);      frame->add(crossfade_curve);
648        // on Gtk 3 there is no margin at all by default
649    #if GTKMM_MAJOR_VERSION >= 3
650        frame->set_margin_top(12);
651        frame->set_margin_bottom(12);
652    #endif
653    #if USE_GTKMM_GRID
654        table[pageno]->attach(*frame, 1, rowno, 2);
655    #else
656      table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,      table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,
657                            Gtk::SHRINK, Gtk::SHRINK);                            Gtk::SHRINK, Gtk::SHRINK);
658    #endif
659      rowno++;      rowno++;
660    
661      eCrossfade_in_start.signal_value_changed().connect(      eCrossfade_in_start.signal_value_changed().connect(
# Line 622  DimRegionEdit::DimRegionEdit() : Line 729  DimRegionEdit::DimRegionEdit() :
729    
730      frame = new Gtk::Frame;      frame = new Gtk::Frame;
731      frame->add(cutoff_curve);      frame->add(cutoff_curve);
732        // on Gtk 3 there is no margin at all by default
733    #if GTKMM_MAJOR_VERSION >= 3
734        frame->set_margin_top(12);
735        frame->set_margin_bottom(12);
736    #endif
737    #if USE_GTKMM_GRID
738        table[pageno]->attach(*frame, 1, rowno, 2);
739    #else
740      table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,      table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,
741                            Gtk::SHRINK, Gtk::SHRINK);                            Gtk::SHRINK, Gtk::SHRINK);
742    #endif
743      rowno++;      rowno++;
744    
745      addProp(eVCFResonance);      addProp(eVCFResonance);
# Line 659  DimRegionEdit::DimRegionEdit() : Line 775  DimRegionEdit::DimRegionEdit() :
775      addProp(eEG2ControllerAttackInfluence);      addProp(eEG2ControllerAttackInfluence);
776      addProp(eEG2ControllerDecayInfluence);      addProp(eEG2ControllerDecayInfluence);
777      addProp(eEG2ControllerReleaseInfluence);      addProp(eEG2ControllerReleaseInfluence);
778        addLine(eEG2StateOptions);
779      lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)"));      lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)"));
780      addProp(eLFO2Frequency);      addProp(eLFO2Frequency);
781      addProp(eLFO2InternalDepth);      addProp(eLFO2InternalDepth);
# Line 723  DimRegionEdit::DimRegionEdit() : Line 840  DimRegionEdit::DimRegionEdit() :
840    
841      frame = new Gtk::Frame;      frame = new Gtk::Frame;
842      frame->add(velocity_curve);      frame->add(velocity_curve);
843        // on Gtk 3 there is no margin at all by default
844    #if GTKMM_MAJOR_VERSION >= 3
845        frame->set_margin_top(12);
846        frame->set_margin_bottom(12);
847    #endif
848    #if USE_GTKMM_GRID
849        table[pageno]->attach(*frame, 1, rowno, 2);
850    #else
851      table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,      table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,
852                            Gtk::SHRINK, Gtk::SHRINK);                            Gtk::SHRINK, Gtk::SHRINK);
853    #endif
854      rowno++;      rowno++;
855    
856      addHeader(_("Release Velocity Response"));      addHeader(_("Release Velocity Response"));
# Line 739  DimRegionEdit::DimRegionEdit() : Line 865  DimRegionEdit::DimRegionEdit() :
865          sigc::mem_fun(release_curve, &VelocityCurve::queue_draw));          sigc::mem_fun(release_curve, &VelocityCurve::queue_draw));
866      frame = new Gtk::Frame;      frame = new Gtk::Frame;
867      frame->add(release_curve);      frame->add(release_curve);
868        // on Gtk 3 there is no margin at all by default
869    #if GTKMM_MAJOR_VERSION >= 3
870        frame->set_margin_top(12);
871        frame->set_margin_bottom(12);
872    #endif
873    #if USE_GTKMM_GRID
874        table[pageno]->attach(*frame, 1, rowno, 2);
875    #else
876      table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,      table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,
877                            Gtk::SHRINK, Gtk::SHRINK);                            Gtk::SHRINK, Gtk::SHRINK);
878    #endif
879      rowno++;      rowno++;
880    
881      addProp(eReleaseTriggerDecay);      addProp(eReleaseTriggerDecay);
# Line 835  void DimRegionEdit::addString(const char Line 970  void DimRegionEdit::addString(const char
970                                Gtk::Entry*& widget)                                Gtk::Entry*& widget)
971  {  {
972      label = new Gtk::Label(Glib::ustring(labelText) + ":");      label = new Gtk::Label(Glib::ustring(labelText) + ":");
973    #if HAS_GTKMM_ALIGNMENT
974      label->set_alignment(Gtk::ALIGN_START);      label->set_alignment(Gtk::ALIGN_START);
975    #else
976        label->set_halign(Gtk::Align::START);
977    #endif
978    
979    #if USE_GTKMM_GRID
980        table[pageno]->attach(*label, 1, rowno);
981    #else
982      table[pageno]->attach(*label, 1, 2, rowno, rowno + 1,      table[pageno]->attach(*label, 1, 2, rowno, rowno + 1,
983                            Gtk::FILL, Gtk::SHRINK);                            Gtk::FILL, Gtk::SHRINK);
984    #endif
985    
986      widget = new Gtk::Entry();      widget = new Gtk::Entry();
987    
988    #if USE_GTKMM_GRID
989        table[pageno]->attach(*widget, 2, rowno);
990    #else
991      table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1,      table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1,
992                            Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK);                            Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK);
993    #endif
994    
995      rowno++;      rowno++;
996  }  }
# Line 852  void DimRegionEdit::addString(const char Line 999  void DimRegionEdit::addString(const char
999                                Gtk::Entry*& widget, Gtk::Button*& button)                                Gtk::Entry*& widget, Gtk::Button*& button)
1000  {  {
1001      label = new Gtk::Label(Glib::ustring(labelText) + ":");      label = new Gtk::Label(Glib::ustring(labelText) + ":");
1002    #if HAS_GTKMM_ALIGNMENT
1003      label->set_alignment(Gtk::ALIGN_START);      label->set_alignment(Gtk::ALIGN_START);
1004    #else
1005        label->set_halign(Gtk::Align::START);
1006    #endif
1007    
1008    #if USE_GTKMM_GRID
1009        table[pageno]->attach(*label, 1, rowno);
1010    #else
1011      table[pageno]->attach(*label, 1, 2, rowno, rowno + 1,      table[pageno]->attach(*label, 1, 2, rowno, rowno + 1,
1012                            Gtk::FILL, Gtk::SHRINK);                            Gtk::FILL, Gtk::SHRINK);
1013    #endif
1014    
1015      widget = new Gtk::Entry();      widget = new Gtk::Entry();
1016      button = new Gtk::Button();      button = new Gtk::Button();
1017    
1018      Gtk::HBox* hbox = new Gtk::HBox;      HBox* hbox = new HBox;
1019      hbox->pack_start(*widget);      hbox->pack_start(*widget);
1020      hbox->pack_start(*button, Gtk::PACK_SHRINK);      hbox->pack_start(*button, Gtk::PACK_SHRINK);
1021    
1022    #if USE_GTKMM_GRID
1023        table[pageno]->attach(*hbox, 2, rowno);
1024    #else
1025      table[pageno]->attach(*hbox, 2, 3, rowno, rowno + 1,      table[pageno]->attach(*hbox, 2, 3, rowno, rowno + 1,
1026                            Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK);                            Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK);
1027    #endif
1028    
1029      rowno++;      rowno++;
1030  }  }
# Line 875  Gtk::Label* DimRegionEdit::addHeader(con Line 1034  Gtk::Label* DimRegionEdit::addHeader(con
1034      if (firstRowInBlock < rowno - 1)      if (firstRowInBlock < rowno - 1)
1035      {      {
1036          Gtk::Label* filler = new Gtk::Label("    ");          Gtk::Label* filler = new Gtk::Label("    ");
1037    #if USE_GTKMM_GRID
1038            table[pageno]->attach(*filler, 0, firstRowInBlock);
1039    #else
1040          table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno,          table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno,
1041                                Gtk::FILL, Gtk::SHRINK);                                Gtk::FILL, Gtk::SHRINK);
1042    #endif
1043      }      }
1044      Glib::ustring str = "<b>";      Glib::ustring str = "<b>";
1045      str += text;      str += text;
1046      str += "</b>";      str += "</b>";
1047      Gtk::Label* label = new Gtk::Label(str);      Gtk::Label* label = new Gtk::Label(str);
1048      label->set_use_markup();      label->set_use_markup();
1049    #if HAS_GTKMM_ALIGNMENT
1050      label->set_alignment(Gtk::ALIGN_START);      label->set_alignment(Gtk::ALIGN_START);
1051    #else
1052        label->set_halign(Gtk::Align::START);
1053    #endif
1054        // on GTKMM 3 there is absolutely no margin by default
1055    #if GTKMM_MAJOR_VERSION >= 3
1056        label->set_margin_top(18);
1057        label->set_margin_bottom(13);
1058    #endif
1059    #if USE_GTKMM_GRID
1060        table[pageno]->attach(*label, 0, rowno, 3);
1061    #else
1062      table[pageno]->attach(*label, 0, 3, rowno, rowno + 1,      table[pageno]->attach(*label, 0, 3, rowno, rowno + 1,
1063                            Gtk::FILL, Gtk::SHRINK);                            Gtk::FILL, Gtk::SHRINK);
1064    #endif
1065      rowno++;      rowno++;
1066      firstRowInBlock = rowno;      firstRowInBlock = rowno;
1067      return label;      return label;
# Line 896  void DimRegionEdit::nextPage() Line 1072  void DimRegionEdit::nextPage()
1072      if (firstRowInBlock < rowno - 1)      if (firstRowInBlock < rowno - 1)
1073      {      {
1074          Gtk::Label* filler = new Gtk::Label("    ");          Gtk::Label* filler = new Gtk::Label("    ");
1075    #if USE_GTKMM_GRID
1076            table[pageno]->attach(*filler, 0, firstRowInBlock);
1077    #else
1078          table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno,          table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno,
1079                                Gtk::FILL, Gtk::SHRINK);                                Gtk::FILL, Gtk::SHRINK);
1080    #endif
1081      }      }
1082      pageno++;      pageno++;
1083      rowno = 0;      rowno = 0;
# Line 906  void DimRegionEdit::nextPage() Line 1086  void DimRegionEdit::nextPage()
1086    
1087  void DimRegionEdit::addProp(BoolEntry& boolentry)  void DimRegionEdit::addProp(BoolEntry& boolentry)
1088  {  {
1089    #if USE_GTKMM_GRID
1090        table[pageno]->attach(boolentry.widget, 1, rowno, 2);
1091    #else
1092      table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1,      table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1,
1093                            Gtk::FILL, Gtk::SHRINK);                            Gtk::FILL, Gtk::SHRINK);
1094    #endif
1095      rowno++;      rowno++;
1096  }  }
1097    
1098  void DimRegionEdit::addProp(BoolEntryPlus6& boolentry)  void DimRegionEdit::addProp(BoolEntryPlus6& boolentry)
1099  {  {
1100    #if USE_GTKMM_GRID
1101        table[pageno]->attach(boolentry.widget, 1, rowno, 2);
1102    #else
1103      table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1,      table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1,
1104                            Gtk::FILL, Gtk::SHRINK);                            Gtk::FILL, Gtk::SHRINK);
1105    #endif
1106      rowno++;      rowno++;
1107  }  }
1108    
1109  void DimRegionEdit::addProp(LabelWidget& prop)  void DimRegionEdit::addProp(LabelWidget& prop)
1110  {  {
1111    #if USE_GTKMM_GRID
1112        table[pageno]->attach(prop.label, 1, rowno);
1113        table[pageno]->attach(prop.widget, 2, rowno);
1114    #else
1115      table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1,      table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1,
1116                            Gtk::FILL, Gtk::SHRINK);                            Gtk::FILL, Gtk::SHRINK);
1117      table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1,      table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1,
1118                            Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK);                            Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK);
1119    #endif
1120        rowno++;
1121    }
1122    
1123    void DimRegionEdit::addLine(HBox& line)
1124    {
1125    #if USE_GTKMM_GRID
1126        table[pageno]->attach(line, 1, rowno, 2);
1127    #else
1128        table[pageno]->attach(line, 1, 3, rowno, rowno + 1,
1129                              Gtk::FILL, Gtk::SHRINK);
1130    #endif
1131      rowno++;      rowno++;
1132  }  }
1133    
1134  void DimRegionEdit::addRightHandSide(Gtk::Widget& widget)  void DimRegionEdit::addRightHandSide(Gtk::Widget& widget)
1135  {  {
1136    #if USE_GTKMM_GRID
1137        table[pageno]->attach(widget, 2, rowno);
1138    #else
1139      table[pageno]->attach(widget, 2, 3, rowno, rowno + 1,      table[pageno]->attach(widget, 2, 3, rowno, rowno + 1,
1140                            Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK);                            Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK);
1141    #endif
1142      rowno++;      rowno++;
1143  }  }
1144    
# Line 959  void DimRegionEdit::set_dim_region(gig:: Line 1167  void DimRegionEdit::set_dim_region(gig::
1167      eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence);      eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence);
1168      eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence);      eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence);
1169      eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence);      eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence);
1170        eEG1StateOptions.checkBoxAttack.set_value(d->EG1Options.AttackCancel);
1171        eEG1StateOptions.checkBoxAttackHold.set_value(d->EG1Options.AttackHoldCancel);
1172        eEG1StateOptions.checkBoxDecay1.set_value(d->EG1Options.Decay1Cancel);
1173        eEG1StateOptions.checkBoxDecay2.set_value(d->EG1Options.Decay2Cancel);
1174        eEG1StateOptions.checkBoxRelease.set_value(d->EG1Options.ReleaseCancel);
1175      eLFO1Frequency.set_value(d->LFO1Frequency);      eLFO1Frequency.set_value(d->LFO1Frequency);
1176      eLFO1InternalDepth.set_value(d->LFO1InternalDepth);      eLFO1InternalDepth.set_value(d->LFO1InternalDepth);
1177      eLFO1ControlDepth.set_value(d->LFO1ControlDepth);      eLFO1ControlDepth.set_value(d->LFO1ControlDepth);
# Line 977  void DimRegionEdit::set_dim_region(gig:: Line 1190  void DimRegionEdit::set_dim_region(gig::
1190      eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence);      eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence);
1191      eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence);      eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence);
1192      eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence);      eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence);
1193        eEG2StateOptions.checkBoxAttack.set_value(d->EG2Options.AttackCancel);
1194        eEG2StateOptions.checkBoxAttackHold.set_value(d->EG2Options.AttackHoldCancel);
1195        eEG2StateOptions.checkBoxDecay1.set_value(d->EG2Options.Decay1Cancel);
1196        eEG2StateOptions.checkBoxDecay2.set_value(d->EG2Options.Decay2Cancel);
1197        eEG2StateOptions.checkBoxRelease.set_value(d->EG2Options.ReleaseCancel);
1198      eLFO2Frequency.set_value(d->LFO2Frequency);      eLFO2Frequency.set_value(d->LFO2Frequency);
1199      eLFO2InternalDepth.set_value(d->LFO2InternalDepth);      eLFO2InternalDepth.set_value(d->LFO2InternalDepth);
1200      eLFO2ControlDepth.set_value(d->LFO2ControlDepth);      eLFO2ControlDepth.set_value(d->LFO2ControlDepth);
# Line 1122  void DimRegionEdit::VCFEnabled_toggled() Line 1340  void DimRegionEdit::VCFEnabled_toggled()
1340      eEG2ControllerAttackInfluence.set_sensitive(sensitive);      eEG2ControllerAttackInfluence.set_sensitive(sensitive);
1341      eEG2ControllerDecayInfluence.set_sensitive(sensitive);      eEG2ControllerDecayInfluence.set_sensitive(sensitive);
1342      eEG2ControllerReleaseInfluence.set_sensitive(sensitive);      eEG2ControllerReleaseInfluence.set_sensitive(sensitive);
1343        eEG2StateOptions.set_sensitive(sensitive);
1344      lLFO2->set_sensitive(sensitive);      lLFO2->set_sensitive(sensitive);
1345      eLFO2Frequency.set_sensitive(sensitive);      eLFO2Frequency.set_sensitive(sensitive);
1346      eLFO2InternalDepth.set_sensitive(sensitive);      eLFO2InternalDepth.set_sensitive(sensitive);
# Line 1315  void DimRegionEdit::loop_infinite_toggle Line 1534  void DimRegionEdit::loop_infinite_toggle
1534    
1535  bool DimRegionEdit::set_sample(gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop)  bool DimRegionEdit::set_sample(gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop)
1536  {  {
1537        bool result = false;
1538      for (std::set<gig::DimensionRegion*>::iterator itDimReg = dimregs.begin();      for (std::set<gig::DimensionRegion*>::iterator itDimReg = dimregs.begin();
1539           itDimReg != dimregs.end(); ++itDimReg)           itDimReg != dimregs.end(); ++itDimReg)
1540      {      {
1541          set_sample(*itDimReg, sample, copy_sample_unity, copy_sample_tune, copy_sample_loop);          result |= set_sample(*itDimReg, sample, copy_sample_unity, copy_sample_tune, copy_sample_loop);
1542      }      }
1543        return result;
1544  }  }
1545    
1546  bool DimRegionEdit::set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop)  bool DimRegionEdit::set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop)
# Line 1328  bool DimRegionEdit::set_sample(gig::Dime Line 1549  bool DimRegionEdit::set_sample(gig::Dime
1549          //TODO: we should better move the code from MainWindow::on_sample_label_drop_drag_data_received() here          //TODO: we should better move the code from MainWindow::on_sample_label_drop_drag_data_received() here
1550    
1551          // currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received()          // currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received()
1552          //dimreg_to_be_changed_signal.emit(dimregion);          //DimRegionChangeGuard(this, dimregion);
1553    
1554          // make sure stereo samples always are the same in both          // make sure stereo samples always are the same in both
1555          // dimregs in the samplechannel dimension          // dimregs in the samplechannel dimension
# Line 1398  bool DimRegionEdit::set_sample(gig::Dime Line 1619  bool DimRegionEdit::set_sample(gig::Dime
1619          update_model--;          update_model--;
1620    
1621          sample_ref_changed_signal.emit(oldref, sample);          sample_ref_changed_signal.emit(oldref, sample);
         // currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received()  
         //dimreg_changed_signal.emit(dimreg);  
1622          return true;          return true;
1623      }      }
1624      return false;      return false;
# Line 1468  void DimRegionEdit::set_LoopEnabled(gig: Line 1687  void DimRegionEdit::set_LoopEnabled(gig:
1687      if (value) {      if (value) {
1688          // create a new sample loop in case there is none yet          // create a new sample loop in case there is none yet
1689          if (!d->SampleLoops) {          if (!d->SampleLoops) {
1690                DimRegionChangeGuard(this, d);
1691    
1692              DLS::sample_loop_t loop;              DLS::sample_loop_t loop;
1693              loop.LoopType = gig::loop_type_normal;              loop.LoopType = gig::loop_type_normal;
1694              // loop the whole sample by default              // loop the whole sample by default
1695              loop.LoopStart  = 0;              loop.LoopStart  = 0;
1696              loop.LoopLength =              loop.LoopLength =
1697                  (d->pSample) ? d->pSample->SamplesTotal : 0;                  (d->pSample) ? d->pSample->SamplesTotal : 0;
             dimreg_to_be_changed_signal.emit(d);  
1698              d->AddSampleLoop(&loop);              d->AddSampleLoop(&loop);
             dimreg_changed_signal.emit(d);  
1699          }          }
1700      } else {      } else {
1701          if (d->SampleLoops) {          if (d->SampleLoops) {
1702              dimreg_to_be_changed_signal.emit(d);              DimRegionChangeGuard(this, d);
1703    
1704              // delete ALL existing sample loops              // delete ALL existing sample loops
1705              while (d->SampleLoops) {              while (d->SampleLoops) {
1706                  d->DeleteSampleLoop(&d->pSampleLoops[0]);                  d->DeleteSampleLoop(&d->pSampleLoops[0]);
1707              }              }
             dimreg_changed_signal.emit(d);  
1708          }          }
1709      }      }
1710  }  }
# Line 1535  void DimRegionEdit::nullOutSampleReferen Line 1754  void DimRegionEdit::nullOutSampleReferen
1754      gig::Sample* oldref = dimregion->pSample;      gig::Sample* oldref = dimregion->pSample;
1755      if (!oldref) return;      if (!oldref) return;
1756    
1757      dimreg_to_be_changed_signal.emit(dimregion);      DimRegionChangeGuard(this, dimregion);
1758    
1759      // in case currently assigned sample is a stereo one, then remove both      // in case currently assigned sample is a stereo one, then remove both
1760      // references (expected to be due to a "stereo dimension")      // references (expected to be due to a "stereo dimension")
# Line 1573  void DimRegionEdit::nullOutSampleReferen Line 1792  void DimRegionEdit::nullOutSampleReferen
1792      set_dim_region(dimregion);      set_dim_region(dimregion);
1793    
1794      sample_ref_changed_signal.emit(oldref, NULL);      sample_ref_changed_signal.emit(oldref, NULL);
     dimreg_changed_signal.emit(dimregion);  
1795  }  }
1796    
1797  void DimRegionEdit::onButtonSelectSamplePressed() {  void DimRegionEdit::onButtonSelectSamplePressed() {

Legend:
Removed from v.2991  
changed lines
  Added in v.3408

  ViewVC Help
Powered by ViewVC