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)
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.
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.
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.
6
21
//=========================================================
8
23
#ifndef __MIDIEDITOR_H__
32
55
class MidiEditor : public TopWin {
36
std::list<int> _parts;
58
MusECore::PartList* _pl;
37
60
int _curDrumInstrument; // currently selected instrument if drum
63
MusEGui::ScrollScale* hscroll;
64
MusEGui::ScrollScale* vscroll;
65
MusEGui::MTScale* time;
43
66
EventCanvas* canvas;
46
69
std::list<CtrlEdit*> ctrlEditList;
48
71
QGridLayout* mainGrid;
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();
79
void addNewParts(const std::map< MusECore::Part*, std::set<MusECore::Part*> >&);
56
82
void songChanged(int type);
57
83
void setCurDrumInstrument(int instr);
84
void horizontalZoomIn();
85
void horizontalZoomOut();
59
87
virtual void updateHScrollRange() { };
61
89
void curDrumInstrumentChanged(int);
64
MidiEditor(int, int, PartList*,
92
MidiEditor(ToplevelType t, int, MusECore::PartList*,
65
93
QWidget* parent = 0, const char* name = 0);
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*);
114
} // namespace MusEGui