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

Move WOverview::drawNextPixmapPart() into new class WOverviewLMH (Low Mid High), also add new HSV waveform overview and interface, to select woverview type #17

Merged
merged 13 commits into from
Jun 25, 2013

Conversation

xorik
Copy link
Contributor

@xorik xorik commented Jun 20, 2013

This helps to change interface of woverview widget in the future (e.g. replace it with HSV, or other new types)

float m_waveformPeak;

int m_diffGain;

Copy link
Member

Choose a reason for hiding this comment

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

I know it is not your fault, but please reorder like http://www.mixxx.org/wiki/doku.php/coding_guidelines#class_declaration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I can't see, which rule is not satisfied?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only thing I see is /* ... */ comment, is there more errors here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@daschuer what exact you want I need to fix?

Copy link
Member

Choose a reason for hiding this comment

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

The order of the declaration blocks
public:
private:
protected:

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer

public:
protected:
private:

So the most commenly used stuff is on top and not top+bottom

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in last commit

Copy link
Member

Choose a reason for hiding this comment

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

+1 to Max -- that's what we already use in most places.

@daschuer
Copy link
Member

Thank you for your work!

For me it is in a merge-able state, because it does not change the current behavior, but is fist step for a configurable waveform overview. But since this is the result from our teamwork, I would like to have a confirm from an other team member before merge.

In the meanwhile it would be nice if you could check your changes against http://www.mixxx.org/wiki/doku.php/coding_guidelines. There are some braces at start of a line and some /* */ comments.

@xorik
Copy link
Contributor Author

xorik commented Jun 20, 2013

Should I need to create bug on launchpad for this?

@daschuer
Copy link
Member

Should I need to create bug on launchpad for this?

For what? All team member will already get a copy of this discussion by mail.

@ywwg
Copy link
Member

ywwg commented Jun 20, 2013

Bugs are only for code committed in trunk or another release branch. Since your code is still in review and in your personal branch, no bug is needed. Just go ahead and fix it! 👍

@xorik
Copy link
Contributor Author

xorik commented Jun 25, 2013

Hi guys! I just added combobox in the preferences dialog, and add functions to select and store waveform overview type, please check it

waveformOverviewComboBox->setCurrentIndex(
m_pConfig->getValueString(ConfigKey("[Waveform]","WaveformOverviewType"), "0").toInt());
connect(waveformOverviewComboBox,SIGNAL(currentIndexChanged(int)),
this,SLOT(slotSetWaveformOverviewType(int)));
Copy link
Member

Choose a reason for hiding this comment

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

Please add commends to clarify what "0" is and to clarify the relation between config options and ComboBox items/index.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please add commends to clarify what "0" is

I wrote "By default we set filtered woverview", I must write something more?

and to clarify the relation between config options and ComboBox items/index.

Hmm... I don't understand, can you give an example?

Copy link
Member

Choose a reason for hiding this comment

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

// Waveform overview init
waveformOverviewComboBox->addItem( tr("Filtered") ); // "0"
waveformOverviewComboBox->addItem( tr("HSV") ); // "1"

// By default we set "Filtered" woverview = "0"
waveformOverviewComboBox->setCurrentIndex(
m_pConfig->getValueString(ConfigKey("[Waveform]","WaveformOverviewType"), "0").toInt());

@daschuer
Copy link
Member

Although you have just moved most of the commented lines, you have inherit the code clean up job. Sorry ;-)

WOverview* overviewWidget = new WOverview(pSafeChannelStr, m_pConfig, m_pParent);
WOverview* overviewWidget = NULL;

// HSV or LMH waveform overview type
Copy link
Member

Choose a reason for hiding this comment

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

// HSV = "1" or "Filtered" = "0" (LMH) waveform overview type

@xorik
Copy link
Contributor Author

xorik commented Jun 25, 2013

Although you have just moved most of the commented lines, you have inherit the code clean up job. Sorry ;-)

no problem :)

@xorik
Copy link
Contributor Author

xorik commented Jun 25, 2013

@daschuer please check last commits

@daschuer
Copy link
Member

Thank you, it looks good to me now, except some comment style violations:
//disabed_code()
// comment

IMHO we can commit after this is fixed. But lets give the other a chance for review.

@xorik
Copy link
Contributor Author

xorik commented Jun 25, 2013

Done

@daschuer
Copy link
Member

Thank you very much!

}

