Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/rism-digital/verovio int…
Browse files Browse the repository at this point in the history
…o develop
  • Loading branch information
lpugin committed Oct 18, 2023
2 parents 4463c69 + a5ab4ba commit 545f379
Show file tree
Hide file tree
Showing 30 changed files with 290 additions and 284 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:

steps:
- name: Checkout main repo
uses: actions/checkout@v3
uses: actions/checkout@v4

# Installation step for Ubuntu
- name: Configure Ubuntu with ${{ matrix.compiler }}-${{ matrix.version }}
Expand Down Expand Up @@ -239,7 +239,7 @@ jobs:

steps:
- name: Checkout main repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Create TEMP_DIR
working-directory: ${{ github.workspace }}
Expand Down Expand Up @@ -291,7 +291,7 @@ jobs:

steps:
- name: Checkout main repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Create TEMP_DIR
working-directory: ${{ github.workspace }}
Expand Down Expand Up @@ -353,7 +353,7 @@ jobs:

steps:
- name: Checkout GH_PAGES_REPO into GH_PAGES_DIR
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# repository to check out
repository: ${{ env.GH_PAGES_REPO }}
Expand Down Expand Up @@ -435,7 +435,7 @@ jobs:

steps:
- name: Checkout main repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install doxygen
run: |
Expand Down Expand Up @@ -472,7 +472,7 @@ jobs:

steps:
- name: Checkout DOXYGEN_REPO into DOXYGEN_DIR
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# repository to check out
repository: ${{ env.DOXYGEN_REPO }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Check for ${{ matrix.path['check'] }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run clang-format style check for C/C++ programs.
uses: jidicula/[email protected]
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/python-ci-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# Build the wheels for Linux, Windows and macOS
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
architecture: [x86, x64]
include:
- os: macos-latest
Expand All @@ -48,7 +48,7 @@ jobs:
steps:
#===============================================#
# Set up
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
#===============================================#
# wheels
- name: Build wheels
uses: pypa/cibuildwheel@v2.11.1
uses: pypa/cibuildwheel@v2.16.1
with:
output-dir: wheelhouse
env:
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
steps:
#===============================================#
# Set up
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -224,7 +224,7 @@ jobs:
steps:
#===============================================#
# Set up
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
echo "OUTPUT_DIR=${{ github.event.pull_request.number }}/${{ env.SHORT_SHA }}" >> $GITHUB_ENV
- name: Checkout GH_PAGES_BRANCH into GH_PAGES_DIR
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ env.GH_PAGES_REPO }}
ref: ${{ env.GH_PAGES_BRANCH }}
Expand All @@ -67,7 +67,7 @@ jobs:
python3 -m pip install diffimg jsondiff lxml xmldiff cairosvg
- name: Checkout the dev branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: develop
path: ${{ env.DEV_DIR }}/
Expand All @@ -88,7 +88,7 @@ jobs:
python3 ../../doc/test-suite.py ${{ github.workspace }}/${{env.GH_PAGES_DIR}}/musicxmlTestSuite ${{ github.workspace }}/${{ env.TEMP_DIR }}/${{ env.DEV_DIR }}/
- name: Checkout the PR
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: ${{ env.PR_DIR }}/
Expand Down
14 changes: 7 additions & 7 deletions Verovio.podspec
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Pod::Spec.new do |s|
s.name = 'Verovio'
s.version = '4.1.0-dev'
s.license = { :type => 'LGPL' }
s.license = { :type => 'LGPL', :file => 'COPYING' }
s.homepage = 'https://www.verovio.org/index.xhtml'
s.authors = { 'Contributors List' => 'https://github.com/rism-digital/verovio/graphs/contributors' }
s.summary = 'Verovio'
s.source = { :git => 'https://github.com/rism-digital/verovio.git', :tag => 'version-' + s.version.to_s }
s.swift_versions = ['3.0', '4.0', '4.1', '4.2', '5.0','5.1']
s.swift_versions = ['3.0', '4.0', '4.1', '4.2', '5.0', '5.1', '5.2', '5.3', '5.4', '5.5', '5.6', '5.7']
s.source_files = 'src/**/*.{h,cpp,cc}',
'include/{crc,hum,json,midi,pugi,utf8,vrv,zip}/*.{h,hpp}',
'libmei/{dist,addons}/*.{h,cpp}'
'include/{crc,hum,json,midi,pugi,utf8,vrv,zip}/*.{h,hpp}',
'libmei/{dist,addons}/*.{h,cpp}'
s.public_header_files = 'src/**/*.{h}',
'include/{crc,hum,json,midi,pugi,utf8,vrv,zip}/*.{h,hpp}',
'libmei/{dist,addons}/*.{h}'
s.resources = 'data'
s.ios.deployment_target = '10.0'
s.osx.deployment_target = '10.13'
s.ios.deployment_target = '14.0'
s.osx.deployment_target = '10.15'
s.pod_target_xcconfig = {
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
"CLANG_CXX_LIBRARY" => "libc++",
Expand All @@ -29,7 +29,7 @@ Pod::Spec.new do |s|
"MTL_FAST_MATH" => "YES",
"SUPPORTS_UIKITFORMAC" => "NO",
"MTL_ENABLE_DEBUG_INFO" => "NO",
"PRODUCT_BUNDLE_IDENTIFIER" => "com.rism.VerovioFramework"
"PRODUCT_BUNDLE_IDENTIFIER" => "digital.rism.VerovioFramework"
}
end

