/[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 3461 by persson, Sat Feb 2 17:53:36 2019 UTC revision 3738 by schoenebeck, Mon Feb 3 18:47:02 2020 UTC
# Line 39  VelocityCurve::VelocityCurve(double (gig Line 39  VelocityCurve::VelocityCurve(double (gig
39  bool VelocityCurve::on_expose_event(GdkEventExpose* e) {  bool VelocityCurve::on_expose_event(GdkEventExpose* e) {
40      const Cairo::RefPtr<Cairo::Context>& cr =      const Cairo::RefPtr<Cairo::Context>& cr =
41          get_window()->create_cairo_context();          get_window()->create_cairo_context();
 #if 0  
 }  
 #endif  
42  #else  #else
43  bool VelocityCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) {  bool VelocityCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) {
44  #endif  #endif
# Line 77  bool VelocityCurve::on_draw(const Cairo: Line 74  bool VelocityCurve::on_draw(const Cairo:
74    
75    
76  CrossfadeCurve::CrossfadeCurve() : dimreg(0) {  CrossfadeCurve::CrossfadeCurve() : dimreg(0) {
77      set_size_request(280, 80);      set_size_request(500, 100);
78  }  }
79    
80  #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2  #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
81  bool CrossfadeCurve::on_expose_event(GdkEventExpose* e) {  bool CrossfadeCurve::on_expose_event(GdkEventExpose* e) {
82      const Cairo::RefPtr<Cairo::Context>& cr =      const Cairo::RefPtr<Cairo::Context>& cr =
83          get_window()->create_cairo_context();          get_window()->create_cairo_context();
 #if 0  
 }  
 #endif  
84  #else  #else
85  bool CrossfadeCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) {  bool CrossfadeCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) {
86  #endif  #endif
# Line 155  void CrossfadeCurve::draw_one_curve(cons Line 149  void CrossfadeCurve::draw_one_curve(cons
149  }  }
150    
151    
152    LFOGraph::LFOGraph() : dimreg(0) {
153        set_size_request(500, 100);
154    }
155    
156    #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
157    bool LFOGraph::on_expose_event(GdkEventExpose* e) {
158        const Cairo::RefPtr<Cairo::Context>& cr =
159            get_window()->create_cairo_context();
160    #else
161    bool LFOGraph::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) {
162    #endif
163        if (dimreg) {
164            const int w = get_width();
165            const int h = get_height();
166            const bool sensitive = is_sensitive();
167            const bool signedRange = this->signedRange();
168            const float visiblePeriods = 5.f; // such that minimum LFO frequency 0.1 Hz draws exactly a half period
169    
170            // short-hand functions for setting colors
171            auto setGrayColor = [&] {
172                cr->set_source_rgba(0.88, 0.88, 0.88, sensitive ? 1.0 : 0.3);
173            };
174            auto setBlackColor = [&] {
175                cr->set_source_rgba(0, 0, 0, sensitive ? 1.0 : 0.3);
176            };
177            auto setGreenColor = [&] {
178                cr->set_source_rgba(94/255.f, 219/255.f, 80/255.f, sensitive ? 1.0 : 0.3);
179            };
180            auto setRedColor = [&] {
181                cr->set_source_rgba(255.f, 44/255.f, 44/255.f, sensitive ? 1.0 : 0.3);
182            };
183            /*auto setBlueColor = [&] {
184                cr->set_source_rgba(53/255.f, 167/255.f, 255.f, sensitive ? 1.0 : 0.3);
185            };*/
186            auto setOrangeColor = [&] {
187                cr->set_source_rgba(255.f, 177/255.f, 82/255.f, sensitive ? 1.0 : 0.3);
188            };
189            auto setWhiteColor = [&] {
190                cr->set_source_rgba(255.f, 255.f, 255.f, sensitive ? 1.0 : 0.3);
191            };
192    
193            // fill background white
194            cr->rectangle(0, 0, w, h);
195            setWhiteColor();
196            cr->fill();
197    
198            // draw horizontal center line (dashed gray) if LFO range is signed
199            if (signedRange) {
200                cr->move_to(0, h/2);
201                cr->line_to(w, h/2);
202                cr->set_line_width(2);
203                setGrayColor();
204                cr->set_dash(std::vector<double>{ 7, 5 }, 0 /*offset*/);
205                cr->stroke();
206            }
207    
208            // draw a vertical line for each second
209            for (int period = 1; period < visiblePeriods; ++period) {
210                int x = float(w) / float(visiblePeriods) * period;
211                cr->move_to(x, 0);
212                cr->line_to(x, h);
213                cr->set_line_width(2);
214                setGrayColor();
215                cr->set_dash(std::vector<double>{ 5, 3 }, 0 /*offset*/);
216                cr->stroke();
217            }
218    
219            // how many curves shall we draw, two or one?
220            const int runs = (hasControllerAssigned()) ? 2 : 1;
221            // only draw the two curves in dashed style if they're very close to each other
222            const bool dashedCurves = (runs == 2 && controllerDepth() < 63);
223            // draw the required amount of curves
224            for (int run = 0; run < runs; ++run) {
225                // setup the LFO generator with the relevant parameters
226                lfo.setup({
227                    .waveType = waveType(),
228                    .rangeType = (signedRange) ? LinuxSampler::LFO::range_signed : LinuxSampler::LFO::range_unsigned,
229                    .frequency = frequency(),
230                    .phase = phase(),
231                    .startLevel = startLevel(),
232                    .internalDepth = internalDepth(),
233                    .midiControllerDepth = controllerDepth(),
234                    .flipPolarity = flipPolarity(),
235                    .samplerate = w / visiblePeriods,
236                    .maxValue = (signedRange) ? h/2 : h,
237                });
238                // 1st curve reflects min. CC value, 2nd curve max. CC value
239                lfo.setMIDICtrlValue( (run == 0) ? 0 : 127 );
240    
241                // the actual render/draw loop
242                for (int x = 0; x < w ; ++x) {
243                    const float y =
244                        (signedRange) ?
245                            h/2 - lfo.render() :
246                            h   - lfo.render();
247                    if (x == 0)
248                        cr->move_to(x, y);
249                    else
250                        cr->line_to(x, y);
251                }
252                cr->set_line_width( (frequency() <= 4.f) ? 2 : 1 );
253                if (runs == 1)
254                    setOrangeColor();
255                else if (run == 0)
256                    setGreenColor();
257                else
258                    setRedColor();
259                if (dashedCurves)
260                    cr->set_dash(std::vector<double>{ 3, 3 }, (run == 0) ? 0 : 3 /*offset*/);
261                else
262                    cr->set_dash(std::vector<double>(), 0 /*offset*/);
263                cr->stroke();
264            }
265    
266            // draw text legend
267            if (runs == 2) {
268                setRedColor();
269                cr->move_to(2, 10);
270                cr->show_text("CC Max.");
271    
272                setGreenColor();
273                cr->move_to(2, 23);
274                cr->show_text("CC Min.");
275            } else { // no controller assigned, internal depth only ...
276                setOrangeColor();
277                cr->move_to(2, 10);
278                cr->show_text("Const. Depth");
279            }
280            // draw text legend for each second ("1s", "2s", ...)
281            for (int period = 1; period < visiblePeriods; ++period) {
282                int x = float(w) / float(visiblePeriods) * period;
283                setBlackColor();
284                cr->move_to(x - 13, h - 3);
285                cr->show_text(ToString(period) + "s");
286            }
287        }
288        return true;
289    }
290    
291    
292  EGStateOptions::EGStateOptions() : HBox(),  EGStateOptions::EGStateOptions() : HBox(),
293      label(_("May be cancelled: ")),      label(_("May be cancelled: ")),
294      checkBoxAttack(_("Attack")),      checkBoxAttack(_("Attack")),
# Line 217  DimRegionEdit::DimRegionEdit() : Line 351  DimRegionEdit::DimRegionEdit() :
351      eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3),      eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3),
352      eEG1ControllerDecayInfluence(_("Controller decay influence"), 0, 3),      eEG1ControllerDecayInfluence(_("Controller decay influence"), 0, 3),
353      eEG1ControllerReleaseInfluence(_("Controller release influence"), 0, 3),      eEG1ControllerReleaseInfluence(_("Controller release influence"), 0, 3),
354        eLFO1Wave(_("Wave Form")),
355      eLFO1Frequency(_("Frequency"), 0.1, 10, 2),      eLFO1Frequency(_("Frequency"), 0.1, 10, 2),
356        eLFO1Phase(_("Phase"), 0.0, 360.0, 2),
357      eLFO1InternalDepth(_("Internal depth"), 0, 1200),      eLFO1InternalDepth(_("Internal depth"), 0, 1200),
358      eLFO1ControlDepth(_("Control depth"), 0, 1200),      eLFO1ControlDepth(_("Control depth"), 0, 1200),
359      eLFO1Controller(_("Controller")),      eLFO1Controller(_("Controller")),
# Line 235  DimRegionEdit::DimRegionEdit() : Line 371  DimRegionEdit::DimRegionEdit() :
371      eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3),      eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3),
372      eEG2ControllerDecayInfluence(_("Controller decay influence"), 0, 3),      eEG2ControllerDecayInfluence(_("Controller decay influence"), 0, 3),
373      eEG2ControllerReleaseInfluence(_("Controller release influence"), 0, 3),      eEG2ControllerReleaseInfluence(_("Controller release influence"), 0, 3),
374        eLFO2Wave(_("Wave Form")),
375      eLFO2Frequency(_("Frequency"), 0.1, 10, 2),      eLFO2Frequency(_("Frequency"), 0.1, 10, 2),
376        eLFO2Phase(_("Phase"), 0.0, 360.0, 2),
377      eLFO2InternalDepth(_("Internal depth"), 0, 1200),      eLFO2InternalDepth(_("Internal depth"), 0, 1200),
378      eLFO2ControlDepth(_("Control depth"), 0, 1200),      eLFO2ControlDepth(_("Control depth"), 0, 1200),
379      eLFO2Controller(_("Controller")),      eLFO2Controller(_("Controller")),
# Line 243  DimRegionEdit::DimRegionEdit() : Line 381  DimRegionEdit::DimRegionEdit() :
381      eLFO2Sync(_("Sync")),      eLFO2Sync(_("Sync")),
382      eEG3Attack(_("Attack"), 0, 10, 3),      eEG3Attack(_("Attack"), 0, 10, 3),
383      eEG3Depth(_("Depth"), -1200, 1200),      eEG3Depth(_("Depth"), -1200, 1200),
384        eLFO3Wave(_("Wave Form")),
385      eLFO3Frequency(_("Frequency"), 0.1, 10, 2),      eLFO3Frequency(_("Frequency"), 0.1, 10, 2),
386        eLFO3Phase(_("Phase"), 0.0, 360.0, 2),
387      eLFO3InternalDepth(_("Internal depth"), 0, 1200),      eLFO3InternalDepth(_("Internal depth"), 0, 1200),
388      eLFO3ControlDepth(_("Control depth"), 0, 1200),      eLFO3ControlDepth(_("Control depth"), 0, 1200),
389      eLFO3Controller(_("Controller")),      eLFO3Controller(_("Controller")),
390        eLFO3FlipPhase(_("Flip phase")),
391      eLFO3Sync(_("Sync")),      eLFO3Sync(_("Sync")),
392      eVCFEnabled(_("Enabled")),      eVCFEnabled(_("Enabled")),
393      eVCFType(_("Type")),      eVCFType(_("Type")),
# Line 290  DimRegionEdit::DimRegionEdit() : Line 431  DimRegionEdit::DimRegionEdit() :
431      eSampleID("Sample ID"),      eSampleID("Sample ID"),
432      eChecksum("Wave Data CRC-32"),      eChecksum("Wave Data CRC-32"),
433      eFineTune(_("Fine tune"), -49, 50),      eFineTune(_("Fine tune"), -49, 50),
434      eGain(_("Gain"), -96, 0, 2, -655360),      eGain(_("Gain (dB)"), -96, +96, 2, -655360),
     eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360),  
