Keep Rubberband Faster selected during testing a Rubberband V2 build#26
Keep Rubberband Faster selected during testing a Rubberband V2 build#26daschuer wants to merge 3 commits into
Conversation
Pull Request Test Coverage Report for Build 2744453422
💛 - Coveralls |
| if (index >= 0) { | ||
| keylockComboBox->setCurrentIndex(index); | ||
| } | ||
|
|
There was a problem hiding this comment.
RUBBERBAND_FASTER is always available and therefore in the combobox.
Why are these safety measures necessary?
The line below can be removed now?
There was a problem hiding this comment.
Yes the line below can be removed.
In the current version index and engine have the same integer number.
This may change when a user has engine 5 of a yet unknown future version or such. It will become the last combo box position. Which is 2 or 3.
That is why I have made the selection index independent from the selected engine, which is now stored as user data.
Even though I know the index already Ihere, I look it up for correctness. A kind of future Prove measure.
I'd this OK?
There was a problem hiding this comment.
Okay that makes sense.
It' just I don't see how RUBBERBAND_FASTER could not be available. For additional scaler engines one would need to modify the enginebuffer enum in order to make them available, and if RUBBERBAND_FASTER was removed from the enum class (or renamed) static_cast<int>(EngineBuffer::RUBBERBAND_FASTER) wouldn't compile anyway, right?
Or is this supposed to cover the case where RUBBERBAND_FASTER is in the enum but deactivated for some reason?
There was a problem hiding this comment.
Oh sorry I think I confused you due to my wrong commit message. RUBBERBAND_FASTER will be always available (for now)
In a future version, let's say we remove Soundtouch, than we should keep the enum value, but remove the selection from the combo box. I will add a comment that the enum values must not be changed only appended.
|
Thanks for this PR. Actually I tried that 'static' approach but it didn't work out for some reason. I left a note and will take a closer look soonish. |
|
the commit message |
|
|
||
| #include "audio/frame.h" | ||
| #include "control/controlvalue.h" | ||
| #include "engine/bufferscalers/enginebufferscalerubberband.h" |
There was a problem hiding this comment.
do I get that right:
besides the other improvements in this PR, including only the scaler header (instead of the rubberband header) is more efficient because of
- pragma once (which we can't put in the rubberband header)?
- the scaler header is a little smaller than the rubberband header
There was a problem hiding this comment.
#pragma once is these days equal efficient than #ifndef RUBBERBAND_STRETCHER_H
The pure size might be an issue, but all this effect only the duration of the build run anyway.
My driver for this change was hiding of information. In the current solution the scaler combobox work without any hard coded knowledge about the available scaler.
There is however the issue with the "EngineBuffer::RUBBERBAND_FASTER" as default value. We may refactor this also into the engine buffer.
Than we are in the situation that we do not have to touch the preferences for any new scaler mode.
What do you think? Shall I add this change as well?
5391549 to
8debe8e
Compare
|
I have updated the PR including the single source of default idea. |
|
Nice, thank you! |
| switch (engine) { | ||
| case SOUNDTOUCH: | ||
| return true; | ||
| case RUBBERBAND_FASTER: | ||
| return true; | ||
| case RUBBERBAND_FINER: | ||
| return EngineBufferScaleRubberBand::isEngineFinerAvailable(); | ||
| default: | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| static KeylockEngine defaultKeylockEngine() { | ||
| return RUBBERBAND_FASTER; | ||
| } |
There was a problem hiding this comment.
IIRC, we allow compiling without rubberband or soundtouch, right? If so, we need the appropriate ifdefs here.
There was a problem hiding this comment.
IIRC, we allow compiling without rubberband or soundtouch, right?
Do we? How?
Until now the enum was fixed.
There was a problem hiding this comment.
Currently Rubberband and Soundtouch are "required" in our CMakeList:
https://github.com/daschuer/mixxx/blob/main/CMakeLists.txt#L2461
https://github.com/daschuer/mixxx/blob/main/CMakeLists.txt#L2449
There was a problem hiding this comment.
Ok nevermind. I thought I've read some code that handled the absence of a pitch-/timestretching algorithm that lead me to believe they were optional.
| keylockComboBox->addItem( | ||
| EngineBuffer::getKeylockEngineName( | ||
| static_cast<EngineBuffer::KeylockEngine>(i))); | ||
| auto engine = static_cast<EngineBuffer::KeylockEngine>(i); |
There was a problem hiding this comment.
| auto engine = static_cast<EngineBuffer::KeylockEngine>(i); | |
| const auto engine = static_cast<EngineBuffer::KeylockEngine>(i); |
There was a problem hiding this comment.
thanks, cherry-picked this (and same change below in loadSettings()).
|
Thanks @daschuer and @Swiftb0y |
No description provided.