Skip to content
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

Adding RadioLanewayCrossfade transition #13750

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

davidlmorris
Copy link
Contributor

RadioLanewayCrossfade transition.
See issue: #13716.

Adding RadioLanewayCrossfade transition.
See mixxxdj#13716
(Wow this is fussy!).
More style issues.
Yet more code style issues (Space at end of line.)
More Code tidy
Missing case in cueinfo.cpp
avoiding a DEBUG_ASSERT(!"Unknown Loop Type");
fix up tooltip
Copy link
Member

@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.

didn't bother looking at the autodj for now.

Comment on lines +17 to +29
// Don't change these to const as they are used only to feed the
// fade thresholds which are consts below themselves while we work
// out which one is best, and you'll just be adding to exe size.
#define N_10DB_FADEOUT_THRESHOLD 0.3162f
#define N_12DB_FADEOUT_THRESHOLD 0.2511f
#define N_15DB_FADEOUT_THRESHOLD 0.1778f
#define N_18DB_FADEOUT_THRESHOLD 0.1259f
#define N_20DB_FADEOUT_THRESHOLD 0.1f
#define N_24DB_FADEOUT_THRESHOLD 0.0631f
#define N_25DB_FADEOUT_THRESHOLD 0.0562f
#define N_27DB_FADEOUT_THRESHOLD 0.0447f
#define N_30DB_FADEOUT_THRESHOLD 0.0316f
#define N_40DB_FADEOUT_THRESHOLD 0.01f
Copy link
Member

Choose a reason for hiding this comment

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

make them constexpr. they have internal linkage and the compiler will strip them out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. I want the compiler to strip them out. Only a couple of these are used, and then only as part of a const. They are there just while we(?) work out the best values. This makes it easier to change. They can be deleted later when we have a fixed value.

Copy link
Member

Choose a reason for hiding this comment

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

No. I want the compiler to strip them out. Only a couple of these are used, and then only as part of a const.

Right, as long as you mark them const. the compiler will remove them..

Anyways, not particularly important if these are only meant to be temporary (that was not clear from the source).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

while we work out which one is best

Comment on lines +55 to +68
template<typename ForwardIterator>
ForwardIterator last_fade_in_sound(ForwardIterator begin, ForwardIterator end) {
return std::find_if(begin, end, [](const auto elem) {
return fabs(elem) >= kFadeInThreshold;
});
}

template<typename Iterator>
Iterator first_fade_out_sound(Iterator begin, Iterator end) {
return std::find_if(begin, end, [](const auto elem) {
return fabs(elem) >= kFadeOutThreshold;
});
}

Copy link
Member

Choose a reason for hiding this comment

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

this is a copy of the above for very little reason. Consider deduplicating by simply taking the Threshold as a parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The second one goes backward, while the first is strictly forward. I spent a long time playing around with these, trying to determine why I was getting weird results (and so I was keen to keep them separate). It turns out AutoDj processing can take place before a track is fully analysed, so I am less invested in that now.

Copy link
Member

Choose a reason for hiding this comment

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

The functions are identical. In this context ForwardIterator and Iterator are just names that resolve to the underlying iterator implementation when called. So there is no difference in terms of what function can be called when. A std::reverse_iterator is a "bidirectional iterator" and thus also a "forward iterator".

Copy link
Member

Choose a reason for hiding this comment

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

std::find_if only requires a forward iterator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you like I'll refactor all of those into one, including the db60.

Copy link
Member

Choose a reason for hiding this comment

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

yes, that would be nice. Thank you.

Comment on lines +158 to +160
"volume last falls below -12Db or at the spin box setting which ever\n"
"is lower, and potentially starts the next earlier if it starts below\n"
"-27Db.");
Copy link
Member

Choose a reason for hiding this comment

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

its very easy to change the threshold in the analyzer but forget to update it here. Do you think its valuable to have the thresholds documented here or can we just omit them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I nearly made it a more general statement (e.g., 'a certain level'), but I figured someone would want to know the exact values. It may well be worth making it more general for the reason you suggested.

Comment on lines -73 to +75
VERIFY_OR_DEBUG_ASSERT(box) { //Assumes the form layout is a QVBox/QHBoxLayout!
} else {
VERIFY_OR_DEBUG_ASSERT(box) { // Assumes the form layout is a QVBox/QHBoxLayout!
}
else {
Copy link
Member

Choose a reason for hiding this comment

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

was this clang-format or you?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was not intentionally me... But I gave up trying to remove spaces at the ends of lines and I did run a format document at some point, so perhaps then.

Copy link
Member

Choose a reason for hiding this comment

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

can you revert that then?

@davidlmorris
Copy link
Contributor Author

didn't bother looking at the autodj for now.

I suggest you do. This transition is groundbreaking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants