GUIDOLib  1.7.7
A Music Score Rendering Engine
GUIDOPianoRoll.h
Go to the documentation of this file.
1 #ifndef GUIDOPianoRollAPI_H
2 #define GUIDOPianoRollAPI_H
3 
4 /*
5  GUIDO Library
6  Copyright (C) 2014 Grame
7 
8  This Source Code Form is subject to the terms of the Mozilla Public
9  License, v. 2.0. If a copy of the MPL was not distributed with this
10  file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 
12  Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
13  research@grame.fr
14 
15 */
16 
17 #include "GUIDOEngine.h"
18 #include "GUIDOExport.h"
19 #include "GUIDOScoreMap.h"
20 
28 class PianoRoll;
29 
35 };
36 
39 const int kCLine = 1;
40 const int kCSharpLine = 1<<1;
41 const int kDLine = 1<<2;
42 const int kDSharpLine = 1<<3;
43 const int kELine = 1<<4;
44 const int kFLine = 1<<5;
45 const int kFSharpLine = 1<<6;
46 const int kGLine = 1<<7;
47 const int kGSharpLine = 1<<8;
48 const int kALine = 1<<9;
49 const int kASharpLine = 1<<10;
50 const int kBLine = 1<<11;
51 const int kAutoLines = 0;
52 const int kNoLine = -1;
53 
57 typedef struct LimitParams {
60  int lowPitch;
61  int highPitch;
62 } LimitParams;
63 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
68  //---------------------------------------------------------------------------
69  // the new API
70  //---------------------------------------------------------------------------
71 
80  GUIDOAPI PianoRoll* GuidoAR2PianoRoll(PianoRollType type, ARHandler arh);
81 
90  GUIDOAPI PianoRoll* GuidoMidi2PianoRoll(PianoRollType type, const char *midiFileName);
91 
98 
110  GUIDOAPI GuidoErrCode GuidoPianoRollSetLimits(PianoRoll *pr, LimitParams limitParams);
111 
118  GUIDOAPI GuidoErrCode GuidoPianoRollEnableKeyboard(PianoRoll *pr, bool enabled);
119 
127  GUIDOAPI GuidoErrCode GuidoPianoRollGetKeyboardWidth(PianoRoll *pr, int height, float &keyboardWidth);
128 
138 
149  GUIDOAPI GuidoErrCode GuidoPianoRollSetRGBColorToVoice(PianoRoll *pr, int voiceNum, int r, int g, int b, int a);
150 
158  GUIDOAPI GuidoErrCode GuidoPianoRollSetHtmlColorToVoice(PianoRoll *pr, int voiceNum, long color);
159 
167  GUIDOAPI GuidoErrCode GuidoPianoRollSetColorToVoice(PianoRoll *pr, int voiceNum, const std::string& color);
168 
175  GUIDOAPI GuidoErrCode GuidoPianoRollRemoveColorToVoice(PianoRoll *pr, int voiceNum);
176 
183  GUIDOAPI GuidoErrCode GuidoPianoRollEnableMeasureBars(PianoRoll *pr, bool enabled);
184 
195 
204  GUIDOAPI GuidoErrCode GuidoPianoRollGetMap(const PianoRoll *pr, int width, int height, Time2GraphicMap &outmap);
205 
214  GUIDOAPI GuidoErrCode GuidoPianoRollOnDraw(PianoRoll *pr, int width, int height, VGDevice* dev);
215 
220 #ifdef __cplusplus
221 }
222 #endif
223 
224 #endif /* GUIDOPianoRollAPI_H */
kSimplePianoRoll
Definition: GUIDOPianoRoll.h:33
kALine
const int kALine
Definition: GUIDOPianoRoll.h:48
kELine
const int kELine
Definition: GUIDOPianoRoll.h:43
GuidoPianoRollSetHtmlColorToVoice
GuidoErrCode GuidoPianoRollSetHtmlColorToVoice(PianoRoll *pr, int voiceNum, long color)
Sets a html color to a voice (first voice is number 1) (black by default)
GuidoPianoRollSetPitchLinesDisplayMode
GuidoErrCode GuidoPianoRollSetPitchLinesDisplayMode(PianoRoll *pr, int mode)
Sets the pitch lines display mode (automatic by default). Use Pitch lines display mode constants to p...
kBLine
const int kBLine
Definition: GUIDOPianoRoll.h:50
GUIDOEngine.h
GuidoPianoRollEnableMeasureBars
GuidoErrCode GuidoPianoRollEnableMeasureBars(PianoRoll *pr, bool enabled)
Enables or not measure bars (false by default)
GuidoAR2PianoRoll
PianoRoll * GuidoAR2PianoRoll(PianoRollType type, ARHandler arh)
Creates a new piano roll from AR, corresponding to type : simplePianoRoll -> basic piano roll traject...
kDLine
const int kDLine
Definition: GUIDOPianoRoll.h:41
LimitParams::startDate
GuidoDate startDate
Definition: GUIDOPianoRoll.h:58
GUIDOScoreMap.h
kCSharpLine
const int kCSharpLine
Definition: GUIDOPianoRoll.h:40
GUIDOAPI
#define GUIDOAPI
Definition: GUIDOExport.h:39
kTrajectoryPianoRoll
Definition: GUIDOPianoRoll.h:34
GuidoPianoRollRemoveColorToVoice
GuidoErrCode GuidoPianoRollRemoveColorToVoice(PianoRoll *pr, int voiceNum)
remove a color to a voice (first voice is number 1) (black by default)
GuidoPianoRollSetRGBColorToVoice
GuidoErrCode GuidoPianoRollSetRGBColorToVoice(PianoRoll *pr, int voiceNum, int r, int g, int b, int a)
Sets a RGB color to a voice (first voice is number 1) (black by default)
kGLine
const int kGLine
Definition: GUIDOPianoRoll.h:46
kAutoLines
const int kAutoLines
Definition: GUIDOPianoRoll.h:51
kCLine
const int kCLine
Pitch lines display mode.
Definition: GUIDOPianoRoll.h:39
GuidoPianoRollEnableAutoVoicesColoration
GuidoErrCode GuidoPianoRollEnableAutoVoicesColoration(PianoRoll *pr, bool enabled)
Enables or not the automatic voices coloration (not enabled by default) (not for a midi rendering) //...
GuidoPianoRollEnableKeyboard
GuidoErrCode GuidoPianoRollEnableKeyboard(PianoRoll *pr, bool enabled)
Enables keyboard or not (not enabled by default)
Time2GraphicMap
std::vector< TMapSegments > Time2GraphicMap
Definition: GUIDOScoreMap.h:89
GuidoErrCode
GuidoErrCode
The guido error codes list.
Definition: GUIDOEngine.h:211
kFLine
const int kFLine
Definition: GUIDOPianoRoll.h:44
GUIDOExport.h
kNoLine
const int kNoLine
Definition: GUIDOPianoRoll.h:52
LimitParams
struct LimitParams LimitParams
A struct to set a piano roll boundaries in time and in pitch.
GuidoDate
Representation of a date as a rational value.
Definition: GUIDOEngine.h:83
VGDevice
Generic platform independant drawing device.
Definition: VGDevice.h:68
GuidoDestroyPianoRoll
GuidoErrCode GuidoDestroyPianoRoll(PianoRoll *pr)
Destroys a guido piano roll and releases all the associated ressources.
kASharpLine
const int kASharpLine
Definition: GUIDOPianoRoll.h:49
GuidoMidi2PianoRoll
PianoRoll * GuidoMidi2PianoRoll(PianoRollType type, const char *midiFileName)
Creates a new piano roll from Midi, corresponding to type : simplePianoRoll -> basic piano roll traje...
LimitParams
A struct to set a piano roll boundaries in time and in pitch.
Definition: GUIDOPianoRoll.h:57
GuidoPianoRollGetKeyboardWidth
GuidoErrCode GuidoPianoRollGetKeyboardWidth(PianoRoll *pr, int height, float &keyboardWidth)
Gets the piano roll keyboard width.
PianoRollType
PianoRollType
PianoRollType.
Definition: GUIDOPianoRoll.h:32
LimitParams::lowPitch
int lowPitch
Definition: GUIDOPianoRoll.h:60
ARHandler
struct NodeAR * ARHandler
Definition: GUIDOEngine.h:36
kDSharpLine
const int kDSharpLine
Definition: GUIDOPianoRoll.h:42
GuidoPianoRollGetMap
GuidoErrCode GuidoPianoRollGetMap(const PianoRoll *pr, int width, int height, Time2GraphicMap &outmap)
Gets the piano roll map.
LimitParams::highPitch
int highPitch
Definition: GUIDOPianoRoll.h:61
GuidoPianoRollSetLimits
GuidoErrCode GuidoPianoRollSetLimits(PianoRoll *pr, LimitParams limitParams)
Sets limits to a piano roll (start/end date, lower/higher pitch)
GuidoPianoRollOnDraw
GuidoErrCode GuidoPianoRollOnDraw(PianoRoll *pr, int width, int height, VGDevice *dev)
Draw the piano roll on a VGDevice.
kFSharpLine
const int kFSharpLine
Definition: GUIDOPianoRoll.h:45
GuidoPianoRollSetColorToVoice
GuidoErrCode GuidoPianoRollSetColorToVoice(PianoRoll *pr, int voiceNum, const std::string &color)
Sets a html color to a voice (first voice is number 1) (black by default)
kGSharpLine
const int kGSharpLine
Definition: GUIDOPianoRoll.h:47
LimitParams::endDate
GuidoDate endDate
Definition: GUIDOPianoRoll.h:59

Guido Project Copyright © 2019 Grame-CNCM