diff --git a/CMakeLists.txt b/CMakeLists.txt index 25c2f2833b3..aadf8b7d95c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,6 +174,7 @@ if(APPLE) endif() project(mixxx VERSION 2.5.0) +enable_language(C CXX) # Work around missing version suffixes support https://gitlab.kitware.com/cmake/cmake/-/issues/16716 set(MIXXX_VERSION_PRERELEASE "alpha") # set to "alpha" "beta" or "" @@ -1096,7 +1097,6 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL src/util/logger.cpp src/util/logging.cpp src/util/mac.cpp - src/util/moc_included_test.cpp src/util/movinginterquartilemean.cpp src/util/rangelist.cpp src/util/readaheadsamplebuffer.cpp @@ -1197,6 +1197,164 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL src/widget/wwidgetgroup.cpp src/widget/wwidgetstack.cpp ) +target_precompile_headers(mixxx-lib PUBLIC + src/audio/frame.h + src/audio/signalinfo.h + src/audio/streaminfo.h + src/audio/types.h + src/control/control.h + src/control/controlaudiotaperpot.h + src/control/controlbehavior.h + src/control/controlcompressingproxy.h + src/control/controleffectknob.h + src/control/controlencoder.h + src/control/controlindicator.h + src/control/controlindicatortimer.h + src/control/controllinpotmeter.h + src/control/controllogpotmeter.h + src/control/controlmodel.h + src/control/controlobject.h + src/control/controlobjectscript.h + src/control/controlpotmeter.h + src/control/controlproxy.h + src/control/controlpushbutton.h + src/control/controlsortfiltermodel.h + src/control/controlttrotary.h + src/control/controlvalue.h + src/control/convert.h + src/control/pollingcontrolproxy.h + src/controllers/defs_controllers.h + src/defs_urls.h + src/effects/defs.h + src/engine/channelhandle.h + src/engine/engine.h + src/errordialoghandler.h + src/track/track.h + src/track/track_decl.h + src/track/trackid.h + src/track/trackinfo.h + src/track/trackiterator.h + src/track/trackmetadata.h + src/track/tracknumbers.h + src/track/trackrecord.h + src/track/trackref.h + src/util/alphabetafilter.h + src/util/assert.h + src/util/battery/battery.h + src/util/cache.h + src/util/circularbuffer.h + src/util/class.h + src/util/cmdlineargs.h + src/util/color/color.h + src/util/color/colorpalette.h + src/util/color/predefinedcolorpalettes.h + src/util/color/rgbcolor.h + src/util/colorcomponents.h + src/util/compatibility/qatomic.h + src/util/compatibility/qbytearray.h + src/util/compatibility/qhash.h + src/util/compatibility/qmutex.h + src/util/console.h + src/util/counter.h + src/util/datetime.h + src/util/db/dbconnection.h + src/util/db/dbconnectionpool.h + src/util/db/dbconnectionpooled.h + src/util/db/dbconnectionpooler.h + src/util/db/dbentity.h + src/util/db/dbfieldindex.h + src/util/db/dbid.h + src/util/db/dbnamedentity.h + src/util/db/fwdsqlquery.h + src/util/db/fwdsqlqueryselectresult.h + src/util/db/sqlite.h + src/util/db/sqllikewildcards.h + src/util/db/sqlqueryfinisher.h + src/util/db/sqlstorage.h + src/util/db/sqlstringformatter.h + src/util/db/sqlsubselectmode.h + src/util/db/sqltransaction.h + src/util/debug.h + src/util/defs.h + src/util/denormalsarezero.h + src/util/desktophelper.h + src/util/dnd.h + src/util/duration.h + src/util/event.h + src/util/experiment.h + src/util/fifo.h + src/util/file.h + src/util/fileaccess.h + src/util/fileinfo.h + src/util/filename.h + src/util/font.h + src/util/fpclassify.h + src/util/gitinfostore.h + src/util/imagefiledata.h + src/util/imageutils.h + src/util/indexrange.h + src/util/itemiterator.h + src/util/lcs.h + src/util/logger.h + src/util/logging.h + src/util/mac.h + src/util/macros.h + src/util/math.h + src/util/memory.h + src/util/messagepipe.h + src/util/movinginterquartilemean.h + src/util/mutex.h + src/util/optional.h + src/util/painterscope.h + src/util/parented_ptr.h + src/util/path.h + src/util/performancetimer.h + src/util/platform.h + src/util/qt.h + src/util/quuid.h + src/util/rampingvalue.h + src/util/rangelist.h + src/util/readaheadsamplebuffer.h + src/util/reference.h + src/util/regex.h + src/util/rescaler.h + src/util/ringdelaybuffer.h + src/util/rotary.h + src/util/runtimeloggingcategory.h + src/util/safelywritablefile.h + src/util/sample.h + src/util/sample_autogen.h + src/util/samplebuffer.h + src/util/sandbox.h + src/util/scopedoverridecursor.h + src/util/screensaver.h + src/util/screensavermanager.h + src/util/semanticversion.h + src/util/singleton.h + src/util/span.h + src/util/stat.h + src/util/statmodel.h + src/util/statsmanager.h + src/util/string.h + src/util/tapfilter.h + src/util/task.h + src/util/taskmonitor.h + src/util/thread_affinity.h + src/util/thread_annotations.h + src/util/threadcputimer.h + src/util/time.h + src/util/timer.h + src/util/trace.h + src/util/translations.h + src/util/types.h + src/util/unique_ptr_vector.h + src/util/valuetransformer.h + src/util/versionstore.h + src/util/widgethelper.h + src/util/workerthread.h + src/util/workerthreadscheduler.h + src/util/xml.h +) if(QML) target_sources(mixxx-lib PRIVATE src/qml/asyncimageprovider.cpp @@ -1327,6 +1485,8 @@ if(UNIX AND NOT APPLE) endif() if(APPLE) + enable_language(OBJC OBJCXX) + # Enable Automatic Reference Counting (ARC) when compiling Objective-C(++). # This frees us from having to worry about memory management when interfacing # with Apple frameworks (e.g. as in itunesmacosimporter.mm) since the compiler @@ -1931,7 +2091,6 @@ add_executable(mixxx-test src/test/wbatterytest.cpp src/test/wpushbutton_test.cpp src/test/wwidgetstack_test.cpp - src/util/moc_included_test.cpp ) find_package(GTest CONFIG REQUIRED) set_target_properties(mixxx-test PROPERTIES AUTOMOC ON) diff --git a/res/skins/Deere/tool_bar.xml b/res/skins/Deere/tool_bar.xml index 5c8c19adab4..d925f7830f7 100644 --- a/res/skins/Deere/tool_bar.xml +++ b/res/skins/Deere/tool_bar.xml @@ -40,7 +40,7 @@ diff --git a/res/skins/Shade/effectrow.xml b/res/skins/Shade/effectrow.xml index 4dc5a27bf50..8c5d65769a4 100644 --- a/res/skins/Shade/effectrow.xml +++ b/res/skins/Shade/effectrow.xml @@ -61,7 +61,7 @@ - [EffectRack1],show + [Skin],show_effectrack visible diff --git a/src/controllers/hid/hiddevice.cpp b/src/controllers/hid/hiddevice.cpp index 49afa6860d6..0d35450853d 100644 --- a/src/controllers/hid/hiddevice.cpp +++ b/src/controllers/hid/hiddevice.cpp @@ -105,9 +105,9 @@ QDebug operator<<(QDebug dbg, const DeviceInfo& deviceInfo) { if (!usage.isEmpty()) { parts.append(QStringLiteral("Usage: ") + usage); } - const QString interface = deviceInfo.formatInterface(); - if (!interface.isEmpty()) { - parts.append(QStringLiteral("Interface: ") + interface); + const QString interfaceId = deviceInfo.formatInterface(); + if (!interfaceId.isEmpty()) { + parts.append(QStringLiteral("Interface: ") + interfaceId); } if (!deviceInfo.manufacturerString().isEmpty()) { parts.append(QStringLiteral("Manufacturer: ") + deviceInfo.manufacturerString()); @@ -129,11 +129,11 @@ QString DeviceCategory::guessFromDeviceInfoImpl( const DeviceInfo& deviceInfo) const { // This should be done somehow else, I know. But at least we get started with // the idea of mapping this information - const QString interface = deviceInfo.formatInterface(); - if (!interface.isEmpty()) { + const QString interfaceId = deviceInfo.formatInterface(); + if (!interfaceId.isEmpty()) { // TODO: Guess linux device types somehow as well // or maybe just fill in the interface number? - return tr("HID Interface %1: ").arg(interface) + deviceInfo.formatUsage(); + return tr("HID Interface %1: ").arg(interfaceId) + deviceInfo.formatUsage(); } if (deviceInfo.usage_page == kGenericDesktopUsagePage) { switch (deviceInfo.usage) { diff --git a/src/coreservices.h b/src/coreservices.h index 34eddbb769e..1b8e1a27936 100644 --- a/src/coreservices.h +++ b/src/coreservices.h @@ -26,7 +26,6 @@ class ControllerManager; class VinylControlManager; class TrackCollectionManager; class Library; -class LV2Backend; namespace mixxx { @@ -82,10 +81,6 @@ class CoreServices : public QObject { return m_pVCManager; } - LV2Backend* getLV2Backend() const { - return m_pLV2Backend; - } - std::shared_ptr getEffectsManager() const { return m_pEffectsManager; } @@ -129,8 +124,6 @@ class CoreServices : public QObject { std::shared_ptr m_pSettingsManager; std::shared_ptr m_pControlIndicatorTimer; std::shared_ptr m_pEffectsManager; - // owned by EffectsManager - LV2Backend* m_pLV2Backend; std::shared_ptr m_pEngine; std::shared_ptr m_pSoundManager; std::shared_ptr m_pPlayerManager; diff --git a/src/preferences/configobject.h b/src/preferences/configobject.h index 1188c719ade..f2a7059b27e 100644 --- a/src/preferences/configobject.h +++ b/src/preferences/configobject.h @@ -219,3 +219,21 @@ template class ConfigObject { // not be opened; otherwise true. bool parse(); }; + +// Specialization must be declared before the first use that would cause +// implicit instantiation, in every translation unit where such use occurs. +// See for +// details. +template<> +template<> +QString ConfigObject::getValue( + const ConfigKey& key, const QString& default_value) const; +template<> +template<> +bool ConfigObject::getValue(const ConfigKey& key, const bool& default_value) const; +template<> +template<> +void ConfigObject::setValue(const ConfigKey& key, const QString& value); +template<> +template<> +void ConfigObject::setValue(const ConfigKey& key, const bool& value); diff --git a/src/preferences/dialog/dlgprefinterface.cpp b/src/preferences/dialog/dlgprefinterface.cpp index 1e6e601cf02..c576d6fff1d 100644 --- a/src/preferences/dialog/dlgprefinterface.cpp +++ b/src/preferences/dialog/dlgprefinterface.cpp @@ -257,14 +257,16 @@ void DlgPrefInterface::slotUpdateSchemes() { } void DlgPrefInterface::slotUpdate() { - const SkinPointer pSkinOnUpdate = m_pSkinLoader->getConfiguredSkin(); - if (pSkinOnUpdate != nullptr && pSkinOnUpdate->isValid()) { - m_skinNameOnUpdate = pSkinOnUpdate->name(); - } else { - m_skinNameOnUpdate = m_pSkinLoader->getDefaultSkinName(); + if (m_pSkinLoader) { + const SkinPointer pSkinOnUpdate = m_pSkinLoader->getConfiguredSkin(); + if (pSkinOnUpdate != nullptr && pSkinOnUpdate->isValid()) { + m_skinNameOnUpdate = pSkinOnUpdate->name(); + } else { + m_skinNameOnUpdate = m_pSkinLoader->getDefaultSkinName(); + } + ComboBoxSkinconf->setCurrentIndex(ComboBoxSkinconf->findText(m_skinNameOnUpdate)); + slotUpdateSchemes(); } - ComboBoxSkinconf->setCurrentIndex(ComboBoxSkinconf->findText(m_skinNameOnUpdate)); - slotUpdateSchemes(); m_localeOnUpdate = m_pConfig->getValue(ConfigKey(kConfigGroup, kLocaleKey)); ComboBoxLocale->setCurrentIndex(ComboBoxLocale->findData(m_localeOnUpdate)); @@ -286,9 +288,11 @@ void DlgPrefInterface::slotUpdate() { } void DlgPrefInterface::slotResetToDefaults() { - int index = ComboBoxSkinconf->findText(m_pSkinLoader->getDefaultSkinName()); - ComboBoxSkinconf->setCurrentIndex(index); - slotSetSkin(index); + if (m_pSkinLoader) { + int index = ComboBoxSkinconf->findText(m_pSkinLoader->getDefaultSkinName()); + ComboBoxSkinconf->setCurrentIndex(index); + slotSetSkin(index); + } // Use System locale ComboBoxLocale->setCurrentIndex(0); @@ -428,8 +432,9 @@ void DlgPrefInterface::slotApply() { } // load skin/scheme if necessary - if (m_pSkin->name() != m_skinNameOnUpdate || - m_colorScheme != m_colorSchemeOnUpdate) { + if (m_pSkin && + (m_pSkin->name() != m_skinNameOnUpdate || + m_colorScheme != m_colorSchemeOnUpdate)) { // ColorSchemeParser::setupLegacyColorSchemes() reads scheme from config emit reloadUserInterface(); // Allow switching skins multiple times without closing the dialog diff --git a/src/soundio/soundmanagerutil.cpp b/src/soundio/soundmanagerutil.cpp index 4dd936ce591..eda1d05a16f 100644 --- a/src/soundio/soundmanagerutil.cpp +++ b/src/soundio/soundmanagerutil.cpp @@ -2,14 +2,12 @@ #include "engine/channels/enginechannel.h" -using mixxx::audio::ChannelCount; - /** * Constructs a ChannelGroup. * @param channelBase the first channel in the group. * @param channels the number of channels. */ -ChannelGroup::ChannelGroup(unsigned char channelBase, ChannelCount channels) +ChannelGroup::ChannelGroup(unsigned char channelBase, mixxx::audio::ChannelCount channels) : m_channelBase(channelBase), m_channels(channels) { } @@ -23,7 +21,7 @@ unsigned char ChannelGroup::getChannelBase() const { /** * @return The number of channels in this ChannelGroup */ -ChannelCount ChannelGroup::getChannelCount() const { +mixxx::audio::ChannelCount ChannelGroup::getChannelCount() const { return m_channels; } @@ -233,19 +231,19 @@ AudioPathType AudioPath::getTypeFromInt(int typeInt) { } // static -ChannelCount AudioPath::minChannelsForType(AudioPathType type) { +mixxx::audio::ChannelCount AudioPath::minChannelsForType(AudioPathType type) { switch (type) { case AudioPathType::VinylControl: - return ChannelCount::stereo(); + return mixxx::audio::ChannelCount::stereo(); default: - return ChannelCount::mono(); + return mixxx::audio::ChannelCount::mono(); } } // static -ChannelCount AudioPath::maxChannelsForType(AudioPathType type) { +mixxx::audio::ChannelCount AudioPath::maxChannelsForType(AudioPathType type) { Q_UNUSED(type); - return ChannelCount::stereo(); + return mixxx::audio::ChannelCount::stereo(); } /** @@ -253,7 +251,7 @@ ChannelCount AudioPath::maxChannelsForType(AudioPathType type) { */ AudioOutput::AudioOutput(AudioPathType type, unsigned char channelBase, - ChannelCount channels, + mixxx::audio::ChannelCount channels, unsigned char index) : AudioPath(channelBase, channels) { // TODO(rryan): This is a virtual function call from a constructor. @@ -286,13 +284,14 @@ AudioOutput AudioOutput::fromXML(const QDomElement &xml) { AudioPathType type(AudioPath::getTypeFromString(xml.attribute("type"))); unsigned int index(xml.attribute("index", "0").toUInt()); unsigned int channel(xml.attribute("channel", "0").toUInt()); - auto channels = ChannelCount::fromInt(xml.attribute("channel_count", "0").toInt()); + auto channels = mixxx::audio::ChannelCount::fromInt( + xml.attribute("channel_count", "0").toInt()); // In Mixxx < 1.12.0 we didn't save channels to file since they directly // corresponded to the type. To migrate users over, use mono for all // microphones and stereo for everything else since previously microphone // inputs were the only mono AudioPath. if (!channels.isValid()) { - channels = ChannelCount::stereo(); + channels = mixxx::audio::ChannelCount::stereo(); } return AudioOutput(type, channel, channels, index); } @@ -330,7 +329,7 @@ void AudioOutput::setType(AudioPathType type) { */ AudioInput::AudioInput(AudioPathType type, unsigned char channelBase, - ChannelCount channels, + mixxx::audio::ChannelCount channels, unsigned char index) : AudioPath(channelBase, channels) { // TODO(rryan): This is a virtual function call from a constructor. @@ -367,14 +366,15 @@ AudioInput AudioInput::fromXML(const QDomElement &xml) { AudioPathType type(AudioPath::getTypeFromString(xml.attribute("type"))); unsigned int index(xml.attribute("index", "0").toUInt()); unsigned int channel(xml.attribute("channel", "0").toUInt()); - auto channels = ChannelCount::fromInt(xml.attribute("channel_count", "0").toInt()); + auto channels = mixxx::audio::ChannelCount::fromInt( + xml.attribute("channel_count", "0").toInt()); // In Mixxx <1.12.0 we didn't save channels to file since they directly // corresponded to the type. To migrate users over, use mono for all // microphones and stereo for everything else since previously microphone // inputs were the only mono AudioPath. if (!channels.isValid()) { - channels = type == AudioPathType::Microphone ? ChannelCount::mono() - : ChannelCount::stereo(); + channels = type == AudioPathType::Microphone ? mixxx::audio::ChannelCount::mono() + : mixxx::audio::ChannelCount::stereo(); } return AudioInput(type, channel, channels, index); } diff --git a/src/test/coreservicestest.cpp b/src/test/coreservicestest.cpp index 45197f5d5f1..d1769f8acb6 100644 --- a/src/test/coreservicestest.cpp +++ b/src/test/coreservicestest.cpp @@ -22,7 +22,6 @@ TEST_F(CoreServicesTest, DISABLED_TestInitialization) { EXPECT_NE(pCoreServices->getControllerManager(), nullptr); EXPECT_NE(pCoreServices->getEffectsManager(), nullptr); - EXPECT_NE(pCoreServices->getLV2Backend(), nullptr); EXPECT_NE(pCoreServices->getLibrary(), nullptr); EXPECT_NE(pCoreServices->getPlayerManager(), nullptr); EXPECT_NE(pCoreServices->getScreensaverManager(), nullptr); diff --git a/src/util/moc_included_test.cpp b/src/util/moc_included_test.cpp deleted file mode 100644 index 605693a25e5..00000000000 --- a/src/util/moc_included_test.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "../mocs_compilation.cpp" - -// QT_VERSION will be defined by any moc_.cpp file included from mocs_compilation.cpp -// It is empty in case all moc files are included, a requirement to speed up incremental builds. -// See https://cmake.org/cmake/help/latest/prop_tgt/AUTOMOC.html for details. -#ifdef QT_VERSION -#error mocs_compilation.cpp not empty. Move all #include "moc_.cpp" lines from mocs_compilation.cpp to the cpp files of the related classes. -#endif