-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Num deck steamline #14112
base: 2.5
Are you sure you want to change the base?
Num deck steamline #14112
Changes from 1 commit
d5a419e
6687077
82a2158
3bdfc03
e460466
4c1560e
9c24d1a
c89f06e
6ec70aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,7 @@ class PlayerManagerTest : public MixxxDbTest, SoundSourceProviderRegistration { | |
|
||
TEST_F(PlayerManagerTest, UnEjectTest) { | ||
// Ejecting an empty deck with no previously-recorded ejected track has no effect. | ||
auto deck1 = m_pPlayerManager->getDeck(1); | ||
auto deck1 = m_pPlayerManager->getDeck(0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. our There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You point out the downside of the change. The benefit is that it now matches Like here: (I will also place an inline comment)
In addition there was a naming clash with Index vs. Number. In general we should stick to the rule to use 0 based counting inside the code base and 1 base in all user visible cases. Please have a second look. If you still think we should keep the 1 based index here I will fix the issue in that direction. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the explanation. I see the tension there. I too prefer 0-based indexing. I will take a second look. |
||
deck1->slotEjectTrack(1.0); | ||
ASSERT_EQ(nullptr, deck1->getLoadedTrack()); | ||
|
||
|
@@ -154,7 +154,7 @@ TEST_F(PlayerManagerTest, UnEjectTest) { | |
deck1->slotLoadTrack(pTrack2, false); | ||
|
||
// Ejecting in an empty deck loads the last-ejected track. | ||
auto deck2 = m_pPlayerManager->getDeck(2); | ||
auto deck2 = m_pPlayerManager->getDeck(1); | ||
ASSERT_EQ(nullptr, deck2->getLoadedTrack()); | ||
// make sure eject does not trigger 'unreplace' | ||
QTest::qSleep(kUnreplaceDelay); // millis | ||
|
@@ -166,7 +166,7 @@ TEST_F(PlayerManagerTest, UnEjectTest) { | |
// Loading a new track in a deck causes the old one to be ejected. | ||
// That old track can be unejected into a different deck. | ||
TEST_F(PlayerManagerTest, UnEjectReplaceTrackTest) { | ||
auto deck1 = m_pPlayerManager->getDeck(1); | ||
auto deck1 = m_pPlayerManager->getDeck(0); | ||
// Load a track and the load another one | ||
TrackPointer pTrack1 = getOrAddTrackByLocation(getTestDir().filePath(kTrackLocationTest1)); | ||
ASSERT_NE(nullptr, pTrack1); | ||
|
@@ -186,7 +186,7 @@ TEST_F(PlayerManagerTest, UnEjectReplaceTrackTest) { | |
waitForTrackToBeLoaded(deck1); | ||
|
||
// Ejecting in an empty deck loads the last-ejected track. | ||
auto deck2 = m_pPlayerManager->getDeck(2); | ||
auto deck2 = m_pPlayerManager->getDeck(1); | ||
ASSERT_EQ(nullptr, deck2->getLoadedTrack()); | ||
// make sure eject does not trigger 'unreplace' | ||
QTest::qSleep(kUnreplaceDelay); | ||
|
@@ -201,7 +201,7 @@ TEST_F(PlayerManagerTest, UnEjectInvalidTrackIdTest) { | |
getTestDir().filePath(kTrackLocationTest1), TrackId(QVariant(10))); | ||
ASSERT_NE(nullptr, pTrack); | ||
m_pPlayerManager->slotSaveEjectedTrack(pTrack); | ||
auto deck1 = m_pPlayerManager->getDeck(1); | ||
auto deck1 = m_pPlayerManager->getDeck(0); | ||
// Does nothing -- no crash. | ||
// make sure eject does not trigger 'unreplace' | ||
QTest::qSleep(kUnreplaceDelay); | ||
|
@@ -211,7 +211,7 @@ TEST_F(PlayerManagerTest, UnEjectInvalidTrackIdTest) { | |
|
||
TEST_F(PlayerManagerTest, UnReplaceTest) { | ||
// Trigger eject twice within 500 ms to undo track replacement | ||
auto deck1 = m_pPlayerManager->getDeck(1); | ||
auto deck1 = m_pPlayerManager->getDeck(0); | ||
// Load a track | ||
TrackPointer pTrack1 = getOrAddTrackByLocation(getTestDir().filePath(kTrackLocationTest1)); | ||
ASSERT_NE(nullptr, pTrack1); | ||
|
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.
Here we benefit form the 0 based index