GUIDOLib  1.7.7
A Music Score Rendering Engine
GUIDOPianoRollAdapter.h
Go to the documentation of this file.
1 #ifndef GUIDOPIANOROLLADAPTER_H
2 #define GUIDOPIANOROLLADAPTER_H
3 /*
4  GUIDO Library
5  Copyright (C) 2014 Grame
6 
7  This Source Code Form is subject to the terms of the Mozilla Public
8  License, v. 2.0. If a copy of the MPL was not distributed with this
9  file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11  Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
12  research@grame.fr
13 
14 */
15 
16 #include <string>
17 
18 #include "GUIDOPianoRoll.h"
19 
30 {
31  public:
33  virtual ~GUIDOPianoRollAdapter();
42  PianoRoll * ar2PianoRoll(PianoRollType type, ARHandler arh);
43 
52  PianoRoll * midi2PianoRoll(PianoRollType type, const std::string &midiFileName);
53 
59  GuidoErrCode destroyPianoRoll(PianoRoll *pr);
60 
72  GuidoErrCode setLimits(PianoRoll *pr, LimitParams &limitParams);
73 
80  GuidoErrCode enableKeyboard(PianoRoll *pr, bool enabled);
81 
88  float getKeyboardWidth(PianoRoll *pr, int height);
89 
98  GuidoErrCode enableAutoVoicesColoration(PianoRoll *pr, bool enabled);
99 
110  GuidoErrCode setRGBColorToVoice(PianoRoll *pr, int voiceNum, int r, int g, int b, int a);
111 
119  GuidoErrCode setHtmlColorToVoice(PianoRoll *pr, int voiceNum, long color);
127  GuidoErrCode setColorToVoice(PianoRoll *pr, int voiceNum, const std::string& color);
128 
135  GuidoErrCode removeColorToVoice(PianoRoll *pr, int voiceNum);
136 
143  GuidoErrCode enableMeasureBars(PianoRoll *pr, bool enabled);
144 
154  GuidoErrCode setPitchLinesDisplayMode(PianoRoll *pr, int mode);
155 
163  Time2GraphicMap getMap(PianoRoll *pr, int width, int height);
164 
173  GuidoErrCode onDraw(PianoRoll *pr, int width, int height, VGDevice* dev);
174 
182  std::string svgExport(PianoRoll *pr, int width, int height);
183 
184 #ifdef CANVASSYSTEM
185 
192  GuidoErrCode javascriptExport(PianoRoll *pr, int width, int height);
193 #endif
194 };
198 #endif // GUIDOPIANOROLLADAPTER_H
setLimits
GuidoErrCode setLimits(PianoRoll *pr, LimitParams &limitParams)
Sets limits to a piano roll (start/end date, lower/higher pitch)
enableMeasureBars
GuidoErrCode enableMeasureBars(PianoRoll *pr, bool enabled)
Enables or not measure bars (false by default)
setHtmlColorToVoice
GuidoErrCode setHtmlColorToVoice(PianoRoll *pr, int voiceNum, long color)
Sets a html color to a voice (first voice is number 1) (black by default)
svgExport
std::string svgExport(PianoRoll *pr, int width, int height)
svgExport Draw the piano roll on SVG device and return the xml string.
onDraw
GuidoErrCode onDraw(PianoRoll *pr, int width, int height, VGDevice *dev)
Draw the piano roll on a VGDevice.
destroyPianoRoll
GuidoErrCode destroyPianoRoll(PianoRoll *pr)
Destroys a guido piano roll and releases all the associated ressources.
~GUIDOPianoRollAdapter
virtual ~GUIDOPianoRollAdapter()
enableAutoVoicesColoration
GuidoErrCode enableAutoVoicesColoration(PianoRoll *pr, bool enabled)
Enables or not the automatic voices coloration (not enabled by default) (not for a midi rendering) //...
getMap
Time2GraphicMap getMap(PianoRoll *pr, int width, int height)
Gets the piano roll map.
setColorToVoice
GuidoErrCode setColorToVoice(PianoRoll *pr, int voiceNum, const std::string &color)
Sets a html color to a voice (first voice is number 1) (black by default)
Time2GraphicMap
std::vector< TMapSegments > Time2GraphicMap
Definition: GUIDOScoreMap.h:89
GuidoErrCode
GuidoErrCode
The guido error codes list.
Definition: GUIDOEngine.h:211
ar2PianoRoll
PianoRoll * ar2PianoRoll(PianoRollType type, ARHandler arh)
Creates a new piano roll from AR, corresponding to type : simplePianoRoll -> basic piano roll traject...
VGDevice
Generic platform independant drawing device.
Definition: VGDevice.h:68
LimitParams
A struct to set a piano roll boundaries in time and in pitch.
Definition: GUIDOPianoRoll.h:57
PianoRollType
PianoRollType
PianoRollType.
Definition: GUIDOPianoRoll.h:32
GUIDOPianoRoll.h
ARHandler
struct NodeAR * ARHandler
Definition: GUIDOEngine.h:36
class_export
#define class_export
Definition: GUIDOExport.h:38
GUIDOPianoRollAdapter
class_export GUIDOPianoRollAdapter
Definition: GUIDOPianoRollAdapter.h:30
setRGBColorToVoice
GuidoErrCode setRGBColorToVoice(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)
enableKeyboard
GuidoErrCode enableKeyboard(PianoRoll *pr, bool enabled)
Enables keyboard or not (not enabled by default)
setPitchLinesDisplayMode
GuidoErrCode setPitchLinesDisplayMode(PianoRoll *pr, int mode)
Sets the pitch lines display mode (automatic by default). Use Pitch lines display mode constants to p...
midi2PianoRoll
PianoRoll * midi2PianoRoll(PianoRollType type, const std::string &midiFileName)
Creates a new piano roll from Midi, corresponding to type : simplePianoRoll -> basic piano roll traje...
removeColorToVoice
GuidoErrCode removeColorToVoice(PianoRoll *pr, int voiceNum)
remove a color to a voice (first voice is number 1) (black by default)
getKeyboardWidth
float getKeyboardWidth(PianoRoll *pr, int height)
Gets the piano roll keyboard width.

Guido Project Copyright © 2019 Grame-CNCM