435      eSampleLoopEnabled(_("Enabled")),      eSampleLoopEnabled(_("Enabled")),
436      eSampleLoopStart(_("Loop start position")),      eSampleLoopStart(_("Loop start position")),
437      eSampleLoopLength(_("Loop size")),      eSampleLoopLength(_("Loop size")),
# Line 299  DimRegionEdit::DimRegionEdit() : Line 439  DimRegionEdit::DimRegionEdit() :
439      eSampleLoopInfinite(_("Infinite loop")),      eSampleLoopInfinite(_("Infinite loop")),
440      eSampleLoopPlayCount(_("Playback count"), 1),      eSampleLoopPlayCount(_("Playback count"), 1),
441      buttonSelectSample(UNICODE_LEFT_ARROW + "  " + _("Select Sample")),      buttonSelectSample(UNICODE_LEFT_ARROW + "  " + _("Select Sample")),
442        editScriptSlotsButton(_("Edit Slots ...")),
443      update_model(0)      update_model(0)
444  {  {
445      // make synthesis parameter page tabs scrollable      // make synthesis parameter page tabs scrollable
446      // (workaround for GTK3: default theme uses huge tabs which breaks layout)      // (workaround for GTK3: default theme uses huge tabs which breaks layout)
447      set_scrollable();      set_scrollable();
448    
449        // use more appropriate increment/decrement steps for these spinboxes
450        eEG1PreAttack.set_increments(0.1, 5.0);
451        eEG2PreAttack.set_increments(0.1, 5.0);
452        eEG1Sustain.set_increments(0.1, 5.0);
453        eEG2Sustain.set_increments(0.1, 5.0);
454        eLFO1Frequency.set_increments(0.02, 0.2);
455        eLFO2Frequency.set_increments(0.02, 0.2);
456        eLFO3Frequency.set_increments(0.02, 0.2);
457        eLFO1Phase.set_increments(1.0, 10.0);
458        eLFO2Phase.set_increments(1.0, 10.0);
459        eLFO3Phase.set_increments(1.0, 10.0);
460    
461      connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack);      connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack);
462      connect(eEG1Attack, &gig::DimensionRegion::EG1Attack);      connect(eEG1Attack, &gig::DimensionRegion::EG1Attack);
463      connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1);      connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1);
# Line 331  DimRegionEdit::DimRegionEdit() : Line 484  DimRegionEdit::DimRegionEdit() :
484              &gig::eg_opt_t::Decay2Cancel);              &gig::eg_opt_t::Decay2Cancel);
485      connect(eEG1StateOptions.checkBoxRelease, &gig::DimensionRegion::EG1Options,      connect(eEG1StateOptions.checkBoxRelease, &gig::DimensionRegion::EG1Options,
486              &gig::eg_opt_t::ReleaseCancel);              &gig::eg_opt_t::ReleaseCancel);
487        connect(eLFO1Wave, &gig::DimensionRegion::LFO1WaveForm);
488      connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency);      connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency);
489        connect(eLFO1Phase, &gig::DimensionRegion::LFO1Phase);
490      connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth);      connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth);
491      connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth);      connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth);
492      connect(eLFO1Controller, &gig::DimensionRegion::LFO1Controller);      connect(eLFO1Controller, &gig::DimensionRegion::LFO1Controller);
# Line 362  DimRegionEdit::DimRegionEdit() : Line 517  DimRegionEdit::DimRegionEdit() :
517              &gig::eg_opt_t::Decay2Cancel);              &gig::eg_opt_t::Decay2Cancel);
518      connect(eEG2StateOptions.checkBoxRelease, &gig::DimensionRegion::EG2Options,      connect(eEG2StateOptions.checkBoxRelease, &gig::DimensionRegion::EG2Options,
519              &gig::eg_opt_t::ReleaseCancel);              &gig::eg_opt_t::ReleaseCancel);
520        connect(eLFO2Wave, &gig::DimensionRegion::LFO2WaveForm);
521      connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency);      connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency);
522        connect(eLFO2Phase, &gig::DimensionRegion::LFO2Phase);
523      connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth);      connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth);
524      connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth);      connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth);
525      connect(eLFO2Controller, &gig::DimensionRegion::LFO2Controller);      connect(eLFO2Controller, &gig::DimensionRegion::LFO2Controller);
# Line 370  DimRegionEdit::DimRegionEdit() : Line 527  DimRegionEdit::DimRegionEdit() :
527      connect(eLFO2Sync, &gig::DimensionRegion::LFO2Sync);      connect(eLFO2Sync, &gig::DimensionRegion::LFO2Sync);
528      connect(eEG3Attack, &gig::DimensionRegion::EG3Attack);      connect(eEG3Attack, &gig::DimensionRegion::EG3Attack);
529      connect(eEG3Depth, &gig::DimensionRegion::EG3Depth);      connect(eEG3Depth, &gig::DimensionRegion::EG3Depth);
530        connect(eLFO3Wave, &gig::DimensionRegion::LFO3WaveForm);
531      connect(eLFO3Frequency, &gig::DimensionRegion::LFO3Frequency);      connect(eLFO3Frequency, &gig::DimensionRegion::LFO3Frequency);
532        connect(eLFO3Phase, &gig::DimensionRegion::LFO3Phase);
533      connect(eLFO3InternalDepth, &gig::DimensionRegion::LFO3InternalDepth);      connect(eLFO3InternalDepth, &gig::DimensionRegion::LFO3InternalDepth);
534      connect(eLFO3ControlDepth, &gig::DimensionRegion::LFO3ControlDepth);      connect(eLFO3ControlDepth, &gig::DimensionRegion::LFO3ControlDepth);
535      connect(eLFO3Controller, &gig::DimensionRegion::LFO3Controller);      connect(eLFO3Controller, &gig::DimensionRegion::LFO3Controller);
536        connect(eLFO3FlipPhase, &gig::DimensionRegion::LFO3FlipPhase);
537      connect(eLFO3Sync, &gig::DimensionRegion::LFO3Sync);      connect(eLFO3Sync, &gig::DimensionRegion::LFO3Sync);
538      connect(eVCFEnabled, &gig::DimensionRegion::VCFEnabled);      connect(eVCFEnabled, &gig::DimensionRegion::VCFEnabled);
539      connect(eVCFType, &gig::DimensionRegion::VCFType);      connect(eVCFType, &gig::DimensionRegion::VCFType);
# Line 427  DimRegionEdit::DimRegionEdit() : Line 587  DimRegionEdit::DimRegionEdit() :
587      connect(eUnityNote, &DimRegionEdit::set_UnityNote);      connect(eUnityNote, &DimRegionEdit::set_UnityNote);
588      connect(eFineTune, &DimRegionEdit::set_FineTune);      connect(eFineTune, &DimRegionEdit::set_FineTune);
589      connect(eGain, &DimRegionEdit::set_Gain);      connect(eGain, &DimRegionEdit::set_Gain);
     connect(eGainPlus6, &DimRegionEdit::set_Gain);  
