|
|
@ -21,10 +21,10 @@ int testSegmentBbtoF()
|
|
|
|
Event * bes = n->getAsNoteEvent(1, 10);
|
|
|
|
Event * bes = n->getAsNoteEvent(1, 10);
|
|
|
|
segment1->insert(bes);
|
|
|
|
segment1->insert(bes);
|
|
|
|
segment1->insert(Key("Bb major").getAsEvent(0));
|
|
|
|
segment1->insert(Key("Bb major").getAsEvent(0));
|
|
|
|
SegmentTransposeCommand * tqmockCommand =
|
|
|
|
SegmentTransposeCommand * mockCommand =
|
|
|
|
new SegmentTransposeCommand(*segment1,
|
|
|
|
new SegmentTransposeCommand(*segment1,
|
|
|
|
true, -3, -5, true);
|
|
|
|
true, -3, -5, true);
|
|
|
|
tqmockCommand->execute();
|
|
|
|
mockCommand->execute();
|
|
|
|
|
|
|
|
|
|
|
|
EventSelection m_selection(*segment1, segment1->getStartTime(), segment1->getEndMarkerTime());
|
|
|
|
EventSelection m_selection(*segment1, segment1->getStartTime(), segment1->getEndMarkerTime());
|
|
|
|
EventSelection::eventcontainer::iterator i;
|
|
|
|
EventSelection::eventcontainer::iterator i;
|
|
|
@ -58,10 +58,10 @@ int testGistoAis()
|
|
|
|
Event * gis = n->getAsNoteEvent(1, 8);
|
|
|
|
Event * gis = n->getAsNoteEvent(1, 8);
|
|
|
|
segment1->insert(gis);
|
|
|
|
segment1->insert(gis);
|
|
|
|
segment1->insert(Key("E major").getAsEvent(0));
|
|
|
|
segment1->insert(Key("E major").getAsEvent(0));
|
|
|
|
SegmentTransposeCommand * tqmockCommand =
|
|
|
|
SegmentTransposeCommand * mockCommand =
|
|
|
|
new SegmentTransposeCommand(*segment1,
|
|
|
|
new SegmentTransposeCommand(*segment1,
|
|
|
|
true, 1, 2, true);
|
|
|
|
true, 1, 2, true);
|
|
|
|
tqmockCommand->execute();
|
|
|
|
mockCommand->execute();
|
|
|
|
|
|
|
|
|
|
|
|
EventSelection m_selection(*segment1, segment1->getStartTime(), segment1->getEndMarkerTime());
|
|
|
|
EventSelection m_selection(*segment1, segment1->getStartTime(), segment1->getEndMarkerTime());
|
|
|
|
EventSelection::eventcontainer::iterator i;
|
|
|
|
EventSelection::eventcontainer::iterator i;
|
|
|
@ -93,10 +93,10 @@ int testSegmentCisToC()
|
|
|
|
Event * cis = n->getAsNoteEvent(1, 13);
|
|
|
|
Event * cis = n->getAsNoteEvent(1, 13);
|
|
|
|
segment1->insert(cis);
|
|
|
|
segment1->insert(cis);
|
|
|
|
segment1->insert(Key("C# major").getAsEvent(0));
|
|
|
|
segment1->insert(Key("C# major").getAsEvent(0));
|
|
|
|
SegmentTransposeCommand * tqmockCommand =
|
|
|
|
SegmentTransposeCommand * mockCommand =
|
|
|
|
new SegmentTransposeCommand(*segment1,
|
|
|
|
new SegmentTransposeCommand(*segment1,
|
|
|
|
true, 0, -1, true);
|
|
|
|
true, 0, -1, true);
|
|
|
|
tqmockCommand->execute();
|
|
|
|
mockCommand->execute();
|
|
|
|
|
|
|
|
|
|
|
|
EventSelection m_selection(*segment1, segment1->getStartTime(), segment1->getEndMarkerTime());
|
|
|
|
EventSelection m_selection(*segment1, segment1->getStartTime(), segment1->getEndMarkerTime());
|
|
|
|
EventSelection::eventcontainer::iterator i;
|
|
|
|
EventSelection::eventcontainer::iterator i;
|
|
|
@ -124,29 +124,29 @@ int testUndo()
|
|
|
|
Segment * segment2 = new Segment();
|
|
|
|
Segment * segment2 = new Segment();
|
|
|
|
|
|
|
|
|
|
|
|
// transpose once
|
|
|
|
// transpose once
|
|
|
|
SegmentTransposeCommand * tqmockCommand1a =
|
|
|
|
SegmentTransposeCommand * mockCommand1a =
|
|
|
|
new SegmentTransposeCommand(*segment1,
|
|
|
|
new SegmentTransposeCommand(*segment1,
|
|
|
|
true, -1, -2, true);
|
|
|
|
true, -1, -2, true);
|
|
|
|
tqmockCommand1a->execute();
|
|
|
|
mockCommand1a->execute();
|
|
|
|
SegmentTransposeCommand * tqmockCommand1b =
|
|
|
|
SegmentTransposeCommand * mockCommand1b =
|
|
|
|
new SegmentTransposeCommand(*segment2,
|
|
|
|
new SegmentTransposeCommand(*segment2,
|
|
|
|
true, -1, -2, true);
|
|
|
|
true, -1, -2, true);
|
|
|
|
tqmockCommand1b->execute();
|
|
|
|
mockCommand1b->execute();
|
|
|
|
|
|
|
|
|
|
|
|
// transpose twice
|
|
|
|
// transpose twice
|
|
|
|
SegmentTransposeCommand * tqmockCommand2a =
|
|
|
|
SegmentTransposeCommand * mockCommand2a =
|
|
|
|
new SegmentTransposeCommand(*segment1,
|
|
|
|
new SegmentTransposeCommand(*segment1,
|
|
|
|
true, -1, -2, true);
|
|
|
|
true, -1, -2, true);
|
|
|
|
tqmockCommand2a->execute();
|
|
|
|
mockCommand2a->execute();
|
|
|
|
SegmentTransposeCommand * tqmockCommand2b =
|
|
|
|
SegmentTransposeCommand * mockCommand2b =
|
|
|
|
new SegmentTransposeCommand(*segment2,
|
|
|
|
new SegmentTransposeCommand(*segment2,
|
|
|
|
true, -1, -2, true);
|
|
|
|
true, -1, -2, true);
|
|
|
|
tqmockCommand2b->execute();
|
|
|
|
mockCommand2b->execute();
|
|
|
|
|
|
|
|
|
|
|
|
tqmockCommand2b->unexecute();
|
|
|
|
mockCommand2b->unexecute();
|
|
|
|
tqmockCommand2a->unexecute();
|
|
|
|
mockCommand2a->unexecute();
|
|
|
|
tqmockCommand1b->unexecute();
|
|
|
|
mockCommand1b->unexecute();
|
|
|
|
tqmockCommand1a->unexecute();
|
|
|
|
mockCommand1a->unexecute();
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|