-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #324 from ywwg/pitch_knob_stuck
When disabling keylock, explicitly reset musical pitch.
- Loading branch information
Showing
4 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Tests for enginebuffer.cpp | ||
|
||
#include <gtest/gtest.h> | ||
#include <gmock/gmock.h> | ||
|
||
#include <QtDebug> | ||
|
||
#include "configobject.h" | ||
#include "controlobject.h" | ||
#include "test/mockedenginebackendtest.h" | ||
#include "test/mixxxtest.h" | ||
|
||
|
||
class EngineBufferTest : public MockedEngineBackendTest { | ||
}; | ||
|
||
TEST_F(EngineBufferTest, DisableKeylockResetsPitch) { | ||
// To prevent one-slider users from getting stuck on a key, unsetting | ||
// keylock resets the musical pitch. | ||
ControlObject::getControl(ConfigKey(m_sGroup1, "file_bpm"))->set(128.0); | ||
ControlObject::getControl(ConfigKey(m_sGroup1, "keylock"))->set(1.0); | ||
ControlObject::getControl(ConfigKey(m_sGroup1, "pitch"))->set(0.5); | ||
ProcessBuffer(); | ||
|
||
ControlObject::getControl(ConfigKey(m_sGroup1, "keylock"))->set(0.0); | ||
// We require a buffer process to see that the keylock state has changed. | ||
ProcessBuffer(); | ||
ASSERT_EQ(0.0, ControlObject::getControl(ConfigKey(m_sGroup1, "pitch"))->get()); | ||
} | ||
|
||
TEST_F(EngineBufferTest, TrackLoadResetsPitch) { | ||
// When a new track is loaded, the pitch value should be reset. | ||
ControlObject::getControl(ConfigKey(m_sGroup1, "file_bpm"))->set(128.0); | ||
ControlObject::getControl(ConfigKey(m_sGroup1, "pitch"))->set(0.5); | ||
ProcessBuffer(); | ||
ASSERT_EQ(0.5, ControlObject::getControl(ConfigKey(m_sGroup1, "pitch"))->get()); | ||
|
||
m_pChannel1->getEngineBuffer()->loadFakeTrack(); | ||
ASSERT_EQ(0.0, ControlObject::getControl(ConfigKey(m_sGroup1, "pitch"))->get()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fa79563
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Achievement unlocked -- #2 all-time developer by number of commits :)