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

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

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

revision 2556 by schoenebeck, Fri May 16 23:19:23 2014 UTC revision 3131 by schoenebeck, Thu Apr 27 17:28:01 2017 UTC
# Line 1  Line 1 
1  /*                                                         -*- c++ -*-  /*                                                         -*- c++ -*-
2   * Copyright (C) 2006-2014 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 27  Line 27 
27    
28  #include "compat.h"  #include "compat.h"
29    
30  #include <gig.h>  #ifdef LIBGIG_HEADER_FILE
31    # include LIBGIG_HEADER_FILE(gig.h)
32    #else
33    # include <gig.h>
34    #endif
35    
36  #include <set>  #include <set>
37    #include <map>
38    
39    #include "global.h"
40    
41  class DimRegionChooser : public Gtk::DrawingArea  class DimRegionChooser : public Gtk::DrawingArea
42  {  {
43  public:  public:
44      DimRegionChooser();      DimRegionChooser(Gtk::Window& window);
45      virtual ~DimRegionChooser();      virtual ~DimRegionChooser();
46    
47      void set_region(gig::Region* region);      void set_region(gig::Region* region);
# Line 42  public: Line 49  public:
49      sigc::signal<void>& signal_dimregion_selected();      sigc::signal<void>& signal_dimregion_selected();
50      sigc::signal<void>& signal_region_changed();      sigc::signal<void>& signal_region_changed();
51    
52      gig::DimensionRegion* get_dimregion() const { return dimreg; }      gig::DimensionRegion* get_main_dimregion() const;
53      void get_dimregions(const gig::Region* region, bool stereo,      void get_dimregions(const gig::Region* region, bool stereo,
54                          std::set<gig::DimensionRegion*>& dimregs) const;                          std::set<gig::DimensionRegion*>& dimregs) const;
55        bool select_dimregion(gig::DimensionRegion* dimrgn);
56        void select_next_dimzone();
57        void select_prev_dimzone();
58        void select_next_dimension();
59        void select_prev_dimension();
60    
61        // those 3 are ATM only relevant when resizing custom dimension region zones
62        void setModifyBothChannels(bool b);
63        void setModifyAllDimensionRegions(bool b);
64        void setModifyAllRegions(bool b);
65    
66  protected:  protected:
67  #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
# Line 56  protected: Line 73  protected:
73      virtual bool on_button_release_event(GdkEventButton* event);      virtual bool on_button_release_event(GdkEventButton* event);
74      virtual bool on_motion_notify_event(GdkEventMotion* event);      virtual bool on_motion_notify_event(GdkEventMotion* event);
75      virtual bool on_focus(Gtk::DirectionType direction);      virtual bool on_focus(Gtk::DirectionType direction);
76        bool onKeyPressed(GdkEventKey* key);
77        bool onKeyReleased(GdkEventKey* key);
78      void refresh_all();      void refresh_all();
79      void split_dimension_zone();      void split_dimension_zone();
80      void delete_dimension_zone();      void delete_dimension_zone();
81        void resetSelectedZones();
82        void select_dimzone_by_dir(int dir);
83    
84      Gdk::RGBA red, black, white;      Gdk::RGBA red, blue, black, white;
85        Glib::RefPtr<Gdk::Pixbuf> blueHatchedPatternARGB;
86        Cairo::RefPtr<Cairo::SurfacePattern> blueHatchedSurfacePattern;
87    
88      gig::Instrument* instrument;      gig::Instrument* instrument;
89      gig::Region* region;      gig::Region* region;
     int dimregno;  
90    
91      sigc::signal<void> dimregion_selected;      sigc::signal<void> dimregion_selected;
92      sigc::signal<void> region_changed;      sigc::signal<void> region_changed;
93    
94      gig::DimensionRegion* dimreg;      // those 3 are ATM only relevant when resizing custom dimension region zones
95        bool modifybothchannels;
96        bool modifyalldimregs;
97        bool modifyallregions;
98    
99      int focus_line;      int focus_line;
100      int dimvalue[256];      std::map<gig::dimension_t, std::set<int> > dimzones; ///< Reflects which zone(s) of the individual dimension are currently selected.
101      int label_width;      int label_width;
102      bool labels_changed;      bool labels_changed;
103      int nbDimensions;      int nbDimensions;
104    
105      int dimtype;      // the "main" dimension region is the one that is used to i.e. evaluate the
106      int dimzone;      // precise custom velocity splits (could also be interpreted for focus stuff,
107        // i.e. keyboard arrow key navigation)
108        // NOTE: these may *not* necessarily currently be selected !
109        gig::dimension_t maindimtype;
110        DimensionCase maindimcase;
111        int maindimregno;
112    
113      // information needed during a resize      // information needed during a resize
114      struct {      struct {
# Line 91  protected: Line 122  protected:
122          int min;          int min;
123          int max;          int max;
124          int dimension;          int dimension;
125          int offset;          gig::dimension_def_t dimensionDef;
126            int zone;
127      } resize;      } resize;
128    
129        bool multiSelectKeyDown;
130        bool primaryKeyDown; // on Mac: Cmd key, on all other OSs: Ctrl key
131        bool shiftKeyDown;
132    
133      bool cursor_is_resize;      bool cursor_is_resize;
134      bool is_in_resize_zone(double x, double y);      bool is_in_resize_zone(double x, double y);
135      void update_after_resize();      void update_after_resize();
# Line 104  protected: Line 140  protected:
140      Glib::RefPtr<Gtk::UIManager> uiManager;      Glib::RefPtr<Gtk::UIManager> uiManager;
141      Gtk::Menu* popup_menu_inside_dimregion;      Gtk::Menu* popup_menu_inside_dimregion;
142      Gtk::Menu* popup_menu_outside_dimregion;      Gtk::Menu* popup_menu_outside_dimregion;
143    
144    private:
145        Glib::RefPtr<Gtk::Action> actionDeleteDimZone;
146        Glib::RefPtr<Gtk::Action> actionSplitDimZone;
147  };  };
148    
149  #endif  #endif

Legend:
Removed from v.2556  
changed lines
  Added in v.3131

  ViewVC Help
Powered by ViewVC