~ubuntu-branches/ubuntu/wily/muse/wily-proposed

« back to all changes in this revision

Viewing changes to muse/midieditor.h

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2011-12-03 17:12:54 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20111203171254-28b1j4lpb46r5jtl
Tags: 2.0~rc1-1
* New upstream RC release.
* Refresh patches, remove those patches not needed anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
//  Linux Music Editor
4
4
//    $Id: midieditor.h,v 1.3.2.2 2009/02/02 21:38:00 terminator356 Exp $
5
5
//  (C) Copyright 1999 Werner Schweer (ws@seh.de)
 
6
//
 
7
//  This program is free software; you can redistribute it and/or
 
8
//  modify it under the terms of the GNU General Public License
 
9
//  as published by the Free Software Foundation; version 2 of
 
10
//  the License, or (at your option) any later version.
 
11
//
 
12
//  This program is distributed in the hope that it will be useful,
 
13
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
//  GNU General Public License for more details.
 
16
//
 
17
//  You should have received a copy of the GNU General Public License
 
18
//  along with this program; if not, write to the Free Software
 
19
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
20
//
6
21
//=========================================================
7
22
 
8
23
#ifndef __MIDIEDITOR_H__
12
27
#include "al/sig.h"
13
28
#include "cobject.h"
14
29
 
 
30
 
 
31
#include <set>
 
32
 
15
33
class QGridLayout;
16
34
class QWidget;
17
35
 
 
36
 
 
37
namespace MusECore {
 
38
class Part;
18
39
class PartList;
 
40
class WavePart;
19
41
class Xml;
 
42
}
 
43
 
 
44
namespace MusEGui {
 
45
class CtrlEdit;
20
46
class EventCanvas;
 
47
class MTScale;
21
48
class ScrollScale;
22
 
class CtrlEdit;
23
 
class MTScale;
24
49
class WaveView;
25
 
class Part;
26
 
class WavePart;
27
50
 
28
51
//---------------------------------------------------------
29
52
//   MidiEditor
32
55
class MidiEditor : public TopWin  {
33
56
      Q_OBJECT
34
57
 
35
 
      PartList* _pl;
36
 
      std::list<int> _parts;
 
58
      MusECore::PartList* _pl;
 
59
      std::set<int> _parts;
37
60
      int _curDrumInstrument;  // currently selected instrument if drum
38
61
                               // editor
39
62
   protected:
40
 
      ScrollScale* hscroll;
41
 
      ScrollScale* vscroll;
42
 
      MTScale* time;
 
63
      MusEGui::ScrollScale* hscroll;
 
64
      MusEGui::ScrollScale* vscroll;
 
65
      MusEGui::MTScale* time;
43
66
      EventCanvas* canvas;
44
67
      WaveView* wview;
45
68
 
46
69
      std::list<CtrlEdit*> ctrlEditList;
47
 
      int _quant, _raster;
 
70
      int _raster;
48
71
      QGridLayout* mainGrid;
49
72
      QWidget* mainw;
50
 
      virtual void readStatus(Xml&);
51
 
      virtual void writeStatus(int, Xml&) const;
52
 
      void writePartList(int, Xml&) const;
 
73
      virtual void readStatus(MusECore::Xml&);
 
74
      virtual void writeStatus(int, MusECore::Xml&) const;
 
75
      void writePartList(int, MusECore::Xml&) const;
53
76
      void genPartlist();
54
77
 
 
78
   private slots:
 
79
      void addNewParts(const std::map< MusECore::Part*, std::set<MusECore::Part*> >&);
 
80
 
55
81
   public slots:
56
82
      void songChanged(int type);
57
83
      void setCurDrumInstrument(int instr);
58
 
      
 
84
      void horizontalZoomIn();
 
85
      void horizontalZoomOut();
 
86
 
59
87
      virtual void updateHScrollRange() { };
60
88
   signals:
61
89
      void curDrumInstrumentChanged(int);
62
90
 
63
91
   public:
64
 
      MidiEditor(int, int, PartList*,
 
92
      MidiEditor(ToplevelType t, int, MusECore::PartList*,
65
93
         QWidget* parent = 0, const char* name = 0);
66
94
      ~MidiEditor();
67
95
 
68
 
      int quantVal(int v) const;
69
96
      ///int rasterStep(unsigned tick) const   { return sigmap.rasterStep(tick, _raster); }
70
97
      ///unsigned rasterVal(unsigned v)  const { return sigmap.raster(v, _raster);  }
71
98
      ///unsigned rasterVal1(unsigned v) const { return sigmap.raster1(v, _raster); }
74
101
      unsigned rasterVal(unsigned v)  const { return AL::sigmap.raster(v, _raster);  }
75
102
      unsigned rasterVal1(unsigned v) const { return AL::sigmap.raster1(v, _raster); }
76
103
      unsigned rasterVal2(unsigned v) const { return AL::sigmap.raster2(v, _raster); }
77
 
      int quant() const            { return _quant; }
78
 
      void setQuant(int val)       { _quant = val; }
79
104
      int raster() const           { return _raster; }
80
105
      void setRaster(int val)      { _raster = val; }
81
 
      PartList* parts()            { return _pl;  }
 
106
      MusECore::PartList* parts()            { return _pl;  }
82
107
      int curDrumInstrument() const  { return _curDrumInstrument; }
83
 
      Part* curCanvasPart();
84
 
      WavePart* curWavePart();
85
 
      void setCurCanvasPart(Part*); 
 
108
      MusECore::Part* curCanvasPart();
 
109
      MusECore::WavePart* curWavePart();
 
110
      void setCurCanvasPart(MusECore::Part*); 
 
111
      void addPart(MusECore::Part*);
86
112
      };
87
113
 
 
114
} // namespace MusEGui
 
115
 
88
116
#endif
89
117