bool WOverviewHSV::drawNextPixmapPart() {
ScopedTimer t("WOverview::drawNextPixmapPart");
Copy link
Member

Choose a reason for hiding this comment

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

Please change to WOverviewHSV so that timing stats are reported separately for the two overviews.

@rryan
Copy link
Member

rryan commented Jun 25, 2013

LGTM to me as well @xorik (other than the 2 ScopedTimer changes I just commented on) -- thanks!

@xorik
Copy link
Contributor Author

xorik commented Jun 25, 2013

@rryan, done

rryan added a commit that referenced this pull request Jun 25, 2013
Move WOverview::drawNextPixmapPart() into new class WOverviewLMH (Low Mid High), also add new HSV waveform overview and interface, to select woverview type
@rryan rryan merged commit 34dcb1b into mixxxdj:master Jun 25, 2013
@rryan
Copy link
Member

rryan commented Jun 25, 2013

Thanks @xorik -- merged.

@esbrandt esbrandt mentioned this pull request Dec 15, 2013
@daschuer daschuer mentioned this pull request Dec 28, 2014
@daschuer daschuer mentioned this pull request Aug 13, 2017
19 tasks
@daschuer daschuer mentioned this pull request Jun 11, 2018
11 tasks
Holzhaus referenced this pull request in Holzhaus/mixxx Feb 21, 2022
…h sync

When loading a track that is not yet present in the library (and thus
doesn't have any BPM because it hasn't been analyzed yet) while another
deck is playing and both decks have sync enabled, a debug assertion is
triggered:

    DEBUG ASSERT: "isValid()" in function double mixxx::Bpm::value() const at src/track/bpm.h:53
    Aborted (core dumped)

The backtrace looks as follows:

    #0  0x00007f175c87234c in __pthread_kill_implementation () at /usr/lib/libc.so.6
    #1  0x00007f175c8254b8 in raise () at /usr/lib/libc.so.6
    #2  0x00007f175c80f534 in abort () at /usr/lib/libc.so.6
    #3  0x00007f175cf05ee4 in qt_assert(char const*, char const*, int) () at /usr/lib/libQt5Core.so.5
    #4  0x000055deb2e67e1c in mixxx::(anonymous namespace)::handleMessage(QtMsgType, QMessageLogContext const&, QString const&) (type=<optimized out>, context=<optimized out>, input=<optimized out>) at src/util/logging.cpp:355
    #5  0x00007f175cf47128 in  () at /usr/lib/libQt5Core.so.5
    #6  0x00007f175cf3fd8a in  () at /usr/lib/libQt5Core.so.5
    #7  0x00007f175cf06526 in QMessageLogger::critical(char const*, ...) const () at /usr/lib/libQt5Core.so.5
    #8  0x000055deb2e5c720 in mixxx_debug_assert(char const*, char const*, int, char const*) (assertion=assertion@entry=0x55deb39bd0db "isValid()", file=file@entry=0x55deb39bbf30 "src/track/bpm.h", line=line@entry=53, function=function@entry=0x55deb39bbf08 "double mixxx::Bpm::value() const") at gsrc/util/assert.h:9
    #9  0x000055deb2ee7e7e in mixxx_debug_assert_return_true(char const*, char const*, int, char const*) (function=0x55deb39bbf08 "double mixxx::Bpm::value() const", line=53, file=0x55deb39bbf30 "src/track/bpm.h", assertion=0x55deb39bd0db "isValid()") at gsrc/util/assert.h:18
    #10 mixxx::Bpm::value() const (this=<synthetic pointer>) at src/track/bpm.h:53
    #11 mixxx::operator*(mixxx::Bpm, double) (multiple=1, bpm=...) at src/track/bpm.h:160
    #12 SyncControl::setLocalBpm(mixxx::Bpm) (this=<optimized out>, localBpm=...) at src/engine/sync/synccontrol.cpp:567
    #13 0x000055deb34c7ba3 in EngineBuffer::postProcess(int) (this=0x55deb56eb060, iBufferSize=2048) at src/engine/enginebuffer.cpp:1318
    #14 0x000055deb3139023 in EngineMaster::processChannels(int) (this=0x55deb5449440, iBufferSize=<optimized out>) at src/engine/enginemaster.cpp:383
    #15 0x000055deb31394f7 in EngineMaster::process(int) (this=0x55deb5449440, iBufferSize=iBufferSize@entry=2048) at src/engine/enginemaster.cpp:410
    #16 0x000055deb2f91d0b in SoundManager::onDeviceOutputCallback(long) (this=<optimized out>, iFramesPerBuffer=iFramesPerBuffer@entry=1024) at src/soundio/soundmanager.cpp:596
    #17 0x000055deb32dd794 in SoundDevicePortAudio::callbackProcessClkRef(long, float*, float const*, PaStreamCallbackTimeInfo const*, unsigned long) (this=0x55deb553e6b0, framesPerBuffer=1024, out=<optimized out>, in=<optimized out>, timeInfo=<optimized out>, statusFlags=<optimized out>) at src/soundio/sounddeviceportaudio.cpp:965

This happens because `newLocalBpm` is invalid when `localBpm` is
invalid. Trying to do sync decks while no tempo information is available
does not make sense, so we only synchronize decks if the local BPM is
available.
Holzhaus referenced this pull request in Holzhaus/mixxx Mar 1, 2022
…h sync

When loading a track that is not yet present in the library (and thus
doesn't have any BPM because it hasn't been analyzed yet) while another
deck is playing and both decks have sync enabled, a debug assertion is
triggered:

    DEBUG ASSERT: "isValid()" in function double mixxx::Bpm::value() const at src/track/bpm.h:53
    Aborted (core dumped)

The backtrace looks as follows:

    #0  0x00007f175c87234c in __pthread_kill_implementation () at /usr/lib/libc.so.6
    #1  0x00007f175c8254b8 in raise () at /usr/lib/libc.so.6
    #2  0x00007f175c80f534 in abort () at /usr/lib/libc.so.6
    #3  0x00007f175cf05ee4 in qt_assert(char const*, char const*, int) () at /usr/lib/libQt5Core.so.5
    #4  0x000055deb2e67e1c in mixxx::(anonymous namespace)::handleMessage(QtMsgType, QMessageLogContext const&, QString const&) (type=<optimized out>, context=<optimized out>, input=<optimized out>) at src/util/logging.cpp:355
    #5  0x00007f175cf47128 in  () at /usr/lib/libQt5Core.so.5
    #6  0x00007f175cf3fd8a in  () at /usr/lib/libQt5Core.so.5
    #7  0x00007f175cf06526 in QMessageLogger::critical(char const*, ...) const () at /usr/lib/libQt5Core.so.5
    #8  0x000055deb2e5c720 in mixxx_debug_assert(char const*, char const*, int, char const*) (assertion=assertion@entry=0x55deb39bd0db "isValid()", file=file@entry=0x55deb39bbf30 "src/track/bpm.h", line=line@entry=53, function=function@entry=0x55deb39bbf08 "double mixxx::Bpm::value() const") at gsrc/util/assert.h:9
    #9  0x000055deb2ee7e7e in mixxx_debug_assert_return_true(char const*, char const*, int, char const*) (function=0x55deb39bbf08 "double mixxx::Bpm::value() const", line=53, file=0x55deb39bbf30 "src/track/bpm.h", assertion=0x55deb39bd0db "isValid()") at gsrc/util/assert.h:18
    #10 mixxx::Bpm::value() const (this=<synthetic pointer>) at src/track/bpm.h:53
    #11 mixxx::operator*(mixxx::Bpm, double) (multiple=1, bpm=...) at src/track/bpm.h:160
    #12 SyncControl::setLocalBpm(mixxx::Bpm) (this=<optimized out>, localBpm=...) at src/engine/sync/synccontrol.cpp:567
    #13 0x000055deb34c7ba3 in EngineBuffer::postProcess(int) (this=0x55deb56eb060, iBufferSize=2048) at src/engine/enginebuffer.cpp:1318
    #14 0x000055deb3139023 in EngineMaster::processChannels(int) (this=0x55deb5449440, iBufferSize=<optimized out>) at src/engine/enginemaster.cpp:383
    #15 0x000055deb31394f7 in EngineMaster::process(int) (this=0x55deb5449440, iBufferSize=iBufferSize@entry=2048) at src/engine/enginemaster.cpp:410
    #16 0x000055deb2f91d0b in SoundManager::onDeviceOutputCallback(long) (this=<optimized out>, iFramesPerBuffer=iFramesPerBuffer@entry=1024) at src/soundio/soundmanager.cpp:596
    #17 0x000055deb32dd794 in SoundDevicePortAudio::callbackProcessClkRef(long, float*, float const*, PaStreamCallbackTimeInfo const*, unsigned long) (this=0x55deb553e6b0, framesPerBuffer=1024, out=<optimized out>, in=<optimized out>, timeInfo=<optimized out>, statusFlags=<optimized out>) at src/soundio/sounddeviceportaudio.cpp:965

This happens because `newLocalBpm` is invalid when `localBpm` is
invalid. Trying to do sync decks while no tempo information is available
does not make sense, so we only synchronize decks if the local BPM is
available.
m0dB referenced this pull request in m0dB/mixxx Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants