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

Sound proxy fix and clean up #4584

Merged
merged 4 commits into from
Jan 2, 2022
Merged

Conversation

daschuer
Copy link
Member

This fixes https://bugs.launchpad.net/mixxx/+bug/1955840 and improves the readability of the initializing phase.
This is the refactoring for https://bugs.launchpad.net/mixxx/+bug/1955331 moved to the main branch to lower the risk for the stable 2.3 branch.

@uklotzde
Copy link
Contributor

Please rebase on main

@uklotzde
Copy link
Contributor

As a first step I suggest to get rid of m_pAudioSource that is not needed. I will prepare a PR. Bigger refactorings should be done afterwards, step by step.

@daschuer
Copy link
Member Author

Done

@daschuer daschuer force-pushed the sound_proxy_clean_up branch from 8b18970 to bffe627 Compare December 30, 2021 22:57
@daschuer daschuer force-pushed the sound_proxy_clean_up branch from bffe627 to 095110a Compare December 31, 2021 11:29
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.

Just some minor suggestions

@@ -196,11 +200,12 @@ class SoundSourceProxy {
// provider and is initialized with -1 if no
int m_providerRegistrationIndex;

void initSoundSource(
const mixxx::SoundSourceProviderPointer& pProvider);
void findAndInitSoundSource();
Copy link
Contributor

Choose a reason for hiding this comment

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

findProviderAndInitSoundSource()

VERIFY_OR_DEBUG_ASSERT(m_pTrack) {
return nullptr;
}
if (openSoundSource(params)) {
Copy link
Contributor

@uklotzde uklotzde Jan 1, 2022

Choose a reason for hiding this comment

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

Prefer a linear control flow for the regular path:

if (!openSoundSource(params)) {
  return nullptr;
}
...

const mixxx::SoundSourceProviderPointer& pProvider);
void findAndInitSoundSource();

bool initSoundSource(
Copy link
Contributor

Choose a reason for hiding this comment

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

initSoundSourceWithProvider()

@daschuer
Copy link
Member Author

daschuer commented Jan 2, 2022

Done

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.

The code now better reveals the dependencies and states.Thank you! LGTM

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.

2 participants