1
// RCS-ID: $Id: Formatter3.h,v 1.3 2006/02/23 19:23:54 cecilios Exp $
2
//--------------------------------------------------------------------------------------
3
// LenMus Phonascus: The teacher of music
4
// Copyright (c) 2002-2006 Cecilio Salmeron
6
// This program is free software; you can redistribute it and/or modify it under the
7
// terms of the GNU General Public License as published by the Free Software Foundation;
8
// either version 2 of the License, or (at your option) any later version.
10
// This program is distributed in the hope that it will be useful, but WITHOUT ANY
11
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
// PARTICULAR PURPOSE. See the GNU General Public License for more details.
14
// You should have received a copy of the GNU General Public License along with this
15
// program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
16
// Fifth Floor, Boston, MA 02110-1301, USA.
18
// For any comment, suggestion or feature request, please contact the manager of
19
// the project at cecilios@users.sourceforge.net
21
//-------------------------------------------------------------------------------------
22
/*! @file Formatter3.h
23
@brief Header file for class lmFormatter3
30
#ifndef __FORMATTER3_H__ //to avoid nested includes
31
#define __FORMATTER3_H__
33
//constants to define some tables' size
34
//! @limit a score can not have more than 30 systems (very strong: only a couple of pages)
35
//! @limit a system can not have more than 30 staves
36
//! @limit a system can not have more than 20 measures
37
//! @todo Review all code to avoid limits: dynamic tables
38
#define MAX_STAVES_PER_SYSTEM 30 //max number of staves in a system
39
#define MAX_SYSTEMS 30 //max number of systems in a score
40
#define MAX_MEASURES_PER_SYSTEM 20 //max number of measures in a system
42
#include "TimeposTable.h"
44
class lmFormatter3 : public lmFormatter
50
//implementation of base class virtual functions
51
void RenderScore(lmPaper* pPaper);
52
//bool fMetodoJustificado = true,
53
//ESpacingMethod nTipoEspaciado = esm_PropConstantShortNote,
54
//bool fJustificada = true,
55
//bool fTruncarUltimoSistema = false,
56
//float rFactorAjuste = 1.0) = 0;
59
void RenderMinimal(lmPaper *pPaper);
60
void RenderJustified(lmPaper* pPaper);
62
lmMicrons SizeMeasureColumn(int nAbsMeasure, int nRelMeasure, int nSystem, lmPaper* pPaper);
63
void RedistributeFreeSpace(lmMicrons nAvailable);
64
void DrawMeasure(lmVStaff* pVStaff, int iMeasure, lmPaper* pPaper);
65
void SizeMeasure(lmVStaff* pVStaff, int nAbsMeasure, int nRelMeasure, lmPaper* pPaper);
70
//auxiliary data for computing and justifying systems.
71
lmTimeposTable m_oTimepos[MAX_MEASURES_PER_SYSTEM+1]; //timepos table for current measure column
72
lmMicrons m_nFreeSpace; //free space available on current system
73
lmMicrons m_nMeasureSize[MAX_STAVES_PER_SYSTEM+1]; //size of all measure columns of current system
74
int m_nMeasuresInSystem; //the number of measures in current system
76
////variables de dibujo que se pasan como par�metros a diversas funciones y que defino aqui para evitarlo
77
//m_rFactorAjuste As Single //factor de ajuste para espaciado proporcional
78
//m_nSpacingMethod As ESpacingMethod
80
////to optimize re-paints if canvas has not changed
81
//m_nIdLastCanvas As Long //Id of canvas used last time RenderScore was invoked
82
//m_nLastCanvasWidth As Long
83
int m_nNumMeasures[MAX_SYSTEMS+1]; //num of measures in each system
84
lmMicrons m_ySystemPos[MAX_SYSTEMS+1]; //paper y position at which each system starts
85
int m_nNumSystems; //num of systems in which the score has been splitted
87
// variables for debugging
88
bool m_fDebugMode; //debug on/off
93
#endif // __FORMATTER3_H__