Commit 394053f2 authored by Sandro Andrade's avatar Sandro Andrade

Merge branch 'Applications/16.04'

parents e1e45f59 9d6a7821
......@@ -235,6 +235,8 @@ void MidiSequencer::setVolumeFactor(unsigned int vol)
void MidiSequencer::setTempoFactor(unsigned int value)
{
float tempoFactor = (value*value + 100.0*value + 20000.0) / 40000.0;
m_midiSequencerOutputThread->setTempoFactor(tempoFactor);
drumstick::QueueTempo queueTempo = m_queue->getTempo();
queueTempo.setTempoFactor(tempoFactor);
m_queue->setTempo(queueTempo);
......
......@@ -36,6 +36,7 @@ MidiSequencerOutputThread::MidiSequencerOutputThread(drumstick::MidiClient *clie
m_lastEvent(0),
m_volumeFactor(100),
m_pitchShift(0),
m_tempoFactor(1.0),
m_songIterator(0)
{
for (int chan = 0; chan < MIDI_CHANNELS; ++chan)
......@@ -100,7 +101,7 @@ void MidiSequencerOutputThread::setSong(Song *song)
drumstick::QueueTempo firstTempo = m_Queue->getTempo();
firstTempo.setPPQ(m_song->division());
firstTempo.setTempo(m_song->initialTempo());
firstTempo.setTempoFactor(1.0);
firstTempo.setTempoFactor(m_tempoFactor);
m_Queue->setTempo(firstTempo);
}
......@@ -131,6 +132,11 @@ void MidiSequencerOutputThread::setPitchShift(int value)
start();
}
void MidiSequencerOutputThread::setTempoFactor(float value)
{
m_tempoFactor = value;
}
void MidiSequencerOutputThread::setPosition(unsigned int pos)
{
m_songPosition = pos;
......
......@@ -48,6 +48,7 @@ public:
void setVolumeFactor(unsigned int vol);
void setPitchShift(int value);
void setPosition(unsigned int pos);
void setTempoFactor(float value);
void resetPosition();
Q_SIGNALS:
......@@ -65,6 +66,7 @@ private:
int m_volume[MIDI_CHANNELS];
unsigned int m_volumeFactor;
int m_pitchShift;
float m_tempoFactor;
QListIterator<drumstick::SequencerEvent *>* m_songIterator;
};
......
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