62 changes: 36 additions & 26 deletions include/vrv/doc.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ class Doc : public Object {
/**
* Generate a document pgFoot if none is provided
*/
bool GenerateFooter();
void GenerateFooter();

/**
* Generate a document pgHead from the MEI header if none is provided
*/
bool GenerateHeader();
void GenerateHeader();

/**
* Generate measure numbers from measure attributes
Expand All @@ -121,11 +121,6 @@ class Doc : public Object {
*/
bool HasPage(int pageIdx) const;

/**
* Get all the Score in the visible Mdiv.
*/
std::list<Score *> GetScores();

/**
* Get the Pages in the visible Mdiv.
* Will find it only when having read a pages-based MEI file,
Expand All @@ -141,6 +136,31 @@ class Doc : public Object {
*/
int GetPageCount() const;

/**
* Get the first scoreDef
*/
///@{
ScoreDef *GetFirstScoreDef();
const ScoreDef *GetFirstScoreDef() const;
///@}

/**
* Get all visible scores / the first visible score
* Lazily updates the visible scores, hence not const
*/
///@{
std::list<Score *> GetVisibleScores();
Score *GetFirstVisibleScore();
///@}

/**
* Get the corresponding score for a node
*/
///@{
Score *GetCorrespondingScore(const Object *object);
const Score *GetCorrespondingScore(const Object *object) const;
///@}

/**
* Return true if the MIDI generation is already done
*/
Expand Down Expand Up @@ -225,7 +245,7 @@ class Doc : public Object {
* Get the default distance from the staff for the object
* The distance is given in x * MEI UNIT
*/
data_MEASUREMENTSIGNED GetStaffDistance(const ClassId classId, int staffIndex, data_STAFFREL staffPosition);
data_MEASUREMENTSIGNED GetStaffDistance(const Object *object, int staffIndex, data_STAFFREL staffPosition) const;

/**
* Prepare the timemap for MIDI and timemap file export.
Expand Down Expand Up @@ -418,19 +438,6 @@ class Doc : public Object {
bool HasFacsimile() const { return m_facsimile != NULL; }
///@}

/**
* @name Setter and getter for the current Score/ScoreDef.
* If not set, then looks for the first Score in the Document and use that.
* The currentScoreDef is also changed by the Object::Process whenever as Score is reached.
* When processing backward, the ScoreDef is changed when reaching the corresponding PageMilestoneEnd
*/
///@{
Score *GetCurrentScore();
ScoreDef *GetCurrentScoreDef();
void SetCurrentScore(Score *score);
bool HasCurrentScore() const { return m_currentScore != NULL; }
///@}

/**
* Return true if the document has been cast off already.
*/
Expand Down Expand Up @@ -477,6 +484,11 @@ class Doc : public Object {
*/
void PrepareMeasureIndices();

/**
* Determine all visible scores
*/
void CollectVisibleScores();

public:
Page *m_selectionPreceding;
Page *m_selectionFollowing;
Expand Down Expand Up @@ -546,12 +558,10 @@ class Doc : public Object {
Resources m_resources;

/**
* @name Holds a pointer to the current score/scoreDef.
* Set by Doc::GetCurrentScoreDef or explicitly through Doc::SetCurrentScoreDef
* The list of all visible scores
* Used in Doc::GetCorrespondingScore to quickly determine the score for an object
*/
///@{
Score *m_currentScore;
///@}
std::list<Score *> m_visibleScores;

/**
* A flag indicating if the document has been cast off or not.
Expand Down
2 changes: 1 addition & 1 deletion include/vrv/floatingobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class FloatingPositioner : public BoundingBox {
/**
* Update the Y drawing relative position based on collision detection with the overlapping bounding box
*/
void CalcDrawingYRel(Doc *doc, const StaffAlignment *staffAlignment, const BoundingBox *horizOverlappingBBox);
void CalcDrawingYRel(const Doc *doc, const StaffAlignment *staffAlignment, const BoundingBox *horizOverlappingBBox);

/**
* Align extender elements across systems
Expand Down
2 changes: 1 addition & 1 deletion include/vrv/iomei.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class MEIOutput : public Output {
* Scoredef manipulation
*/
///@{
void WriteCustomScoreDef();
void WriteCustomScoreDef(ScoreDef *scoreDef);
void AdjustStaffDef(StaffDef *staffDef, Measure *measure);
bool AdjustLabel(Label *label);
///@}
Expand Down
1 change: 0 additions & 1 deletion include/vrv/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,6 @@ class Object : public BoundingBox {
* Helper methods for functor processing
*/
///@{
void UpdateDocumentScore(bool direction);
bool SkipChildren(bool visibleOnly) const;
bool FiltersApply(const Filters *filters, Object *object) const;
///@}
Expand Down
5 changes: 0 additions & 5 deletions include/vrv/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ class Page : public Object {
bool IsSupportedChild(Object *object) override;
///@}

/**
* Return the number of system (children are System object only)
*/
int GetSystemCount() const { return (int)GetChildren().size(); }

/**
* @name Get and set the pixel per unit factor.
*/
Expand Down
6 changes: 0 additions & 6 deletions include/vrv/score.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ class Score : public PageElement, public PageMilestoneInterface, public AttLabel
const ScoreDef *GetScoreDef() const { return &m_scoreDef; }
///@}

/**
* Helper looking at the parent Doc and set its scoreDef as current one.
* Called from Object::Process
*/
void SetAsCurrent();

/**
* Calculate the height of the pgHead/pgHead2 and pgFoot/pgFoot2 (if any)
* Requires the Doc to have an empty Pages object because it adds temporary pages
Expand Down
4 changes: 3 additions & 1 deletion src/adjustaccidxfunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//----------------------------------------------------------------------------

#include "doc.h"
#include "score.h"

//----------------------------------------------------------------------------

Expand Down Expand Up @@ -41,7 +42,8 @@ FunctorCode AdjustAccidXFunctor::VisitAlignmentReference(AlignmentReference *ali
if (accids.empty()) return FUNCTOR_SIBLINGS;

assert(m_doc);
StaffDef *staffDef = m_doc->GetCurrentScoreDef()->GetStaffDef(alignmentReference->GetN());
ScoreDef *scoreDef = m_doc->GetCorrespondingScore(alignmentReference)->GetScoreDef();
StaffDef *staffDef = scoreDef->GetStaffDef(alignmentReference->GetN());
int staffSize = (staffDef && staffDef->HasScale()) ? staffDef->GetScale() : 100;

std::sort(accids.begin(), accids.end(), AccidSpaceSort());
Expand Down
3 changes: 2 additions & 1 deletion src/adjustdotsfunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "doc.h"
#include "elementpart.h"
#include "score.h"
#include "staff.h"

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -125,7 +126,7 @@ FunctorCode AdjustDotsFunctor::VisitMeasure(Measure *measure)

FunctorCode AdjustDotsFunctor::VisitScore(Score *score)
{
m_staffNs = m_doc->GetCurrentScoreDef()->GetStaffNs();
m_staffNs = score->GetScoreDef()->GetStaffNs();

return FUNCTOR_CONTINUE;
}
Expand Down
3 changes: 2 additions & 1 deletion src/adjustgracexposfunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//----------------------------------------------------------------------------

#include "doc.h"
#include "score.h"

//----------------------------------------------------------------------------

Expand Down Expand Up @@ -230,7 +231,7 @@ FunctorCode AdjustGraceXPosFunctor::VisitMeasure(Measure *measure)

FunctorCode AdjustGraceXPosFunctor::VisitScore(Score *score)
{
m_staffNs = m_doc->GetCurrentScoreDef()->GetStaffNs();
m_staffNs = score->GetScoreDef()->GetStaffNs();

return FUNCTOR_CONTINUE;
}
Expand Down
Loading

0 comments on commit 545f379

Please sign in to comment.