Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/engraving/dom/note.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ class Note final : public EngravingItem
int tpc2() const { return m_tpc[1]; } // transposed tpc
String tpcUserName(bool explicitAccidental = false, bool full = false) const;

static String tpcUserName(int tpc, int pitch, bool explicitAccidental, bool full = false);

void setTpc(int v);
void setTpc1(int v) { m_tpc[0] = v; }
void setTpc2(int v) { m_tpc[1] = v; }
Expand Down Expand Up @@ -479,8 +481,6 @@ class Note final : public EngravingItem

void normalizeLeftDragDelta(Segment* seg, EditData& ed, NoteEditData* ned);

static String tpcUserName(int tpc, int pitch, bool explicitAccidental, bool full = false);

void getNoteListForDots(std::vector<Note*>& topDownNotes, std::vector<Note*>& bottomUpNotes, std::vector<int>& anchoredDots);

void addLineAttachPoint(PointF point, EngravingItem* line, bool start);
Expand Down
34 changes: 31 additions & 3 deletions src/notation/internal/notationaccessibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "engraving/dom/measure.h"

#include "accessibility/accessibleroot.h"
#include <QtCore/qglobal.h>

using namespace mu::notation;
using namespace muse::async;
Expand Down Expand Up @@ -180,9 +181,36 @@ QString NotationAccessibility::rangeAccessibilityInfo() const
}
end += "; " + muse::qtrc("engraving", "End beat: %1").arg(endBarbeat.beat);

return muse::qtrc("notation", "Range selection; %1; %2")
.arg(start)
.arg(end);
// QString pitchClasses = muse::qtrc("engraving", "Pitch classes:");


LOGD() << "TTTTTTTT before scanning ";

QString pitchClasses = muse::qtrc("engraving", "*** Pitch classes:");

auto elements = selection()->elements();

std::vector<EngravingItem*> notes;

std::copy_if(elements.begin(), elements.end(), std::back_inserter(notes), [](EngravingItem* i){return i->type() == ElementType::NOTE;});
std::sort(notes.begin(), notes.end(), [](EngravingItem* i, EngravingItem* j){ return ((Note*)i)->pitch() - ((Note*)j)->pitch(); });

for (EngravingItem* n : notes) {
LOGD() << "TTTTTTTT item is playable " << n->isPlayable();

Note* note = (Note*)n;
//String pitchClassName = note->tpcUserName(false);
String pitchClassName = note->tpcUserName(note->tpc1(), note->ppitch(), false);
LOGD() << "TTTTTTTT note pitch class " << pitchClassName;
pitchClasses += " " + muse::qtrc("engraving", pitchClassName);
}
pitchClasses += " ***";
LOGD() << "TTTTTTTT after scanning ";

return muse::qtrc("notation", "Range selection; %1; %2; %3")
.arg(pitchClasses)
.arg(start)
.arg(end);
}

QString NotationAccessibility::singleElementAccessibilityInfo() const
Expand Down