~ubuntu-branches/ubuntu/quantal/muse/quantal

« back to all changes in this revision

Viewing changes to muse/arranger/arranger.h

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2012-07-18 16:07:06 UTC
  • mfrom: (1.1.12) (10.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20120718160706-qy1lydijykeiqqmg
Tags: 2.0-1
* New stable release.
* debian/rules: Exclude muse/widgets/arrangercolumns.{cpp,h}~ from being
  deleted by dh_clean.
* Drop 0002-gcc_hardening.patch, applied upstream.
* Drop 0003-ftbfs_gcc47.patch, applied upstream.
* Refresh 1001-buildsystem.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#define __ARRANGER_H__
25
25
 
26
26
#include <vector>
 
27
#include <QString>
 
28
 
 
29
#include <QScrollBar>
 
30
#include <QResizeEvent>
27
31
 
28
32
#include "midieditor.h"
29
33
#include "pcanvas.h"
33
37
class QCheckBox;
34
38
class QMainWindow;
35
39
class QMenu;
36
 
class QScrollBar;
37
40
class QToolButton;
38
41
class QWheelEvent;
39
42
class QKeyEvent;
40
 
//class QStackedWidget;
41
43
 
42
44
namespace MusECore {
43
45
class Track;
59
61
class TList;
60
62
class WidgetStack;
61
63
 
 
64
 
62
65
//---------------------------------------------------------
63
66
//   WidgetStack
64
67
//---------------------------------------------------------
68
71
      std::vector<QWidget*> stack;
69
72
      int top;
70
73
 
 
74
   protected:
 
75
      virtual void wheelEvent(QWheelEvent* e);
 
76
      
 
77
   signals:
 
78
      void redirectWheelEvent(QWheelEvent*);
 
79
      
71
80
   public:
72
81
      WidgetStack(QWidget* parent, const char* name = 0);
73
82
      void raiseWidget(int idx);
76
85
      QWidget* visibleWidget() const;
77
86
      int curIdx() const { return top; }
78
87
      virtual QSize minimumSizeHint() const;
79
 
      //QSize minimumSize() const;
80
 
      //int minimumHeight() const;
81
88
      };
82
89
 
83
90
//---------------------------------------------------------
 
91
//   ScrollBar
 
92
//---------------------------------------------------------
 
93
 
 
94
class ScrollBar : public QScrollBar {
 
95
      Q_OBJECT
 
96
      
 
97
  public slots:
 
98
      void redirectedWheelEvent(QWheelEvent*);
 
99
      
 
100
  protected:
 
101
      virtual void resizeEvent(QResizeEvent* e) { setPageStep(e->size().height()); }
 
102
      
 
103
  public:    
 
104
    ScrollBar(Qt::Orientation orientation, QWidget * parent = 0 ) : QScrollBar(orientation, parent) {};  
 
105
};
 
106
 
 
107
 
 
108
//---------------------------------------------------------
84
109
//   Arranger
85
110
//---------------------------------------------------------
86
111
 
87
112
class Arranger : public QWidget {
88
113
      Q_OBJECT
89
114
 
 
115
      static QByteArray header_state;
 
116
 
90
117
      int _quant, _raster;
91
118
      PartCanvas* canvas;
92
119
      ScrollScale* hscroll;
97
124
      SpinBox* lenEntry;
98
125
      bool showTrackinfoFlag;
99
126
      WidgetStack* trackInfo;
100
 
      //QStackedWidget* trackInfo;
101
 
      QScrollBar* infoScroll;
102
 
      //MidiTrackInfoBase* midiTrackInfo;
 
127
      ScrollBar* infoScroll;
103
128
      MidiTrackInfo* midiTrackInfo;
104
129
      AudioStrip* waveTrackInfo;
105
130
      QWidget* noTrackInfo;
 
131
      QWidget* tracklist;
106
132
      TLLayout* tgrid;
107
133
 
108
134
      MusECore::Track* selected;
111
137
      QToolButton* ib;
112
138
      int trackInfoType;
113
139
      Splitter* split;
114
 
      ///QMenu* pop;
115
140
      int songType;
116
141
      PosLabel* cursorPos;
117
142
      SpinBox* globalTempoSpinBox;
134
159
      void songChanged(int);
135
160
      void modeChange(int);
136
161
      void setTime(unsigned);
137
 
      void headerMoved();
138
162
      void globalPitchChanged(int);
139
163
      void globalTempoChanged(int);
140
164
      void setTempo50();
141
165
      void setTempo100();
142
166
      void setTempo200();
143
 
      //void seek();
144
167
      void verticalScrollSetYpos(unsigned);
145
168
      void horizontalZoomIn();
146
169
      void horizontalZoomOut();
147
170
      
148
171
   signals:
149
 
      void redirectWheelEvent(QWheelEvent*);
150
172
      void editPart(MusECore::Track*);
151
173
      void selectionChanged();
152
174
      void dropSongFile(const QString&);
153
175
      void dropMidiFile(const QString&);
154
176
      void startEditor(MusECore::PartList*, int);
155
177
      void toolChanged(int);
156
 
      //void addMarker(int);
157
178
      void setUsedTool(int);
158
179
 
159
180
 
160
181
   protected:
161
 
      virtual void wheelEvent(QWheelEvent* e);
162
182
      virtual void keyPressEvent(QKeyEvent* event);
163
183
 
164
184
   public slots:
166
186
      void setTool(int);
167
187
      void updateTrackInfo(int flags);
168
188
      void configChanged();
169
 
      void controllerChanged(MusECore::Track *t);
 
189
      void controllerChanged(MusECore::Track *t, int ctrlId);
 
190
      void focusCanvas();
170
191
 
171
192
   public:
172
193
      enum { CMD_CUT_PART, CMD_COPY_PART, CMD_COPY_PART_IN_RANGE, CMD_PASTE_PART, CMD_PASTE_CLONE_PART,
173
194
             CMD_PASTE_DIALOG, CMD_PASTE_CLONE_DIALOG, CMD_INSERT_EMPTYMEAS };
 
195
      
 
196
      struct custom_col_t
 
197
      {
 
198
        enum affected_pos_t {AFFECT_BEGIN, AFFECT_CPOS};
 
199
 
 
200
        int ctrl;
 
201
        QString name;
 
202
        affected_pos_t affected_pos;
 
203
        
 
204
        custom_col_t(int c, QString n, affected_pos_t a=AFFECT_BEGIN)
 
205
        {
 
206
          ctrl=c;
 
207
          name=n;
 
208
          affected_pos=a;
 
209
        }
 
210
      };
 
211
      static std::vector<custom_col_t> custom_columns;     //FINDMICH TODO: eliminate all usage of new_custom_columns
 
212
      static std::vector<custom_col_t> new_custom_columns; //and instead let the arranger update without restarting muse!
174
213
 
175
214
      Arranger(ArrangerView* parent, const char* name = 0);
176
215
 
180
219
      
181
220
      void writeStatus(int level, MusECore::Xml&);
182
221
      void readStatus(MusECore::Xml&);
 
222
      void writeConfiguration(int level, MusECore::Xml&);
 
223
      static void readConfiguration(MusECore::Xml&);
 
224
      static void writeCustomColumns(int level, MusECore::Xml&);
 
225
      static void readCustomColumns(MusECore::Xml&);
 
226
      static custom_col_t readOneCustomColumn(MusECore::Xml&);
183
227
 
184
228
      MusECore::Track* curTrack() const { return selected; }
185
229
      void cmd(int);