drumstick  0.5.0
qove.h
Go to the documentation of this file.
1 /*
2  Overture OVE File component
3  Copyright (C) 2006-2010, 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 along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef DRUMSTICK_OVE_H
21 #define DRUMSTICK_OVE_H
22 
23 #include "macros.h"
24 #include <QObject>
25 
26 namespace OVE {
27  class Track;
28  class Voice;
29  class Measure;
30  class MeasureData;
31  class NoteContainer;
32 }
33 
41 namespace drumstick {
42 
43 class MeasureToTick;
44 
51 class DRUMSTICK_EXPORT QOve : public QObject {
52  Q_OBJECT
53 
54 public:
55  QOve(QObject * parent = 0);
56  virtual ~QOve();
57 
58  void setTextCodecName(const QString& codec);
59 
60  void readFromFile(const QString& fileName);
61 
62 Q_SIGNALS:
63 
69  void signalOVEError(const QString& errorStr);
70 
77  void signalOVEHeader(int quarter, int trackCount);
78 
82  void signalOVEEnd();
83 
93  void signalOVENoteOn(int track, long tick, int channel, int pitch, int vol);
94  void signalOVENoteOff(int track, long tick, int channel, int pitch, int vol);
95 
105  void signalOVECtlChange(int track, long tick, int channel, int ctl, int value);
106 
116  void signalOVEKeyPress(int track, long tick, int channel, int pitch, int press);
117 
126  void signalOVEPitchBend(int track, long tick, int channel, int value);
127 
136  void signalOVEProgram(int track, long tick, int channel, int patch);
137 
146  void signalOVEChanPress(int track, long tick, int channel, int press);
147 
155  void signalOVESysexEvent(int track, long tick, int bank);
156 
166  void signalOVESysex(int bank, const QString& name, bool autosend, int port, const QByteArray& data);
167 
175  void signalOVEText(int track, long tick, const QString& data);
176 
185  void signalOVETimeSig(int bar, long tick, int num, int den);
186 
194  void signalOVEKeySig(int bar, long tick, int alt);
195 
205  void signalOVETempo(long tick, int tempo);
206 
220  void signalOVENewTrack(const QString& name, int track, int channel,
221  int pitch, int velocity, int port, bool selected, bool muted, bool loop);
222 
230  void signalOVETrackPatch(int track, int channel, int patch);
231 
239  void signalOVETrackBank(int track, int channel, int bank);
240 
248  void signalOVETrackVol(int track, int channel, int vol);
249 
258  void signalOVEChord(int track, long tick, const QString& name, const QByteArray& data);
259 
268  void signalOVEExpression(int track, long time, int code, const QString& text);
269 
270 private:
271  void convertSong();
272  void convertSignatures();
273  void convertTrackHeader(OVE::Track* track, int trackNo);
274  void convertMeasure(
275  OVE::Track* track,
276  int trackNo,
277  const QList<OVE::Voice*>& voices,
278  OVE::Measure* measure,
279  OVE::MeasureData* measureData,
280  int transpose,
281  int offsetTick);
282  void convertNotes(int trackNo, int measureTick, OVE::NoteContainer* container, int channel, int pitchShift);
283 
284 private:
285  class QOvePrivate;
286  QOvePrivate* d;
287 };
288 
289 } // namespace drumstick
290 
293 #endif // DRUMSTICK_OVE_H
The QObject class is the base class of all Qt objects.
Drumstick visibility macros.
Definition: qove.h:26
Overture OVE Files (input only)
Definition: qove.h:51