drumstick  1.1.2
qove.h
Go to the documentation of this file.
1 /*
2  Overture OVE File component
3  Copyright (C) 2006-2017, Rui Fan <vanferry@gmail.com>
4 
5  This library is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef DRUMSTICK_OVE_H
20 #define DRUMSTICK_OVE_H
21 
22 #include "macros.h"
23 #include <QObject>
24 
25 namespace OVE {
26  class Track;
27  class Voice;
28  class Measure;
29  class MeasureData;
30  class NoteContainer;
31 }
32 
40 namespace drumstick {
41 
42 class MeasureToTick;
43 
50 class DRUMSTICK_EXPORT QOve : public QObject {
51  Q_OBJECT
52 
53 public:
54  QOve(QObject * parent = 0);
55  virtual ~QOve();
56 
57  void setTextCodecName(const QString& codec);
58 
59  void readFromFile(const QString& fileName);
60 
61 Q_SIGNALS:
62 
68  void signalOVEError(const QString& errorStr);
69 
76  void signalOVEHeader(int quarter, int trackCount);
77 
81  void signalOVEEnd();
82 
92  void signalOVENoteOn(int track, long tick, int channel, int pitch, int vol);
93  void signalOVENoteOff(int track, long tick, int channel, int pitch, int vol);
94 
104  void signalOVECtlChange(int track, long tick, int channel, int ctl, int value);
105 
115  void signalOVEKeyPress(int track, long tick, int channel, int pitch, int press);
116 
125  void signalOVEPitchBend(int track, long tick, int channel, int value);
126 
135  void signalOVEProgram(int track, long tick, int channel, int patch);
136 
145  void signalOVEChanPress(int track, long tick, int channel, int press);
146 
154  void signalOVESysexEvent(int track, long tick, int bank);
155 
165  void signalOVESysex(int bank, const QString& name, bool autosend, int port, const QByteArray& data);
166 
174  void signalOVEText(int track, long tick, const QString& data);
175 
184  void signalOVETimeSig(int bar, long tick, int num, int den);
185 
193  void signalOVEKeySig(int bar, long tick, int alt);
194 
204  void signalOVETempo(long tick, int tempo);
205 
219  void signalOVENewTrack(const QString& name, int track, int channel,
220  int pitch, int velocity, int port, bool selected, bool muted, bool loop);
221 
229  void signalOVETrackPatch(int track, int channel, int patch);
230 
238  void signalOVETrackBank(int track, int channel, int bank);
239 
247  void signalOVETrackVol(int track, int channel, int vol);
248 
257  void signalOVEChord(int track, long tick, const QString& name, const QByteArray& data);
258 
267  void signalOVEExpression(int track, long time, int code, const QString& text);
268 
269 private:
270  void convertSong();
271  void convertSignatures();
272  void convertTrackHeader(OVE::Track* track, int trackNo);
273  void convertMeasure(
274  OVE::Track* track,
275  int trackNo,
276  const QList<OVE::Voice*>& voices,
277  OVE::Measure* measure,
278  OVE::MeasureData* measureData,
279  int transpose,
280  int offsetTick);
281  void convertNotes(int trackNo, int measureTick, OVE::NoteContainer* container, int channel, int pitchShift);
282 
283 private:
284  class QOvePrivate;
285  QOvePrivate* d;
286 };
287 
288 } // namespace drumstick
289 
292 #endif // DRUMSTICK_OVE_H
The QObject class is the base class of all Qt objects.
Drumstick visibility macros.
Overture OVE Files (input only)
Definition: qove.h:50