fix #22353: Bass clef appears in drums
This commit is contained in:
parent
95de82de22
commit
3d7121d3da
4 changed files with 8 additions and 4 deletions
|
@ -492,7 +492,7 @@ void MTrack::convertTrack(const ReducedFraction &lastTick)
|
|||
const auto swingType = preferences.midiImportOperations.trackOperations(indexOfOperation).swing;
|
||||
Swing::detectSwing(staff, swingType);
|
||||
|
||||
MidiClef::createClefs(staff, indexOfOperation);
|
||||
MidiClef::createClefs(staff, indexOfOperation, mtrack->drumTrack());
|
||||
}
|
||||
|
||||
Fraction metaTimeSignature(const MidiEvent& e)
|
||||
|
|
|
@ -212,13 +212,13 @@ Segment* enlargeSegToPrev(Segment *s, int strack, int counterLimit, int lPitch,
|
|||
return s;
|
||||
}
|
||||
|
||||
void createClefs(Staff *staff, int indexOfOperation)
|
||||
void createClefs(Staff *staff, int indexOfOperation, bool isDrumTrack)
|
||||
{
|
||||
ClefType currentClef = staff->initialClef()._concertClef;
|
||||
createClef(currentClef, staff, 0);
|
||||
|
||||
const auto trackOpers = preferences.midiImportOperations.trackOperations(indexOfOperation);
|
||||
if (!trackOpers.changeClef)
|
||||
if (!trackOpers.changeClef || isDrumTrack)
|
||||
return;
|
||||
|
||||
const int highPitch = 65; // all notes equal or upper - in treble clef
|
||||
|
|
|
@ -10,7 +10,7 @@ class Staff;
|
|||
|
||||
namespace MidiClef {
|
||||
|
||||
void createClefs(Staff *staff, int indexOfOperation);
|
||||
void createClefs(Staff *staff, int indexOfOperation, bool isDrumTrack);
|
||||
int midPitch();
|
||||
ClefType clefTypeFromAveragePitch(int averagePitch);
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ struct Controller {
|
|||
Node *splitDrums = nullptr;
|
||||
Node *showStaffBracket = nullptr;
|
||||
Node *pickupMeasure = nullptr;
|
||||
Node *clef = nullptr;
|
||||
|
||||
int trackCount = 0;
|
||||
bool isDrumTrack = false;
|
||||
|
@ -187,6 +188,7 @@ OperationsModel::OperationsModel()
|
|||
changeClef->oper.value = TrackOperations().changeClef;
|
||||
changeClef->parent = root.get();
|
||||
root->children.push_back(std::unique_ptr<Node>(changeClef));
|
||||
controller->clef = changeClef;
|
||||
|
||||
|
||||
Node *splitDrums = new Node;
|
||||
|
@ -621,6 +623,8 @@ bool Controller::updateNodeDependencies(Node *node, bool forceUpdate)
|
|||
splitDrums->visible = isDrumTrack;
|
||||
if (multipleVoices)
|
||||
multipleVoices->visible = !isDrumTrack;
|
||||
if (clef)
|
||||
clef->visible = !isDrumTrack;
|
||||
if (pickupMeasure)
|
||||
pickupMeasure->visible = allTracksSelected;
|
||||
result = true;
|
||||
|
|
Loading…
Reference in a new issue