Commit 87511fe7 authored by Sandro Andrade's avatar Sandro Andrade

Refactor prepareFromExerciseOptions parameter

parent 7eb23886
......@@ -69,7 +69,7 @@ public Q_SLOTS:
virtual void setVolume(quint8 tempo) = 0;
virtual void setTempo(quint8 tempo) = 0;
virtual void prepareFromExerciseOptions(QJsonArray selectedOptions) = 0;
virtual void prepareFromExerciseOptions(QJsonArray selectedExerciseOptions) = 0;
virtual void prepareFromMidiFile(const QString &fileName) = 0;
virtual void play() = 0;
......
......@@ -146,7 +146,7 @@ void DrumstickSoundBackend::setTempo (quint8 tempo)
emit tempoChanged(m_tempo);
}
void DrumstickSoundBackend::prepareFromExerciseOptions(QJsonArray selectedOptions)
void DrumstickSoundBackend::prepareFromExerciseOptions(QJsonArray selectedExerciseOptions)
{
Song *song = new Song;
song->setHeader(0, 1, 60);
......@@ -166,10 +166,10 @@ void DrumstickSoundBackend::prepareFromExerciseOptions(QJsonArray selectedOption
barStart = 240;
}
for (int i = 0; i < selectedOptions.size(); ++i) {
QString sequence = selectedOptions[i].toObject()[QStringLiteral("sequence")].toString();
for (int i = 0; i < selectedExerciseOptions.size(); ++i) {
QString sequence = selectedExerciseOptions[i].toObject()[QStringLiteral("sequence")].toString();
unsigned int chosenRootNote = selectedOptions[i].toObject()[QStringLiteral("rootNote")].toString().toInt();
unsigned int chosenRootNote = selectedExerciseOptions[i].toObject()[QStringLiteral("rootNote")].toString().toInt();
if (m_playMode != RhythmPlayMode) {
appendEvent(new drumstick::NoteOnEvent(1, chosenRootNote, 120), barStart);
appendEvent(new drumstick::NoteOffEvent(1, chosenRootNote, 120), barStart + 60);
......
......@@ -59,7 +59,7 @@ public Q_SLOTS:
virtual void setVolume(quint8 volume);
virtual void setTempo (quint8 tempo);
virtual void prepareFromExerciseOptions(QJsonArray selectedOptions) override;
virtual void prepareFromExerciseOptions(QJsonArray selectedExerciseOptions) override;
virtual void prepareFromMidiFile(const QString &fileName) override;
virtual void play() override;
......
......@@ -46,9 +46,9 @@ void FluidSynthSoundBackend::setTempo (quint8 tempo)
Q_UNUSED(tempo);
}
void FluidSynthSoundBackend::prepareFromExerciseOptions(QJsonArray selectedOptions)
void FluidSynthSoundBackend::prepareFromExerciseOptions(QJsonArray selectedExerciseOptions)
{
Q_UNUSED(selectedOptions)
Q_UNUSED(selectedExerciseOptions)
}
void FluidSynthSoundBackend::prepareFromMidiFile(const QString &fileName)
......
......@@ -42,7 +42,7 @@ public Q_SLOTS:
virtual void setVolume(quint8 volume);
virtual void setTempo(quint8 tempo);
virtual void prepareFromExerciseOptions(QJsonArray selectedOptions) override;
virtual void prepareFromExerciseOptions(QJsonArray selectedExerciseOptions) override;
virtual void prepareFromMidiFile(const QString &fileName) override;
virtual void play() override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment