Skip to content

Commit

Permalink
Merge commit 'd9b11ad7ebe24602a5c4e4aa85c5c2f69cafc956'
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Apr 22, 2015
2 parents 6e53a39 + d9b11ad commit 162c7dc
Show file tree
Hide file tree
Showing 63 changed files with 1,661 additions and 711 deletions.
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# xcode
Verovio.xccheckout
Verovio.xcodeproj/project.xcworkspace/xcuserdata
Verovio.xcodeproj/xcuserdata/
bin/

# doc generated file
doc/pae-tests.html

# include file generated at compilation
include/vrv/git_commit.h

# cmake build
tools/CMakeCache.txt
tools/CMakeFiles/
tools/Makefile
tools/cmake_install.cmake
tools/install_manifest.txt
tools/verovio

# emscripten build
emscripten/data/
emscripten/build/

# python build
python/verovio_wrap.cpp
python/verovio.pyc
python/verovio.py
python/_verovio.so

# java build
java/verovio_wrap.cxx
java/main.class
java/src/
java/target/
25 changes: 25 additions & 0 deletions Verovio.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
4DA3FCD419B61DB400CBDFE6 /* atts_cmn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DEE28EF1940BCC100C76319 /* atts_cmn.cpp */; };
4DA80D961A6ACF5D0089802D /* style.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DA80D951A6ACF5D0089802D /* style.cpp */; };
4DA80D971A6ACF5D0089802D /* style.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DA80D951A6ACF5D0089802D /* style.cpp */; };
4DB3072F1AC9ED2500EE0982 /* space.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DB3072E1AC9ED2500EE0982 /* space.cpp */; };
4DC34BA219BC4A71006175CD /* accid.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DC34B9F19BC4A70006175CD /* accid.h */; };
4DC34BA319BC4A71006175CD /* custos.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DC34BA019BC4A70006175CD /* custos.h */; };
4DC34BA419BC4A71006175CD /* dot.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DC34BA119BC4A70006175CD /* dot.h */; };
Expand Down Expand Up @@ -221,8 +222,11 @@
4D9A9C18199F561200028D93 /* verse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = verse.cpp; path = src/verse.cpp; sourceTree = "<group>"; };
4D9A9C1B199F576100028D93 /* syl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = syl.h; path = include/vrv/syl.h; sourceTree = "<group>"; };
4D9A9C1D19A1DE2000028D93 /* syl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = syl.cpp; path = src/syl.cpp; sourceTree = "<group>"; };
4D9C5F3A1ADBBBEB005D3031 /* git_commit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = git_commit.h; path = include/vrv/git_commit.h; sourceTree = SOURCE_ROOT; };
4DA80D941A6940120089802D /* style.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = style.h; path = include/vrv/style.h; sourceTree = "<group>"; };
4DA80D951A6ACF5D0089802D /* style.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = style.cpp; path = src/style.cpp; sourceTree = "<group>"; };
4DB3072D1AC9ED1800EE0982 /* space.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = space.h; path = include/vrv/space.h; sourceTree = "<group>"; };
4DB3072E1AC9ED2500EE0982 /* space.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = space.cpp; path = src/space.cpp; sourceTree = "<group>"; };
4DC34B9F19BC4A70006175CD /* accid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = accid.h; path = include/vrv/accid.h; sourceTree = "<group>"; };
4DC34BA019BC4A70006175CD /* custos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = custos.h; path = include/vrv/custos.h; sourceTree = "<group>"; };
4DC34BA119BC4A70006175CD /* dot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dot.h; path = include/vrv/dot.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -380,6 +384,7 @@
4D7D8A3C1886E36200D78B62 /* tools */ = {
isa = PBXGroup;
children = (
4D9C5F3A1ADBBBEB005D3031 /* git_commit.h */,
4D983004192E959E00320037 /* main.cpp */,
4D2E09B118A92371001EEEB8 /* emscripten_main.cpp */,
);
Expand Down Expand Up @@ -612,6 +617,8 @@
8F59292318854BF800FE51AD /* note.h */,
8F086ED1188539540037FD8E /* rest.cpp */,
8F59292818854BF800FE51AD /* rest.h */,
4DB3072E1AC9ED2500EE0982 /* space.cpp */,
4DB3072D1AC9ED1800EE0982 /* space.h */,
4D9A9C1D19A1DE2000028D93 /* syl.cpp */,
4D9A9C1B199F576100028D93 /* syl.h */,
8F086ED9188539540037FD8E /* tuplet.cpp */,
Expand Down Expand Up @@ -692,6 +699,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 8F086EB3188534690037FD8E /* Build configuration list for PBXNativeTarget "Verovio" */;
buildPhases = (
4D9C5F361ADBADDA005D3031 /* ShellScript */,
8F086EA5188534680037FD8E /* Sources */,
8F086EA6188534680037FD8E /* Frameworks */,
8F086EA7188534680037FD8E /* CopyFiles */,
Expand Down Expand Up @@ -748,6 +756,22 @@
};
/* End PBXProject section */

/* Begin PBXShellScriptBuildPhase section */
4D9C5F361ADBADDA005D3031 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd ${SRCROOT}/tools\n./get_git_commit.sh";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
8F086EA5188534680037FD8E /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand All @@ -763,6 +787,7 @@
8F086EEA188539540037FD8E /* durationinterface.cpp in Sources */,
8F086EEB188539540037FD8E /* toolkit.cpp in Sources */,
8F086EEC188539540037FD8E /* io.cpp in Sources */,
4DB3072F1AC9ED2500EE0982 /* space.cpp in Sources */,
8F086EED188539540037FD8E /* iodarms.cpp in Sources */,
8F086EEE188539540037FD8E /* iomei.cpp in Sources */,
8F086EEF188539540037FD8E /* iomusxml.cpp in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion doc/tests/pae/6_mixed/measure_rest_and_keysig_change.pae
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@clef:G-2
@keysig:xF
@timesig:3/8
@data:=25//$xFCG @c 2-4.-'8E/{6AGFE}{8A''C}'B''4D{6C'B}/{''DC'BA}{''8EA}
@data:=25//=5//$xFCG @c 2-4.-'8E/{6AGFE}{8A''C}'B''4D{6C'B}/{''DC'BA}{''8EA}
10 changes: 8 additions & 2 deletions emscripten/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function print_help {
echo "Usage:
-l Light version with no increased memory allocation
-w WebWorker-compatible build.
-v N Version number (e.g., 1.0.0); no number by default
-v N Version number (e.g., 1.0.0); no number by default
-c Turns on \"Chatty\" compiling; Will print the compiler progress" >&2 ;
}

Expand All @@ -29,6 +29,7 @@ if [ ! -d data ]; then mkdir data; fi
ASM="\
-O2 --memory-init-file 0 \
-s ASM_JS=1 \
-s TOTAL_MEMORY=128*1024*1024 \
-s TOTAL_STACK=64*1024*1024"
ASM_NAME=""

Expand All @@ -38,6 +39,9 @@ VERSION_NAME=""
CHATTY=""
WEBWORKER=false

# generate the git commit file
../tools/get_git_commit.sh

while getopts "lwv:h:c" opt; do
case $opt in
l)
Expand Down Expand Up @@ -131,11 +135,12 @@ python $EMCC $CHATTY \
$VEROVIO_ROOT/src/rest.cpp \
$VEROVIO_ROOT/src/scoredef.cpp \
$VEROVIO_ROOT/src/slur.cpp \
$VEROVIO_ROOT/src/space.cpp \
$VEROVIO_ROOT/src/staff.cpp \
$VEROVIO_ROOT/src/style.cpp \
$VEROVIO_ROOT/src/svgdevicecontext.cpp \
$VEROVIO_ROOT/src/syl.cpp \
$VEROVIO_ROOT/src/system.cpp \
$VEROVIO_ROOT/src/system.cpp \
$VEROVIO_ROOT/src/tie.cpp \
$VEROVIO_ROOT/src/timeinterface.cpp \
$VEROVIO_ROOT/src/toolkit.cpp \
Expand All @@ -152,6 +157,7 @@ python $EMCC $CHATTY \
'_vrvToolkit_constructor',\
'_vrvToolkit_destructor',\
'_vrvToolkit_getLog',\
'_vrvToolkit_getVersion',\
'_vrvToolkit_getMEI',\
'_vrvToolkit_getPageCount',\
'_vrvToolkit_getPageWithElement',\
Expand Down
7 changes: 6 additions & 1 deletion emscripten/emscripten_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ extern "C" {
tk->SetCString(tk->GetLogString());
return tk->GetCString();
}


const char *vrvToolkit_getVersion(Toolkit *tk) {
tk->SetCString(tk->GetVersion());
return tk->GetCString();
}

int vrvToolkit_getPageCount(Toolkit *tk) {
return tk->GetPageCount();
}
Expand Down
7 changes: 7 additions & 0 deletions emscripten/verovio-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ verovio.vrvToolkit.destructor = Module.cwrap('vrvToolkit_destructor', null, ['nu
// char *getLog(Toolkit *ic)
verovio.vrvToolkit.getLog = Module.cwrap('vrvToolkit_getLog', 'string', ['number']);

// char *getVersion(Toolkit *ic)
verovio.vrvToolkit.getVersion = Module.cwrap('vrvToolkit_getVersion', 'string', ['number']);

// int getPageCount(Toolkit *ic)
verovio.vrvToolkit.getPageCount = Module.cwrap('vrvToolkit_getPageCount', 'number', ['number']);

Expand Down Expand Up @@ -72,6 +75,10 @@ verovio.toolkit.prototype.getLog = function () {
return verovio.vrvToolkit.getLog(this.ptr);
};

verovio.toolkit.prototype.getVersion = function () {
return verovio.vrvToolkit.getVersion(this.ptr);
};

verovio.toolkit.prototype.getPageCount = function () {
return verovio.vrvToolkit.getPageCount(this.ptr);
};
Expand Down
2 changes: 1 addition & 1 deletion include/vrv/aligner.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class MeasureAligner;
*/
enum AlignmentType {
ALIGNMENT_MEASURE_START = 0,
ALIGNMENT_BARLINE,
ALIGNMENT_CLEF_ATTR,
ALIGNMENT_KEYSIG_ATTR,
ALIGNMENT_MENSUR_ATTR,
Expand All @@ -36,7 +37,6 @@ enum AlignmentType {
ALIGNMENT_DOT,
ALIGNMENT_GRACENOTE,
ALIGNMENT_CONTAINER,
ALIGNMENT_BARLINE,
ALIGNMENT_MULTIREST,
ALIGNMENT_DEFAULT,
ALIGNMENT_MEASURE_END
Expand Down
6 changes: 6 additions & 0 deletions include/vrv/bboxdevicecontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ class BBoxDeviceContext: public DeviceContext
virtual void DrawBackgroundImage( int x = 0, int y = 0 ) {};
///@}

/**
* Special method for forcing bounding boxes to be updated
* Used for invisible elements (e.g. <space>) that needs to be take into account in spacing
*/
virtual void DrawPlaceholder( int x, int y );

/**
* @name Method for starting and ending a text
*/
Expand Down
1 change: 1 addition & 0 deletions include/vrv/beam.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,5 @@ class BeamElementCoord


} // namespace vrv

#endif
22 changes: 16 additions & 6 deletions include/vrv/chord.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "atts_shared.h"
#include "durationinterface.h"
#include "layerelement.h"
#include "object.h"

namespace vrv {

Expand All @@ -35,7 +34,6 @@ namespace vrv {
*/

class Chord: public LayerElement, public ObjectListInterface, public DurationInterface,
public AttColoration,
public AttCommon,
public AttStemmed,
public AttTiepresent
Expand All @@ -50,6 +48,7 @@ class Chord: public LayerElement, public ObjectListInterface, public DurationInt
virtual ~Chord();
virtual void Reset();
virtual std::string GetClassName( ) { return "Chord"; };
///@}

/**
* Add an element (only note supported) to a chord.
Expand All @@ -64,6 +63,11 @@ class Chord: public LayerElement, public ObjectListInterface, public DurationInt
* Returns list of notes that have accidentals
*/
void ResetAccidList();

/**
* Prepares a 2D grid of booleans to track where accidentals are placed.
* Further documentation in chord.cpp comments.
*/
void ResetAccidSpace(int staffSize);

/**
Expand All @@ -84,7 +88,6 @@ class Chord: public LayerElement, public ObjectListInterface, public DurationInt
*/
virtual int PrepareTieAttr( ArrayPtrVoid params );


/**
* See Object::PrepareTieAttr
*/
Expand All @@ -104,17 +107,24 @@ class Chord: public LayerElement, public ObjectListInterface, public DurationInt

/**
* Number of ledger lines for the chord where:
* m_ledgerLines[0][x] is single-length, m_ledgerLines[1][x] is double-length
* m_ledgerLines[x][0] is below staff, m_ledgerLines[x][1] is above staff
* Staff * is each staff for which the chord has notes and maps to:
* a four char vector acting as a 2D array (2x2) where:
* [0][x] is single-length, [1][x] is double-length
* [x][0] is below staff, [x][1] is above staff
*/
char m_ledgerLines[2][2];
MapOfLedgerLineFlags m_drawingLedgerLines;

/**
* Positions of dots in the chord to avoid overlapping
*/
std::list<int> m_dots;

/**
* Variables related to preventing overlapping in the X dimension for accidentals
*/
std::vector<Note*> m_accidList;
std::vector< std::vector<bool> > m_accidSpace;
int m_accidSpaceTop, m_accidSpaceBot, m_accidSpaceLeft;
};

} // namespace vrv
Expand Down
17 changes: 17 additions & 0 deletions include/vrv/devicecontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ class DeviceContext
virtual void DrawSpline(int n, Point points[]) = 0;
virtual void DrawBackgroundImage( int x = 0, int y = 0 ) = 0;
///@}

/**
* Special method for forcing bounding boxes to be updated
* Used for invisible elements (e.g. <space>) that needs to be take into account in spacing
*/
virtual void DrawPlaceholder( int x, int y ) {};

/**
* @name Method for starting and ending a text
Expand Down Expand Up @@ -160,10 +166,21 @@ class DeviceContext
virtual bool GetDrawBoundingBoxes() {return m_drawingBoundingBoxes;};
///@}

/**
* Change the flag for indicating the use of the VerovioText font
*/
void VrvTextFont() { m_vrvTextFont = true; };

protected:

bool m_correctMusicAscent; // specify if the ascent has to be correct when view the music font (true wxDC, false SVG)
bool m_drawingBoundingBoxes;
/**
* Flag for indicating if the VerovioText font is currently used.
* If used, it has to be initialized to false (e.g., in the overriden version of StartPage) and will be changed in DeviceContext::VrvTextFont
*/
bool m_vrvTextFont;


std::stack<Pen> m_penStack;
std::stack<Brush> m_brushStack;
Expand Down
2 changes: 2 additions & 0 deletions include/vrv/doc.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ class Doc: public Object
float m_drawingBeamMaxSlope;
/** flag for disabling justification */
bool m_drawingJustifyX;
/** minimum measure width */
int m_drawingMinMeasureWidth;

private:
/**
Expand Down
21 changes: 20 additions & 1 deletion include/vrv/dot.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace vrv {

class ChildElement;
class Note;

//----------------------------------------------------------------------------
// Dot
Expand All @@ -34,11 +34,30 @@ class Dot: public LayerElement, public PositionInterface
virtual std::string GetClassName( ) { return "Dot"; };
///@}


//----------//
// Functors //
//----------//

/**
* See Object::PreparePointersByLayer
*/
virtual int PreparePointersByLayer( ArrayPtrVoid params );

/**
* Reset the drawing values before calling PrepareDrawing after changes.
*/
virtual int ResetDarwing( ArrayPtrVoid params );

protected:

private:

public:
/**
* A pointer to the note the point relates to.
*/
Note *m_drawingNote;

private:

Expand Down
Loading

0 comments on commit 162c7dc

Please sign in to comment.