590      connect(eSampleLoopEnabled, &DimRegionEdit::set_LoopEnabled);      connect(eSampleLoopEnabled, &DimRegionEdit::set_LoopEnabled);
591      connect(eSampleLoopType, &DimRegionEdit::set_LoopType);      connect(eSampleLoopType, &DimRegionEdit::set_LoopType);
592      connect(eSampleLoopStart, &DimRegionEdit::set_LoopStart);      connect(eSampleLoopStart, &DimRegionEdit::set_LoopStart);
# Line 438  DimRegionEdit::DimRegionEdit() : Line 597  DimRegionEdit::DimRegionEdit() :
597          sigc::mem_fun(*this, &DimRegionEdit::onButtonSelectSamplePressed)          sigc::mem_fun(*this, &DimRegionEdit::onButtonSelectSamplePressed)
598      );      );
599    
600      for (int i = 0 ; i < 7 ; i++) {      for (int i = 0; i < tableSize; i++) {
601  #if USE_GTKMM_GRID  #if USE_GTKMM_GRID
602          table[i] = new Gtk::Grid;          table[i] = new Gtk::Grid;
603          table[i]->set_column_spacing(7);          table[i]->set_column_spacing(7);
# Line 543  DimRegionEdit::DimRegionEdit() : Line 702  DimRegionEdit::DimRegionEdit() :
702      eLFO2FlipPhase.set_tip(      eLFO2FlipPhase.set_tip(
703         "Inverts the LFO's generated wave vertically."         "Inverts the LFO's generated wave vertically."
704      );      );
705        eLFO3FlipPhase.set_tip(
706           "Inverts the LFO's generated wave vertically."
707        );
708    
709      pageno = 0;      pageno = 0;
710      rowno = 0;      rowno = 0;
# Line 591  DimRegionEdit::DimRegionEdit() : Line 753  DimRegionEdit::DimRegionEdit() :
753    
754      addHeader(_("General Amplitude Settings"));      addHeader(_("General Amplitude Settings"));
755      addProp(eGain);      addProp(eGain);
     addProp(eGainPlus6);  
756      addProp(ePan);      addProp(ePan);
757      addHeader(_("Amplitude Envelope (EG1)"));      addHeader(_("Amplitude Envelope (EG1)"));
758      addProp(eEG1PreAttack);      addProp(eEG1PreAttack);
# Line 612  DimRegionEdit::DimRegionEdit() : Line 773  DimRegionEdit::DimRegionEdit() :
773      nextPage();      nextPage();
774    
775      addHeader(_("Amplitude Oscillator (LFO1)"));      addHeader(_("Amplitude Oscillator (LFO1)"));
776        addProp(eLFO1Wave);
777      addProp(eLFO1Frequency);      addProp(eLFO1Frequency);
778        addProp(eLFO1Phase);
779      addProp(eLFO1InternalDepth);      addProp(eLFO1InternalDepth);
780      addProp(eLFO1ControlDepth);      addProp(eLFO1ControlDepth);
781      {      {
# Line 630  DimRegionEdit::DimRegionEdit() : Line 793  DimRegionEdit::DimRegionEdit() :
793      addProp(eLFO1Controller);      addProp(eLFO1Controller);
794      addProp(eLFO1FlipPhase);      addProp(eLFO1FlipPhase);
795      addProp(eLFO1Sync);      addProp(eLFO1Sync);
796        {
797            Gtk::Frame* frame = new Gtk::Frame;
798            frame->add(lfo1Graph);
799            // on Gtk 3 there is no margin at all by default
800    #if GTKMM_MAJOR_VERSION >= 3
801            frame->set_margin_top(12);
802            frame->set_margin_bottom(12);
803    #endif
804    #if USE_GTKMM_GRID
805            table[pageno]->attach(*frame, 1, rowno, 2);
806    #else
807            table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,
808                                  Gtk::SHRINK, Gtk::SHRINK);
809    #endif
810            rowno++;
811        }
812        eLFO1Wave.signal_value_changed().connect(
813            sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
814        );
815        eLFO1Frequency.signal_value_changed().connect(
816            sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
817        );
818        eLFO1Phase.signal_value_changed().connect(
819            sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
820        );
821        eLFO1InternalDepth.signal_value_changed().connect(
822            sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
823        );
824        eLFO1ControlDepth.signal_value_changed().connect(
825            sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
826        );
827        eLFO1Controller.signal_value_changed().connect(
828            sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
829        );
830        eLFO1FlipPhase.signal_value_changed().connect(
831            sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
832        );
833        eLFO1Sync.signal_value_changed().connect(
834            sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
835        );
836    
837        nextPage();
838    
839      addHeader(_("Crossfade"));      addHeader(_("Crossfade"));
840      addProp(eAttenuationController);      addProp(eAttenuationController);
841      addProp(eInvertAttenuationController);      addProp(eInvertAttenuationController);
# Line 668  DimRegionEdit::DimRegionEdit() : Line 874  DimRegionEdit::DimRegionEdit() :
874      addHeader(_("General Filter Settings"));      addHeader(_("General Filter Settings"));
875      addProp(eVCFEnabled);      addProp(eVCFEnabled);
876      {      {
877          const char* choices[] = { _("lowpass"), _("lowpassturbo"), _("bandpass"),          const char* choices[] = {
878                                    _("highpass"), _("bandreject"), 0 };              _("lowpass"), _("lowpassturbo"), _("bandpass"), _("highpass"),
879                _("bandreject"),
880                _("lowpass 1-pole [EXT]"),
881                _("lowpass 2-pole [EXT]"),
882                _("lowpass 4-pole [EXT]"),
883                _("lowpass 6-pole [EXT]"),
884                _("highpass 1-pole [EXT]"),
885                _("highpass 2-pole [EXT]"),
886                _("highpass 4-pole [EXT]"),
887                _("highpass 6-pole [EXT]"),
888                _("bandpass 2-pole [EXT]"),
889                _("bandreject 2-pole [EXT]"),
890                NULL
891            };
892          static const gig::vcf_type_t values[] = {          static const gig::vcf_type_t values[] = {
893                // GigaStudio original filter types
894              gig::vcf_type_lowpass,              gig::vcf_type_lowpass,
895              gig::vcf_type_lowpassturbo,              gig::vcf_type_lowpassturbo,
896              gig::vcf_type_bandpass,              gig::vcf_type_bandpass,
897              gig::vcf_type_highpass,              gig::vcf_type_highpass,
898              gig::vcf_type_bandreject              gig::vcf_type_bandreject,
899                // LinuxSampler filter types (as gig format extension)
900                gig::vcf_type_lowpass_1p,
901                gig::vcf_type_lowpass_2p,
902                gig::vcf_type_lowpass_4p,
903                gig::vcf_type_lowpass_6p,
904                gig::vcf_type_highpass_1p,
905                gig::vcf_type_highpass_2p,
906                gig::vcf_type_highpass_4p,
907                gig::vcf_type_highpass_6p,
908                gig::vcf_type_bandpass_2p,
909                gig::vcf_type_bandreject_2p,
910          };          };
911          eVCFType.set_choices(choices, values);          eVCFType.set_choices(choices, values);
912      }      }
# Line 772  DimRegionEdit::DimRegionEdit() : Line 1003  DimRegionEdit::DimRegionEdit() :
1003      addProp(eEG2ControllerDecayInfluence);      addProp(eEG2ControllerDecayInfluence);
1004      addProp(eEG2ControllerReleaseInfluence);      addProp(eEG2ControllerReleaseInfluence);
1005      addLine(eEG2StateOptions);      addLine(eEG2StateOptions);
1006    
1007        nextPage();
1008    
1009      lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)"));      lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)"));
1010        addProp(eLFO2Wave);
1011      addProp(eLFO2Frequency);      addProp(eLFO2Frequency);
1012        addProp(eLFO2Phase);
1013      addProp(eLFO2InternalDepth);      addProp(eLFO2InternalDepth);
1014      addProp(eLFO2ControlDepth);      addProp(eLFO2ControlDepth);
1015      {      {
# Line 791  DimRegionEdit::DimRegionEdit() : Line 1027  DimRegionEdit::DimRegionEdit() :
1027      addProp(eLFO2Controller);      addProp(eLFO2Controller);
1028      addProp(eLFO2FlipPhase);      addProp(eLFO2FlipPhase);
1029      addProp(eLFO2Sync);      addProp(eLFO2Sync);
1030        {
1031            Gtk::Frame* frame = new Gtk::Frame;
1032            frame->add(lfo2Graph);
1033            // on Gtk 3 there is no margin at all by default
1034    #if GTKMM_MAJOR_VERSION >= 3
1035            frame->set_margin_top(12);
1036            frame->set_margin_bottom(12);
1037    #endif
1038    #if USE_GTKMM_GRID
1039            table[pageno]->attach(*frame, 1, rowno, 2);
1040    #else
1041            table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,
1042                                  Gtk::SHRINK, Gtk::SHRINK);
1043    #endif
1044            rowno++;
1045        }
1046        eLFO2Wave.signal_value_changed().connect(
1047            sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
1048        );
1049        eLFO2Frequency.signal_value_changed().connect(
1050            sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
1051        );
1052        eLFO2Phase.signal_value_changed().connect(
1053            sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
1054        );
1055        eLFO2InternalDepth.signal_value_changed().connect(
1056            sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
1057        );
1058        eLFO2ControlDepth.signal_value_changed().connect(
1059            sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
1060        );
1061        eLFO2Controller.signal_value_changed().connect(
1062            sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
1063        );
1064        eLFO2FlipPhase.signal_value_changed().connect(
1065            sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
1066        );
1067        eLFO2Sync.signal_value_changed().connect(
1068            sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
1069        );
1070    
1071      nextPage();      nextPage();
1072    
# Line 801  DimRegionEdit::DimRegionEdit() : Line 1077  DimRegionEdit::DimRegionEdit() :
1077      addProp(eEG3Attack);      addProp(eEG3Attack);
1078      addProp(eEG3Depth);      addProp(eEG3Depth);
1079      addHeader(_("Pitch Oscillator (LFO3)"));      addHeader(_("Pitch Oscillator (LFO3)"));
1080        addProp(eLFO3Wave);
1081      addProp(eLFO3Frequency);      addProp(eLFO3Frequency);
1082        addProp(eLFO3Phase);
1083      addProp(eLFO3InternalDepth);      addProp(eLFO3InternalDepth);
1084      addProp(eLFO3ControlDepth);      addProp(eLFO3ControlDepth);
1085      {      {
# Line 817  DimRegionEdit::DimRegionEdit() : Line 1095  DimRegionEdit::DimRegionEdit() :
1095          eLFO3Controller.set_choices(choices, values);          eLFO3Controller.set_choices(choices, values);
1096      }      }
1097      addProp(eLFO3Controller);      addProp(eLFO3Controller);
1098        addProp(eLFO3FlipPhase);
1099      addProp(eLFO3Sync);      addProp(eLFO3Sync);
1100        {
1101            Gtk::Frame* frame = new Gtk::Frame;
1102            frame->add(lfo3Graph);
1103            // on Gtk 3 there is no margin at all by default
1104    #if GTKMM_MAJOR_VERSION >= 3
1105            frame->set_margin_top(12);
1106            frame->set_margin_bottom(12);
1107    #endif
1108    #if USE_GTKMM_GRID
1109            table[pageno]->attach(*frame, 1, rowno, 2);
1110    #else
1111            table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,
1112                                  Gtk::SHRINK, Gtk::SHRINK);
1113    #endif
1114            rowno++;
1115        }
1116        eLFO3Wave.signal_value_changed().connect(
1117            sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
1118        );
1119        eLFO3Frequency.signal_value_changed().connect(
1120            sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
1121        );
1122        eLFO3Phase.signal_value_changed().connect(
1123            sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
1124        );
1125        eLFO3InternalDepth.signal_value_changed().connect(
1126            sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
1127        );
1128        eLFO3ControlDepth.signal_value_changed().connect(
1129            sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
1130        );
1131        eLFO3Controller.signal_value_changed().connect(
1132            sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
1133        );
1134        eLFO3FlipPhase.signal_value_changed().connect(
1135            sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
1136        );
1137        eLFO3Sync.signal_value_changed().connect(
1138            sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
1139        );
1140    
1141      nextPage();      nextPage();
1142    
# Line 970  DimRegionEdit::DimRegionEdit() : Line 1289  DimRegionEdit::DimRegionEdit() :
1289      eSampleLoopInfinite.signal_value_changed().connect(      eSampleLoopInfinite.signal_value_changed().connect(
1290          sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled));          sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled));
1291    
1292    
1293        addHeader(_("Script Patch Variables"));
1294    
1295        m_labelPatchVarsDescr.set_markup(
1296            _("These are variables declared in scripts with keyword "
1297              "<span color='#FF4FF3'><b>patch</b></span>. "
1298              "A 'patch' variable allows to override its default value on a per "
1299              "instrument basis. That way a script may be shared by instruments "
1300              "while being able to fine tune certain script parameters for each "
1301              "instrument individually if necessary. Overridden default values "
1302              "are displayed in bold. To revert back to the script's default "
1303              "value, select the variable(s) and hit <b>&#x232b;</b> or "
1304              "<b>&#x2326;</b> key.")
1305        );
1306        scriptVarsDescrBox.set_spacing(13);
1307        scriptVarsDescrBox.pack_start(m_labelPatchVarsDescr, true, true);
1308        scriptVarsDescrBox.pack_start(editScriptSlotsButton, false, false);
1309    #if USE_GTKMM_GRID
1310        table[pageno]->attach(scriptVarsDescrBox, 1, rowno, 2);
1311    #else
1312        table[pageno]->attach(scriptVarsDescrBox, 1, 3, rowno, rowno + 1,
1313                              Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK);
1314    #endif
1315        rowno++;
1316    
1317    #if GTKMM_MAJOR_VERSION >= 3
1318        scriptVars.set_margin_top(20);
1319    #endif
1320    #if USE_GTKMM_GRID
1321        table[pageno]->attach(scriptVars, 1, rowno, 2);
1322    #else
1323    
1324        table[pageno]->attach(scriptVars, 1, 3, rowno, rowno + 1,
1325                              Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL);
1326    #endif
1327        rowno++;
1328    
1329    
1330      append_page(*table[0], _("Sample"));      append_page(*table[0], _("Sample"));
1331      append_page(*table[1], _("Amplitude (1)"));      append_page(*table[1], _("Amp (1)"));
1332      append_page(*table[2], _("Amplitude (2)"));      append_page(*table[2], _("Amp (2)"));
1333      append_page(*table[3], _("Filter (1)"));      append_page(*table[3], _("Amp (3)"));
1334      append_page(*table[4], _("Filter (2)"));      append_page(*table[4], _("Filter (1)"));
1335      append_page(*table[5], _("Pitch"));      append_page(*table[5], _("Filter (2)"));
1336      append_page(*table[6], _("Misc"));      append_page(*table[6], _("Filter (3)"));
1337        append_page(*table[7], _("Pitch"));
1338        append_page(*table[8], _("Misc"));
1339        append_page(*table[9], _("Script"));
1340    
1341      Settings::singleton()->showTooltips.get_proxy().signal_changed().connect(      Settings::singleton()->showTooltips.get_proxy().signal_changed().connect(
1342          sigc::mem_fun(*this, &DimRegionEdit::on_show_tooltips_changed)          sigc::mem_fun(*this, &DimRegionEdit::on_show_tooltips_changed)
# Line 1131  void DimRegionEdit::addProp(BoolEntry& b Line 1491  void DimRegionEdit::addProp(BoolEntry& b
1491      rowno++;      rowno++;
1492  }  }
1493    
 void DimRegionEdit::addProp(BoolEntryPlus6& boolentry)  
 {  
 #if USE_GTKMM_GRID  
     table[pageno]->attach(boolentry.widget, 1, rowno, 2);  
 #else  
     table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1,  
                           Gtk::FILL, Gtk::SHRINK);  
 #endif  
     rowno++;  
 }  
   
