Skip to content

Keep Rubberband Faster selected during testing a Rubberband V2 build#26

Closed
daschuer wants to merge 3 commits into
ronso0:rubberband3-switchfrom
daschuer:rubberband3-switch
Closed

Keep Rubberband Faster selected during testing a Rubberband V2 build#26
daschuer wants to merge 3 commits into
ronso0:rubberband3-switchfrom
daschuer:rubberband3-switch

Conversation

@daschuer
Copy link
Copy Markdown

No description provided.

@coveralls
Copy link
Copy Markdown

coveralls commented Jul 24, 2022

Pull Request Test Coverage Report for Build 2744453422

  • 4 of 8 (50.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 34.304%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/engine/enginebuffer.cpp 1 5 20.0%
Totals Coverage Status
Change from base Build 2725155026: 0.02%
Covered Lines: 25723
Relevant Lines: 74986

💛 - Coveralls

Comment thread src/preferences/dialog/dlgprefsound.cpp Outdated
if (index >= 0) {
keylockComboBox->setCurrentIndex(index);
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RUBBERBAND_FASTER is always available and therefore in the combobox.
Why are these safety measures necessary?

The line below can be removed now?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ronso0
Copy link
Copy Markdown
Owner

ronso0 commented Jul 25, 2022

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.

@ronso0
Copy link
Copy Markdown
Owner

ronso0 commented Jul 25, 2022

the commit message
"Keep Rubberband Faster selected during testing a Rubberband V2 build"
should be
"Keep 'Rubberband Finer' selected during testing a Rubberband V2 build"

Comment thread src/engine/enginebuffer.h

#include "audio/frame.h"
#include "control/controlvalue.h"
#include "engine/bufferscalers/enginebufferscalerubberband.h"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#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?

@daschuer daschuer force-pushed the rubberband3-switch branch from 5391549 to 8debe8e Compare July 27, 2022 05:51
@daschuer
Copy link
Copy Markdown
Author

I have updated the PR including the single source of default idea.

@ronso0
Copy link
Copy Markdown
Owner

ronso0 commented Jul 27, 2022

Nice, thank you!
I'll test this asap (hopefully this week)

Comment thread src/engine/enginebuffer.h
Comment on lines +166 to +180
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;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, we allow compiling without rubberband or soundtouch, right? If so, we need the appropriate ifdefs here.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, we allow compiling without rubberband or soundtouch, right?

Do we? How?
Until now the enum was fixed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm otherwise

keylockComboBox->addItem(
EngineBuffer::getKeylockEngineName(
static_cast<EngineBuffer::KeylockEngine>(i)));
auto engine = static_cast<EngineBuffer::KeylockEngine>(i);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
auto engine = static_cast<EngineBuffer::KeylockEngine>(i);
const auto engine = static_cast<EngineBuffer::KeylockEngine>(i);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, cherry-picked this (and same change below in loadSettings()).

@ronso0
Copy link
Copy Markdown
Owner

ronso0 commented Aug 2, 2022

Thanks @daschuer and @Swiftb0y
I added (and tweaked) the commits to mixxxdj#4855

@ronso0 ronso0 closed this Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants