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

BeatFactory: Remove makeBeatGrid function #4258

Merged
merged 5 commits into from
Sep 3, 2021

Conversation

Holzhaus
Copy link
Member

@Holzhaus Holzhaus commented Sep 3, 2021

That function and just calls BeatGrid::makeBeatGrid internally. This is useless indirection.

Copy link
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

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

LGTM

The naming is now repeating itself, but this could be adjusted later.

@uklotzde uklotzde merged commit 31b5e6c into mixxxdj:main Sep 3, 2021
if (!bpm.isValid() || !firstBeatPosition.isValid()) {
mixxx::audio::FramePos firstBeatPosition,
const QString& subVersion) {
VERIFY_OR_DEBUG_ASSERT(bpm.isValid() && firstBeatPosition.isValid() &&
Copy link
Contributor

Choose a reason for hiding this comment

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

No grid after analysis:

#1  0x00007ffff3591d18 in qt_message_print(QtMsgType, QMessageLogContext const&, QString const&) () at /lib64/libQt5Core.so.5
#2  0x00007ffff3591e39 in qt_message(QtMsgType, QMessageLogContext const&, char const*, __va_list_tag*) () at /lib64/libQt5Core.so.5
#3  0x00007ffff356205a in QMessageLogger::critical(char const*, ...) const () at /lib64/libQt5Core.so.5
#4  0x00000000004a3e2e in mixxx_debug_assert(char const*, char const*, int, char const*)
    (assertion=assertion@entry=0x1129978 "bpm.isValid() && firstBeatPosition.isValid() && !firstBeatPosition.isFractional()", file=file@entry=0x1129874 "../src/track/beatgrid.cpp", line=line@entry=81, function=function@entry=0x11298f0 "static mixxx::BeatsPointer mixxx::BeatGrid::makeBeatGrid(mixxx::audio::SampleRate, mixxx::Bpm, mixxx::audio::FramePos, const QString&)")
    at ../src/util/assert.h:9
#5  0x000000000051a8c9 in mixxx_debug_assert_return_true(char const*, char const*, int, char const*)
    (function=0x11298f0 "static mixxx::BeatsPointer mixxx::BeatGrid::makeBeatGrid(mixxx::audio::SampleRate, mixxx::Bpm, mixxx::audio::FramePos, const QString&)", line=81, file=0x1129874 "../src/track/beatgrid.cpp", assertion=0x1129978 "bpm.isValid() && firstBeatPosition.isValid() && !firstBeatPosition.isFractional()") at ../src/util/assert.h:18
#6  mixxx::BeatGrid::makeBeatGrid(mixxx::audio::SampleRate, mixxx::Bpm, mixxx::audio::FramePos, QString const&) (sampleRate=sampleRate@entry=..., bpm=..., 
    bpm@entry=..., firstBeatPosition=..., subVersion=<optimized out>) at ../src/track/beatgrid.cpp:81
#7  0x0000000000e04f7d in BeatFactory::makePreferredBeats(QVector<mixxx::audio::FramePos> const&, QHash<QString, QString> const&, bool, mixxx::audio::SampleRate)
    (beats=..., extraVersionInfo=..., fixedTempo=<optimized out>, sampleRate=...) at ../src/track/beatfactory.cpp:82
#8  0x0000000000c0693b in AnalyzerBeats::storeResults(std::shared_ptr<Track>) (this=0x7fff5801c350, pTrack=std::shared_ptr<Track> (use count 32, weak count 1) = {...})
    at ../src/analyzer/analyzerbeats.cpp:228
#9  0x0000000000e3dace in AnalyzerWithState::finish(std::shared_ptr<Track>)Python Exception <class 'gdb.error'> value has been optimized out: 
 (tio=, this=0x7fff5801dd40) at /usr/include/c++/11/bits/shared_ptr_base.h:708
#10 AnalyzerThread::doRun() (this=0x46dbe00) at ../src/analyzer/analyzerthread.cpp:167
(gdb) f 6
#6  mixxx::BeatGrid::makeBeatGrid (sampleRate=sampleRate@entry=..., bpm=..., bpm@entry=..., firstBeatPosition=..., subVersion=...) at ../src/track/beatgrid.cpp:81
81	    VERIFY_OR_DEBUG_ASSERT(bpm.isValid() && firstBeatPosition.isValid() &&
(gdb) p bpm
$1 = <optimized out>
(gdb)  p firstBeatPosition
$2 = {static kStartValue = 0, static kInvalidValue = nan(0x8000000000000), static kLegacyInvalidEnginePosition = -1, m_framePosition = 17094.20338565085}

Copy link
Contributor

@uklotzde uklotzde Sep 4, 2021

Choose a reason for hiding this comment

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

bpm is invalid, not sure why

Copy link
Contributor

Choose a reason for hiding this comment

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

No, the passed bpm is valid but firstBeatPosition is fractional!

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

Successfully merging this pull request may close these issues.

2 participants