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

Refactor WaveformFactory and Pref #13245

Open
acolombier opened this issue May 20, 2024 · 4 comments
Open

Refactor WaveformFactory and Pref #13245

acolombier opened this issue May 20, 2024 · 4 comments

Comments

@acolombier
Copy link
Member

acolombier commented May 20, 2024

  • Make WaveformWidgetFactory::findHandle* const and use something like
    auto it = std::find_if(m_waveformWidgetHandles.cbegin(), m_waveformWidgetHandles.cend(), [type](const auto& handle){   return handle.m_type == type; }); return it == m_waveformWidgetHandles.cend() ? -1 :   std::distance(m_waveformWidgetHandles.cbegin(), m_waveformWidgetHandles.cend());
    
  • Replace raw pointer in WaveformWidgetFactory::create[*]Waveform with smart pointers
  • Use templated UserConfig functions whenever applicable and replace verbose set or get with setValue or getValue
  • Assessing the situation with WaveformWidgetAbstractHandle and aim to remove it if possible
  • Use a model in the preference for waveform types, and allow sorting by most to least recommended, instead of alphabetically
  • Refactor src/waveform/widgets/waveformwidgettype.h to adopt a similar style than in Refactor/preferences enums #12798

This is a dependency for #13226

@acolombier
Copy link
Member Author

@Swiftb0y let me know if you would like me to take a look at this if you are happy with doing the clean up yourself

@Swiftb0y
Copy link
Member

I'm currently ringing for time a little so I don't know if I have the time. I'll try to whip up something later today, If not feel free to take over.

@Swiftb0y
Copy link
Member

@acolombier so I spent the day and came up with https://github.com/Swiftb0y/mixxx/tree/refactor/gh13245-waveform-factory%26prefs (doesn't fully build; also currently segfaults on teardown because of 424b1c9 which I haven't found the time to dig into).
I'll try to finish that tomorrow.

@acolombier
Copy link
Member Author

Great! Thanks for your effort.

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

No branches or pull requests

2 participants