Rename 'Simplify notation' option to 'Simplify durations'
This commit is contained in:
parent
184b0be4dd
commit
2e0babffd5
9 changed files with 38 additions and 38 deletions
|
@ -950,7 +950,7 @@ void convertMidi(Score *score, const MidiFile *mf)
|
|||
"convertMidi", "There are notes of length < min allowed duration");
|
||||
|
||||
MChord::mergeChordsWithEqualOnTimeAndVoice(tracks);
|
||||
Simplify::simplifyNotation(tracks, sigmap);
|
||||
Simplify::simplifyDurations(tracks, sigmap);
|
||||
MidiVoice::separateVoices(tracks, sigmap);
|
||||
MidiDrum::splitDrumVoices(tracks);
|
||||
MidiDrum::splitDrumTracks(tracks);
|
||||
|
|
|
@ -22,7 +22,7 @@ struct MidiOperation
|
|||
|
||||
USE_DOTS,
|
||||
|
||||
SIMPLIFY_NOTATION,
|
||||
SIMPLIFY_DURATIONS,
|
||||
|
||||
ALLOWED_VOICES,
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ struct TrackOperations
|
|||
bool doImport = true;
|
||||
Quantization quantize;
|
||||
bool useDots = true;
|
||||
bool simplifyNotation = true;
|
||||
bool simplifyDurations = true;
|
||||
LHRHSeparation LHRH;
|
||||
SearchTuplets tuplets;
|
||||
MidiOperation::AllowedVoices allowedVoices = MidiOperation::AllowedVoices::V_4;
|
||||
|
|
|
@ -101,12 +101,12 @@ OperationsModel::OperationsModel()
|
|||
root->children.push_back(std::unique_ptr<Node>(useDots));
|
||||
|
||||
|
||||
Node *simplifyNotation = new Node;
|
||||
simplifyNotation->name = QCoreApplication::translate("MIDI import operations", "Simplify notation");
|
||||
simplifyNotation->oper.type = MidiOperation::Type::SIMPLIFY_NOTATION;
|
||||
simplifyNotation->oper.value = TrackOperations().simplifyNotation;
|
||||
simplifyNotation->parent = root.get();
|
||||
root->children.push_back(std::unique_ptr<Node>(simplifyNotation));
|
||||
Node *simplifyDurations = new Node;
|
||||
simplifyDurations->name = QCoreApplication::translate("MIDI import operations", "Simplify durations");
|
||||
simplifyDurations->oper.type = MidiOperation::Type::SIMPLIFY_DURATIONS;
|
||||
simplifyDurations->oper.value = TrackOperations().simplifyDurations;
|
||||
simplifyDurations->parent = root.get();
|
||||
root->children.push_back(std::unique_ptr<Node>(simplifyDurations));
|
||||
|
||||
|
||||
// ------------- tuplets --------------
|
||||
|
@ -512,8 +512,8 @@ void setNodeOperations(Node *node, const DefinedTrackOperations &opers)
|
|||
case MidiOperation::Type::USE_DOTS:
|
||||
node->oper.value = opers.opers.useDots; break;
|
||||
|
||||
case MidiOperation::Type::SIMPLIFY_NOTATION:
|
||||
node->oper.value = opers.opers.simplifyNotation; break;
|
||||
case MidiOperation::Type::SIMPLIFY_DURATIONS:
|
||||
node->oper.value = opers.opers.simplifyDurations; break;
|
||||
|
||||
case MidiOperation::Type::SWING:
|
||||
node->oper.value = (int)opers.opers.swing; break;
|
||||
|
|
|
@ -209,7 +209,7 @@ void minimizeNumberOfRests(
|
|||
}
|
||||
}
|
||||
|
||||
void simplifyNotation(std::multimap<int, MTrack> &tracks, const TimeSigMap *sigmap)
|
||||
void simplifyDurations(std::multimap<int, MTrack> &tracks, const TimeSigMap *sigmap)
|
||||
{
|
||||
auto &opers = preferences.midiImportOperations;
|
||||
|
||||
|
@ -224,7 +224,7 @@ void simplifyNotation(std::multimap<int, MTrack> &tracks, const TimeSigMap *sigm
|
|||
// for further usage
|
||||
opers.setCurrentTrack(mtrack.indexOfOperation);
|
||||
|
||||
if (opers.currentTrackOperations().simplifyNotation)
|
||||
if (opers.currentTrackOperations().simplifyDurations)
|
||||
minimizeNumberOfRests(chords, sigmap, mtrack.tuplets);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ class TimeSigMap;
|
|||
|
||||
namespace Simplify {
|
||||
|
||||
void simplifyNotation(std::multimap<int, MTrack> &tracks, const TimeSigMap *sigmap);
|
||||
void simplifyDurations(std::multimap<int, MTrack> &tracks, const TimeSigMap *sigmap);
|
||||
|
||||
} // Simplify
|
||||
} // Ms
|
||||
|
|
|
@ -109,8 +109,8 @@ void TracksModel::setTrackOperation(int trackIndex, MidiOperation::Type operType
|
|||
case MidiOperation::Type::USE_DOTS:
|
||||
trackData.opers.useDots = operValue.toBool();
|
||||
break;
|
||||
case MidiOperation::Type::SIMPLIFY_NOTATION:
|
||||
trackData.opers.simplifyNotation = operValue.toBool();
|
||||
case MidiOperation::Type::SIMPLIFY_DURATIONS:
|
||||
trackData.opers.simplifyDurations = operValue.toBool();
|
||||
break;
|
||||
case MidiOperation::Type::SWING:
|
||||
trackData.opers.swing = (MidiOperation::Swing)operValue.toInt();
|
||||
|
@ -249,10 +249,10 @@ DefinedTrackOperations TracksModel::trackOperations(int row) const
|
|||
}
|
||||
}
|
||||
|
||||
// MidiOperation::Type::SIMPLIFY_NOTATION
|
||||
// MidiOperation::Type::SIMPLIFY_DURATIONS
|
||||
for (int i = 1; i != trackCount_; ++i) {
|
||||
if (tracksData_[i].opers.simplifyNotation != opers.opers.simplifyNotation) {
|
||||
opers.undefinedOpers.insert((int)MidiOperation::Type::SIMPLIFY_NOTATION);
|
||||
if (tracksData_[i].opers.simplifyDurations != opers.opers.simplifyDurations) {
|
||||
opers.undefinedOpers.insert((int)MidiOperation::Type::SIMPLIFY_DURATIONS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -628,7 +628,7 @@ void separateVoices(std::multimap<int, MTrack> &tracks, const TimeSigMap *sigmap
|
|||
// for further usage
|
||||
opers.setCurrentTrack(mtrack.indexOfOperation);
|
||||
|
||||
if (opers.currentTrackOperations().simplifyNotation && voiceLimit() > 1) {
|
||||
if (opers.currentTrackOperations().simplifyDurations && voiceLimit() > 1) {
|
||||
|
||||
Q_ASSERT_X(MidiTuplet::areAllTupletsReferenced(mtrack.chords, mtrack.tuplets),
|
||||
"MidiVoice::doVoiceSeparation",
|
||||
|
|
|
@ -56,7 +56,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
{
|
||||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.simplifyNotation = false;
|
||||
opers.simplifyDurations = false;
|
||||
opers.LHRH.doIt = false;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf(file);
|
||||
|
@ -85,7 +85,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
void human4_4()
|
||||
{
|
||||
TrackOperations opers;
|
||||
opers.simplifyNotation = false;
|
||||
opers.simplifyDurations = false;
|
||||
opers.LHRH.doIt = false;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("human_4-4");
|
||||
|
@ -141,7 +141,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.changeClef = false;
|
||||
opers.simplifyNotation = false;
|
||||
opers.simplifyDurations = false;
|
||||
opers.LHRH.doIt = false;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("tuplet_3_5_7_tuplets");
|
||||
|
@ -200,7 +200,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.LHRH.doIt = true;
|
||||
opers.simplifyNotation = false;
|
||||
opers.simplifyDurations = false;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("split_nontuplet");
|
||||
preferences.midiImportOperations.clear();
|
||||
|
@ -210,7 +210,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.LHRH.doIt = true;
|
||||
opers.simplifyNotation = false;
|
||||
opers.simplifyDurations = false;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("split_acid");
|
||||
preferences.midiImportOperations.clear();
|
||||
|
@ -220,7 +220,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.LHRH.doIt = true;
|
||||
opers.simplifyNotation = false;
|
||||
opers.simplifyDurations = false;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("split_tuplet");
|
||||
preferences.midiImportOperations.clear();
|
||||
|
@ -230,7 +230,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.LHRH.doIt = true;
|
||||
opers.simplifyNotation = false;
|
||||
opers.simplifyDurations = false;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("split_2_melodies");
|
||||
preferences.midiImportOperations.clear();
|
||||
|
@ -240,7 +240,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.LHRH.doIt = true;
|
||||
opers.simplifyNotation = false;
|
||||
opers.simplifyDurations = false;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("split_octave");
|
||||
preferences.midiImportOperations.clear();
|
||||
|
@ -252,7 +252,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.swing = MidiOperation::Swing::SWING;
|
||||
opers.simplifyNotation = false;
|
||||
opers.simplifyDurations = false;
|
||||
opers.LHRH.doIt = false;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("swing_triplets");
|
||||
|
@ -263,7 +263,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.swing = MidiOperation::Swing::SHUFFLE;
|
||||
opers.simplifyNotation = false;
|
||||
opers.simplifyDurations = false;
|
||||
opers.LHRH.doIt = false;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("swing_shuffle");
|
||||
|
@ -275,7 +275,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
opers.canRedefineDefaultsLater = false;
|
||||
opers.swing = MidiOperation::Swing::SWING;
|
||||
opers.changeClef = true;
|
||||
opers.simplifyNotation = false;
|
||||
opers.simplifyDurations = false;
|
||||
opers.LHRH.doIt = false;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("swing_clef");
|
||||
|
@ -297,7 +297,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.LHRH.doIt = false;
|
||||
opers.simplifyNotation = true;
|
||||
opers.simplifyDurations = true;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("simplify_16th_staccato");
|
||||
preferences.midiImportOperations.clear();
|
||||
|
@ -307,7 +307,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.LHRH.doIt = false;
|
||||
opers.simplifyNotation = true;
|
||||
opers.simplifyDurations = true;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("simplify_8th_dont");
|
||||
preferences.midiImportOperations.clear();
|
||||
|
@ -317,7 +317,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.LHRH.doIt = false;
|
||||
opers.simplifyNotation = true;
|
||||
opers.simplifyDurations = true;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("simplify_32nd_staccato");
|
||||
preferences.midiImportOperations.clear();
|
||||
|
@ -327,7 +327,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.LHRH.doIt = false;
|
||||
opers.simplifyNotation = true;
|
||||
opers.simplifyDurations = true;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("simplify_8th_dotted_no_staccato");
|
||||
preferences.midiImportOperations.clear();
|
||||
|
@ -337,7 +337,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.LHRH.doIt = false;
|
||||
opers.simplifyNotation = true;
|
||||
opers.simplifyDurations = true;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("simplify_4th_dotted_tied");
|
||||
preferences.midiImportOperations.clear();
|
||||
|
@ -347,7 +347,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.LHRH.doIt = false;
|
||||
opers.simplifyNotation = true;
|
||||
opers.simplifyDurations = true;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("simplify_triplet_staccato");
|
||||
preferences.midiImportOperations.clear();
|
||||
|
@ -359,7 +359,7 @@ class TestImportMidi : public QObject, public MTest
|
|||
TrackOperations opers;
|
||||
opers.canRedefineDefaultsLater = false;
|
||||
opers.LHRH.doIt = false;
|
||||
opers.simplifyNotation = true;
|
||||
opers.simplifyDurations = true;
|
||||
preferences.midiImportOperations.resetDefaults(opers);
|
||||
mf("voice_acid");
|
||||
preferences.midiImportOperations.clear();
|
||||
|
|
Loading…
Reference in a new issue