GUIDOLib  1.7.7
Guido Engine Internal Documentation
NoteDrawer.h
1 
2 #pragma once
3 
4 /*
5  GUIDO Library
6  Copyright (C) 2019 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 "NVPoint.h"
18 #include "defines.h"
19 
20 class VGDevice;
21 class VGFont;
22 
27 {
28  public:
29  NoteDrawer(const VGFont * font, const NVPoint& pos, float align );
30  virtual ~NoteDrawer() {}
31 
32  float DrawNote( VGDevice & hdc, const TYPE_DURATION & noteDur, float xOffset, float yOffset ) const;
33  static float GetScaling (float textfontsize );
34  static const VGFont* GetMusicFont (float scale );
35 
36  private:
37  unsigned int getSymbol (const TYPE_DURATION & noteDur) const;
38  unsigned int getFlags (const TYPE_DURATION & noteDur) const;
39 
40  const VGFont* fFont = 0;
41  NVPoint fPosition;
42  float fYAlign = 0.f; // used as Y offset acording to the context vertical align
43 };
NoteDrawer
Utility to draw a note.
Definition: NoteDrawer.h:26
NoteDrawer::GetScaling
static float GetScaling(float textfontsize)
Fraction
Numerator and denominator.
Definition: Fraction.h:23
NVPoint
Definition: NVPoint.h:20
NoteDrawer::GetMusicFont
static const VGFont * GetMusicFont(float scale)
NoteDrawer::~NoteDrawer
virtual ~NoteDrawer()
Definition: NoteDrawer.h:30
VGDevice
Generic platform independant drawing device.
Definition: VGDevice.h:68
VGFont
Generic pure virtual & device-independant font class.
Definition: VGFont.h:36
NoteDrawer::NoteDrawer
NoteDrawer(const VGFont *font, const NVPoint &pos, float align)
NoteDrawer::DrawNote
float DrawNote(VGDevice &hdc, const TYPE_DURATION &noteDur, float xOffset, float yOffset) const

Guido Project Copyright © 2019 Grame-CNCM