Skip to content

Commit

Permalink
Merge branch 'develop' into develop-humdrum
Browse files Browse the repository at this point in the history
  • Loading branch information
craigsapp committed Dec 20, 2024
2 parents 066360b + c681d41 commit e65a50a
Show file tree
Hide file tree
Showing 70 changed files with 606 additions and 453 deletions.
1 change: 0 additions & 1 deletion include/vrv/arpeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class Arpeg : public ControlElement,
public TimePointInterface,
public AttArpegLog,
public AttArpegVis,
public AttColor,
public AttEnclosingChars {
public:
/**
Expand Down
3 changes: 1 addition & 2 deletions include/vrv/beamspan.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class BeamSpan : public ControlElement,
public PlistInterface,
public TimeSpanningInterface,
public AttBeamedWith,
public AttBeamRend,
public AttColor {
public AttBeamRend {
public:
/**
* @name Constructors, destructors, and other standard methods
Expand Down
1 change: 0 additions & 1 deletion include/vrv/bracketspan.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace vrv {
class BracketSpan : public ControlElement,
public TimeSpanningInterface,
public AttBracketSpanLog,
public AttColor,
public AttLineRend,
public AttLineRendBase {
public:
Expand Down
2 changes: 1 addition & 1 deletion include/vrv/breath.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace vrv {
/**
* This class models the MEI <breath> element.
*/
class Breath : public ControlElement, public TimePointInterface, public AttColor, public AttPlacementRelStaff {
class Breath : public ControlElement, public TimePointInterface, public AttPlacementRelStaff {
public:
/**
* @name Constructors, destructors, and other standard methods
Expand Down
1 change: 0 additions & 1 deletion include/vrv/caesura.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace vrv {
*/
class Caesura : public ControlElement,
public TimePointInterface,
public AttColor,
public AttExtSymAuth,
public AttExtSymNames,
public AttPlacementRelStaff {
Expand Down
2 changes: 2 additions & 0 deletions include/vrv/controlelement.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "altsyminterface.h"
#include "atts_shared.h"
#include "atts_visual.h"
#include "devicecontextbase.h"
#include "floatingobject.h"
#include "linkinginterface.h"
Expand All @@ -27,6 +28,7 @@ namespace vrv {
class ControlElement : public FloatingObject,
public AltSymInterface,
public LinkingInterface,
public AttColor,
public AttLabelled,
public AttTyped {
public:
Expand Down
5 changes: 3 additions & 2 deletions include/vrv/editortoolkit_neume.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class EditorToolkitNeume : public EditorToolkit {
///@{
bool Chain(jsonxx::Array actions);
bool DisplaceClefOctave(std::string elementId, std::string direction);
bool Drag(std::string elementId, int x, int y);
bool Drag(std::string elementId, int x, int y, bool topLevel = true);
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);
Expand Down Expand Up @@ -102,7 +102,8 @@ class EditorToolkitNeume : public EditorToolkit {
* Helper functions for editor actions.
*/
///@{
bool AdjustPitchFromPosition(Object *obj, Clef *clef = NULL);
bool AdjustPitchAfterDrag(Object *obj, int y = 0);
bool AdjustPitchFromPosition(Object *obj);
bool AdjustClefLineFromPosition(Clef *clef, Staff *staff = NULL);
///@}
};
Expand Down
1 change: 0 additions & 1 deletion include/vrv/fermata.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace vrv {
*/
class Fermata : public ControlElement,
public TimePointInterface,
public AttColor,
public AttEnclosingChars,
public AttExtSymAuth,
public AttExtSymNames,
Expand Down
1 change: 0 additions & 1 deletion include/vrv/gliss.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace vrv {
*/
class Gliss : public ControlElement,
public TimeSpanningInterface,
public AttColor,
public AttLineRend,
public AttLineRendBase,
public AttNNumberLike {
Expand Down
1 change: 0 additions & 1 deletion include/vrv/hairpin.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace vrv {
*/
class Hairpin : public ControlElement,
public TimeSpanningInterface,
public AttColor,
public AttHairpinLog,
public AttHairpinVis,
public AttLineRendBase,
Expand Down
1 change: 0 additions & 1 deletion include/vrv/mnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class MNum : public ControlElement,
public TextListInterface,
public TextDirInterface,
public TimePointInterface,
public AttColor,
public AttLang,
public AttTypography {
public:
Expand Down
1 change: 0 additions & 1 deletion include/vrv/mordent.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace vrv {
*/
class Mordent : public ControlElement,
public TimePointInterface,
public AttColor,
public AttExtSymAuth,
public AttExtSymNames,
public AttOrnamentAccid,
Expand Down
6 changes: 5 additions & 1 deletion include/vrv/note.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
//----------------------------------------------------------------------------

#include "accid.h"
#include "altsyminterface.h"
#include "atts_analytical.h"
#include "atts_externalsymbols.h"
#include "atts_frettab.h"
Expand Down Expand Up @@ -45,6 +46,7 @@ class Verse;
*/
class Note : public LayerElement,
public StemmedDrawingInterface,
public AltSymInterface,
public DurationInterface,
public PitchInterface,
public PositionInterface,
Expand Down Expand Up @@ -80,6 +82,8 @@ class Note : public LayerElement,
* @name Getter to interfaces
*/
///@{
AltSymInterface *GetAltSymInterface() override { return vrv_cast<AltSymInterface *>(this); }
const AltSymInterface *GetAltSymInterface() const override { return vrv_cast<const AltSymInterface *>(this); }
DurationInterface *GetDurationInterface() override { return vrv_cast<DurationInterface *>(this); }
const DurationInterface *GetDurationInterface() const override { return vrv_cast<const DurationInterface *>(this); }
PitchInterface *GetPitchInterface() override { return vrv_cast<PitchInterface *>(this); }
Expand Down Expand Up @@ -145,7 +149,7 @@ class Note : public LayerElement,
* @name Return the smufl string to use for a note give the notation type
*/
///@{
std::u32string GetTabFretString(data_NOTATIONTYPE notationType) const;
std::u32string GetTabFretString(data_NOTATIONTYPE notationType, int &overline, int &strike, int &underline) const;
///@}

/**
Expand Down
1 change: 0 additions & 1 deletion include/vrv/octave.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace vrv {
*/
class Octave : public ControlElement,
public TimeSpanningInterface,
public AttColor,
public AttExtender,
public AttLineRend,
public AttLineRendBase,
Expand Down
1 change: 0 additions & 1 deletion include/vrv/ornam.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class Ornam : public ControlElement,
public TextListInterface,
public TextDirInterface,
public TimePointInterface,
public AttColor,
public AttOrnamentAccid {
public:
/**
Expand Down
1 change: 0 additions & 1 deletion include/vrv/pedal.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class System;
*/
class Pedal : public ControlElement,
public TimeSpanningInterface,
public AttColor,
public AttExtSymAuth,
public AttExtSymNames,
public AttPedalLog,
Expand Down
1 change: 0 additions & 1 deletion include/vrv/reh.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class TextElement;
class Reh : public ControlElement,
public TextDirInterface,
public TimePointInterface,
public AttColor,
public AttLang,
public AttVerticalGroup {
public:
Expand Down
1 change: 0 additions & 1 deletion include/vrv/repeatmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class RepeatMark : public ControlElement,
public TextListInterface,
public TextDirInterface,
public TimePointInterface,
public AttColor,
public AttExtSymAuth,
public AttExtSymNames,
public AttRepeatMarkLog {
Expand Down
3 changes: 3 additions & 0 deletions include/vrv/rest.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#ifndef __VRV_REST_H__
#define __VRV_REST_H__

#include "altsyminterface.h"
#include "atts_externalsymbols.h"
#include "atts_mensural.h"
#include "durationinterface.h"
Expand All @@ -34,6 +35,7 @@ enum RestNotePlace { RNP_UNSET = -1, RNP_noteInSpace, RNP_noteOnLine };
* This class models the MEI <rest> element.
*/
class Rest : public LayerElement,
public AltSymInterface,
public DurationInterface,
public PositionInterface,
public AttColor,
Expand Down Expand Up @@ -69,6 +71,7 @@ class Rest : public LayerElement,
* @name Getter to interfaces
*/
///@{
AltSymInterface *GetAltSymInterface() override { return vrv_cast<AltSymInterface *>(this); }
PositionInterface *GetPositionInterface() override { return vrv_cast<PositionInterface *>(this); }
const PositionInterface *GetPositionInterface() const override { return vrv_cast<const PositionInterface *>(this); }
DurationInterface *GetDurationInterface() override { return vrv_cast<DurationInterface *>(this); }
Expand Down
1 change: 0 additions & 1 deletion include/vrv/slur.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ enum class PortatoSlurType { None, StemSide, Centered };

class Slur : public ControlElement,
public TimeSpanningInterface,
public AttColor,
public AttCurvature,
public AttLayerIdent,
public AttLineRendBase {
Expand Down
3 changes: 2 additions & 1 deletion include/vrv/staffdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class StaffDef : public ScoreDefElement,
public AttStaffDefLog,
public AttStaffDefVis,
public AttTimeBase,
public AttTransposition {
public AttTransposition,
public AttVerticalAlign {
public:
/**
* @name Constructors, destructors, and other standard methods
Expand Down
3 changes: 2 additions & 1 deletion include/vrv/tabdursym.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace vrv {
/**
* This class models the MEI <tabDurSym> element.
*/
class TabDurSym : public LayerElement, public StemmedDrawingInterface, public AttNNumberLike {
class TabDurSym : public LayerElement, public StemmedDrawingInterface, public AttNNumberLike, public AttStaffLoc {
public:
/**
* @name Constructors, destructors, and other standard methods
Expand All @@ -30,6 +30,7 @@ class TabDurSym : public LayerElement, public StemmedDrawingInterface, public At
///@{
TabDurSym();
virtual ~TabDurSym();
Object *Clone() const override { return new TabDurSym(*this); }
void Reset() override;
std::string GetClassName() const override { return "TabDurSym"; }
///@}
Expand Down
1 change: 1 addition & 0 deletions include/vrv/tabgrp.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class TabGrp : public LayerElement, public ObjectListInterface, public DurationI
///@{
TabGrp();
virtual ~TabGrp();
Object *Clone() const override { return new TabGrp(*this); }
void Reset() override;
std::string GetClassName() const override { return "TabGrp"; }
///@}
Expand Down
6 changes: 1 addition & 5 deletions include/vrv/tie.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ class Note;
/**
* This class models the MEI <tie> element.
*/
class Tie : public ControlElement,
public TimeSpanningInterface,
public AttColor,
public AttCurvature,
public AttLineRendBase {
class Tie : public ControlElement, public TimeSpanningInterface, public AttCurvature, public AttLineRendBase {
public:
/**
* @name Constructors, destructors, and other standard methods
Expand Down
1 change: 0 additions & 1 deletion include/vrv/trill.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace vrv {
*/
class Trill : public ControlElement,
public TimeSpanningInterface,
public AttColor,
public AttExtender,
public AttExtSymAuth,
public AttExtSymNames,
Expand Down
17 changes: 15 additions & 2 deletions include/vrv/tuning.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,22 @@ class Tuning : public Object, public AttCourseLog {
bool IsSupportedChild(Object *object) override;

/**
* Return the line for a the tuning and a given course and a notation type
* Return the line for a note according to tablature type.
* Guitar, french and italian tablature: the line is based on the course.
* German tablature: the line is based on the note's index in the note list
* or by explicit @loc.
*
* @param[in] course
* @param[in] notationType
* @param[in] lines
* @param[in] listSize
* @param[in] index - 0 based from the bottom of the chord
* @param[in] loc - German tablature: note@loc if specified, 0 at the bottom
* @param[in] topAlign - German tablature: true => align at the top, false => align at the bottom
* @return position in staff half lines
*/
int CalcPitchPos(int course, data_NOTATIONTYPE notationType, int lines) const;
int CalcPitchPos(
int course, data_NOTATIONTYPE notationType, int lines, int listSize, int index, int loc, bool topAlign) const;

/**
* Calculate the MIDI note number for course/fret
Expand Down
1 change: 0 additions & 1 deletion include/vrv/turn.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace vrv {
*/
class Turn : public ControlElement,
public TimePointInterface,
public AttColor,
public AttExtSymAuth,
public AttExtSymNames,
public AttOrnamentAccid,
Expand Down
2 changes: 1 addition & 1 deletion include/vrv/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class View {
void DrawMeterSigGrp(DeviceContext *dc, Layer *layer, Staff *staff);
void DrawMNum(DeviceContext *dc, MNum *mnum, Measure *measure, System *system, int yOffset);
void DrawStaff(DeviceContext *dc, Staff *staff, Measure *measure, System *system);
void DrawStaffLines(DeviceContext *dc, Staff *staff, Measure *measure, System *system);
void DrawStaffLines(DeviceContext *dc, Staff *staff, StaffDef *staffDef, Measure *measure, System *system);
void DrawLayer(DeviceContext *dc, Layer *layer, Staff *staff, Measure *measure);
void DrawLayerList(DeviceContext *dc, Layer *layer, Staff *staff, Measure *measure, const ClassId classId);
void DrawLayerDefLabels(
Expand Down
1 change: 1 addition & 0 deletions include/vrv/vrvdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ enum MeasureType { MEASURED = 0, UNMEASURED, NEUMELINE };
//----------------------------------------------------------------------------

#define TABLATURE_STAFF_RATIO 1.75
#define GERMAN_TAB_STAFF_RATIO 2.2

#define SUPER_SCRIPT_FACTOR 0.58
#define SUPER_SCRIPT_POSITION -0.20 // lowered down from the midline
Expand Down
5 changes: 1 addition & 4 deletions src/arpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ namespace vrv {

static const ClassRegistrar<Arpeg> s_factory("arpeg", ARPEG);

Arpeg::Arpeg()
: ControlElement(ARPEG, "arpeg-"), PlistInterface(), TimePointInterface(), AttArpegLog(), AttArpegVis(), AttColor()
Arpeg::Arpeg() : ControlElement(ARPEG, "arpeg-"), PlistInterface(), TimePointInterface(), AttArpegLog(), AttArpegVis()
{
this->RegisterInterface(PlistInterface::GetAttClasses(), PlistInterface::IsInterface());
this->RegisterInterface(TimePointInterface::GetAttClasses(), TimePointInterface::IsInterface());
this->RegisterAttClass(ATT_ARPEGLOG);
this->RegisterAttClass(ATT_ARPEGVIS);
this->RegisterAttClass(ATT_COLOR);
this->RegisterAttClass(ATT_ENCLOSINGCHARS);

this->Reset();
Expand All @@ -51,7 +49,6 @@ void Arpeg::Reset()
TimePointInterface::Reset();
this->ResetArpegLog();
this->ResetArpegVis();
this->ResetColor();
this->ResetEnclosingChars();

m_drawingXRel = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/beam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,8 @@ void BeamSegment::CalcBeamInit(
beamInterface->m_beamWidthBlack /= 2;
beamInterface->m_beamWidthWhite /= 2;

// Adjust it further for tab.lute.french and tab.lute.italian
if (staff->IsTabLuteFrench() || staff->IsTabLuteItalian()) {
// Adjust it further for tab.lute.french, tab.lute.german and tab.lute.italian
if (staff->IsTabLuteFrench() || staff->IsTabLuteGerman() || staff->IsTabLuteItalian()) {
beamInterface->m_beamWidthBlack = beamInterface->m_beamWidthBlack * 2 / 5;
beamInterface->m_beamWidthWhite = beamInterface->m_beamWidthWhite * 3 / 5;
}
Expand Down
3 changes: 0 additions & 3 deletions src/beamspan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ BeamSpan::BeamSpan()
, TimeSpanningInterface()
, AttBeamedWith()
, AttBeamRend()
, AttColor()
{
RegisterInterface(PlistInterface::GetAttClasses(), PlistInterface::IsInterface());
RegisterInterface(TimeSpanningInterface::GetAttClasses(), TimeSpanningInterface::IsInterface());
RegisterAttClass(ATT_BEAMEDWITH);
RegisterAttClass(ATT_BEAMREND);
RegisterAttClass(ATT_COLOR);

Reset();
InitBeamSegments();
Expand All @@ -61,7 +59,6 @@ void BeamSpan::Reset()
TimeSpanningInterface::Reset();
ResetBeamedWith();
ResetBeamRend();
ResetColor();

ClearBeamSegments();
}
Expand Down
Loading

0 comments on commit e65a50a

Please sign in to comment.