/[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 2926 by schoenebeck, Sun Jun 5 14:33:58 2016 UTC revision 3364 by schoenebeck, Tue Nov 14 18:07:25 2017 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 230  DimRegionEdit::DimRegionEdit() : Line 271  DimRegionEdit::DimRegionEdit() :
271      eMSDecode(_("Decode Mid/Side Recordings")),      eMSDecode(_("Decode Mid/Side Recordings")),
272      eSampleStartOffset(_("Sample start offset"), 0, 2000),      eSampleStartOffset(_("Sample start offset"), 0, 2000),
273      eUnityNote(_("Unity note")),      eUnityNote(_("Unity note")),
274        eSampleGroup(_("Sample Group")),
275      eSampleFormatInfo(_("Sample Format")),      eSampleFormatInfo(_("Sample Format")),
276      eSampleID("Sample ID"),      eSampleID("Sample ID"),
277        eChecksum("Wave Data CRC-32"),
278      eFineTune(_("Fine tune"), -49, 50),      eFineTune(_("Fine tune"), -49, 50),
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),
# Line 264  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 285  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 360  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      }      }
455    
456      // set tooltips      // set tooltips
# Line 467  DimRegionEdit::DimRegionEdit() : Line 556  DimRegionEdit::DimRegionEdit() :
556      wSample->set_tooltip_text(_("Drag & drop a sample here"));      wSample->set_tooltip_text(_("Drag & drop a sample here"));
557  #endif  #endif
558      addProp(eUnityNote);      addProp(eUnityNote);
559        addProp(eSampleGroup);
560      addProp(eSampleFormatInfo);      addProp(eSampleFormatInfo);
561      addProp(eSampleID);      addProp(eSampleID);
562        addProp(eChecksum);
563      addRightHandSide(buttonSelectSample);      addRightHandSide(buttonSelectSample);
564      addHeader(_("Optional Settings"));      addHeader(_("Optional Settings"));
565      addProp(eSampleStartOffset);      addProp(eSampleStartOffset);
# Line 510  DimRegionEdit::DimRegionEdit() : Line 601  DimRegionEdit::DimRegionEdit() :
601      addProp(eEG1ControllerAttackInfluence);      addProp(eEG1ControllerAttackInfluence);
602      addProp(eEG1ControllerDecayInfluence);      addProp(eEG1ControllerDecayInfluence);
603      addProp(eEG1ControllerReleaseInfluence);      addProp(eEG1ControllerReleaseInfluence);
604        addLine(eEG1StateOptions);
605    
606      nextPage();      nextPage();
607    
# Line 543  DimRegionEdit::DimRegionEdit() : Line 635  DimRegionEdit::DimRegionEdit() :
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(
# Line 618  DimRegionEdit::DimRegionEdit() : Line 714  DimRegionEdit::DimRegionEdit() :
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);
# Line 655  DimRegionEdit::DimRegionEdit() : Line 755  DimRegionEdit::DimRegionEdit() :
755      addProp(eEG2ControllerAttackInfluence);      addProp(eEG2ControllerAttackInfluence);
756      addProp(eEG2ControllerDecayInfluence);      addProp(eEG2ControllerDecayInfluence);
757      addProp(eEG2ControllerReleaseInfluence);      addProp(eEG2ControllerReleaseInfluence);
758        addLine(eEG2StateOptions);
759      lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)"));      lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)"));
760      addProp(eLFO2Frequency);      addProp(eLFO2Frequency);
761      addProp(eLFO2InternalDepth);      addProp(eLFO2InternalDepth);
# Line 719  DimRegionEdit::DimRegionEdit() : Line 820  DimRegionEdit::DimRegionEdit() :
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"));
# Line 735  DimRegionEdit::DimRegionEdit() : Line 840  DimRegionEdit::DimRegionEdit() :
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);
# Line 831  void DimRegionEdit::addString(const char Line 940  void DimRegionEdit::addString(const char
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  }  }
# Line 848  void DimRegionEdit::addString(const char Line 969  void DimRegionEdit::addString(const char
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  }  }
# Line 871  Gtk::Label* DimRegionEdit::addHeader(con Line 1004  Gtk::Label* DimRegionEdit::addHeader(con
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;
# Line 892  void DimRegionEdit::nextPage() Line 1037  void DimRegionEdit::nextPage()
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;
# Line 902  void DimRegionEdit::nextPage() Line 1051  void DimRegionEdit::nextPage()
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++;
1086    }
1087    
1088    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,
1094                              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    
# Line 955  void DimRegionEdit::set_dim_region(gig:: Line 1132  void DimRegionEdit::set_dim_region(gig::
1132      eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence);      eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence);
1133      eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence);      eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence);
1134      eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence);      eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence);
1135        eEG1StateOptions.checkBoxAttack.set_value(d->EG1Options.AttackCancel);
1136        eEG1StateOptions.checkBoxAttackHold.set_value(d->EG1Options.AttackHoldCancel);
1137        eEG1StateOptions.checkBoxDecay1.set_value(d->EG1Options.Decay1Cancel);
1138        eEG1StateOptions.checkBoxDecay2.set_value(d->EG1Options.Decay2Cancel);
1139        eEG1StateOptions.checkBoxRelease.set_value(d->EG1Options.ReleaseCancel);
1140      eLFO1Frequency.set_value(d->LFO1Frequency);      eLFO1Frequency.set_value(d->LFO1Frequency);
1141      eLFO1InternalDepth.set_value(d->LFO1InternalDepth);      eLFO1InternalDepth.set_value(d->LFO1InternalDepth);
1142      eLFO1ControlDepth.set_value(d->LFO1ControlDepth);      eLFO1ControlDepth.set_value(d->LFO1ControlDepth);
# Line 973  void DimRegionEdit::set_dim_region(gig:: Line 1155  void DimRegionEdit::set_dim_region(gig::
1155      eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence);      eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence);
1156      eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence);      eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence);
1157      eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence);      eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence);
1158        eEG2StateOptions.checkBoxAttack.set_value(d->EG2Options.AttackCancel);
1159        eEG2StateOptions.checkBoxAttackHold.set_value(d->EG2Options.AttackHoldCancel);
1160        eEG2StateOptions.checkBoxDecay1.set_value(d->EG2Options.Decay1Cancel);
1161        eEG2StateOptions.checkBoxDecay2.set_value(d->EG2Options.Decay2Cancel);
1162        eEG2StateOptions.checkBoxRelease.set_value(d->EG2Options.ReleaseCancel);
1163      eLFO2Frequency.set_value(d->LFO2Frequency);      eLFO2Frequency.set_value(d->LFO2Frequency);
1164      eLFO2InternalDepth.set_value(d->LFO2InternalDepth);      eLFO2InternalDepth.set_value(d->LFO2InternalDepth);
1165      eLFO2ControlDepth.set_value(d->LFO2ControlDepth);      eLFO2ControlDepth.set_value(d->LFO2ControlDepth);
# Line 1021  void DimRegionEdit::set_dim_region(gig:: Line 1208  void DimRegionEdit::set_dim_region(gig::
1208      eMSDecode.set_value(d->MSDecode);      eMSDecode.set_value(d->MSDecode);
1209      eSampleStartOffset.set_value(d->SampleStartOffset);      eSampleStartOffset.set_value(d->SampleStartOffset);
1210      eUnityNote.set_value(d->UnityNote);      eUnityNote.set_value(d->UnityNote);
1211        // show sample group name
1212        {
1213            Glib::ustring s = "---";
1214            if (d->pSample && d->pSample->GetGroup())
1215                s = d->pSample->GetGroup()->Name;
1216            eSampleGroup.text.set_text(s);
1217        }
1218      // assemble sample format info string      // assemble sample format info string
1219      {      {
1220          Glib::ustring s;          Glib::ustring s;
# Line 1052  void DimRegionEdit::set_dim_region(gig:: Line 1246  void DimRegionEdit::set_dim_region(gig::
1246          }          }
1247          eSampleID.text.set_text(s);          eSampleID.text.set_text(s);
1248      }      }
1249        // generate raw wave form data CRC-32 checksum string
1250        {
1251            Glib::ustring s = "---";
1252            if (d->pSample) {
1253                char buf[64] = {};
1254                snprintf(buf, sizeof(buf), "%x", d->pSample->GetWaveDataCRC32Checksum());
1255                s = buf;
1256            }
1257            eChecksum.text.set_text(s);
1258        }
1259      buttonSelectSample.set_sensitive(d && d->pSample);      buttonSelectSample.set_sensitive(d && d->pSample);
1260      eFineTune.set_value(d->FineTune);      eFineTune.set_value(d->FineTune);
1261      eGain.set_value(d->Gain);      eGain.set_value(d->Gain);
# Line 1101  void DimRegionEdit::VCFEnabled_toggled() Line 1305  void DimRegionEdit::VCFEnabled_toggled()
1305      eEG2ControllerAttackInfluence.set_sensitive(sensitive);      eEG2ControllerAttackInfluence.set_sensitive(sensitive);
1306      eEG2ControllerDecayInfluence.set_sensitive(sensitive);      eEG2ControllerDecayInfluence.set_sensitive(sensitive);
1307      eEG2ControllerReleaseInfluence.set_sensitive(sensitive);      eEG2ControllerReleaseInfluence.set_sensitive(sensitive);
1308        eEG2StateOptions.set_sensitive(sensitive);
1309      lLFO2->set_sensitive(sensitive);      lLFO2->set_sensitive(sensitive);
1310      eLFO2Frequency.set_sensitive(sensitive);      eLFO2Frequency.set_sensitive(sensitive);
1311      eLFO2InternalDepth.set_sensitive(sensitive);      eLFO2InternalDepth.set_sensitive(sensitive);
# Line 1294  void DimRegionEdit::loop_infinite_toggle Line 1499  void DimRegionEdit::loop_infinite_toggle
1499    
1500  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)
1501  {  {
1502        bool result = false;
1503      for (std::set<gig::DimensionRegion*>::iterator itDimReg = dimregs.begin();      for (std::set<gig::DimensionRegion*>::iterator itDimReg = dimregs.begin();
1504           itDimReg != dimregs.end(); ++itDimReg)           itDimReg != dimregs.end(); ++itDimReg)
1505      {      {
1506          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);
1507      }      }
1508        return result;
1509  }  }
1510    
1511  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 1307  bool DimRegionEdit::set_sample(gig::Dime Line 1514  bool DimRegionEdit::set_sample(gig::Dime
1514          //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
1515    
1516          // 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()
1517          //dimreg_to_be_changed_signal.emit(dimregion);          //DimRegionChangeGuard(this, dimregion);
1518    
1519          // make sure stereo samples always are the same in both          // make sure stereo samples always are the same in both
1520          // dimregs in the samplechannel dimension          // dimregs in the samplechannel dimension
# Line 1377  bool DimRegionEdit::set_sample(gig::Dime Line 1584  bool DimRegionEdit::set_sample(gig::Dime
1584          update_model--;          update_model--;
1585    
1586          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);  
1587          return true;          return true;
1588      }      }
1589      return false;      return false;
# Line 1447  void DimRegionEdit::set_LoopEnabled(gig: Line 1652  void DimRegionEdit::set_LoopEnabled(gig:
1652      if (value) {      if (value) {
1653          // create a new sample loop in case there is none yet          // create a new sample loop in case there is none yet
1654          if (!d->SampleLoops) {          if (!d->SampleLoops) {
1655                DimRegionChangeGuard(this, d);
1656    
1657              DLS::sample_loop_t loop;              DLS::sample_loop_t loop;
1658              loop.LoopType = gig::loop_type_normal;              loop.LoopType = gig::loop_type_normal;
1659              // loop the whole sample by default              // loop the whole sample by default
1660              loop.LoopStart  = 0;              loop.LoopStart  = 0;
1661              loop.LoopLength =              loop.LoopLength =
1662                  (d->pSample) ? d->pSample->SamplesTotal : 0;                  (d->pSample) ? d->pSample->SamplesTotal : 0;
             dimreg_to_be_changed_signal.emit(d);  
1663              d->AddSampleLoop(&loop);              d->AddSampleLoop(&loop);
             dimreg_changed_signal.emit(d);  
1664          }          }
1665      } else {      } else {
1666          if (d->SampleLoops) {          if (d->SampleLoops) {
1667              dimreg_to_be_changed_signal.emit(d);              DimRegionChangeGuard(this, d);
1668    
1669              // delete ALL existing sample loops              // delete ALL existing sample loops
1670              while (d->SampleLoops) {              while (d->SampleLoops) {
1671                  d->DeleteSampleLoop(&d->pSampleLoops[0]);                  d->DeleteSampleLoop(&d->pSampleLoops[0]);
1672              }              }
             dimreg_changed_signal.emit(d);  
1673          }          }
1674      }      }
1675  }  }
# Line 1514  void DimRegionEdit::nullOutSampleReferen Line 1719  void DimRegionEdit::nullOutSampleReferen
1719      gig::Sample* oldref = dimregion->pSample;      gig::Sample* oldref = dimregion->pSample;
1720      if (!oldref) return;      if (!oldref) return;
1721    
1722      dimreg_to_be_changed_signal.emit(dimregion);      DimRegionChangeGuard(this, dimregion);
1723    
1724      // in case currently assigned sample is a stereo one, then remove both      // in case currently assigned sample is a stereo one, then remove both
1725      // references (expected to be due to a "stereo dimension")      // references (expected to be due to a "stereo dimension")
# Line 1552  void DimRegionEdit::nullOutSampleReferen Line 1757  void DimRegionEdit::nullOutSampleReferen
1757      set_dim_region(dimregion);      set_dim_region(dimregion);
1758    
1759      sample_ref_changed_signal.emit(oldref, NULL);      sample_ref_changed_signal.emit(oldref, NULL);
     dimreg_changed_signal.emit(dimregion);  
1760  }  }
1761    
1762  void DimRegionEdit::onButtonSelectSamplePressed() {  void DimRegionEdit::onButtonSelectSamplePressed() {

Legend:
Removed from v.2926  
changed lines
  Added in v.3364

  ViewVC Help
Powered by ViewVC