/[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 2695 by schoenebeck, Tue Jan 6 18:11:27 2015 UTC
# Line 1  Line 1 
1  /*                                                         -*- c++ -*-  /*                                                         -*- c++ -*-
2   * Copyright (C) 2006-2014 Andreas Persson   * Copyright (C) 2006-2015 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 30  Line 30 
30  #include <gig.h>  #include <gig.h>
31    
32  #include <set>  #include <set>
33    #include <map>
34    
35  class DimRegionChooser : public Gtk::DrawingArea  class DimRegionChooser : public Gtk::DrawingArea
36  {  {
37  public:  public:
38      DimRegionChooser();      DimRegionChooser(Gtk::Window& window);
39      virtual ~DimRegionChooser();      virtual ~DimRegionChooser();
40    
41      void set_region(gig::Region* region);      void set_region(gig::Region* region);
# Line 42  public: Line 43  public:
43      sigc::signal<void>& signal_dimregion_selected();      sigc::signal<void>& signal_dimregion_selected();
44      sigc::signal<void>& signal_region_changed();      sigc::signal<void>& signal_region_changed();
45    
46      gig::DimensionRegion* get_dimregion() const { return dimreg; }      gig::DimensionRegion* get_main_dimregion() const;
47      void get_dimregions(const gig::Region* region, bool stereo,      void get_dimregions(const gig::Region* region, bool stereo,
48                          std::set<gig::DimensionRegion*>& dimregs) const;                          std::set<gig::DimensionRegion*>& dimregs) const;
49        bool select_dimregion(gig::DimensionRegion* dimrgn);
50    
51  protected:  protected:
52  #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 58  protected:
58      virtual bool on_button_release_event(GdkEventButton* event);      virtual bool on_button_release_event(GdkEventButton* event);
59      virtual bool on_motion_notify_event(GdkEventMotion* event);      virtual bool on_motion_notify_event(GdkEventMotion* event);
60      virtual bool on_focus(Gtk::DirectionType direction);      virtual bool on_focus(Gtk::DirectionType direction);
61        bool onKeyPressed(GdkEventKey* key);
62        bool onKeyReleased(GdkEventKey* key);
63      void refresh_all();      void refresh_all();
64      void split_dimension_zone();      void split_dimension_zone();
65      void delete_dimension_zone();      void delete_dimension_zone();
66        void resetSelectedZones();
67    
68      Gdk::RGBA red, black, white;      Gdk::RGBA red, black, white;
69    
70      gig::Instrument* instrument;      gig::Instrument* instrument;
71      gig::Region* region;      gig::Region* region;
     int dimregno;  
72    
73      sigc::signal<void> dimregion_selected;      sigc::signal<void> dimregion_selected;
74      sigc::signal<void> region_changed;      sigc::signal<void> region_changed;
75    
76      gig::DimensionRegion* dimreg;      //std::set<gig::DimensionRegion*> dimregs; ///< Reflects which dimension regions are currently selected.
77      int focus_line;      int focus_line;
78      int dimvalue[256];      std::map<gig::dimension_t, std::set<int> > dimzones; ///< Reflects which zone(s) of the individual dimension are currently selected.
79      int label_width;      int label_width;
80      bool labels_changed;      bool labels_changed;
81      int nbDimensions;      int nbDimensions;
82    
83      int dimtype;      // the "main" dimension region is the one that is used to i.e. evaluate the
84      int dimzone;      // precise custom velocity splits (could also be interpreted for focus stuff,
85        // i.e. keyboard arrow key navigation)
86        // NOTE: these may *not* necessarily currently be selected !
87        gig::dimension_t maindimtype;
88        std::map<gig::dimension_t,int> maindimcase;
89        int maindimregno;
90    
91      // information needed during a resize      // information needed during a resize
92      struct {      struct {
# Line 94  protected: Line 103  protected:
103          int offset;          int offset;
104      } resize;      } resize;
105    
106        bool multiSelectKeyDown;
107    
108      bool cursor_is_resize;      bool cursor_is_resize;
109      bool is_in_resize_zone(double x, double y);      bool is_in_resize_zone(double x, double y);
110      void update_after_resize();      void update_after_resize();

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

  ViewVC Help
Powered by ViewVC