-
-
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
Add Sample-Based Play Position Control (m_playposition_samples) #13822
base: main
Are you sure you want to change the base?
Changes from all commits
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -167,6 +167,7 @@ | |||||||||
|
||||||||||
m_pRepeat = new ControlPushButton(ConfigKey(m_group, "repeat")); | ||||||||||
m_pRepeat->setButtonMode(mixxx::control::ButtonMode::Toggle); | ||||||||||
m_playposition_samples = new ControlObject<double>(ConfigKey(m_group, "playposition_samples")); | ||||||||||
Check failure on line 170 in src/engine/enginebuffer.cpp GitHub Actions / macOS 12 x64
Check failure on line 170 in src/engine/enginebuffer.cpp GitHub Actions / macOS 12 x64
Check failure on line 170 in src/engine/enginebuffer.cpp GitHub Actions / Windows 2019 (MSVC)
Check failure on line 170 in src/engine/enginebuffer.cpp GitHub Actions / Windows 2019 (MSVC)
Check failure on line 170 in src/engine/enginebuffer.cpp GitHub Actions / macOS 12 arm64
Check failure on line 170 in src/engine/enginebuffer.cpp GitHub Actions / macOS 12 arm64
Check failure on line 170 in src/engine/enginebuffer.cpp GitHub Actions / Ubuntu 22.04
Check failure on line 170 in src/engine/enginebuffer.cpp GitHub Actions / Ubuntu 22.04
Check failure on line 170 in src/engine/enginebuffer.cpp GitHub Actions / coverage
Check failure on line 170 in src/engine/enginebuffer.cpp GitHub Actions / coverage
Check failure on line 170 in src/engine/enginebuffer.cpp GitHub Actions / clang-tidy
Check failure on line 170 in src/engine/enginebuffer.cpp GitHub Actions / clang-tidy
Check failure on line 170 in src/engine/enginebuffer.cpp GitHub Actions / clazy
|
||||||||||
|
||||||||||
m_pSampleRate = new ControlProxy(kAppGroup, QStringLiteral("samplerate"), this); | ||||||||||
|
||||||||||
|
@@ -294,6 +295,7 @@ | |||||||||
#endif | ||||||||||
delete m_pReadAheadManager; | ||||||||||
delete m_pReader; | ||||||||||
delete m_playposition_samples; | ||||||||||
Check failure on line 298 in src/engine/enginebuffer.cpp GitHub Actions / macOS 12 x64
Check failure on line 298 in src/engine/enginebuffer.cpp GitHub Actions / Windows 2019 (MSVC)
Check failure on line 298 in src/engine/enginebuffer.cpp GitHub Actions / Windows 2019 (MSVC)
Check failure on line 298 in src/engine/enginebuffer.cpp GitHub Actions / macOS 12 arm64
Check failure on line 298 in src/engine/enginebuffer.cpp GitHub Actions / Ubuntu 22.04
Check failure on line 298 in src/engine/enginebuffer.cpp GitHub Actions / coverage
Check failure on line 298 in src/engine/enginebuffer.cpp GitHub Actions / clang-tidy
|
||||||||||
|
||||||||||
delete m_playButton; | ||||||||||
delete m_playStartButton; | ||||||||||
|
@@ -464,6 +466,7 @@ | |||||||||
if (kLogger.traceEnabled()) { | ||||||||||
kLogger.trace() << m_group << "EngineBuffer::setNewPlaypos" << position; | ||||||||||
} | ||||||||||
m_playposition_samples->set(m_playPos.toEngineSamplePos()); | ||||||||||
Check failure on line 469 in src/engine/enginebuffer.cpp GitHub Actions / macOS 12 x64
Check failure on line 469 in src/engine/enginebuffer.cpp GitHub Actions / Windows 2019 (MSVC)
Check failure on line 469 in src/engine/enginebuffer.cpp GitHub Actions / macOS 12 arm64
Check failure on line 469 in src/engine/enginebuffer.cpp GitHub Actions / Ubuntu 22.04
Check failure on line 469 in src/engine/enginebuffer.cpp GitHub Actions / coverage
Check failure on line 469 in src/engine/enginebuffer.cpp GitHub Actions / clang-tidy
|
||||||||||
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. Do you intend to set Otherwise, I'm confused why you set Although, as mentioned in the other comments, |
||||||||||
|
||||||||||
m_playPos = position; | ||||||||||
|
||||||||||
|
@@ -712,12 +715,16 @@ | |||||||||
void EngineBuffer::seekAbs(mixxx::audio::FramePos position) { | ||||||||||
DEBUG_ASSERT(position.isValid()); | ||||||||||
doSeekPlayPos(position, SEEK_STANDARD); | ||||||||||
m_playposition_samples->set(position.toEngineSamplePos()); | ||||||||||
Check failure on line 718 in src/engine/enginebuffer.cpp GitHub Actions / macOS 12 x64
Check failure on line 718 in src/engine/enginebuffer.cpp GitHub Actions / Windows 2019 (MSVC)
Check failure on line 718 in src/engine/enginebuffer.cpp GitHub Actions / macOS 12 arm64
Check failure on line 718 in src/engine/enginebuffer.cpp GitHub Actions / Ubuntu 22.04
Check failure on line 718 in src/engine/enginebuffer.cpp GitHub Actions / coverage
Check failure on line 718 in src/engine/enginebuffer.cpp GitHub Actions / clang-tidy
|
||||||||||
|
||||||||||
Comment on lines
+718
to
+719
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.
Suggested change
|
||||||||||
} | ||||||||||
|
||||||||||
// WARNING: This method is called by EngineControl and runs in the engine thread | ||||||||||
void EngineBuffer::seekExact(mixxx::audio::FramePos position) { | ||||||||||
DEBUG_ASSERT(position.isValid()); | ||||||||||
doSeekPlayPos(position, SEEK_EXACT); | ||||||||||
m_playposition_samples->set(position.toEngineSamplePos()); | ||||||||||
Check failure on line 726 in src/engine/enginebuffer.cpp GitHub Actions / macOS 12 x64
Check failure on line 726 in src/engine/enginebuffer.cpp GitHub Actions / Windows 2019 (MSVC)
Check failure on line 726 in src/engine/enginebuffer.cpp GitHub Actions / macOS 12 arm64
Check failure on line 726 in src/engine/enginebuffer.cpp GitHub Actions / Ubuntu 22.04
Check failure on line 726 in src/engine/enginebuffer.cpp GitHub Actions / coverage
Check failure on line 726 in src/engine/enginebuffer.cpp GitHub Actions / clang-tidy
|
||||||||||
|
||||||||||
Comment on lines
+726
to
+727
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.
Suggested change
|
||||||||||
} | ||||||||||
|
||||||||||
double EngineBuffer::fractionalPlayposFromAbsolute(mixxx::audio::FramePos absolutePlaypos) { | ||||||||||
|
@@ -1457,6 +1464,7 @@ | |||||||||
// called yet. | ||||||||||
return; | ||||||||||
} | ||||||||||
m_playposition_samples->set(m_playPos.toEngineSamplePos()); | ||||||||||
Check failure on line 1467 in src/engine/enginebuffer.cpp GitHub Actions / macOS 12 x64
Check failure on line 1467 in src/engine/enginebuffer.cpp GitHub Actions / Windows 2019 (MSVC)
Check failure on line 1467 in src/engine/enginebuffer.cpp GitHub Actions / macOS 12 arm64
Check failure on line 1467 in src/engine/enginebuffer.cpp GitHub Actions / Ubuntu 22.04
Check failure on line 1467 in src/engine/enginebuffer.cpp GitHub Actions / coverage
Check failure on line 1467 in src/engine/enginebuffer.cpp GitHub Actions / clang-tidy
|
||||||||||
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.
Suggested change
|
||||||||||
|
||||||||||
// Increase samplesCalculated by the buffer size | ||||||||||
m_iSamplesSinceLastIndicatorUpdate += iBufferSize; | ||||||||||
|
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.
For consistency reasons,
m_playposition_samples
should probably intialized directly afterm_playposSlider
to keepplayposition
andplayposition_samples
closer together.mixxx/src/engine/enginebuffer.cpp
Lines 158 to 164 in edae0ca
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.
Additionally, I'd suggest the name
m_playPositionInSamples
instead to adhere tocamelCase
naming conventions and to make the name a bit more descriptive.