Skip to content

Commit

Permalink
Merge pull request rism-digital#3564 from DDMAL/develop
Browse files Browse the repository at this point in the history
Integrate lates changes from DDMAL
  • Loading branch information
lpugin authored Dec 28, 2023
2 parents 30563af + 11e013d commit dab41c5
Show file tree
Hide file tree
Showing 14 changed files with 677 additions and 669 deletions.
4 changes: 4 additions & 0 deletions include/vrv/doc.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ class Doc : public Object {
///@{
DocType GetType() const { return m_type; }
void SetType(DocType type);
bool IsFacs() const { return (m_type == Facs); }
bool IsRaw() const { return (m_type == Raw); }
bool IsRendering() const { return (m_type == Rendering); }
bool IsTranscription() const { return (m_type == Transcription); }
///@}

/**
Expand Down
10 changes: 5 additions & 5 deletions include/vrv/editortoolkit_neume.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ namespace vrv {
class EditorToolkitNeume : public EditorToolkit {
public:
EditorToolkitNeume(Doc *doc, View *view) : EditorToolkit(doc, view) {}
bool ParseEditorAction(const std::string &json_editorAction);
virtual std::string EditInfo() { return m_infoObject.json(); };
bool ParseEditorAction(const std::string &json_editorAction) override;
std::string EditInfo() override;

/**
* Experimental editor functions.
Expand All @@ -44,6 +44,7 @@ class EditorToolkitNeume : public EditorToolkit {
bool Insert(std::string elementType, std::string staffId, int ulx, int uly, int lrx, int lry,
std::vector<std::pair<std::string, std::string>> attributes);
bool InsertToSyllable(std::string elementId);
bool MatchHeight(std::string elementId);
bool Merge(std::vector<std::string> elementIds);
bool MoveOutsideSyllable(std::string elementId);
bool Set(std::string elementId, std::string attrType, std::string attrValue);
Expand All @@ -54,6 +55,7 @@ class EditorToolkitNeume : public EditorToolkit {
bool Remove(std::string elementId);
bool Resize(std::string elementId, int ulx, int uly, int lrx, int lry, float resize = NAN);
bool Group(std::string groupType, std::vector<std::string> elementIds);
void UnlinkSyllable(Syllable *syllable);
bool Ungroup(std::string groupType, std::vector<std::string> elementIds);
bool ChangeGroup(std::string elementId, std::string contour);
bool ToggleLigature(std::vector<std::string> elementIds);
Expand All @@ -72,6 +74,7 @@ class EditorToolkitNeume : public EditorToolkit {
bool ParseInsertAction(jsonxx::Object param, std::string *elementType, std::string *staffId, int *ulx, int *uly,
int *lrx, int *lry, std::vector<std::pair<std::string, std::string>> *attributes);
bool ParseInsertToSyllableAction(jsonxx::Object param, std::string *elementId);
bool ParseMatchHeightAction(jsonxx::Object param, std::string *elementId);
bool ParseMergeAction(jsonxx::Object param, std::vector<std::string> *elementIds);
bool ParseMoveOutsideSyllableAction(jsonxx::Object param, std::string *elementId);
bool ParseSetAction(jsonxx::Object param, std::string *elementId, std::string *attrType, std::string *attrValue);
Expand All @@ -98,9 +101,6 @@ class EditorToolkitNeume : public EditorToolkit {
bool AdjustPitchFromPosition(Object *obj, Clef *clef = NULL);
bool AdjustClefLineFromPosition(Clef *clef, Staff *staff = NULL);
///@}

private:
jsonxx::Object m_infoObject;
};

//--------------------------------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions src/doc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ void Doc::PrepareData()
}

/************ Resolve @facs ************/
if (this->GetType() == Facs) {
if (this->IsFacs()) {
// Associate zones with elements
PrepareFacsimileFunctor prepareFacsimile(this->GetFacsimile());
this->Process(prepareFacsimile);
Expand Down Expand Up @@ -1281,10 +1281,10 @@ void Doc::ConvertToCastOffMensuralDoc(bool castOff)
if (!m_isMensuralMusicOnly) return;

// Do not convert transcription files
if (this->GetType() == Transcription) return;
if (this->IsTranscription()) return;

// Do not convert facs files
if (this->GetType() == Facs) return;
if (this->IsFacs()) return;

// We are converting to measure music in a definite way
if (this->GetOptions()->m_mensuralToMeasure.GetValue()) {
Expand Down Expand Up @@ -2088,7 +2088,7 @@ int Doc::GetAdjustedDrawingPageHeight() const
{
assert(m_drawingPage);

if ((this->GetType() == Transcription) || (this->GetType() == Facs)) {
if (this->IsTranscription() || this->IsFacs()) {
return m_drawingPage->m_pageHeight / DEFINITION_FACTOR;
}

Expand All @@ -2100,7 +2100,7 @@ int Doc::GetAdjustedDrawingPageWidth() const
{
assert(m_drawingPage);

if ((this->GetType() == Transcription) || (this->GetType() == Facs)) {
if (this->IsTranscription() || this->IsFacs()) {
return m_drawingPage->m_pageWidth / DEFINITION_FACTOR;
}

Expand Down
Loading

0 comments on commit dab41c5

Please sign in to comment.