1494  void DimRegionEdit::addProp(LabelWidget& prop)  void DimRegionEdit::addProp(LabelWidget& prop)
1495  {  {
1496  #if USE_GTKMM_GRID  #if USE_GTKMM_GRID
# Line 1185  void DimRegionEdit::set_dim_region(gig:: Line 1534  void DimRegionEdit::set_dim_region(gig::
1534      release_curve.set_dim_region(d);      release_curve.set_dim_region(d);
1535      cutoff_curve.set_dim_region(d);      cutoff_curve.set_dim_region(d);
1536      crossfade_curve.set_dim_region(d);      crossfade_curve.set_dim_region(d);
1537        lfo1Graph.set_dim_region(d);
1538        lfo2Graph.set_dim_region(d);
1539        lfo3Graph.set_dim_region(d);
1540    
1541      set_sensitive(d);      set_sensitive(d);
1542      if (!d) return;      if (!d) return;
# Line 1208  void DimRegionEdit::set_dim_region(gig:: Line 1560  void DimRegionEdit::set_dim_region(gig::
1560      eEG1StateOptions.checkBoxDecay1.set_value(d->EG1Options.Decay1Cancel);      eEG1StateOptions.checkBoxDecay1.set_value(d->EG1Options.Decay1Cancel);
1561      eEG1StateOptions.checkBoxDecay2.set_value(d->EG1Options.Decay2Cancel);      eEG1StateOptions.checkBoxDecay2.set_value(d->EG1Options.Decay2Cancel);
1562      eEG1StateOptions.checkBoxRelease.set_value(d->EG1Options.ReleaseCancel);      eEG1StateOptions.checkBoxRelease.set_value(d->EG1Options.ReleaseCancel);
1563        eLFO1Wave.set_value(d->LFO1WaveForm);
1564      eLFO1Frequency.set_value(d->LFO1Frequency);      eLFO1Frequency.set_value(d->LFO1Frequency);
1565        eLFO1Phase.set_value(d->LFO1Phase);
1566      eLFO1InternalDepth.set_value(d->LFO1InternalDepth);      eLFO1InternalDepth.set_value(d->LFO1InternalDepth);
1567      eLFO1ControlDepth.set_value(d->LFO1ControlDepth);      eLFO1ControlDepth.set_value(d->LFO1ControlDepth);
1568      eLFO1Controller.set_value(d->LFO1Controller);      eLFO1Controller.set_value(d->LFO1Controller);
# Line 1231  void DimRegionEdit::set_dim_region(gig:: Line 1585  void DimRegionEdit::set_dim_region(gig::
1585      eEG2StateOptions.checkBoxDecay1.set_value(d->EG2Options.Decay1Cancel);      eEG2StateOptions.checkBoxDecay1.set_value(d->EG2Options.Decay1Cancel);
1586      eEG2StateOptions.checkBoxDecay2.set_value(d->EG2Options.Decay2Cancel);      eEG2StateOptions.checkBoxDecay2.set_value(d->EG2Options.Decay2Cancel);
1587      eEG2StateOptions.checkBoxRelease.set_value(d->EG2Options.ReleaseCancel);      eEG2StateOptions.checkBoxRelease.set_value(d->EG2Options.ReleaseCancel);
1588        eLFO2Wave.set_value(d->LFO2WaveForm);
1589      eLFO2Frequency.set_value(d->LFO2Frequency);      eLFO2Frequency.set_value(d->LFO2Frequency);
1590        eLFO2Phase.set_value(d->LFO2Phase);
1591      eLFO2InternalDepth.set_value(d->LFO2InternalDepth);      eLFO2InternalDepth.set_value(d->LFO2InternalDepth);
1592      eLFO2ControlDepth.set_value(d->LFO2ControlDepth);      eLFO2ControlDepth.set_value(d->LFO2ControlDepth);
1593      eLFO2Controller.set_value(d->LFO2Controller);      eLFO2Controller.set_value(d->LFO2Controller);
# Line 1239  void DimRegionEdit::set_dim_region(gig:: Line 1595  void DimRegionEdit::set_dim_region(gig::
1595      eLFO2Sync.set_value(d->LFO2Sync);      eLFO2Sync.set_value(d->LFO2Sync);
1596      eEG3Attack.set_value(d->EG3Attack);      eEG3Attack.set_value(d->EG3Attack);
1597      eEG3Depth.set_value(d->EG3Depth);      eEG3Depth.set_value(d->EG3Depth);
1598        eLFO3Wave.set_value(d->LFO3WaveForm);
1599      eLFO3Frequency.set_value(d->LFO3Frequency);      eLFO3Frequency.set_value(d->LFO3Frequency);
1600        eLFO3Phase.set_value(d->LFO3Phase);
1601      eLFO3InternalDepth.set_value(d->LFO3InternalDepth);      eLFO3InternalDepth.set_value(d->LFO3InternalDepth);
1602      eLFO3ControlDepth.set_value(d->LFO3ControlDepth);      eLFO3ControlDepth.set_value(d->LFO3ControlDepth);
1603      eLFO3Controller.set_value(d->LFO3Controller);      eLFO3Controller.set_value(d->LFO3Controller);
1604        eLFO3FlipPhase.set_value(d->LFO3FlipPhase);
1605      eLFO3Sync.set_value(d->LFO3Sync);      eLFO3Sync.set_value(d->LFO3Sync);
1606      eVCFEnabled.set_value(d->VCFEnabled);      eVCFEnabled.set_value(d->VCFEnabled);
1607      eVCFType.set_value(d->VCFType);      eVCFType.set_value(d->VCFType);
# Line 1332  void DimRegionEdit::set_dim_region(gig:: Line 1691  void DimRegionEdit::set_dim_region(gig::
1691      buttonSelectSample.set_sensitive(d && d->pSample);      buttonSelectSample.set_sensitive(d && d->pSample);
1692      eFineTune.set_value(d->FineTune);      eFineTune.set_value(d->FineTune);
1693      eGain.set_value(d->Gain);      eGain.set_value(d->Gain);
     eGainPlus6.set_value(d->Gain);  
1694      eSampleLoopEnabled.set_value(d->SampleLoops);      eSampleLoopEnabled.set_value(d->SampleLoops);
1695      eSampleLoopType.set_value(      eSampleLoopType.set_value(
1696          d->SampleLoops ? d->pSampleLoops[0].LoopType : 0);          d->SampleLoops ? d->pSampleLoops[0].LoopType : 0);
# Line 1349  void DimRegionEdit::set_dim_region(gig:: Line 1707  void DimRegionEdit::set_dim_region(gig::
1707      wSample->set_text(d->pSample ? gig_to_utf8(d->pSample->pInfo->Name) :      wSample->set_text(d->pSample ? gig_to_utf8(d->pSample->pInfo->Name) :
1708                        _("NULL"));                        _("NULL"));
1709    
1710        scriptVars.setInstrument(
1711            (gig::Instrument*) d->GetParent()->GetParent()
1712        );
1713    
1714      update_loop_elements();      update_loop_elements();
1715      VCFEnabled_toggled();      VCFEnabled_toggled();
1716  }  }
# Line 1380  void DimRegionEdit::VCFEnabled_toggled() Line 1742  void DimRegionEdit::VCFEnabled_toggled()
1742      eEG2ControllerReleaseInfluence.set_sensitive(sensitive);      eEG2ControllerReleaseInfluence.set_sensitive(sensitive);
1743      eEG2StateOptions.set_sensitive(sensitive);      eEG2StateOptions.set_sensitive(sensitive);
1744      lLFO2->set_sensitive(sensitive);      lLFO2->set_sensitive(sensitive);
1745        eLFO2Wave.set_sensitive(sensitive);
1746      eLFO2Frequency.set_sensitive(sensitive);      eLFO2Frequency.set_sensitive(sensitive);
1747        eLFO2Phase.set_sensitive(sensitive);
1748      eLFO2InternalDepth.set_sensitive(sensitive);      eLFO2InternalDepth.set_sensitive(sensitive);
1749      eLFO2ControlDepth.set_sensitive(sensitive);      eLFO2ControlDepth.set_sensitive(sensitive);
1750      eLFO2Controller.set_sensitive(sensitive);      eLFO2Controller.set_sensitive(sensitive);
1751      eLFO2FlipPhase.set_sensitive(sensitive);      eLFO2FlipPhase.set_sensitive(sensitive);
1752      eLFO2Sync.set_sensitive(sensitive);      eLFO2Sync.set_sensitive(sensitive);
1753        lfo2Graph.set_sensitive(sensitive);
1754      if (sensitive) {      if (sensitive) {
1755          VCFCutoffController_changed();          VCFCutoffController_changed();
1756          VCFResonanceController_changed();          VCFResonanceController_changed();

Legend:
Removed from v.3461  
changed lines
  Added in v.3738

  ViewVC Help
Powered by ViewVC