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

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

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

revision 2720 by schoenebeck, Sun Mar 1 15:43:42 2015 UTC revision 3177 by schoenebeck, Thu May 11 20:59:46 2017 UTC
# Line 1  Line 1 
1  /*                                                         -*- c++ -*-  /*                                                         -*- c++ -*-
2   * Copyright (C) 2006-2015 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 20  Line 20 
20  #ifndef GIGEDIT_DIMREGIONEDIT_H  #ifndef GIGEDIT_DIMREGIONEDIT_H
21  #define GIGEDIT_DIMREGIONEDIT_H  #define GIGEDIT_DIMREGIONEDIT_H
22    
23  #include <gig.h>  #ifdef LIBGIG_HEADER_FILE
24    # include LIBGIG_HEADER_FILE(gig.h)
25    #else
26    # include <gig.h>
27    #endif
28    
29  #include <cairomm/context.h>  #include <cairomm/context.h>
30    #include <gtkmm/box.h>
31  #include <gtkmm/drawingarea.h>  #include <gtkmm/drawingarea.h>
32  #include <gtkmm/entry.h>  #include <gtkmm/entry.h>
33  #include <gtkmm/label.h>  #include <gtkmm/label.h>
# Line 32  Line 37 
37  #include <set>  #include <set>
38    
39  #include "paramedit.h"  #include "paramedit.h"
40    #include "global.h"
41    
42  class VelocityCurve : public Gtk::DrawingArea {  class VelocityCurve : public Gtk::DrawingArea {
43  public:  public:
# Line 76  public: Line 82  public:
82      virtual ~DimRegionEdit();      virtual ~DimRegionEdit();
83      void set_dim_region(gig::DimensionRegion* d);      void set_dim_region(gig::DimensionRegion* d);
84      bool set_sample(gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop);      bool set_sample(gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop);
85        bool set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop);
86      Gtk::Entry* wSample;      Gtk::Entry* wSample;
87      Gtk::Button* buttonNullSampleReference;      Gtk::Button* buttonNullSampleReference;
88      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed();      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed();
# Line 92  protected: Line 99  protected:
99      sigc::signal<void> instrument_changed;      sigc::signal<void> instrument_changed;
100      sigc::signal<void, gig::Sample*> select_sample_signal;      sigc::signal<void, gig::Sample*> select_sample_signal;
101    
102        /**
103         * Ensures that the 2 signals DimRegionEdit::dimreg_to_be_changed_signal and
104         * DimRegionEdit::dimreg_changed_signal are always triggered correctly as a
105         * pair. It behaves similar to a "mutex lock guard" design pattern.
106         */
107        class DimRegionChangeGuard : public SignalGuard<gig::DimensionRegion*> {
108        public:
109            DimRegionChangeGuard(DimRegionEdit* edit, gig::DimensionRegion* pDimReg) :
110                SignalGuard<gig::DimensionRegion*>(edit->dimreg_to_be_changed_signal, edit->dimreg_changed_signal, pDimReg)
111            {
112            }
113        };
114    
115      gig::DimensionRegion* dimregion;      gig::DimensionRegion* dimregion;
116    
117  #ifdef OLD_TOOLTIPS  #ifdef OLD_TOOLTIPS
# Line 186  protected: Line 206  protected:
206      BoolEntry eMSDecode;      BoolEntry eMSDecode;
207      NumEntryTemp<uint16_t> eSampleStartOffset;      NumEntryTemp<uint16_t> eSampleStartOffset;
208      NoteEntry eUnityNote;      NoteEntry eUnityNote;
209        ReadOnlyLabelWidget eSampleGroup;
210      ReadOnlyLabelWidget eSampleFormatInfo;      ReadOnlyLabelWidget eSampleFormatInfo;
211      ReadOnlyLabelWidget eSampleID;      ReadOnlyLabelWidget eSampleID;
212        ReadOnlyLabelWidget eChecksum;
213      NumEntryTemp<int16_t> eFineTune;      NumEntryTemp<int16_t> eFineTune;
214      NumEntryGain eGain;      NumEntryGain eGain;
215      BoolEntryPlus6 eGainPlus6;      BoolEntryPlus6 eGainPlus6;
# Line 273  protected: Line 295  protected:
295                            sigc::mem_fun(widget, &C::get_value)));                            sigc::mem_fun(widget, &C::get_value)));
296      }      }
297    
298      // loop through all dimregions being edited ant set a value in      // loop through all dimregions being edited and set a value in
299      // each of them      // each of them
300      template<typename T>      template<typename T>
301      void set_many(T value,      void set_many(T value,
302                    sigc::slot<void, DimRegionEdit*, gig::DimensionRegion*, T> setter) {                    sigc::slot<void, DimRegionEdit*, gig::DimensionRegion*, T> setter) {
303          if (update_model == 0) {          if (update_model == 0) {
304              for (std::set<gig::DimensionRegion*>::iterator i = dimregs.begin() ;              for (std::set<gig::DimensionRegion*>::iterator i = dimregs.begin() ;
305                   i != dimregs.end() ; i++)                   i != dimregs.end() ; ++i)
306              {              {
307                  dimreg_changed_signal(*i);                  DimRegionChangeGuard(this, *i);
308                  setter(this, *i, value);                  setter(this, *i, value);
309              }              }
310          }          }

Legend:
Removed from v.2720  
changed lines
  Added in v.3177

  ViewVC Help
Powered by ViewVC