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

Qt6 prepare #11863

Merged
merged 4 commits into from
Aug 26, 2023
Merged

Qt6 prepare #11863

merged 4 commits into from
Aug 26, 2023

Conversation

daschuer
Copy link
Member

@daschuer daschuer commented Aug 24, 2023

It turns out that this is required to build main with the new Qt6 vcpkg environment.
I like to merge this first to verify the Qt5 compatibility which I like to maintain during 2.5 beta to be able to compare certain behaviors.

  • Sleef is a FFT library used on macOS from Rubberband 3.1
  • The logic around WIN32/WIN64 definitions was inverted which proves that it was wrong. The WIN32 define is correct even on a 64 bit system, because it has still the so called WIN32 API.

cmake/modules/Findrubberband.cmake Outdated Show resolved Hide resolved
Sleef::sleef
${sleefdft_path}
)
endif()
Copy link
Member

Choose a reason for hiding this comment

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

whats the error like if neither sleef nor fftw is found?

Copy link
Member Author

Choose a reason for hiding this comment

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

Rubberband is linked one of it, which is the choice of the package provider. If the library is not found build will fail with a significant linker error.
I have no idea how to investigate which library is used to fail early.
We need to wait for the Rubberband CONFIG mode.

Copy link
Member

Choose a reason for hiding this comment

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

Couldn't we just detect if !fftw_FOUND && !Sleef_FOUND and error out early then? Sorry for the dumb questions, I'm not familiar enough with cmake. I'm just trying to wrap my head around it.

Comment on lines 1382 to 1386
int columnsSize = 0;
for (int i = 0; i < columnsCount; ++i) {
columnsSize += qstrlen(columns[i].name) + 1;
columnsSize += static_cast<int>(qstrlen(columns[i].name)) + 1;
}
columnsStr.reserve(columnsSize);
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've preferred changing columnsSize to std::size_t/qsizetype instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes that world be nice. However QT provides no common ground with qsizetype for QString.reserve(). So using int is the compatible solution.

Copy link
Member

Choose a reason for hiding this comment

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

What do you mean, "no common ground"? QString.reserve() takes a qsizetype on Qt6...

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't auto use int on Qt5 and size_t on Qt6?

Copy link
Member Author

Choose a reason for hiding this comment

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

We need a cast anyway, because Qt6 uses std::ptrdifsize for reserve()

#include <FLAC/format.h>
#include <chromaprint.h>
#include <lame/lame.h>
#include <portaudio.h>
#include <rubberband/RubberBandStretcher.h>
#include <shoutidjc/shout.h>
Copy link
Member

Choose a reason for hiding this comment

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

what happened to the #ifdef __BROADCAST__?

src/engine/sidechain/shoutconnection.cpp Outdated Show resolved Hide resolved
src/preferences/dialog/dlgprefbroadcast.cpp Outdated Show resolved Hide resolved
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.

LGTM, lets keep the ball rolling

@Swiftb0y Swiftb0y merged commit 3cf5023 into mixxxdj:main Aug 26, 2023
@daschuer daschuer deleted the qt6_prepare branch September 6, 2023 05:38
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.

3 participants