diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index e1f6e70933d..87e7b66f1c1 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -8,33 +8,48 @@ jobs: pre-commit: name: Detecting code style issues runs-on: ubuntu-latest - if: github.event_name == 'push' steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - name: "Check out repository" + uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - name: "Set up Python" + uses: actions/setup-python@v2 + - name: Install clang-format run: sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-format-10 - - uses: pre-commit/action@v2.0.0 + + - name: "Detect code style issues (push)" + uses: pre-commit/action@v2.0.0 + if: github.event_name == 'push' # There are too many files in the repo that have formatting issues. We'll # disable these checks for now when pushing directly (but still run these # on Pull Requests!). env: SKIP: end-of-file-fixer,trailing-whitespace,clang-format,eslint,no-commit-to-branch - pre-commit-pr: - name: Detecting code style issues - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 2 - - uses: actions/setup-python@v2 - - name: Install clang-format - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-format-10 - - uses: pre-commit/action@v2.0.0 + + - name: "Detect code style issues (pull_request)" + uses: pre-commit/action@v2.0.0 + if: github.event_name == 'pull_request' env: SKIP: no-commit-to-branch with: # HEAD is the not yet integrated PR merge commit +refs/pull/xxxx/merge # HEAD^1 is the PR target branch and HEAD^2 is the HEAD of the source branch extra_args: --from-ref HEAD^1 --to-ref HEAD + + - name: "Generate patch file" + if: failure() + run: | + git diff-index -p HEAD > "${PATCH_FILE}" + [ -s "${PATCH_FILE}" ] && echo "UPLOAD_PATCH_FILE=${PATCH_FILE}" >> "${GITHUB_ENV}" + env: + PATCH_FILE: pre-commit.patch + + - name: "Upload patch artifact" + if: failure() && env.UPLOAD_PATCH_FILE != null + uses: actions/upload-artifact@v2 + with: + name: ${{ env.UPLOAD_PATCH_FILE }} + path: ${{ env.UPLOAD_PATCH_FILE }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be362dd1030..37b908690c8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,7 +47,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.3.0 hooks: - - id: check-byte-order-marker + - id: fix-byte-order-marker exclude: ^.*(\.cbproj|\.groupproj|\.props|\.sln|\.vcxproj|\.vcxproj.filters)$ - id: check-case-conflict - id: check-json diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c6d9c1a23ba..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,261 +0,0 @@ -# Enable build config validation (opt-in) -version: ~> 1.0 - -# Default build environment -os: linux -dist: bionic - -# Default programming language -language: cpp - -# Build flags common to OS X and Linux. -# Parallel builds are important for avoiding OSX build timeouts. -# We turn off verbose output to avoid going over the 4MB output limit. -env: - global: - # For SCons builds - - SCONSFLAGS="battery=1 bulk=1 debug_assertions_fatal=1 hid=1 hss1394=0 lilv=1 opus=1 qtkeychain=1 shoutcast=1 test=1 verbose=0 vinylcontrol=1 virtualize=0" - # For CMake builds - # TODO: Set -DDEBUG_ASSERTIONS_FATAL=OFF before deploying CI builds as releases!!! - - CMAKEFLAGS="-DCMAKE_BUILD_TYPE=Release -DBATTERY=ON -DBROADCAST=ON -DBULK=ON -DDEBUG_ASSERTIONS_FATAL=ON -DHID=ON -DLILV=ON -DOPUS=ON -DQTKEYCHAIN=ON -DVINYLCONTROL=ON -DENGINEPRIME=ON" - - GTEST_COLOR=1 - - CTEST_OUTPUT_ON_FAILURE=1 - # Render analyzer waveform tests to an offscreen buffer - - QT_QPA_PLATFORM=offscreen - # DOWNLOADS_HOSTGATOR_DOT_MIXXX_DOT_ORG_KEY_PASSWORD for deploys. - - secure: aS40s8gx1mM01oRj2pskFqR+rBID1nnTY7hwSqkT1bgJT+JF0tMZt/SkMjR08bp+3soNbBtqJgZKAhQ6Tts2DtkWQGbUiXgU5QpowUcecTxge/jqxZeWdJWThpB+qWs70Fm0QhzZXIyBPM8EGljWbLum5ncR7AUBEasRboNZ0P8= - # Code signing secrets: - - MACOS_CODESIGN_CERTIFICATE=cmake/macos_developer_id_codesign_certificate.p12 - # MACOS_CODESIGN_CERTIFICATE_PASSWORD: - - secure: MnQzTJBkeHsRkNov7yoNIlEM5Exo6JvdmRS+z6OPQFuJn+yc8WyeUrW2JhVtVsGFO/fCqcIyymIOSFIEz78eoRj1PL0w2tj3ptBqUAJWupP2mmobKcPY3NYTOhOmOsv8rqlJbPdLxop1pyLaLBFWyGKOgI2xJz8LPHGN5ZINfCY= - # MACOS_CODESIGN_OPENSSL_PASSWORD: - - secure: NJegC0Dag0V8hotFB7u3rSPGnGQzp0JQpRTH1qL8bveUmrTOL26viPeX4vLXwn/RJKZkuUsDBxDSFy/sfVvfaLdAgd5USOV9QLF7lc3z1+t4BWbZ4xDBXCYOWuaQlgqE1k5W7s9wl1DgDFNxBSc46X04h9BZNonz1z0A9IAhn+k= - - # To add a new secret, run: - # $ travis encrypt MY_SECRET=hunter2 -r mixxxdj/mixxx - # and add the new encrypted secret here. - # It will be available as the environment variable ${MY_SECRET} during non-PR builds. - - # DOWNLOADS_HOSTGATOR_DOT_MIXXX_DOT_ORG_KEY_PASSWORD for deploys. - - secure: aS40s8gx1mM01oRj2pskFqR+rBID1nnTY7hwSqkT1bgJT+JF0tMZt/SkMjR08bp+3soNbBtqJgZKAhQ6Tts2DtkWQGbUiXgU5QpowUcecTxge/jqxZeWdJWThpB+qWs70Fm0QhzZXIyBPM8EGljWbLum5ncR7AUBEasRboNZ0P8= - # CACHIX_SIGNING_KEY for cachix deploys. - - secure: NSL5IoCb1+Sh4T3KP50y1qWZ+8+wRetupQDHY6fCmF1tlWSTtBxQIYGBTeE1iTFe8kJPv8CcgQ6HlNh7ss0s152gqhAbpVbq0thAtqL0qt6DFO3tyhA6tYxoOcf6DN+4qQG0A1EVqhFEhB3iWzWWA9PkJrzLV7FLt1kbxoFt1Zg= - -jobs: - include: - - name: Ubuntu/gcc/SCons build - compiler: gcc - # Ubuntu Bionic build prerequisites - before_install: - - sudo apt install -y scons - install: - # TODO for Ubuntu Focal: faad=0 ffmpeg=1 - - scons -j "$(nproc)" faad=1 ffmpeg=0 localecompare=1 mad=1 modplug=1 wv=1 - script: - # NOTE(sblaisot): 2018-01-02 removing gdb wrapper on linux due to a bug in - # return code in order to avoid having a successful build when a test fail. - # https://bugs.launchpad.net/mixxx/+bug/1699689 - - ./mixxx-test --logLevel info - - - name: Ubuntu/gcc/CMake build - compiler: gcc - cache: ccache - # Ubuntu Bionic build prerequisites - # TODO for Ubuntu Focal: Replace "-DFAAD=ON" with "-DFFMPEG=ON" - env: CMAKEFLAGS_EXTRA="-DFAAD=ON -DKEYFINDER=ON -DLOCALECOMPARE=ON -DMAD=ON -DMODPLUG=ON -DWAVPACK=ON -DWARNINGS_FATAL=ON" - before_install: - - export CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)" - - export CTEST_PARALLEL_LEVEL="$(nproc)" - - export PATH="$HOME/.local/bin:$PATH" - - pip install --user cmake - - cmake --version - - ccache -s - install: - - mkdir cmake_build - - cd cmake_build - - cmake -L $CMAKEFLAGS $CMAKEFLAGS_EXTRA .. - - cmake --build . - - cpack -G DEB - script: - # Run tests and benchmarks - - ctest --timeout 45 - - cmake --build . --target benchmark - - - name: OSX/clang/SCons build - os: osx - # The XCode version should match that on the build server! - osx_image: xcode9.4 - compiler: clang - cache: - directories: - - $HOME/Library/Caches/Homebrew - - /usr/local/Homebrew - addons: - homebrew: - update: true - packages: - - chromaprint - - flac - - lame - - libsndfile - - libogg - - libvorbis - - libshout - - libid3tag - - libmad - - lilv - - opusfile - - portaudio - - portmidi - - protobuf - - qt5 - - qtkeychain - - rubberband - - sound-touch - - taglib - # Workaround for bug in libopus's opus.h including - # instead of . - env: >- - CFLAGS="-isystem /usr/local/include/opus" - CXXFLAGS="-isystem /usr/local/include/opus" - before_install: - - brew install scons - - export QTDIR="$(find /usr/local/Cellar/qt -d 1 | tail -n 1)" - - echo "QTDIR=$QTDIR" - install: - # We are hardcoding 4 threads here since "$(sysctl -n hw.ncpu)" only - # returns 2 and makes the travis job run into a timeout: - # https://docs.travis-ci.com/user/reference/overview/#virtualization-environments - - scons -j4 coreaudio=1 - script: - # lldb doesn't provide an easy way to exit 1 on error: - # https://bugs.llvm.org/show_bug.cgi?id=27326 - - lldb ./mixxx-test --batch -o run -o quit -k 'thread backtrace all' -k "script import os; os._exit(1)" -- --logLevel info - before_cache: - # Avoid indefinite cache growth - - brew cleanup - # Cache only .git files under "/usr/local/Homebrew" so "brew update" - # does not take 5min every build - # Source: https://discourse.brew.sh/t/best-practice-for-homebrew-on-travis-brew-update-is-5min-to-build-time/5215/12 - - find /usr/local/Homebrew \! -regex ".+\.git.+" -delete - - - name: OSX/clang/CMake build - os: osx - # The XCode version should match that on the build server! - osx_image: xcode9.4 - compiler: clang - cache: - ccache: true - directories: - - $HOME/Library/Caches/Homebrew - - /usr/local/Homebrew - # Workaround for bug in libopus's opus.h including - # instead of . - # Virtual X (Xvfb) is needed for analyzer waveform tests - addons: - homebrew: - update: true - packages: - - ccache - env: >- - MIXXX_ENVPATH="${HOME}/buildenv" - CMAKEFLAGS_EXTRA="-DCOREAUDIO=ON -DHSS1394=ON" - PATH="/usr/local/opt/ccache/bin:$PATH" - CMAKE_BUILD_PARALLEL_LEVEL=4 - CTEST_PARALLEL_LEVEL=1 - before_install: - # Print some information about CMake and ccache - - cmake --version - - ccache -s - # Download and prepare our build environment - - mkdir "${MIXXX_ENVPATH}" - - read -r MIXXX_ENVNAME < build/osx/golden_environment - - curl "https://downloads.mixxx.org/builds/buildserver/2.3.x-macosx/${MIXXX_ENVNAME}.tar.gz" | tar xzf - --strip 1 -C "${MIXXX_ENVPATH}" - # FIXME: This fixes some wrong hardcoded paths inside pkg-config files of the build environment (e.g. in "lib/pkgconfig/taglib.pc") - # This will only work if neither MIXXX_ENVNAME nor MIXXX_ENVPATH contain special regex characters! - - find "${MIXXX_ENVPATH}" -name "*.pc" -or -path "*/bin/taglib-config" -exec sed -i".orig" -e "s|/Users/mixxx/bs-2.3-mac/amd64/environment/${MIXXX_ENVNAME}|${MIXXX_ENVPATH}|g" {} \; - - export QT_DIR="$(find "${MIXXX_ENVPATH}" -type d -path "*/cmake/Qt5")" - - export QT_QPA_PLATFORM_PLUGIN_PATH="$(find "${MIXXX_ENVPATH}" -type d -path "*/plugins")" - - | - if [ "$TRAVIS_REPO_SLUG" = "mixxxdj/mixxx" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then - # Create a temporary keychain for the certificate and import it. - openssl enc -aes-256-cbc -d -md sha512 -k ${MACOS_CODESIGN_OPENSSL_PASSWORD} -in ${MACOS_CODESIGN_CERTIFICATE}.enc -out ${MACOS_CODESIGN_CERTIFICATE}; - security create-keychain -p mixxx Mixxx.keychain; - security unlock-keychain -p mixxx Mixxx.keychain; - security import ${MACOS_CODESIGN_CERTIFICATE} -k Mixxx.keychain -P ${MACOS_CODESIGN_CERTIFICATE_PASSWORD} -T /usr/bin/codesign; - security set-key-partition-list -S apple-tool:,apple: -k mixxx Mixxx.keychain - # Add keychain to search list - security list-keychains -s Mixxx.keychain; - export APPLE_CODESIGN_IDENTITY=2C2B5D3EDCE82BA55E22E9A67F16F8D03E390870; - fi - - install: - - mkdir cmake_build - - cd cmake_build - - cmake -L $CMAKEFLAGS $CMAKEFLAGS_EXTRA -DMACOS_BUNDLE=ON -DCMAKE_PREFIX_PATH=${MIXXX_ENVPATH} -DQt5_DIR=${QT_DIR} -DAPPLE_CODESIGN_IDENTITY=${APPLE_CODESIGN_IDENTITY} .. - - cmake --build . - - cpack -G DragNDrop -V - # cpack codesigns the Mixxx.app inside the DMG package, but the DMG package also needs to be signed - - | - if ! [ -z $APPLE_CODESIGN_IDENTITY ]; then - codesign --verbose=4 --deep --force --options runtime --sign $APPLE_CODESIGN_IDENTITY --entitlements ../build/osx/entitlements.plist *.dmg; - fi - script: - # Run tests and benchmarks - - ctest --timeout 45 - - cmake --build . --target benchmark - before_cache: - # Cache only .git files under "/usr/local/Homebrew" so "brew update" - # does not take 5min every build - # Source: https://discourse.brew.sh/t/best-practice-for-homebrew-on-travis-brew-update-is-5min-to-build-time/5215/12 - - find /usr/local/Homebrew \! -regex ".+\.git.+" -delete - -git: - depth: 1 - -# Common Addons -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - libavformat-dev - - libchromaprint-dev - - libebur128-dev - - libfaad-dev - - libfftw3-dev - - libflac-dev - - libid3tag0-dev - - liblilv-dev - - libmad0-dev - - libmodplug-dev - - libmp3lame-dev - - libmp4v2-dev - - libopus-dev - - libopusfile-dev - - libportmidi-dev - - libprotobuf-dev - - libqt5opengl5-dev - - libqt5sql5-sqlite - - libqt5svg5-dev - - libqt5x11extras5-dev - - librubberband-dev - - libshout3-dev - - libsndfile1-dev - - libsoundtouch-dev - - libsqlite3-dev - - libtag1-dev - - libupower-glib-dev - - libusb-1.0-0-dev - - libwavpack-dev - - portaudio19-dev - - protobuf-compiler - - qt5-default - - qtdeclarative5-dev - - qtscript5-dev - - qt5keychain-dev - - -notifications: - webhooks: - - https://mixxx.zulipchat.com/api/v1/external/travis?stream=travis&topic=build-status&api_key=$ZULIP_API_KEY diff --git a/CMakeLists.txt b/CMakeLists.txt index d24deb1e89d..a69206e1300 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1017,6 +1017,17 @@ if(APPLE) endif() endif() +# Windows-specific options +if(WIN32) + # https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt + # _WIN32_WINNT_WIN7 = 0x0601 + target_compile_definitions(mixxx-lib PUBLIC WINVER=0x0601) + target_compile_definitions(mixxx-lib PUBLIC _WIN32_WINNT=0x0601) + if(MSVC) + target_compile_definitions(mixxx-lib PUBLIC _USE_MATH_DEFINES) + endif() +endif() + # # Installation directories # @@ -1034,18 +1045,14 @@ if (APPLE AND MACOS_BUNDLE) elseif (UNIX) include(GNUInstallDirs) set(MIXXX_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}") - set(MIXXX_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/mixxx") - set(MIXXX_INSTALL_DOCDIR "${CMAKE_INSTALL_DOCDIR}/mixxx") - set(MIXXX_INSTALL_LICENSEDIR "${CMAKE_INSTALL_DATADIR}/licenses/mixxx") + set(MIXXX_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}") + set(MIXXX_INSTALL_DOCDIR "${CMAKE_INSTALL_DOCDIR}") + set(MIXXX_INSTALL_LICENSEDIR "${CMAKE_INSTALL_DOCDIR}") endif() if(WIN32) target_compile_definitions(mixxx-lib PRIVATE __WINDOWS__) - # Restrict ATL to XP-compatible SDK functions. - # TODO(rryan): Remove once we ditch XP support. - target_compile_definitions(mixxx-lib PUBLIC _ATL_XP_TARGETING) - # Helps prevent duplicate symbols target_compile_definitions(mixxx-lib PUBLIC _ATL_MIN_CRT) @@ -1215,7 +1222,7 @@ install( install( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/res/fonts" - "DESTINATION" + DESTINATION "${MIXXX_INSTALL_DATADIR}" ) @@ -1433,6 +1440,12 @@ gtest_add_tests( WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" TEST_LIST testsuite ) +if (NOT WIN32) + # Default to offscreen rendering during tests. + # This is required if the build system like Fedora koji/mock does not + # allow to pass environment variables into the ctest macro expansion. + set_tests_properties(${testsuite} PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=offscreen") +endif() # Benchmarking add_custom_target(mixxx-benchmark @@ -1651,6 +1664,7 @@ endif() add_library(fidlib STATIC EXCLUDE_FROM_ALL lib/fidlib/fidlib.c) if(MSVC) target_compile_definitions(fidlib PRIVATE T_MSVC) + target_compile_definitions(fidlib PRIVATE _USE_MATH_DEFINES) elseif(MINGW) target_compile_definitions(fidlib PRIVATE T_MINGW) else() @@ -2004,7 +2018,7 @@ elseif(MSVC) # http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx We could define this # in our headers but then include order matters since headers we don't control # may include cmath first. - target_compile_definitions(QueenMaryDsp PUBLIC _USE_MATH_DEFINES) + target_compile_definitions(QueenMaryDsp PRIVATE _USE_MATH_DEFINES) endif() target_include_directories(QueenMaryDsp SYSTEM PUBLIC lib/qm-dsp lib/qm-dsp/include) target_link_libraries(mixxx-lib PUBLIC QueenMaryDsp) @@ -2018,6 +2032,9 @@ target_link_libraries(mixxx-lib PRIVATE ReplayGain) # Reverb add_library(Reverb STATIC EXCLUDE_FROM_ALL lib/reverb/Reverb.cc) +if(MSVC) + target_compile_definitions(Reverb PRIVATE _USE_MATH_DEFINES) +endif() target_include_directories(Reverb PRIVATE src) target_link_libraries(Reverb PUBLIC Qt5::Core) target_include_directories(mixxx-lib SYSTEM PRIVATE lib/reverb) diff --git a/lib/fidlib/fidlib.c b/lib/fidlib/fidlib.c index 8dcef23b017..3f4678eef5e 100644 --- a/lib/fidlib/fidlib.c +++ b/lib/fidlib/fidlib.c @@ -248,10 +248,6 @@ #include #include "fidlib.h" -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - extern FidFilter *mkfilter(char *, ...); // diff --git a/lib/fidlib/fidmkf.h b/lib/fidlib/fidmkf.h index 687abb547a5..5b1c8462025 100644 --- a/lib/fidlib/fidmkf.h +++ b/lib/fidlib/fidmkf.h @@ -139,10 +139,7 @@ #endif #endif -//Hacks for crappy linker error in MSVC... - Albert #ifdef T_MSVC - #undef HUGE_VAL - #define HUGE_VAL 1.797693134862315E+308 #define INF HUGE_VAL #endif diff --git a/lib/reverb/basics.h b/lib/reverb/basics.h index 8fe92b68faf..bae7aa1daba 100644 --- a/lib/reverb/basics.h +++ b/lib/reverb/basics.h @@ -32,8 +32,6 @@ #ifndef BASICS_H #define BASICS_H -// NOTE(rryan): 3/2014 Added for MSVC support. (missing M_PI) -#define _USE_MATH_DEFINES #include #include diff --git a/src/analyzer/analyzerbeats.h b/src/analyzer/analyzerbeats.h index e0667149e61..1169fd0436a 100644 --- a/src/analyzer/analyzerbeats.h +++ b/src/analyzer/analyzerbeats.h @@ -5,8 +5,7 @@ * Author: Vittorio Colao */ -#ifndef ANALYZER_ANALYZERBEATS_H -#define ANALYZER_ANALYZERBEATS_H +#pragma once #include #include @@ -53,5 +52,3 @@ class AnalyzerBeats : public Analyzer { int m_iCurrentSample; int m_iMinBpm, m_iMaxBpm; }; - -#endif /* ANALYZER_ANALYZERBEATS_H */ diff --git a/src/analyzer/analyzerebur128.h b/src/analyzer/analyzerebur128.h index d725f31eb66..5cc794425d1 100644 --- a/src/analyzer/analyzerebur128.h +++ b/src/analyzer/analyzerebur128.h @@ -1,5 +1,4 @@ -#ifndef ANALYZER_ANALYZEREBUR128_H_ -#define ANALYZER_ANALYZEREBUR128_H_ +#pragma once #include @@ -24,5 +23,3 @@ class AnalyzerEbur128 : public Analyzer { ReplayGainSettings m_rgSettings; ebur128_state* m_pState; }; - -#endif /* ANALYZER_ANALYZEREBUR128_H_ */ diff --git a/src/analyzer/analyzergain.h b/src/analyzer/analyzergain.h index dbe426b919d..ddc2d6df578 100644 --- a/src/analyzer/analyzergain.h +++ b/src/analyzer/analyzergain.h @@ -5,8 +5,7 @@ * Author: Vittorio Colao * */ -#ifndef ANALYZER_ANALYZERGAIN_H -#define ANALYZER_ANALYZERGAIN_H +#pragma once #include "analyzer/analyzer.h" #include "preferences/replaygainsettings.h" @@ -34,5 +33,3 @@ class AnalyzerGain : public Analyzer { ReplayGain* m_pReplayGain; int m_iBufferSize; }; - -#endif /* ANALYZER_ANALYZERGAIN_H */ diff --git a/src/analyzer/analyzerkey.h b/src/analyzer/analyzerkey.h index b25fec8b072..504df21705a 100644 --- a/src/analyzer/analyzerkey.h +++ b/src/analyzer/analyzerkey.h @@ -1,5 +1,4 @@ -#ifndef ANALYZER_ANALYZERKEY_H -#define ANALYZER_ANALYZERKEY_H +#pragma once #include #include @@ -43,5 +42,3 @@ class AnalyzerKey : public Analyzer { bool m_bPreferencesFastAnalysisEnabled; bool m_bPreferencesReanalyzeEnabled; }; - -#endif /* ANALYZER_ANALYZERKEY_H */ diff --git a/src/analyzer/analyzerthread.cpp b/src/analyzer/analyzerthread.cpp index b561529e66a..2402ab27349 100644 --- a/src/analyzer/analyzerthread.cpp +++ b/src/analyzer/analyzerthread.cpp @@ -11,6 +11,7 @@ #include "analyzer/constants.h" #include "engine/engine.h" #include "library/dao/analysisdao.h" +#include "moc_analyzerthread.cpp" #include "sources/audiosourcestereoproxy.h" #include "sources/soundsourceproxy.h" #include "track/track.h" diff --git a/src/analyzer/analyzerwaveform.h b/src/analyzer/analyzerwaveform.h index 86b13f2c262..03089261b2b 100644 --- a/src/analyzer/analyzerwaveform.h +++ b/src/analyzer/analyzerwaveform.h @@ -1,5 +1,4 @@ -#ifndef ANALYZER_ANALYZERWAVEFORM_H -#define ANALYZER_ANALYZERWAVEFORM_H +#pragma once #include #include @@ -178,5 +177,3 @@ class AnalyzerWaveform : public Analyzer { QImage* test_heatMap; #endif }; - -#endif /* ANALYZER_ANALYZERWAVEFORM_H */ diff --git a/src/analyzer/plugins/analyzerplugin.h b/src/analyzer/plugins/analyzerplugin.h index 872e8bda928..03bb7ac2d6f 100644 --- a/src/analyzer/plugins/analyzerplugin.h +++ b/src/analyzer/plugins/analyzerplugin.h @@ -1,5 +1,4 @@ -#ifndef ANALYZER_PLUGINS_ANALYZERPLUGIN_H -#define ANALYZER_PLUGINS_ANALYZERPLUGIN_H +#pragma once #include @@ -66,5 +65,3 @@ class AnalyzerKeyPlugin : public AnalyzerPlugin { }; } // namespace mixxx - -#endif /* ANALYZER_PLUGINS_ANALYZERPLUGIN_H */ diff --git a/src/analyzer/plugins/analyzerqueenmarybeats.h b/src/analyzer/plugins/analyzerqueenmarybeats.h index bdc525bd732..5dc70ae85c9 100644 --- a/src/analyzer/plugins/analyzerqueenmarybeats.h +++ b/src/analyzer/plugins/analyzerqueenmarybeats.h @@ -1,5 +1,4 @@ -#ifndef ANALYZER_PLUGINS_ANALYZERQUEENMARYBEATS_H -#define ANALYZER_PLUGINS_ANALYZERQUEENMARYBEATS_H +#pragma once #include @@ -56,5 +55,3 @@ class AnalyzerQueenMaryBeats : public AnalyzerBeatsPlugin { }; } // namespace mixxx - -#endif /* ANALYZER_PLUGINS_ANALYZERQUEENMARYBEATS_H */ diff --git a/src/analyzer/plugins/analyzerqueenmarykey.h b/src/analyzer/plugins/analyzerqueenmarykey.h index 253688b1cfe..ea9d014f6fc 100644 --- a/src/analyzer/plugins/analyzerqueenmarykey.h +++ b/src/analyzer/plugins/analyzerqueenmarykey.h @@ -1,5 +1,4 @@ -#ifndef ANALYZER_PLUGINS_ANALYZERQUEENMARYKEY_H -#define ANALYZER_PLUGINS_ANALYZERQUEENMARYKEY_H +#pragma once #include @@ -50,5 +49,3 @@ class AnalyzerQueenMaryKey : public AnalyzerKeyPlugin { }; } // namespace mixxx - -#endif /* ANALYZER_PLUGINS_ANALYZERQUEENMARYKEY_H */ diff --git a/src/analyzer/plugins/analyzersoundtouchbeats.h b/src/analyzer/plugins/analyzersoundtouchbeats.h index ec495e58a5f..1c8e26a359b 100644 --- a/src/analyzer/plugins/analyzersoundtouchbeats.h +++ b/src/analyzer/plugins/analyzersoundtouchbeats.h @@ -1,5 +1,4 @@ -#ifndef ANALYZER_PLUGINS_ANALYZERSOUNDTOUCHBEATS -#define ANALYZER_PLUGINS_ANALYZERSOUNDTOUCHBEATS +#pragma once #include @@ -49,5 +48,3 @@ class AnalyzerSoundTouchBeats : public AnalyzerBeatsPlugin { }; } // namespace mixxx - -#endif /* ANALYZER_PLUGINS_ANALYZERSOUNDTOUCHBEATS */ diff --git a/src/analyzer/trackanalysisscheduler.cpp b/src/analyzer/trackanalysisscheduler.cpp index 876b6e49639..f4c639a89d1 100644 --- a/src/analyzer/trackanalysisscheduler.cpp +++ b/src/analyzer/trackanalysisscheduler.cpp @@ -2,10 +2,9 @@ #include "library/library.h" #include "library/trackcollection.h" - +#include "moc_trackanalysisscheduler.cpp" #include "util/logger.h" - namespace { mixxx::Logger kLogger("TrackAnalysisScheduler"); diff --git a/src/broadcast/broadcastmanager.cpp b/src/broadcast/broadcastmanager.cpp index 0831d806cf6..18a9801b8ef 100644 --- a/src/broadcast/broadcastmanager.cpp +++ b/src/broadcast/broadcastmanager.cpp @@ -7,15 +7,15 @@ #undef WIN32 #endif +#include "broadcast/broadcastmanager.h" #include "broadcast/defs_broadcast.h" #include "engine/enginemaster.h" #include "engine/sidechain/enginenetworkstream.h" #include "engine/sidechain/enginesidechain.h" +#include "moc_broadcastmanager.cpp" #include "soundio/soundmanager.h" #include "util/logger.h" -#include "broadcast/broadcastmanager.h" - namespace { const mixxx::Logger kLogger("BroadcastManager"); } diff --git a/src/broadcast/broadcastmanager.h b/src/broadcast/broadcastmanager.h index fc037a407c7..75479e3bf69 100644 --- a/src/broadcast/broadcastmanager.h +++ b/src/broadcast/broadcastmanager.h @@ -1,5 +1,4 @@ -#ifndef BROADCAST_BROADCASTMANAGER_H -#define BROADCAST_BROADCASTMANAGER_H +#pragma once #include @@ -56,5 +55,3 @@ class BroadcastManager : public QObject { ControlPushButton* m_pBroadcastEnabled; ControlObject* m_pStatusCO; }; - -#endif /* BROADCAST_BROADCASTMANAGER_H */ diff --git a/src/broadcast/defs_broadcast.h b/src/broadcast/defs_broadcast.h index ad966b58a42..db0bf87f355 100644 --- a/src/broadcast/defs_broadcast.h +++ b/src/broadcast/defs_broadcast.h @@ -1,5 +1,4 @@ -#ifndef DEFS_BROADCAST_H -#define DEFS_BROADCAST_H +#pragma once // NOTE(rryan): Do not change this from [Shoutcast] unless you also put upgrade // logic in src/preferences/upgrade.h. @@ -34,5 +33,3 @@ // the workers are then performed on thread-safe QSharedPointers and not // onto the thread-unsafe QVector #define BROADCAST_MAX_CONNECTIONS 16 - -#endif /* DEFS_BROADCAST_H */ diff --git a/src/build.h.template b/src/build.h.template index 96634ff1b65..c1be0911707 100644 --- a/src/build.h.template +++ b/src/build.h.template @@ -1,7 +1,4 @@ -#ifndef BUILD_H -#define BUILD_H +#pragma once #define BUILD_BRANCH "@GIT_BRANCH@" #define BUILD_REV "@GIT_COMMIT_COUNT@" - -#endif // BUILD_H diff --git a/src/control/control.cpp b/src/control/control.cpp index 6f988913f39..5ea6a51dad5 100644 --- a/src/control/control.cpp +++ b/src/control/control.cpp @@ -1,6 +1,7 @@ #include "control/control.h" #include "control/controlobject.h" +#include "moc_control.cpp" #include "util/stat.h" //static diff --git a/src/control/controlaudiotaperpot.cpp b/src/control/controlaudiotaperpot.cpp index 9264b67774c..f98a37539ef 100644 --- a/src/control/controlaudiotaperpot.cpp +++ b/src/control/controlaudiotaperpot.cpp @@ -1,6 +1,7 @@ - #include "control/controlaudiotaperpot.h" +#include "moc_controlaudiotaperpot.cpp" + ControlAudioTaperPot::ControlAudioTaperPot(const ConfigKey& key, double minDB, double maxDB, diff --git a/src/control/controlaudiotaperpot.h b/src/control/controlaudiotaperpot.h index 8c16262d6fc..afbc59ad57f 100644 --- a/src/control/controlaudiotaperpot.h +++ b/src/control/controlaudiotaperpot.h @@ -1,6 +1,4 @@ - -#ifndef CONTROLAUDIOTAPERPOT_H -#define CONTROLAUDIOTAPERPOT_H +#pragma once #include "control/controlpotmeter.h" #include "preferences/usersettings.h" @@ -14,5 +12,3 @@ class ControlAudioTaperPot : public ControlPotmeter { // neutralParameter is a knob position between 0 and 1 where the gain is 1 (0dB) ControlAudioTaperPot(const ConfigKey& key, double minDB, double maxDB, double neutralParameter); }; - -#endif // CONTROLAUDIOTAPERPOT_H diff --git a/src/control/controlbehavior.h b/src/control/controlbehavior.h index 08f48b724b1..1075cf0bea3 100644 --- a/src/control/controlbehavior.h +++ b/src/control/controlbehavior.h @@ -1,5 +1,4 @@ -#ifndef CONTROLBEHAVIOR_H -#define CONTROLBEHAVIOR_H +#pragma once #include #include @@ -159,5 +158,3 @@ class ControlPushButtonBehavior : public ControlNumericBehavior { int m_iNumStates; QScopedPointer m_pushTimer; }; - -#endif /* CONTROLBEHAVIOR_H */ diff --git a/src/control/controleffectknob.cpp b/src/control/controleffectknob.cpp index cf01306458b..1dfd28d592d 100644 --- a/src/control/controleffectknob.cpp +++ b/src/control/controleffectknob.cpp @@ -1,7 +1,8 @@ #include "control/controleffectknob.h" -#include "util/math.h" #include "effects/effectmanifestparameter.h" +#include "moc_controleffectknob.cpp" +#include "util/math.h" ControlEffectKnob::ControlEffectKnob(const ConfigKey& key, double dMinValue, double dMaxValue) : ControlPotmeter(key, dMinValue, dMaxValue) { diff --git a/src/control/controleffectknob.h b/src/control/controleffectknob.h index b0a10e2ae80..43e7cc3720f 100644 --- a/src/control/controleffectknob.h +++ b/src/control/controleffectknob.h @@ -1,5 +1,4 @@ -#ifndef CONTROLEFFECTKNOB_H -#define CONTROLEFFECTKNOB_H +#pragma once #include "control/controlpotmeter.h" #include "effects/effectmanifestparameter.h" @@ -12,5 +11,3 @@ class ControlEffectKnob : public ControlPotmeter { void setBehaviour(EffectManifestParameter::ControlHint type, double dMinValue, double dMaxValue); }; - -#endif // CONTROLLEFFECTKNOB_H diff --git a/src/control/controlencoder.cpp b/src/control/controlencoder.cpp index 3dd146a6e96..be9b6893ab0 100644 --- a/src/control/controlencoder.cpp +++ b/src/control/controlencoder.cpp @@ -1,5 +1,7 @@ #include "control/controlencoder.h" +#include "moc_controlencoder.cpp" + ControlEncoder::ControlEncoder(const ConfigKey& key, bool bIgnoreNops) : ControlObject(key, bIgnoreNops) { if (m_pControl) { diff --git a/src/control/controlencoder.h b/src/control/controlencoder.h index a323ac31335..75b2cb2015a 100644 --- a/src/control/controlencoder.h +++ b/src/control/controlencoder.h @@ -1,5 +1,4 @@ -#ifndef CONTROLENCODER_H -#define CONTROLENCODER_H +#pragma once #include "preferences/usersettings.h" #include "control/controlobject.h" @@ -9,5 +8,3 @@ class ControlEncoder : public ControlObject { public: ControlEncoder(const ConfigKey& key, bool bIgnoreNops = true); }; - -#endif diff --git a/src/control/controlindicator.cpp b/src/control/controlindicator.cpp index 2d655b02b03..3dc77a108ac 100644 --- a/src/control/controlindicator.cpp +++ b/src/control/controlindicator.cpp @@ -1,5 +1,7 @@ #include "control/controlindicator.h" + #include "control/controlproxy.h" +#include "moc_controlindicator.cpp" #include "util/math.h" ControlIndicator::ControlIndicator(const ConfigKey& key) diff --git a/src/control/controlindicator.h b/src/control/controlindicator.h index 62ec95b4523..3cfbead9873 100644 --- a/src/control/controlindicator.h +++ b/src/control/controlindicator.h @@ -1,5 +1,4 @@ -#ifndef CONTROLINDICATOR_H -#define CONTROLINDICATOR_H +#pragma once #include "control/controlobject.h" @@ -39,5 +38,3 @@ class ControlIndicator : public ControlObject { ControlProxy* m_pCOTGuiTickTime; ControlProxy* m_pCOTGuiTick50ms; }; - -#endif // CONTROLINDICATOR_H diff --git a/src/control/controllinpotmeter.cpp b/src/control/controllinpotmeter.cpp index deaa65f91af..72a2fc721d2 100644 --- a/src/control/controllinpotmeter.cpp +++ b/src/control/controllinpotmeter.cpp @@ -1,5 +1,7 @@ #include "control/controllinpotmeter.h" +#include "moc_controllinpotmeter.cpp" + ControlLinPotmeter::ControlLinPotmeter(const ConfigKey& key, double dMinValue, double dMaxValue, diff --git a/src/control/controllinpotmeter.h b/src/control/controllinpotmeter.h index 98c8e955374..bf6d8d49973 100644 --- a/src/control/controllinpotmeter.h +++ b/src/control/controllinpotmeter.h @@ -1,5 +1,4 @@ -#ifndef CONTROLLINPOTMETER_H -#define CONTROLLINPOTMETER_H +#pragma once #include "control/controlpotmeter.h" @@ -14,5 +13,3 @@ class ControlLinPotmeter : public ControlPotmeter { double dSmallStep = 0, bool allowOutOfBounds = false); }; - -#endif // CONTROLLINPOTMETER_H diff --git a/src/control/controllogpotmeter.cpp b/src/control/controllogpotmeter.cpp index b0c4e401631..4ff8924ed30 100644 --- a/src/control/controllogpotmeter.cpp +++ b/src/control/controllogpotmeter.cpp @@ -1,22 +1,7 @@ -/*************************************************************************** - controlpotmeter.cpp - description - ------------------- - begin : Wed Feb 20 2002 - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "control/controllogpotmeter.h" +#include "moc_controllogpotmeter.cpp" + ControlLogpotmeter::ControlLogpotmeter(const ConfigKey& key, double dMaxValue, double minDB) : ControlPotmeter(key, 0, dMaxValue) { // Override ControlPotmeters default value of 0.5 diff --git a/src/control/controllogpotmeter.h b/src/control/controllogpotmeter.h index 05e7d6bd933..5d5a04cc2f1 100644 --- a/src/control/controllogpotmeter.h +++ b/src/control/controllogpotmeter.h @@ -1,34 +1,10 @@ -/*************************************************************************** - controlpotmeter.h - description - ------------------- - begin : Wed Feb 20 2002 - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef CONTROLLOGPOTMETER_H -#define CONTROLLOGPOTMETER_H +#pragma once #include "control/controlpotmeter.h" #include "preferences/usersettings.h" -/** - *@author Tue and Ken Haste Andersen - */ - class ControlLogpotmeter : public ControlPotmeter { Q_OBJECT public: ControlLogpotmeter(const ConfigKey& key, double dMaxValue, double minDB); }; - -#endif diff --git a/src/control/controlmodel.cpp b/src/control/controlmodel.cpp index 923be754b2d..33824eb52ff 100644 --- a/src/control/controlmodel.cpp +++ b/src/control/controlmodel.cpp @@ -1,5 +1,7 @@ #include "control/controlmodel.h" +#include "moc_controlmodel.cpp" + ControlModel::ControlModel(QObject* pParent) : QAbstractTableModel(pParent) { diff --git a/src/control/controlmodel.h b/src/control/controlmodel.h index 336d5050465..93df7b330a9 100644 --- a/src/control/controlmodel.h +++ b/src/control/controlmodel.h @@ -1,5 +1,4 @@ -#ifndef CONTROLMODEL_H -#define CONTROLMODEL_H +#pragma once #include #include @@ -58,5 +57,3 @@ class ControlModel final : public QAbstractTableModel { QVector > m_headerInfo; QList m_controls; }; - -#endif /* CONTROLMODEL_H */ diff --git a/src/control/controlobject.cpp b/src/control/controlobject.cpp index 5aa71b84ce2..df8983a4e90 100644 --- a/src/control/controlobject.cpp +++ b/src/control/controlobject.cpp @@ -1,27 +1,12 @@ -/*************************************************************************** - controlobject.cpp - description - ------------------- - begin : Wed Feb 20 2002 - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ +#include "control/controlobject.h" -#include #include -#include #include +#include +#include -#include "control/controlobject.h" #include "control/control.h" +#include "moc_controlobject.cpp" #include "util/stat.h" #include "util/timer.h" diff --git a/src/control/controlobject.h b/src/control/controlobject.h index b6f3ae5f53a..cfd2dd39d54 100644 --- a/src/control/controlobject.h +++ b/src/control/controlobject.h @@ -1,20 +1,3 @@ -/*************************************************************************** - controlobject.h - description - ------------------- - begin : Wed Feb 20 2002 - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - #pragma once #include diff --git a/src/control/controlobjectscript.cpp b/src/control/controlobjectscript.cpp index f9b86cfe366..3a6fa5963b2 100644 --- a/src/control/controlobjectscript.cpp +++ b/src/control/controlobjectscript.cpp @@ -3,6 +3,7 @@ #include #include "controllers/controllerdebug.h" +#include "moc_controlobjectscript.cpp" ControlObjectScript::ControlObjectScript(const ConfigKey& key, QObject* pParent) : ControlProxy(key, pParent, ControllerDebug::shouldAssertForInvalidControlObjects()) { diff --git a/src/control/controlobjectscript.h b/src/control/controlobjectscript.h index eec296a01e1..219a4b0a991 100644 --- a/src/control/controlobjectscript.h +++ b/src/control/controlobjectscript.h @@ -1,5 +1,4 @@ -#ifndef CONTROLOBJECTSCRIPT_H -#define CONTROLOBJECTSCRIPT_H +#pragma once #include @@ -39,5 +38,3 @@ class ControlObjectScript : public ControlProxy { private: QVector m_scriptConnections; }; - -#endif // CONTROLOBJECTSCRIPT_H diff --git a/src/control/controlpotmeter.cpp b/src/control/controlpotmeter.cpp index a62b77ef431..2c03d4d3085 100644 --- a/src/control/controlpotmeter.cpp +++ b/src/control/controlpotmeter.cpp @@ -1,23 +1,8 @@ -/*************************************************************************** - controlpotmeter.cpp - description - ------------------- - begin : Wed Feb 20 2002 - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - -#include "control/controlpushbutton.h" #include "control/controlpotmeter.h" + #include "control/controlproxy.h" +#include "control/controlpushbutton.h" +#include "moc_controlpotmeter.cpp" ControlPotmeter::ControlPotmeter(const ConfigKey& key, double dMinValue, diff --git a/src/control/controlpotmeter.h b/src/control/controlpotmeter.h index a3dee755c73..1913513b914 100644 --- a/src/control/controlpotmeter.h +++ b/src/control/controlpotmeter.h @@ -1,30 +1,8 @@ -/*************************************************************************** - controlpotmeter.h - description - ------------------- - begin : Wed Feb 20 2002 - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef CONTROLPOTMETER_H -#define CONTROLPOTMETER_H +#pragma once #include "preferences/usersettings.h" #include "control/controlobject.h" -/** - *@author Tue and Ken Haste Andersen - */ - class ControlPushButton; class ControlProxy; @@ -97,5 +75,3 @@ class ControlPotmeter : public ControlObject { bool m_bAllowOutOfBounds; PotmeterControls m_controls; }; - -#endif diff --git a/src/control/controlproxy.cpp b/src/control/controlproxy.cpp index 5ca1f046304..51e7876f1ae 100644 --- a/src/control/controlproxy.cpp +++ b/src/control/controlproxy.cpp @@ -1,7 +1,9 @@ +#include "control/controlproxy.h" + #include -#include "control/controlproxy.h" #include "control/control.h" +#include "moc_controlproxy.cpp" ControlProxy::ControlProxy(const QString& g, const QString& i, QObject* pParent, ControlFlags flags) : ControlProxy(ConfigKey(g, i), pParent, flags) { diff --git a/src/control/controlproxy.h b/src/control/controlproxy.h index e86fc086703..4eab2fa38d1 100644 --- a/src/control/controlproxy.h +++ b/src/control/controlproxy.h @@ -1,5 +1,4 @@ -#ifndef CONTROLPROXY_H -#define CONTROLPROXY_H +#pragma once #include #include @@ -207,5 +206,3 @@ class ControlProxy : public QObject { // Pointer to connected control. QSharedPointer m_pControl; }; - -#endif // CONTROLPROXY_H diff --git a/src/control/controlpushbutton.cpp b/src/control/controlpushbutton.cpp index 29c4e9dd9b1..1a3b2a1f3b6 100644 --- a/src/control/controlpushbutton.cpp +++ b/src/control/controlpushbutton.cpp @@ -1,22 +1,7 @@ -/*************************************************************************** - controlpushbutton.cpp - description - ------------------- - begin : Wed Feb 20 2002 - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "control/controlpushbutton.h" +#include "moc_controlpushbutton.cpp" + /* -------- ------------------------------------------------------ Purpose: Creates a new simulated latching push-button. Input: key - Key for the configuration file diff --git a/src/control/controlttrotary.cpp b/src/control/controlttrotary.cpp index 930c8c48d6f..4247d78d8f8 100644 --- a/src/control/controlttrotary.cpp +++ b/src/control/controlttrotary.cpp @@ -1,21 +1,7 @@ -/*************************************************************************** - controlttrotary.cpp - description - ------------------- - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "control/controlttrotary.h" +#include "moc_controlttrotary.cpp" + /* -------- ------------------------------------------------------ Purpose: Creates a new rotary encoder Input: key diff --git a/src/control/controlttrotary.h b/src/control/controlttrotary.h index 59ba41eeb2f..ee132fed302 100644 --- a/src/control/controlttrotary.h +++ b/src/control/controlttrotary.h @@ -1,21 +1,4 @@ -/*************************************************************************** - controlttrotary.h - description - ------------------- - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef CONTROLTTROTARY_H -#define CONTROLTTROTARY_H +#pragma once #include "preferences/usersettings.h" #include "control/controlobject.h" @@ -25,5 +8,3 @@ class ControlTTRotary : public ControlObject { public: ControlTTRotary(const ConfigKey& key); }; - -#endif diff --git a/src/controllers/bulk/bulkcontroller.cpp b/src/controllers/bulk/bulkcontroller.cpp index ff0e62b9a78..d8946c9fe65 100644 --- a/src/controllers/bulk/bulkcontroller.cpp +++ b/src/controllers/bulk/bulkcontroller.cpp @@ -1,19 +1,14 @@ -/** - * @file bulkcontroller.cpp - * @author Neale Pickett neale@woozle.org - * @date Thu Jun 28 2012 - * @brief USB Bulk controller backend - * - */ +#include "controllers/bulk/bulkcontroller.h" + #include -#include "controllers/bulk/bulkcontroller.h" #include "controllers/bulk/bulksupported.h" -#include "controllers/defs_controllers.h" #include "controllers/controllerdebug.h" +#include "controllers/defs_controllers.h" +#include "moc_bulkcontroller.cpp" #include "util/compatibility.h" -#include "util/trace.h" #include "util/time.h" +#include "util/trace.h" BulkReader::BulkReader(libusb_device_handle *handle, unsigned char in_epaddr) : QThread(), diff --git a/src/controllers/bulk/bulkcontroller.h b/src/controllers/bulk/bulkcontroller.h index 33c6ec42618..c5a8b08aab4 100644 --- a/src/controllers/bulk/bulkcontroller.h +++ b/src/controllers/bulk/bulkcontroller.h @@ -12,6 +12,7 @@ struct libusb_device_handle; struct libusb_context; struct libusb_device_descriptor; +/// USB Bulk controller backend class BulkReader : public QThread { Q_OBJECT public: diff --git a/src/controllers/bulk/bulkenumerator.cpp b/src/controllers/bulk/bulkenumerator.cpp index ce154e4883a..2e6abdde162 100644 --- a/src/controllers/bulk/bulkenumerator.cpp +++ b/src/controllers/bulk/bulkenumerator.cpp @@ -1,10 +1,3 @@ -/** - * @file bulkenumerator.cpp - * @author Neale Picket neale@woozle.org - * @date Thu Jun 28 2012 - * @brief USB Bulk controller backend - */ - #include #include "controllers/bulk/bulkcontroller.h" diff --git a/src/controllers/bulk/bulkenumerator.h b/src/controllers/bulk/bulkenumerator.h index b281f49c013..b1c2569f33c 100644 --- a/src/controllers/bulk/bulkenumerator.h +++ b/src/controllers/bulk/bulkenumerator.h @@ -1,17 +1,10 @@ -/** -* @file bulkenumerator.h -* @author Neale Pickett neale@woozle.org -* @date Thu Jun 28 2012 -* @brief Locate supported USB bulk controllers -*/ - -#ifndef BULKENUMERATOR_H -#define BULKENUMERATOR_H +#pragma once #include "controllers/controllerenumerator.h" struct libusb_context; +/// Locate supported USB bulk controllers class BulkEnumerator : public ControllerEnumerator { public: explicit BulkEnumerator(UserSettingsPointer pConfig); @@ -24,5 +17,3 @@ class BulkEnumerator : public ControllerEnumerator { libusb_context* m_context; UserSettingsPointer m_pConfig; }; - -#endif diff --git a/src/controllers/bulk/bulksupported.h b/src/controllers/bulk/bulksupported.h index d79ad88f7b4..1ffbc3509ab 100644 --- a/src/controllers/bulk/bulksupported.h +++ b/src/controllers/bulk/bulksupported.h @@ -1,12 +1,6 @@ -/** -* @file bulksupported.h -* @author Neale Picket neale@woozle.org -* @date Thu Jun 28 2012 -* @brief A list of supported USB bulk devices -*/ +// A list of supported USB bulk devices -#ifndef BULKSUPPORTED_H -#define BULKSUPPORTED_H +#pragma once typedef struct bulk_supported { unsigned short vendor_id; @@ -22,5 +16,3 @@ static bulk_supported_t bulk_supported[] = { {0x06f8, 0xb120, 0x82, 0x03}, // Hercules MP3 LE / Glow {0, 0, 0, 0} }; - -#endif diff --git a/src/controllers/controller.cpp b/src/controllers/controller.cpp index f96fa383f2b..e9d02a61547 100644 --- a/src/controllers/controller.cpp +++ b/src/controllers/controller.cpp @@ -1,16 +1,11 @@ -/** -* @file controller.h -* @author Sean Pappalardo spappalardo@mixxx.org -* @date Sat Apr 30 2011 -* @brief Base class representing a physical (or software) controller. -*/ +#include "controllers/controller.h" #include #include -#include "controllers/controller.h" #include "controllers/controllerdebug.h" #include "controllers/defs_controllers.h" +#include "moc_controller.cpp" #include "util/screensaver.h" Controller::Controller() diff --git a/src/controllers/controller.h b/src/controllers/controller.h index 3e5315b31bd..095e49fb0c9 100644 --- a/src/controllers/controller.h +++ b/src/controllers/controller.h @@ -19,7 +19,7 @@ class ControllerJSProxy; class Controller : public QObject, ConstControllerPresetVisitor { Q_OBJECT public: - Controller(); + explicit Controller(); ~Controller() override; // Subclass should call close() at minimum. /// The object that is exposed to the JS scripts as the "controller" object. diff --git a/src/controllers/controllerdebug.h b/src/controllers/controllerdebug.h index b07ce70cbd1..4c5824f5f23 100644 --- a/src/controllers/controllerdebug.h +++ b/src/controllers/controllerdebug.h @@ -1,5 +1,4 @@ -#ifndef CONTROLLERDEBUG_H -#define CONTROLLERDEBUG_H +#pragma once #include @@ -54,11 +53,9 @@ class ControllerDebug { // // In order of Bug #1797746, since transition to qt5 it is needed unquote the // output for mixxx.log with .noquote(), because in qt5 QDebug() is quoted by default. -#define controllerDebug(stream) \ -{ \ - if (ControllerDebug::enabled()) { \ - QDebug(QtDebugMsg).noquote() << ControllerDebug::kLogMessagePrefix << stream; \ - } \ -} \ - -#endif // CONTROLLERDEBUG_H +#define controllerDebug(stream) \ + { \ + if (ControllerDebug::enabled()) { \ + QDebug(QtDebugMsg).noquote() << ControllerDebug::kLogMessagePrefix << stream; \ + } \ + } diff --git a/src/controllers/controllerenumerator.cpp b/src/controllers/controllerenumerator.cpp index b0c4812620f..36bc56f3f6e 100644 --- a/src/controllers/controllerenumerator.cpp +++ b/src/controllers/controllerenumerator.cpp @@ -1,15 +1,7 @@ -/*************************************************************************** - ControllerEnumerator.cpp - Controller Enumerator Class - ---------------------------- - begin : Sat Apr 30 2011 - copyright : (C) 2011 Sean M. Pappalardo - email : spappalardo@mixxx.org - -***************************************************************************/ - #include "controllers/controllerenumerator.h" +#include "moc_controllerenumerator.cpp" + ControllerEnumerator::ControllerEnumerator() : QObject() { } diff --git a/src/controllers/controllerenumerator.h b/src/controllers/controllerenumerator.h index b94c5383893..dc08154de92 100644 --- a/src/controllers/controllerenumerator.h +++ b/src/controllers/controllerenumerator.h @@ -1,18 +1,11 @@ -/** -* @file controllerenumerator.h -* @author Sean Pappalardo spappalardo@mixxx.org -* @date Sat Apr 30 2011 -* @brief Base class handling discovery and enumeration of DJ controllers. -* -* This class handles discovery and enumeration of DJ controllers and -* must be inherited by a class that implements it on some API. -*/ - -#ifndef CONTROLLERENUMERATOR_H -#define CONTROLLERENUMERATOR_H +#pragma once #include "controllers/controller.h" +/// Base class handling discovery and enumeration of DJ controllers. +/// +/// This class handles discovery and enumeration of DJ controllers and +/// must be inherited by a class that implements it on some API. class ControllerEnumerator : public QObject { Q_OBJECT public: @@ -29,5 +22,3 @@ class ControllerEnumerator : public QObject { return false; } }; - -#endif diff --git a/src/controllers/controllerinputmappingtablemodel.cpp b/src/controllers/controllerinputmappingtablemodel.cpp index 73db610044b..e2b629b97d4 100644 --- a/src/controllers/controllerinputmappingtablemodel.cpp +++ b/src/controllers/controllerinputmappingtablemodel.cpp @@ -1,11 +1,13 @@ #include "controllers/controllerinputmappingtablemodel.h" -#include "controllers/midi/midimessage.h" -#include "controllers/midi/midiutils.h" + #include "controllers/delegates/controldelegate.h" +#include "controllers/delegates/midibytedelegate.h" #include "controllers/delegates/midichanneldelegate.h" #include "controllers/delegates/midiopcodedelegate.h" -#include "controllers/delegates/midibytedelegate.h" #include "controllers/delegates/midioptionsdelegate.h" +#include "controllers/midi/midimessage.h" +#include "controllers/midi/midiutils.h" +#include "moc_controllerinputmappingtablemodel.cpp" ControllerInputMappingTableModel::ControllerInputMappingTableModel(QObject* pParent) : ControllerMappingTableModel(pParent) { diff --git a/src/controllers/controllerlearningeventfilter.cpp b/src/controllers/controllerlearningeventfilter.cpp index bdf96d54721..64828e53ac2 100644 --- a/src/controllers/controllerlearningeventfilter.cpp +++ b/src/controllers/controllerlearningeventfilter.cpp @@ -1,12 +1,14 @@ -#include -#include +#include "controllers/controllerlearningeventfilter.h" + #include +#include +#include -#include "widget/wwidget.h" +#include "moc_controllerlearningeventfilter.cpp" #include "widget/wknob.h" #include "widget/wknobcomposed.h" #include "widget/wslidercomposed.h" -#include "controllers/controllerlearningeventfilter.h" +#include "widget/wwidget.h" ControllerLearningEventFilter::ControllerLearningEventFilter(QObject* pParent) : QObject(pParent), diff --git a/src/controllers/controllerlearningeventfilter.h b/src/controllers/controllerlearningeventfilter.h index 087e37b4bb4..dc22e36a53a 100644 --- a/src/controllers/controllerlearningeventfilter.h +++ b/src/controllers/controllerlearningeventfilter.h @@ -1,5 +1,4 @@ -#ifndef CONTROLLERLEARNINGEVENTFILTER_H -#define CONTROLLERLEARNINGEVENTFILTER_H +#pragma once #include #include @@ -48,6 +47,3 @@ class ControllerLearningEventFilter : public QObject { QHash m_widgetControlInfo; bool m_bListening; }; - - -#endif /* CONTROLLERLEARNINGEVENTFILTER_H */ diff --git a/src/controllers/controllermanager.cpp b/src/controllers/controllermanager.cpp index 7f0ea6d17a2..4caafd7132c 100644 --- a/src/controllers/controllermanager.cpp +++ b/src/controllers/controllermanager.cpp @@ -6,6 +6,7 @@ #include "controllers/controllerlearningeventfilter.h" #include "controllers/defs_controllers.h" #include "controllers/midi/portmidienumerator.h" +#include "moc_controllermanager.cpp" #include "util/cmdlineargs.h" #include "util/time.h" #include "util/trace.h" diff --git a/src/controllers/controllermanager.h b/src/controllers/controllermanager.h index 16f5771a4d2..c835dc4e25e 100644 --- a/src/controllers/controllermanager.h +++ b/src/controllers/controllermanager.h @@ -9,11 +9,11 @@ #include "controllers/controllerpresetinfoenumerator.h" #include "preferences/usersettings.h" -//Forward declaration(s) +// Forward declaration(s) class Controller; class ControllerLearningEventFilter; -// Function to sort controllers by name +/// Function to sort controllers by name bool controllerCompare(Controller *a, Controller *b); /// Manages enumeration/operation/deletion of hardware controllers. @@ -36,7 +36,7 @@ class ControllerManager : public QObject { } QString getConfiguredPresetFileForDevice(const QString& name); - // Prevent other parts of Mixxx from having to manually connect to our slots + /// Prevent other parts of Mixxx from having to manually connect to our slots void setUpDevices() { emit requestSetUpDevices(); }; static QList getPresetPaths(UserSettingsPointer pConfig); @@ -55,15 +55,15 @@ class ControllerManager : public QObject { void closeController(Controller* pController); private slots: - // Perform initialization that should be delayed until the ControllerManager - // thread is started. + /// Perform initialization that should be delayed until the ControllerManager + /// thread is started. void slotInitialize(); - // Open whatever controllers are selected in the preferences. This currently - // only runs on start-up but maybe should instead be signaled by the - // preferences dialog on apply, and only open/close changed devices + /// Open whatever controllers are selected in the preferences. This currently + /// only runs on start-up but maybe should instead be signaled by the + /// preferences dialog on apply, and only open/close changed devices void slotSetUpDevices(); void slotShutdown(); - // Calls poll() on all devices that have isPolling() true. + /// Calls poll() on all devices that have isPolling() true. void pollDevices(); void startPolling(); void stopPolling(); diff --git a/src/controllers/controllermappingtablemodel.cpp b/src/controllers/controllermappingtablemodel.cpp index 918da8dfc5c..bd014c1f2c5 100644 --- a/src/controllers/controllermappingtablemodel.cpp +++ b/src/controllers/controllermappingtablemodel.cpp @@ -1,5 +1,7 @@ #include "controllers/controllermappingtablemodel.h" +#include "moc_controllermappingtablemodel.cpp" + ControllerMappingTableModel::ControllerMappingTableModel(QObject* pParent) : QAbstractTableModel(pParent), m_pMidiPreset(NULL), diff --git a/src/controllers/controllermappingtablemodel.h b/src/controllers/controllermappingtablemodel.h index 008665f0d4d..d6de46532c7 100644 --- a/src/controllers/controllermappingtablemodel.h +++ b/src/controllers/controllermappingtablemodel.h @@ -1,5 +1,4 @@ -#ifndef CONTROLLERMAPPINGTABLEMODEL_H -#define CONTROLLERMAPPINGTABLEMODEL_H +#pragma once #include #include @@ -47,5 +46,3 @@ class ControllerMappingTableModel : public QAbstractTableModel, MidiControllerPreset* m_pMidiPreset; HidControllerPreset* m_pHidPreset; }; - -#endif /* CONTROLLERMAPPINGTABLEMODEL_H */ diff --git a/src/controllers/controlleroutputmappingtablemodel.cpp b/src/controllers/controlleroutputmappingtablemodel.cpp index 676442cb1e2..b724726677c 100644 --- a/src/controllers/controlleroutputmappingtablemodel.cpp +++ b/src/controllers/controlleroutputmappingtablemodel.cpp @@ -1,11 +1,12 @@ #include "controllers/controlleroutputmappingtablemodel.h" -#include "controllers/midi/midimessage.h" -#include "controllers/midi/midiutils.h" #include "controllers/delegates/controldelegate.h" +#include "controllers/delegates/midibytedelegate.h" #include "controllers/delegates/midichanneldelegate.h" #include "controllers/delegates/midiopcodedelegate.h" -#include "controllers/delegates/midibytedelegate.h" +#include "controllers/midi/midimessage.h" +#include "controllers/midi/midiutils.h" +#include "moc_controlleroutputmappingtablemodel.cpp" ControllerOutputMappingTableModel::ControllerOutputMappingTableModel(QObject* pParent) : ControllerMappingTableModel(pParent) { diff --git a/src/controllers/controllerpreset.h b/src/controllers/controllerpreset.h index eeb5563f262..931e655752a 100644 --- a/src/controllers/controllerpreset.h +++ b/src/controllers/controllerpreset.h @@ -1,8 +1,4 @@ #pragma once -/// @file controllerpreset.h -/// @author Sean Pappalardo spappalardo@mixxx.org -/// @date Mon 9 Apr 2012 -/// @brief Controller Preset #include #include diff --git a/src/controllers/controllerpresetfilehandler.cpp b/src/controllers/controllerpresetfilehandler.cpp index 122efd2f660..cfec632695c 100644 --- a/src/controllers/controllerpresetfilehandler.cpp +++ b/src/controllers/controllerpresetfilehandler.cpp @@ -1,8 +1,3 @@ -/// @file controllerpresetfilehandler.cpp -/// @author Sean Pappalardo spappalardo@mixxx.org -/// @date Mon 9 Apr 2012 -/// @brief Handles loading and saving of Controller presets. - #include "controllers/controllerpresetfilehandler.h" #include "controllers/controllermanager.h" #include "controllers/defs_controllers.h" diff --git a/src/controllers/controllerpresetfilehandler.h b/src/controllers/controllerpresetfilehandler.h index 5dba31bcc45..7454d171ca6 100644 --- a/src/controllers/controllerpresetfilehandler.h +++ b/src/controllers/controllerpresetfilehandler.h @@ -1,8 +1,4 @@ #pragma once -/// @file controllerpresetfilehandler.h -/// @author Sean Pappalardo spappalardo@mixxx.org -/// @date Mon 9 Apr 2012 -/// @brief Handles loading and saving of Controller presets. #include "util/xml.h" #include "controllers/controllerpreset.h" diff --git a/src/controllers/controllerpresetinfo.cpp b/src/controllers/controllerpresetinfo.cpp index bf0051209af..34f075de5bb 100644 --- a/src/controllers/controllerpresetinfo.cpp +++ b/src/controllers/controllerpresetinfo.cpp @@ -1,14 +1,3 @@ -/** -* @file controllerpresetinfo.cpp -* @author Ilkka Tuohela hile@iki.fi -* @date Wed May 15 2012 -* @brief Implement handling enumeration and parsing of preset info headers -* -* This class handles parsing of controller XML description file -* header tags. It can be used to match controllers automatically or to -* show details for a mapping. -*/ - #include "controllers/controllerpresetinfo.h" #include "controllers/defs_controllers.h" diff --git a/src/controllers/controllerpresetinfo.h b/src/controllers/controllerpresetinfo.h index 3eb5c4ef152..9b38e119007 100644 --- a/src/controllers/controllerpresetinfo.h +++ b/src/controllers/controllerpresetinfo.h @@ -1,16 +1,4 @@ -/** -* @file controllerpresetinfo.h -* @author Ilkka Tuohela hile@iki.fi -* @date Wed May 15 2012 -* @brief Base class handling enumeration and parsing of preset info headers -* -* This class handles enumeration and parsing of controller XML description file -* header tags. It can be used to match controllers automatically or to -* show details for a mapping. -*/ - -#ifndef CONTROLLERPRESETINFO_H -#define CONTROLLERPRESETINFO_H +#pragma once #include #include @@ -37,6 +25,11 @@ struct ProductInfo { QString interface_number; }; +/// Base class handling enumeration and parsing of preset info headers +/// +/// This class handles enumeration and parsing of controller XML description file +/// header tags. It can be used to match controllers automatically or to +/// show details for a mapping. class PresetInfo { public: PresetInfo(); @@ -71,5 +64,3 @@ class PresetInfo { QString m_wikilink; QList m_products; }; - -#endif diff --git a/src/controllers/controllerpresetinfoenumerator.cpp b/src/controllers/controllerpresetinfoenumerator.cpp index 517451fd33f..10201ac6457 100644 --- a/src/controllers/controllerpresetinfoenumerator.cpp +++ b/src/controllers/controllerpresetinfoenumerator.cpp @@ -1,9 +1,3 @@ -/** -* @file controllerpresetinfoenumerator.cpp -* @author Be be.0@gmx.com -* @date Sat Jul 18 2015 -* @brief Enumerate list of available controller mapping presets -*/ #include "controllers/controllerpresetinfoenumerator.h" #include diff --git a/src/controllers/controllerpresetinfoenumerator.h b/src/controllers/controllerpresetinfoenumerator.h index 07a71dfd10d..03f2fd859f5 100644 --- a/src/controllers/controllerpresetinfoenumerator.h +++ b/src/controllers/controllerpresetinfoenumerator.h @@ -1,11 +1,4 @@ -/** -* @file controllerpresetinfoenumerator.h -* @author Be be.0@gmx.com -* @date Sat Jul 18 2015 -* @brief Enumerate list of available controller mapping presets -*/ -#ifndef CONTROLLERPRESETINFOENUMERATOR_H -#define CONTROLLERPRESETINFOENUMERATOR_H +#pragma once #include #include @@ -13,6 +6,7 @@ #include "controllers/controllerpresetinfo.h" +/// Enumerate list of available controller mapping presets class PresetInfoEnumerator { public: PresetInfoEnumerator(const QString& searchPath); @@ -30,5 +24,3 @@ class PresetInfoEnumerator { QList m_midiPresets; QList m_bulkPresets; }; - -#endif diff --git a/src/controllers/controllerpresetvisitor.h b/src/controllers/controllerpresetvisitor.h index 9fc30fc46a2..09ae573cb45 100644 --- a/src/controllers/controllerpresetvisitor.h +++ b/src/controllers/controllerpresetvisitor.h @@ -1,5 +1,4 @@ -#ifndef CONTROLLERPRESETVISITOR_H -#define CONTROLLERPRESETVISITOR_H +#pragma once class MidiControllerPreset; class HidControllerPreset; @@ -17,5 +16,3 @@ class ConstControllerPresetVisitor { virtual void visit(const MidiControllerPreset* preset) = 0; virtual void visit(const HidControllerPreset* preset) = 0; }; - -#endif /* CONTROLLERPRESETVISITOR_H */ diff --git a/src/controllers/controllervisitor.h b/src/controllers/controllervisitor.h index 3c3b2dfbb88..9a236fcc8af 100644 --- a/src/controllers/controllervisitor.h +++ b/src/controllers/controllervisitor.h @@ -1,5 +1,4 @@ -#ifndef CONTROLLERVISITOR_H -#define CONTROLLERVISITOR_H +#pragma once class MidiController; class HidController; @@ -11,5 +10,3 @@ class ControllerVisitor { virtual void visit(HidController* controller) = 0; virtual void visit(BulkController* controller) = 0; }; - -#endif /* CONTROLLERVISITOR_H */ diff --git a/src/controllers/controlpickermenu.cpp b/src/controllers/controlpickermenu.cpp index 18498aeba27..75e16cb87d4 100644 --- a/src/controllers/controlpickermenu.cpp +++ b/src/controllers/controlpickermenu.cpp @@ -7,6 +7,7 @@ #include "engine/controls/cuecontrol.h" #include "engine/controls/loopingcontrol.h" #include "mixer/playermanager.h" +#include "moc_controlpickermenu.cpp" #include "recording/defs_recording.h" #include "vinylcontrol/defs_vinylcontrol.h" diff --git a/src/controllers/controlpickermenu.h b/src/controllers/controlpickermenu.h index 9ca64a4dded..62b9430388b 100644 --- a/src/controllers/controlpickermenu.h +++ b/src/controllers/controlpickermenu.h @@ -1,5 +1,4 @@ -#ifndef CONTROLPICKERMENU_H -#define CONTROLPICKERMENU_H +#pragma once #include #include @@ -110,5 +109,3 @@ class ControlPickerMenu : public QMenu { QHash m_descriptionsByKey; QHash m_titlesByKey; }; - -#endif /* CONTROLPICKERMENU_H */ diff --git a/src/controllers/defs_controllers.h b/src/controllers/defs_controllers.h index fe44cc61091..49e36a88238 100644 --- a/src/controllers/defs_controllers.h +++ b/src/controllers/defs_controllers.h @@ -1,12 +1,4 @@ -/*************************************************************************** - defs_controllers.h - ------------------ - copyright : (C) 2011 by Sean Pappalardo - email : spappalardo@mixxx.org - ***************************************************************************/ - -#ifndef DEFS_CONTROLLERS_H -#define DEFS_CONTROLLERS_H +#pragma once #include #include "preferences/usersettings.h" @@ -35,5 +27,3 @@ inline QString userPresetsPath(UserSettingsPointer pConfig) { #define BULK_PRESET_EXTENSION ".bulk.xml" #define REQUIRED_SCRIPT_FILE "common-controller-scripts.js" #define XML_SCHEMA_VERSION "1" - -#endif /* DEFS_CONTROLLERS_H */ diff --git a/src/controllers/delegates/controldelegate.cpp b/src/controllers/delegates/controldelegate.cpp index 6c6a3300602..e22a7ec87a7 100644 --- a/src/controllers/delegates/controldelegate.cpp +++ b/src/controllers/delegates/controldelegate.cpp @@ -1,9 +1,11 @@ -#include +#include "controllers/delegates/controldelegate.h" + #include #include +#include -#include "controllers/delegates/controldelegate.h" #include "controllers/midi/midimessage.h" +#include "moc_controldelegate.cpp" ControlDelegate::ControlDelegate(QObject* pParent) : QStyledItemDelegate(pParent), diff --git a/src/controllers/delegates/controldelegate.h b/src/controllers/delegates/controldelegate.h index 633e454c532..3ca6954b1c0 100644 --- a/src/controllers/delegates/controldelegate.h +++ b/src/controllers/delegates/controldelegate.h @@ -1,5 +1,4 @@ -#ifndef CONTROLDELEGATE_H -#define CONTROLDELEGATE_H +#pragma once #include @@ -36,5 +35,3 @@ class ControlDelegate : public QStyledItemDelegate { // can't check there. mutable bool m_bIsIndexScript; }; - -#endif /* CONTROLDELEGATE_H */ diff --git a/src/controllers/delegates/midibytedelegate.h b/src/controllers/delegates/midibytedelegate.h index 140cd2e33b6..83700de56b3 100644 --- a/src/controllers/delegates/midibytedelegate.h +++ b/src/controllers/delegates/midibytedelegate.h @@ -1,5 +1,4 @@ -#ifndef MIDIBYTEDELEGATE_H -#define MIDIBYTEDELEGATE_H +#pragma once #include @@ -18,5 +17,3 @@ class MidiByteDelegate : public QStyledItemDelegate { void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; }; - -#endif /* MIDIBYTEDELEGATE_H */ diff --git a/src/controllers/delegates/midichanneldelegate.h b/src/controllers/delegates/midichanneldelegate.h index 7e739834a7e..b6dd7c7e563 100644 --- a/src/controllers/delegates/midichanneldelegate.h +++ b/src/controllers/delegates/midichanneldelegate.h @@ -1,5 +1,4 @@ -#ifndef MIDICHANNELDELEGATE_H -#define MIDICHANNELDELEGATE_H +#pragma once #include @@ -18,5 +17,3 @@ class MidiChannelDelegate : public QStyledItemDelegate { void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; }; - -#endif /* MIDICHANNELDELEGATE_H */ diff --git a/src/controllers/delegates/midiopcodedelegate.h b/src/controllers/delegates/midiopcodedelegate.h index f2dcd5a4acb..0b9963bd5a0 100644 --- a/src/controllers/delegates/midiopcodedelegate.h +++ b/src/controllers/delegates/midiopcodedelegate.h @@ -1,5 +1,4 @@ -#ifndef MIDIOPCODEDELEGATE_H -#define MIDIOPCODEDELEGATE_H +#pragma once #include @@ -18,5 +17,3 @@ class MidiOpCodeDelegate : public QStyledItemDelegate { void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; }; - -#endif /* MIDIOPCODEDELEGATE_H */ diff --git a/src/controllers/delegates/midioptionsdelegate.cpp b/src/controllers/delegates/midioptionsdelegate.cpp index 3b6e45db52e..868f492b5bf 100644 --- a/src/controllers/delegates/midioptionsdelegate.cpp +++ b/src/controllers/delegates/midioptionsdelegate.cpp @@ -1,10 +1,12 @@ -#include +#include "controllers/delegates/midioptionsdelegate.h" + #include #include +#include -#include "controllers/delegates/midioptionsdelegate.h" #include "controllers/midi/midimessage.h" #include "controllers/midi/midiutils.h" +#include "moc_midioptionsdelegate.cpp" MidiOptionsDelegate::MidiOptionsDelegate(QObject* pParent) : QStyledItemDelegate(pParent) { diff --git a/src/controllers/delegates/midioptionsdelegate.h b/src/controllers/delegates/midioptionsdelegate.h index d67957d41d0..636de75003b 100644 --- a/src/controllers/delegates/midioptionsdelegate.h +++ b/src/controllers/delegates/midioptionsdelegate.h @@ -1,5 +1,4 @@ -#ifndef MIDIOPTIONSDELEGATE_H -#define MIDIOPTIONSDELEGATE_H +#pragma once #include #include @@ -22,5 +21,3 @@ class MidiOptionsDelegate : public QStyledItemDelegate { void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; }; - -#endif /* MIDIOPTIONSDELEGATE_H */ diff --git a/src/controllers/dlgcontrollerlearning.cpp b/src/controllers/dlgcontrollerlearning.cpp index 589bf5d687c..d11b6597e9f 100644 --- a/src/controllers/dlgcontrollerlearning.cpp +++ b/src/controllers/dlgcontrollerlearning.cpp @@ -1,17 +1,11 @@ -/** -* @file dlgcontrollerlearning.cpp -* @author Sean M. Pappalardo spappalardo@mixxx.org -* @date Thu 12 Apr 2012 -* @brief The controller mapping learning wizard -* -*/ +#include "controllers/dlgcontrollerlearning.h" #include #include "control/controlobject.h" -#include "controllers/dlgcontrollerlearning.h" #include "controllers/learningutils.h" #include "controllers/midi/midiutils.h" +#include "moc_dlgcontrollerlearning.cpp" #include "util/version.h" namespace { diff --git a/src/controllers/dlgcontrollerlearning.h b/src/controllers/dlgcontrollerlearning.h index c5f19e99080..1323de677bc 100644 --- a/src/controllers/dlgcontrollerlearning.h +++ b/src/controllers/dlgcontrollerlearning.h @@ -1,12 +1,4 @@ -/** -* @file dlgcontrollerlearning.h -* @author Sean M. Pappalardo spappalardo@mixxx.org -* @date Thu 12 Apr 2012 -* @brief The controller mapping learning wizard -* -*/ -#ifndef DLGCONTROLLERLEARNING_H -#define DLGCONTROLLERLEARNING_H +#pragma once #include #include @@ -29,6 +21,7 @@ class ControllerPreset; //#define CONTROLLERLESSTESTING +/// The controller mapping learning wizard class DlgControllerLearning : public QDialog, public ControllerVisitor, public Ui::DlgControllerLearning { @@ -99,5 +92,3 @@ class DlgControllerLearning : public QDialog, QList > m_messages; MidiInputMappings m_mappings; }; - -#endif diff --git a/src/controllers/dlgprefcontroller.cpp b/src/controllers/dlgprefcontroller.cpp index e91dc3ac147..34964ae2c87 100644 --- a/src/controllers/dlgprefcontroller.cpp +++ b/src/controllers/dlgprefcontroller.cpp @@ -1,15 +1,9 @@ -/** -* @file dlgprefcontroller.cpp -* @author Sean M. Pappalardo spappalardo@mixxx.org -* @date Mon May 2 2011 -* @brief Configuration dialog for a DJ controller -*/ - #include "controllers/dlgprefcontroller.h" #include #include #include +#include #include #include #include @@ -20,9 +14,14 @@ #include "controllers/controllermanager.h" #include "controllers/defs_controllers.h" #include "defs_urls.h" +#include "moc_dlgprefcontroller.cpp" #include "preferences/usersettings.h" #include "util/version.h" +namespace { +const QString kPresetExt(".midi.xml"); +} + DlgPrefController::DlgPrefController( QWidget* parent, Controller* controller, @@ -30,6 +29,7 @@ DlgPrefController::DlgPrefController( UserSettingsPointer pConfig) : DlgPreferencePage(parent), m_pConfig(pConfig), + m_pUserDir(userPresetsPath(pConfig)), m_pControllerManager(controllerManager), m_pController(controller), m_pDlgControllerLearning(NULL), @@ -280,14 +280,24 @@ QString DlgPrefController::presetManualLink( return url; } -QString DlgPrefController::presetScriptFileLinks( +QString DlgPrefController::presetFileLinks( const ControllerPresetPointer pPreset) const { - if (!pPreset || pPreset->getScriptFiles().empty()) { - return tr("No Scripts"); + if (!pPreset) { + return QString(); } + const QString builtinFileSuffix = QStringLiteral(" (") + tr("built-in") + QStringLiteral(")"); QString systemPresetPath = resourcePresetsPath(m_pConfig); QStringList linkList; + QString xmlFileName = QFileInfo(pPreset->filePath()).fileName(); + QString xmlFileLink = QStringLiteral("filePath() + QStringLiteral("\">") + + xmlFileName + QStringLiteral(""); + if (pPreset->filePath().startsWith(systemPresetPath)) { + xmlFileLink += builtinFileSuffix; + } + linkList << xmlFileLink; + for (const auto& script : pPreset->getScriptFiles()) { QString scriptFileLink = QStringLiteral("") + @@ -298,8 +308,7 @@ QString DlgPrefController::presetScriptFileLinks( QStringLiteral(" (") + tr("missing") + QStringLiteral(")"); } else if (script.file.absoluteFilePath().startsWith( systemPresetPath)) { - scriptFileLink += - QStringLiteral(" (") + tr("built-in") + QStringLiteral(")"); + scriptFileLink += builtinFileSuffix; } linkList << scriptFileLink; @@ -484,7 +493,7 @@ void DlgPrefController::slotPresetSelected(int chosenIndex) { applyPresetChanges(); if (m_pPreset && m_pPreset->isDirty()) { if (QMessageBox::question(this, - tr("Preset has been edited"), + tr("Mapping has been edited"), tr("Do you want to save the changes?")) == QMessageBox::Yes) { savePreset(); @@ -507,33 +516,118 @@ void DlgPrefController::savePreset() { } if (!m_pPreset->isDirty()) { - qDebug() << "Preset is not dirty, no need to save it."; + qDebug() << "Mapping is not dirty, no need to save it."; return; } - QFileInfo fileInfo(m_pPreset->filePath()); - QString fileName = fileInfo.fileName(); - - // Add " (edited)" to preset name (if it's not already present) - QString editedSuffix = QStringLiteral(" (") + tr("edited") + QStringLiteral(")"); - if (!m_pPreset->name().endsWith(editedSuffix)) { - m_pPreset->setName(m_pPreset->name() + editedSuffix); - qDebug() << "Renamed preset to " << m_pPreset->name(); + QString oldFilePath = m_pPreset->filePath(); + QString newFilePath; + QFileInfo fileInfo(oldFilePath); + QString presetName = m_pPreset->name(); + + bool isUserPreset = fileInfo.absoluteDir().absolutePath().append("/") == m_pUserDir; + bool saveAsNew = true; + if (m_pOverwritePresets.contains(oldFilePath) && + m_pOverwritePresets.value(oldFilePath) == true) { + saveAsNew = false; + } + + // If this is a user preset, ask whether to overwrite or save with new name. + // Optionally, tick checkbox to always overwrite this preset in the current session. + if (isUserPreset && saveAsNew) { + QString overwriteTitle = tr("Preset already exists."); + QString overwriteLabel = tr( + "%1 already exists in user preset folder.
" + "Overwrite or save with a new name?"); + QString overwriteCheckLabel = tr("Always overwrite during this session"); + + QMessageBox overwriteMsgBox; + overwriteMsgBox.setIcon(QMessageBox::Question); + overwriteMsgBox.setWindowTitle(overwriteTitle); + overwriteMsgBox.setText(overwriteLabel.arg(presetName)); + QCheckBox overwriteCheckBox; + overwriteCheckBox.setText(overwriteCheckLabel); + overwriteCheckBox.blockSignals(true); + overwriteCheckBox.setCheckState(Qt::Unchecked); + overwriteMsgBox.addButton(&overwriteCheckBox, QMessageBox::ActionRole); + QPushButton* pSaveAsNew = overwriteMsgBox.addButton( + tr("Save As"), QMessageBox::AcceptRole); + QPushButton* pOverwrite = overwriteMsgBox.addButton( + tr("Overwrite"), QMessageBox::AcceptRole); + overwriteMsgBox.setDefaultButton(pSaveAsNew); + overwriteMsgBox.exec(); + + if (overwriteMsgBox.clickedButton() == pOverwrite) { + saveAsNew = false; + if (overwriteCheckBox.checkState() == Qt::Checked) { + m_pOverwritePresets.insert(m_pPreset->filePath(), true); + } + } else if (overwriteMsgBox.close()) { + return; + } + } - // Add " (edited)" to file name (if it's not already present) - QString baseName = fileInfo.baseName(); - if (baseName.endsWith(editedSuffix)) { - baseName.chop(editedSuffix.size()); + // Ask for a preset name when + // * initially saving a modified Mixxx preset to the user folder + // * saving a user preset with a new name. + // The name will be used as display name and file name. + if (!saveAsNew) { + newFilePath = oldFilePath; + } else { + QString savePresetTitle = tr("Save user mapping"); + QString savePresetLabel = tr("Enter the name for saving the mapping to the user folder."); + QString savingFailedTitle = tr("Saving mapping failed"); + QString invalidNameLabel = + tr("A mapping cannot have a blank name and may not contain " + "special characters."); + QString fileExistsLabel = tr("A mapping file with that name already exists."); + // Only allow the name to contain letters, numbers, whitespaces and _-+()/ + const QRegExp rxRemove = QRegExp("[^[(a-zA-Z0-9\\_\\-\\+\\(\\)\\/|\\s]"); + + // Choose a new file (base) name + bool validPresetName = false; + while (!validPresetName) { + QString userDir = m_pUserDir; + bool ok = false; + presetName = QInputDialog::getText(nullptr, + savePresetTitle, + savePresetLabel, + QLineEdit::Normal, + presetName, + &ok) + .remove(rxRemove) + .trimmed(); + if (!ok) { + return; + } + if (presetName.isEmpty()) { + QMessageBox::warning(nullptr, + savingFailedTitle, + invalidNameLabel); + continue; + } + // While / is allowed for the display name we can't use it for the file name. + QString fileName = presetName.replace(QString("/"), QString("-")); + newFilePath = userDir + fileName + kPresetExt; + if (QFile::exists(newFilePath)) { + QMessageBox::warning(nullptr, + savingFailedTitle, + fileExistsLabel); + continue; + } + validPresetName = true; } - fileName = baseName + editedSuffix + QStringLiteral(".") + fileInfo.completeSuffix(); + m_pPreset->setName(presetName); + qDebug() << "Mapping renamed to" << m_pPreset->name(); } - QString filePath = QDir(userPresetsPath(m_pConfig)).absoluteFilePath(fileName); - if (!m_pPreset->savePreset(filePath)) { - qDebug() << "Failed to save preset!"; + if (!m_pPreset->savePreset(newFilePath)) { + qDebug() << "Failed to save mapping as" << newFilePath; + return; } + qDebug() << "Mapping saved as" << newFilePath; - m_pPreset->setFilePath(filePath); + m_pPreset->setFilePath(newFilePath); m_pPreset->setDirty(false); enumeratePresets(m_pPreset->filePath()); @@ -590,8 +684,8 @@ void DlgPrefController::slotShowPreset(ControllerPresetPointer preset) { QString support = supportLinks.join("  "); m_ui.labelLoadedPresetSupportLinks->setText(support); - QString scriptFiles = presetScriptFileLinks(preset); - m_ui.labelLoadedPresetScriptFileLinks->setText(scriptFiles); + QString mappingFileLinks = presetFileLinks(preset); + m_ui.labelLoadedPresetScriptFileLinks->setText(mappingFileLinks); // We mutate this preset so keep a reference to it while we are using it. // TODO(rryan): Clone it? Technically a waste since nothing else uses this diff --git a/src/controllers/dlgprefcontroller.h b/src/controllers/dlgprefcontroller.h index 845494d43cb..8b114d9719a 100644 --- a/src/controllers/dlgprefcontroller.h +++ b/src/controllers/dlgprefcontroller.h @@ -1,10 +1,4 @@ -/// @file dlgprefcontroller.h -/// @author Sean M. Pappalardo spappalardo@mixxx.org -/// @date Mon May 2 2011 -/// @brief Configuration dialog for a single DJ controller - -#ifndef DLGPREFCONTROLLER_H -#define DLGPREFCONTROLLER_H +#pragma once #include #include @@ -23,6 +17,7 @@ class Controller; class ControllerManager; class PresetInfoEnumerator; +/// Configuration dialog for a single DJ controller class DlgPrefController : public DlgPreferencePage { Q_OBJECT public: @@ -74,7 +69,7 @@ class DlgPrefController : public DlgPreferencePage { QString presetForumLink(const ControllerPresetPointer pPreset) const; QString presetManualLink(const ControllerPresetPointer pPreset) const; QString presetWikiLink(const ControllerPresetPointer pPreset) const; - QString presetScriptFileLinks(const ControllerPresetPointer pPreset) const; + QString presetFileLinks(const ControllerPresetPointer pPreset) const; void applyPresetChanges(); void savePreset(); void initTableView(QTableView* pTable); @@ -110,15 +105,15 @@ class DlgPrefController : public DlgPreferencePage { Ui::DlgPrefControllerDlg m_ui; UserSettingsPointer m_pConfig; + const QString m_pUserDir; ControllerManager* m_pControllerManager; Controller* m_pController; DlgControllerLearning* m_pDlgControllerLearning; ControllerPresetPointer m_pPreset; + QMap m_pOverwritePresets; ControllerInputMappingTableModel* m_pInputTableModel; QSortFilterProxyModel* m_pInputProxyModel; ControllerOutputMappingTableModel* m_pOutputTableModel; QSortFilterProxyModel* m_pOutputProxyModel; bool m_bDirty; }; - -#endif /*DLGPREFCONTROLLER_H*/ diff --git a/src/controllers/dlgprefcontrollerdlg.ui b/src/controllers/dlgprefcontrollerdlg.ui index ff52f35aa2d..a930029f6d2 100644 --- a/src/controllers/dlgprefcontrollerdlg.ui +++ b/src/controllers/dlgprefcontrollerdlg.ui @@ -116,7 +116,7 @@ - Load Preset: + Load Mapping: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -204,11 +204,11 @@ - Preset Info + Mapping Info - + 0 @@ -241,7 +241,7 @@ - (preset name goes here) + (mapping name goes here) true @@ -273,7 +273,7 @@ - (preset author goes here) + (mapping author goes here) @@ -314,7 +314,7 @@ - (preset description goes here) even when it is a damn long text which should wrap but does not + (mapping description goes here) even when it is a damn long text which should wrap but does not Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -358,7 +358,7 @@ Qt::ImhUrlCharactersOnly - (forum link for preset goes here) + (forum link for mapping goes here) true @@ -377,7 +377,7 @@ - Script Files: + Mapping Files: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing @@ -402,7 +402,7 @@ Qt::ImhUrlCharactersOnly - (links to loaded preset script files go here) + (links to loaded mapping script files go here) false diff --git a/src/controllers/dlgprefcontrollers.cpp b/src/controllers/dlgprefcontrollers.cpp index 21110d3c729..99a23e76211 100644 --- a/src/controllers/dlgprefcontrollers.cpp +++ b/src/controllers/dlgprefcontrollers.cpp @@ -6,6 +6,7 @@ #include "controllers/defs_controllers.h" #include "controllers/dlgprefcontroller.h" #include "defs_urls.h" +#include "moc_dlgprefcontrollers.cpp" #include "preferences/dialog/dlgpreferences.h" DlgPrefControllers::DlgPrefControllers(DlgPreferences* pPreferences, diff --git a/src/controllers/dlgprefcontrollersdlg.ui b/src/controllers/dlgprefcontrollersdlg.ui index a3ec8586eb0..45894afc14f 100644 --- a/src/controllers/dlgprefcontrollersdlg.ui +++ b/src/controllers/dlgprefcontrollersdlg.ui @@ -76,7 +76,7 @@ - Presets + Mappings @@ -88,7 +88,7 @@ - Mixxx uses "presets" to connect messages from your controller to controls in Mixxx. If you do not see a preset for your controller in the "Load Preset" menu when you click on your controller on the left sidebar, you may be able to download one online from the <a href="https://mixxx.discourse.group/c/controller-mappings/10">Mixxx Forum</a>. Place the XML (.xml) and Javascript (.js) file(s) in the "User Preset Folder" then restart Mixxx. If you download a mapping in a ZIP file, extract the XML and Javascript file(s) from the ZIP file to your "User Preset Folder" then restart Mixxx: + Mixxx uses "mappings" to connect messages from your controller to controls in Mixxx. If you do not see a mapping for your controller in the "Load Mapping" menu when you click on your controller on the left sidebar, you may be able to download one online from the <a href="https://mixxx.discourse.group/c/controller-mappings/10">Mixxx Forum</a>. Place the XML (.xml) and Javascript (.js) file(s) in the "User Mapping Folder" then restart Mixxx. If you download a mapping in a ZIP file, extract the XML and Javascript file(s) from the ZIP file to your "User Mapping Folder" then restart Mixxx: true @@ -107,7 +107,7 @@ - Open User Preset Folder + Open User Mapping Folder @@ -159,7 +159,7 @@ - <a href="https://github.com/mixxxdj/mixxx/wiki/Midi-Controller-Mapping-File-Format">MIDI Preset File Format</a> + <a href="https://github.com/mixxxdj/mixxx/wiki/Midi-Controller-Mapping-File-Format">MIDI Mapping File Format</a> true diff --git a/src/controllers/hid/hidcontroller.cpp b/src/controllers/hid/hidcontroller.cpp index d050dd90ee9..fbddbab6580 100644 --- a/src/controllers/hid/hidcontroller.cpp +++ b/src/controllers/hid/hidcontroller.cpp @@ -1,8 +1,11 @@ #include "controllers/hid/hidcontroller.h" +#include + #include "controllers/controllerdebug.h" #include "controllers/defs_controllers.h" #include "controllers/hid/hidcontrollerpresetfilehandler.h" +#include "moc_hidcontroller.cpp" #include "util/string.h" #include "util/time.h" #include "util/trace.h" diff --git a/src/controllers/hid/hidcontroller.h b/src/controllers/hid/hidcontroller.h index 9300e495af4..5d51cb0d806 100644 --- a/src/controllers/hid/hidcontroller.h +++ b/src/controllers/hid/hidcontroller.h @@ -5,6 +5,7 @@ #include "controllers/hid/hiddevice.h" #include "util/duration.h" +/// HID controller backend class HidController final : public Controller { Q_OBJECT public: diff --git a/src/controllers/hid/hidcontrollerpreset.cpp b/src/controllers/hid/hidcontrollerpreset.cpp index 5bcbd327255..562847e75cb 100644 --- a/src/controllers/hid/hidcontrollerpreset.cpp +++ b/src/controllers/hid/hidcontrollerpreset.cpp @@ -1,7 +1,4 @@ -/// @file hidcontrollerpreset.cpp -/// @author Jan Holthuis holzhaus@mixxx.org -/// @date Mon 8 Apr 2020 -/// @brief HID/Bulk Controller Preset +/// HID/Bulk Controller Preset /// /// This class represents a HID or Bulk controller preset, containing the data /// elements that make it up. diff --git a/src/controllers/hid/hidcontrollerpreset.h b/src/controllers/hid/hidcontrollerpreset.h index 08aed797229..3291b8caee5 100644 --- a/src/controllers/hid/hidcontrollerpreset.h +++ b/src/controllers/hid/hidcontrollerpreset.h @@ -1,6 +1,4 @@ #pragma once -/// @file hidcontrollerpreset.h -/// @brief HID/Bulk Controller Preset #include "controllers/controllerpreset.h" #include "controllers/controllerpresetvisitor.h" diff --git a/src/controllers/hid/hidcontrollerpresetfilehandler.h b/src/controllers/hid/hidcontrollerpresetfilehandler.h index 7f99f56481d..5baffd229d3 100644 --- a/src/controllers/hid/hidcontrollerpresetfilehandler.h +++ b/src/controllers/hid/hidcontrollerpresetfilehandler.h @@ -1,5 +1,4 @@ -#ifndef HIDCONTROLLERPRESETFILEHANDLER_H -#define HIDCONTROLLERPRESETFILEHANDLER_H +#pragma once #include "controllers/hid/hidcontrollerpreset.h" #include "controllers/controllerpresetfilehandler.h" @@ -16,5 +15,3 @@ class HidControllerPresetFileHandler : public ControllerPresetFileHandler { const QString& filePath, const QDir& systemPresetsPath); }; - -#endif /* HIDCONTROLLERPRESETFILEHANDLER_H */ diff --git a/src/controllers/hid/hiddevice.cpp b/src/controllers/hid/hiddevice.cpp index bbc8f2a1613..43963f64a65 100644 --- a/src/controllers/hid/hiddevice.cpp +++ b/src/controllers/hid/hiddevice.cpp @@ -3,6 +3,7 @@ #include #include "controllers/controllerpresetinfo.h" +#include "moc_hiddevice.cpp" #include "util/path.h" // for PATH_MAX on Windows #include "util/string.h" diff --git a/src/controllers/hid/hidenumerator.h b/src/controllers/hid/hidenumerator.h index c2e7bd8202b..6d35a22a2c5 100644 --- a/src/controllers/hid/hidenumerator.h +++ b/src/controllers/hid/hidenumerator.h @@ -1,15 +1,9 @@ -/** -* @file hidenumerator.h -* @author Sean Pappalardo spappalardo@mixxx.org -* @date Sat Apr 30 2011 -* @brief This class handles discovery and enumeration of DJ controllers that use the USB-HID protocol -*/ - -#ifndef HIDENUMERATOR_H -#define HIDENUMERATOR_H +#pragma once #include "controllers/controllerenumerator.h" +/// This class handles discovery and enumeration of DJ controllers that use the +/// USB-HID protocol. class HidEnumerator : public ControllerEnumerator { public: HidEnumerator() = default; @@ -20,5 +14,3 @@ class HidEnumerator : public ControllerEnumerator { private: QList m_devices; }; - -#endif diff --git a/src/controllers/keyboard/keyboardeventfilter.cpp b/src/controllers/keyboard/keyboardeventfilter.cpp index 28305f59ff5..8722ab770e4 100644 --- a/src/controllers/keyboard/keyboardeventfilter.cpp +++ b/src/controllers/keyboard/keyboardeventfilter.cpp @@ -1,10 +1,12 @@ +#include "controllers/keyboard/keyboardeventfilter.h" + +#include +#include #include #include -#include -#include -#include "controllers/keyboard/keyboardeventfilter.h" #include "control/controlobject.h" +#include "moc_keyboardeventfilter.cpp" #include "util/cmdlineargs.h" KeyboardEventFilter::KeyboardEventFilter(ConfigObject* pKbdConfigObject, diff --git a/src/controllers/keyboard/keyboardeventfilter.h b/src/controllers/keyboard/keyboardeventfilter.h index 224250c542f..b557a4a8c54 100644 --- a/src/controllers/keyboard/keyboardeventfilter.h +++ b/src/controllers/keyboard/keyboardeventfilter.h @@ -1,5 +1,4 @@ -#ifndef CONTROLLERS_KEYBOARD_KEYBOARDEVENTFILTER_H -#define CONTROLLERS_KEYBOARD_KEYBOARDEVENTFILTER_H +#pragma once #include #include @@ -47,5 +46,3 @@ class KeyboardEventFilter : public QObject { // Multi-hash of key sequence to QMultiHash m_keySequenceToControlHash; }; - -#endif // CONTROLLERS_KEYBOARD_KEYBOARDEVENTFILTER_H diff --git a/src/controllers/learningutils.h b/src/controllers/learningutils.h index a82c102aaa3..575b395c6e7 100644 --- a/src/controllers/learningutils.h +++ b/src/controllers/learningutils.h @@ -1,5 +1,4 @@ -#ifndef LEARNINGUTILS_H -#define LEARNINGUTILS_H +#pragma once #include #include @@ -12,5 +11,3 @@ class LearningUtils { const ConfigKey& control, const QList >& messages); }; - -#endif /* LEARNINGUTILS_H */ diff --git a/src/controllers/midi/hss1394controller.cpp b/src/controllers/midi/hss1394controller.cpp index ec59cecf569..d73e2062124 100644 --- a/src/controllers/midi/hss1394controller.cpp +++ b/src/controllers/midi/hss1394controller.cpp @@ -1,13 +1,8 @@ -/** - * @file hss1394controller.cpp - * @author Sean M. Pappalardo spappalardo@mixxx.org - * @date Thu 15 Mar 2012 - * @brief HSS1394-based MIDI backend - */ - -#include "controllers/midi/midiutils.h" #include "controllers/midi/hss1394controller.h" + #include "controllers/controllerdebug.h" +#include "controllers/midi/midiutils.h" +#include "moc_hss1394controller.cpp" #include "util/time.h" DeviceChannelListener::DeviceChannelListener(QObject* pParent, QString name) diff --git a/src/controllers/midi/hss1394controller.h b/src/controllers/midi/hss1394controller.h index 7c08525b23f..1f1cbf57e55 100644 --- a/src/controllers/midi/hss1394controller.h +++ b/src/controllers/midi/hss1394controller.h @@ -1,18 +1,4 @@ -/** - * @file hss1394controller.h - * @author Sean M. Pappalardo spappalardo@mixxx.org - * @date Thu 15 Mar 2012 - * @brief HSS1394-based MIDI backend - * - * This class represents a physical HSS1394 device. - * (HSS1394 is simply a way to send MIDI messages at high speed over - * IEEE1394 (FireWire)) - * It uses the HSS1394 API to send and receive MIDI messages to/from - * the device. - */ - -#ifndef HSS1394CONTROLLER_H -#define HSS1394CONTROLLER_H +#pragma once #include @@ -22,6 +8,11 @@ #define MIXXX_HSS1394_BUFFER_LEN 64 /**Number of MIDI messages to buffer*/ #define MIXXX_HSS1394_NO_DEVICE_STRING "None" /**String to display for no HSS1394 devices present */ +/// HSS1394-based MIDI backend +/// +/// This class represents a physical HSS1394 device. (HSS1394 is simply a way +/// to send MIDI messages at high speed over IEEE1394 (FireWire)) It uses the +/// HSS1394 API to send and receive MIDI messages to/from the device. class DeviceChannelListener : public QObject, public hss1394::ChannelListener { Q_OBJECT public: @@ -71,5 +62,3 @@ class Hss1394Controller : public MidiController { hss1394::Channel* m_pChannel; DeviceChannelListener *m_pChannelListener; }; - -#endif diff --git a/src/controllers/midi/hss1394enumerator.cpp b/src/controllers/midi/hss1394enumerator.cpp index 9c29ac98ee3..76a120c9701 100644 --- a/src/controllers/midi/hss1394enumerator.cpp +++ b/src/controllers/midi/hss1394enumerator.cpp @@ -1,13 +1,9 @@ -/** -* @file hss1394enumerator.cpp -* @author Sean Pappalardo spappalardo@mixxx.org -* @date Thu 15 Mar 2012 -*/ +#include "controllers/midi/hss1394enumerator.h" #include #include "controllers/midi/hss1394controller.h" -#include "controllers/midi/hss1394enumerator.h" +#include "moc_hss1394enumerator.cpp" Hss1394Enumerator::Hss1394Enumerator(UserSettingsPointer pConfig) : MidiEnumerator(), diff --git a/src/controllers/midi/hss1394enumerator.h b/src/controllers/midi/hss1394enumerator.h index 5b52a9c0a69..725aaba5f1f 100644 --- a/src/controllers/midi/hss1394enumerator.h +++ b/src/controllers/midi/hss1394enumerator.h @@ -1,15 +1,9 @@ -/** -* @file hss1394enumerator.h -* @author Sean Pappalardo spappalardo@mixxx.org -* @date Thu 15 Mar 2012 -* @brief This class handles discovery and enumeration of DJ controllers that appear under the HSS1394 cross-platform API. -*/ - -#ifndef HSS1394ENUMERATOR_H -#define HSS1394ENUMERATOR_H +#pragma once #include "controllers/midi/midienumerator.h" +// Handles discovery and enumeration of DJ controllers that appear under the +// HSS1394 cross-platform API. class Hss1394Enumerator : public MidiEnumerator { Q_OBJECT public: @@ -22,5 +16,3 @@ class Hss1394Enumerator : public MidiEnumerator { UserSettingsPointer m_pConfig; QList m_devices; }; - -#endif diff --git a/src/controllers/midi/midicontroller.cpp b/src/controllers/midi/midicontroller.cpp index 7790321d9cb..d5272c29b3f 100644 --- a/src/controllers/midi/midicontroller.cpp +++ b/src/controllers/midi/midicontroller.cpp @@ -1,19 +1,12 @@ -/** - * @file midicontroller.cpp - * @author Sean Pappalardo spappalardo@mixxx.org - * @date Tue 7 Feb 2012 - * @brief MIDI Controller base class - * - */ - #include "controllers/midi/midicontroller.h" -#include "controllers/midi/midiutils.h" -#include "controllers/defs_controllers.h" -#include "controllers/controllerdebug.h" #include "control/controlobject.h" +#include "controllers/controllerdebug.h" +#include "controllers/defs_controllers.h" +#include "controllers/midi/midiutils.h" #include "errordialoghandler.h" #include "mixer/playermanager.h" +#include "moc_midicontroller.cpp" #include "util/math.h" #include "util/screensaver.h" diff --git a/src/controllers/midi/midicontroller.h b/src/controllers/midi/midicontroller.h index 34a184b3bc1..aa46335c2a3 100644 --- a/src/controllers/midi/midicontroller.h +++ b/src/controllers/midi/midicontroller.h @@ -1,17 +1,4 @@ -/** -* @file midicontroller.h -* @author Sean Pappalardo spappalardo@mixxx.org -* @date Tue 7 Feb 2012 -* @brief MIDI Controller base class -* -* This is a base class representing a MIDI controller. -* It must be inherited by a class that implements it on some API. -* -* Note that the subclass' destructor should call close() at a minimum. -*/ - -#ifndef MIDICONTROLLER_H -#define MIDICONTROLLER_H +#pragma once #include "controllers/controller.h" #include "controllers/midi/midicontrollerpreset.h" @@ -20,6 +7,14 @@ #include "controllers/midi/midioutputhandler.h" #include "controllers/softtakeover.h" +class DlgControllerLearning; + +/// MIDI Controller base class +/// +/// This is a base class representing a MIDI controller. +/// It must be inherited by a class that implements it on some API. +/// +/// Note that the subclass' destructor should call close() at a minimum. class MidiController : public Controller { Q_OBJECT public: @@ -49,11 +44,10 @@ class MidiController : public Controller { return m_preset.isMappable(); } - bool matchPreset(const PresetInfo& preset) override; + bool matchPreset(const PresetInfo& preset) override; signals: - void messageReceived(unsigned char status, unsigned char control, - unsigned char value); + void messageReceived(unsigned char status, unsigned char control, unsigned char value); protected: virtual void sendShortMsg(unsigned char status, @@ -144,5 +138,3 @@ class MidiControllerJSProxy : public ControllerJSProxy { private: MidiController* m_pMidiController; }; - -#endif diff --git a/src/controllers/midi/midicontrollerpreset.cpp b/src/controllers/midi/midicontrollerpreset.cpp index 844746f50db..bbeadc97c6b 100644 --- a/src/controllers/midi/midicontrollerpreset.cpp +++ b/src/controllers/midi/midicontrollerpreset.cpp @@ -1,11 +1,3 @@ -/// @file midicontrollerpreset.cpp -/// @author Jan Holthuis holzhaus@mixxx.org -/// @date Wed 8 Apr 2020 -/// @brief MIDI Controller Preset -/// -/// This class represents a MIDI controller preset, containing the data elements -/// that make it up. - #include "controllers/midi/midicontrollerpreset.h" #include "controllers/defs_controllers.h" diff --git a/src/controllers/midi/midicontrollerpreset.h b/src/controllers/midi/midicontrollerpreset.h index f077f0f8f33..a001996fd78 100644 --- a/src/controllers/midi/midicontrollerpreset.h +++ b/src/controllers/midi/midicontrollerpreset.h @@ -1,8 +1,4 @@ #pragma once -/// @file midicontrollerpreset.h -/// @author Sean Pappalardo spappalardo@mixxx.org -/// @date Mon 9 Apr 2012 -/// @brief MIDI Controller preset #include @@ -10,8 +6,8 @@ #include "controllers/controllerpresetvisitor.h" #include "controllers/midi/midimessage.h" -/// This class represents a MIDI controller preset, containing the data elements -/// that make it up. +/// Represents a MIDI controller preset, containing the data elements that make +/// it up. class MidiControllerPreset : public ControllerPreset { public: MidiControllerPreset(){}; diff --git a/src/controllers/midi/midicontrollerpresetfilehandler.cpp b/src/controllers/midi/midicontrollerpresetfilehandler.cpp index fddafd929a7..838b915482f 100644 --- a/src/controllers/midi/midicontrollerpresetfilehandler.cpp +++ b/src/controllers/midi/midicontrollerpresetfilehandler.cpp @@ -1,11 +1,3 @@ -/** -* @file midicontrollerpresetfilehandler.cpp -* @author Sean Pappalardo spappalardo@mixxx.org -* @date Mon 9 Apr 2012 -* @brief Handles loading and saving of MIDI controller presets. -* -*/ - #include "controllers/midi/midicontrollerpresetfilehandler.h" #include "controllers/midi/midiutils.h" diff --git a/src/controllers/midi/midicontrollerpresetfilehandler.h b/src/controllers/midi/midicontrollerpresetfilehandler.h index ad7c43419e0..44d82dd373d 100644 --- a/src/controllers/midi/midicontrollerpresetfilehandler.h +++ b/src/controllers/midi/midicontrollerpresetfilehandler.h @@ -1,16 +1,9 @@ -/** - * @file midicontrollerpresetfilehandler.h - * @author Sean Pappalardo spappalardo@mixxx.org - * @date Mon 9 Apr 2012 - * @brief Handles loading and saving of MIDI controller presets. - */ - -#ifndef MIDICONTROLLERPRESETFILEHANDLER_H -#define MIDICONTROLLERPRESETFILEHANDLER_H +#pragma once #include "controllers/controllerpresetfilehandler.h" #include "controllers/midi/midicontrollerpreset.h" +/// Handles loading and saving of MIDI controller presets. class MidiControllerPresetFileHandler : public ControllerPresetFileHandler { public: MidiControllerPresetFileHandler() {}; @@ -36,5 +29,3 @@ class MidiControllerPresetFileHandler : public ControllerPresetFileHandler { QDomElement outputMappingToXML(QDomDocument* doc, const MidiOutputMapping& mapping) const; }; - -#endif diff --git a/src/controllers/midi/midienumerator.cpp b/src/controllers/midi/midienumerator.cpp index 1cbee7223f8..f7067f343c4 100644 --- a/src/controllers/midi/midienumerator.cpp +++ b/src/controllers/midi/midienumerator.cpp @@ -8,6 +8,8 @@ #include "controllers/midi/midienumerator.h" +#include "moc_midienumerator.cpp" + MidiEnumerator::MidiEnumerator() : ControllerEnumerator() { } diff --git a/src/controllers/midi/midimessage.h b/src/controllers/midi/midimessage.h index 2587603cb55..80ad2d5fac3 100644 --- a/src/controllers/midi/midimessage.h +++ b/src/controllers/midi/midimessage.h @@ -1,5 +1,4 @@ -#ifndef MIDIMESSAGE_H -#define MIDIMESSAGE_H +#pragma once #include #include @@ -193,5 +192,3 @@ struct MidiOutputMapping { QString description; }; typedef QList MidiOutputMappings; - -#endif diff --git a/src/controllers/midi/midioutputhandler.cpp b/src/controllers/midi/midioutputhandler.cpp index f2ad6aac90b..bf3bb4dc012 100644 --- a/src/controllers/midi/midioutputhandler.cpp +++ b/src/controllers/midi/midioutputhandler.cpp @@ -1,17 +1,11 @@ -/** - * @file midioutputhandler.cpp - * @author Sean Pappalardo spappalardo@mixxx.org - * @date Tue 11 Feb 2012 - * @brief MIDI output mapping handler - * - */ +#include "controllers/midi/midioutputhandler.h" #include -#include "controllers/midi/midioutputhandler.h" -#include "controllers/midi/midicontroller.h" -#include "controllers/controllerdebug.h" #include "control/controlobject.h" +#include "controllers/controllerdebug.h" +#include "controllers/midi/midicontroller.h" +#include "moc_midioutputhandler.cpp" MidiOutputHandler::MidiOutputHandler(MidiController* controller, const MidiOutputMapping& mapping) diff --git a/src/controllers/midi/midioutputhandler.h b/src/controllers/midi/midioutputhandler.h index 9b1230b8e54..dc64911d029 100644 --- a/src/controllers/midi/midioutputhandler.h +++ b/src/controllers/midi/midioutputhandler.h @@ -1,21 +1,14 @@ -/** - * @file midioutputhandler.h - * @author Sean Pappalardo spappalardo@mixxx.org - * @date Tue 11 Feb 2012 - * @brief Static MIDI output mapping handler - * - * This class listens to a control object and sends a midi message based on the - * value. - */ - -#ifndef MIDIOUTPUTHANDLER_H -#define MIDIOUTPUTHANDLER_H +#pragma once #include "control/controlproxy.h" #include "controllers/midi/midimessage.h" class MidiController; +/// Static MIDI output mapping handler +/// +/// This class listens to a control object and sends a midi message based on +/// the value. class MidiOutputHandler : public QObject { Q_OBJECT public: @@ -35,5 +28,3 @@ class MidiOutputHandler : public QObject { ControlProxy m_cos; int m_lastVal; }; - -#endif diff --git a/src/controllers/midi/midiutils.h b/src/controllers/midi/midiutils.h index 56e912929c3..f2ab12ec40a 100644 --- a/src/controllers/midi/midiutils.h +++ b/src/controllers/midi/midiutils.h @@ -1,5 +1,4 @@ -#ifndef MIDIUTILS_H -#define MIDIUTILS_H +#pragma once #include "controllers/midi/midimessage.h" #include "util/duration.h" @@ -48,6 +47,3 @@ class MidiUtils { const QByteArray& data, mixxx::Duration timestamp = mixxx::Duration::fromMillis(0)); }; - - -#endif /* MIDIUTILS_H */ diff --git a/src/controllers/midi/portmidicontroller.cpp b/src/controllers/midi/portmidicontroller.cpp index b3932938163..d2dfbe5f83a 100644 --- a/src/controllers/midi/portmidicontroller.cpp +++ b/src/controllers/midi/portmidicontroller.cpp @@ -1,15 +1,8 @@ -/** - * @file portmidicontroller.h - * @author Albert Santoni alberts@mixxx.org - * @author Sean M. Pappalardo spappalardo@mixxx.org - * @date Thu 15 Mar 2012 - * @brief PortMidi-based MIDI backend - * - */ - -#include "controllers/midi/midiutils.h" #include "controllers/midi/portmidicontroller.h" + #include "controllers/controllerdebug.h" +#include "controllers/midi/midiutils.h" +#include "moc_portmidicontroller.cpp" PortMidiController::PortMidiController(const PmDeviceInfo* inputDeviceInfo, const PmDeviceInfo* outputDeviceInfo, diff --git a/src/controllers/midi/portmidicontroller.h b/src/controllers/midi/portmidicontroller.h index 45770edebdf..25012eb1ac9 100644 --- a/src/controllers/midi/portmidicontroller.h +++ b/src/controllers/midi/portmidicontroller.h @@ -1,21 +1,4 @@ -/** - * @file portmidicontroller.h - * @author Albert Santoni alberts@mixxx.org - * @author Sean M. Pappalardo spappalardo@mixxx.org - * @date Thu 15 Mar 2012 - * @brief PortMidi-based MIDI backend - * - * This class is represents a MIDI device, either physical or software. - * It uses the PortMidi API to send and receive MIDI messages to/from the device. - * It's important to note that PortMidi treats input and output on a single - * physical device as two separate half-duplex devices. In this class, we wrap - * those together into a single device, which is why the constructor takes - * both arguments pertaining to both input and output "devices". - * - */ - -#ifndef PORTMIDICONTROLLER_H -#define PORTMIDICONTROLLER_H +#pragma once #include @@ -55,7 +38,14 @@ // String to display for no MIDI devices present #define MIXXX_PORTMIDI_NO_DEVICE_STRING "None" -// A PortMidi-based implementation of MidiController +/// PortMidi-based implementation of MidiController +/// +/// This class is represents a MIDI device, either physical or software. +/// It uses the PortMidi API to send and receive MIDI messages to/from the device. +/// It's important to note that PortMidi treats input and output on a single +/// physical device as two separate half-duplex devices. In this class, we wrap +/// those together into a single device, which is why the constructor takes +/// both arguments pertaining to both input and output "devices". class PortMidiController : public MidiController { Q_OBJECT public: @@ -104,5 +94,3 @@ class PortMidiController : public MidiController { friend class PortMidiControllerTest; }; - -#endif diff --git a/src/controllers/midi/portmididevice.h b/src/controllers/midi/portmididevice.h index 071ddee38a4..bda613ab3e7 100644 --- a/src/controllers/midi/portmididevice.h +++ b/src/controllers/midi/portmididevice.h @@ -1,5 +1,4 @@ -#ifndef CONTROLLERS_MIDI_PORTMIDIDEVICE -#define CONTROLLERS_MIDI_PORTMIDIDEVICE +#pragma once #include @@ -72,5 +71,3 @@ class PortMidiDevice { int m_deviceIndex; PortMidiStream* m_pStream; }; - -#endif /* CONTROLLERS_MIDI_PORTMIDIDEVICE */ diff --git a/src/controllers/midi/portmidienumerator.cpp b/src/controllers/midi/portmidienumerator.cpp index d56a087d135..4958ca82681 100644 --- a/src/controllers/midi/portmidienumerator.cpp +++ b/src/controllers/midi/portmidienumerator.cpp @@ -1,16 +1,11 @@ -/** -* @file portmidienumerator.cpp -* @author Sean Pappalardo spappalardo@mixxx.org -* @date Thu 15 Mar 2012 -* @brief This class handles discovery and enumeration of DJ controller devices that appear under the PortMIDI cross-platform API. -*/ +#include "controllers/midi/portmidienumerator.h" #include -#include -#include "controllers/midi/portmidienumerator.h" +#include #include "controllers/midi/portmidicontroller.h" +#include "moc_portmidienumerator.cpp" #include "util/cmdlineargs.h" namespace { diff --git a/src/controllers/midi/portmidienumerator.h b/src/controllers/midi/portmidienumerator.h index 6be217dfe4e..21548c90dd3 100644 --- a/src/controllers/midi/portmidienumerator.h +++ b/src/controllers/midi/portmidienumerator.h @@ -1,15 +1,8 @@ -/** - * @file portmidienumerator.h - * @author Sean Pappalardo spappalardo@mixxx.org - * @date Thu 15 Mar 2012 - * @brief This class handles discovery and enumeration of DJ controllers that appear under the PortMIDI cross-platform API. - */ - -#ifndef PORTMIDIENUMERATOR_H -#define PORTMIDIENUMERATOR_H +#pragma once #include "controllers/midi/midienumerator.h" +/// This class handles discovery and enumeration of DJ controllers that appear under the PortMIDI cross-platform API. class PortMidiEnumerator : public MidiEnumerator { Q_OBJECT public: @@ -25,5 +18,3 @@ class PortMidiEnumerator : public MidiEnumerator { // For testing. bool shouldLinkInputToOutput(const QString& input_name, const QString& output_name); - -#endif diff --git a/src/controllers/scripting/colormapperjsproxy.cpp b/src/controllers/scripting/colormapperjsproxy.cpp index d09e77d26b3..582bb2aa372 100644 --- a/src/controllers/scripting/colormapperjsproxy.cpp +++ b/src/controllers/scripting/colormapperjsproxy.cpp @@ -1,5 +1,7 @@ #include "controllers/scripting/colormapperjsproxy.h" +#include "moc_colormapperjsproxy.cpp" + ColorMapperJSProxy::ColorMapperJSProxy(const QVariantMap& availableColors) : m_pColorMapper(nullptr) { QMap qrgbMap; diff --git a/src/controllers/softtakeover.cpp b/src/controllers/softtakeover.cpp index eea05b56910..e0211fde446 100644 --- a/src/controllers/softtakeover.cpp +++ b/src/controllers/softtakeover.cpp @@ -1,11 +1,3 @@ -/*************************************************************************** - softtakeover.cpp - description - ---------------- - begin : Sat Mar 26 2011 - copyright : (C) 2011 by Sean M. Pappalardo - email : spappalardo@mixxx.org - ***************************************************************************/ - #include "controllers/softtakeover.h" #include "control/controlpotmeter.h" #include "util/math.h" diff --git a/src/controllers/softtakeover.h b/src/controllers/softtakeover.h index 6a5183df706..ba439b82ad3 100644 --- a/src/controllers/softtakeover.h +++ b/src/controllers/softtakeover.h @@ -1,13 +1,4 @@ -/*************************************************************************** - softtakeover.h - description - -------------- - begin : Thu Mar 17 2011 - copyright : (C) 2011 by Sean M. Pappalardo - email : spappalardo@mixxx.org - ***************************************************************************/ - -#ifndef SOFTTAKEOVER_H -#define SOFTTAKEOVER_H +#pragma once #include @@ -63,5 +54,3 @@ class SoftTakeoverCtrl { private: QHash m_softTakeoverHash; }; - -#endif diff --git a/src/database/mixxxdb.cpp b/src/database/mixxxdb.cpp index 9d6ba17139e..ac459a296d1 100644 --- a/src/database/mixxxdb.cpp +++ b/src/database/mixxxdb.cpp @@ -1,6 +1,7 @@ #include "database/mixxxdb.h" #include "database/schemamanager.h" +#include "moc_mixxxdb.cpp" #include "util/assert.h" #include "util/logger.h" diff --git a/src/database/mixxxdb.h b/src/database/mixxxdb.h index 9899e05b898..d02a7c22803 100644 --- a/src/database/mixxxdb.h +++ b/src/database/mixxxdb.h @@ -1,6 +1,4 @@ -#ifndef MIXXXDB_H -#define MIXXXDB_H - +#pragma once #include @@ -33,6 +31,3 @@ class MixxxDb : public QObject { private: mixxx::DbConnectionPoolPtr m_pDbConnectionPool; }; - - -#endif // MIXXXDB_H diff --git a/src/defs_urls.h b/src/defs_urls.h index 876d9a08a58..4e96c42afe3 100644 --- a/src/defs_urls.h +++ b/src/defs_urls.h @@ -1,21 +1,4 @@ -/*************************************************************************** - defs_urls.h - description - ------------------- - copyright : (C) 2008 by Albert santoni - email : - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DEFS_URLS_H -#define DEFS_URLS_H +#pragma once #define MIXXX_WEBSITE_URL "https://www.mixxx.org" #define MIXXX_SUPPORT_URL "https://www.mixxx.org/support/" @@ -46,5 +29,3 @@ #define MIXXX_MANUAL_VINYL_URL \ MIXXX_MANUAL_URL "/chapters/vinyl_control.html#configuring-vinyl-control" #define MIXXX_MANUAL_FILENAME "Mixxx-Manual.pdf" - -#endif diff --git a/src/defs_version.h b/src/defs_version.h index 4eff317cbf9..73162f722f2 100644 --- a/src/defs_version.h +++ b/src/defs_version.h @@ -1,19 +1,3 @@ -/*************************************************************************** - defs_version.h - description - -------------- - copyright : (C) 2010 by Sean Pappalardo - email : - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - // Doing this in its own file avoids needlessly rebuilding everything when just // the version number changes // diff --git a/src/dialog/dlgabout.cpp b/src/dialog/dlgabout.cpp index 58b0e5ea7ad..3afc55ab4b1 100644 --- a/src/dialog/dlgabout.cpp +++ b/src/dialog/dlgabout.cpp @@ -1,7 +1,10 @@ #include "dialog/dlgabout.h" -#include "util/version.h" + #include +#include "moc_dlgabout.cpp" +#include "util/version.h" + DlgAbout::DlgAbout(QWidget* parent) : QDialog(parent), Ui::DlgAboutDlg() { setupUi(this); diff --git a/src/dialog/dlgabout.h b/src/dialog/dlgabout.h index e0ecbe980c3..a704fc2c372 100644 --- a/src/dialog/dlgabout.h +++ b/src/dialog/dlgabout.h @@ -1,5 +1,4 @@ -#ifndef DIALOG_DLGABOUT_H -#define DIALOG_DLGABOUT_H +#pragma once #include @@ -11,5 +10,3 @@ class DlgAbout : public QDialog, public Ui::DlgAboutDlg { public: DlgAbout(QWidget* parent); }; - -#endif // DIALOG_DLGABOUT_H diff --git a/src/dialog/dlgdevelopertools.cpp b/src/dialog/dlgdevelopertools.cpp index d6fe5951dd2..22e73f2cc25 100644 --- a/src/dialog/dlgdevelopertools.cpp +++ b/src/dialog/dlgdevelopertools.cpp @@ -3,9 +3,10 @@ #include #include "control/control.h" +#include "moc_dlgdevelopertools.cpp" #include "util/cmdlineargs.h" -#include "util/statsmanager.h" #include "util/logging.h" +#include "util/statsmanager.h" DlgDeveloperTools::DlgDeveloperTools(QWidget* pParent, UserSettingsPointer pConfig) diff --git a/src/dialog/dlgdevelopertools.h b/src/dialog/dlgdevelopertools.h index d36c65f769f..f3e607eac4c 100644 --- a/src/dialog/dlgdevelopertools.h +++ b/src/dialog/dlgdevelopertools.h @@ -1,5 +1,4 @@ -#ifndef DIALOG_DLGDEVELOPERTOOLS_H -#define DIALOG_DLGDEVELOPERTOOLS_H +#pragma once #include #include @@ -36,5 +35,3 @@ class DlgDeveloperTools : public QDialog, public Ui::DlgDeveloperTools { QFile m_logFile; QTextCursor m_logCursor; }; - -#endif // DIALOG_DLGDEVELOPERTOOLS_H diff --git a/src/dialog/dlgreplacecuecolor.cpp b/src/dialog/dlgreplacecuecolor.cpp index 0a68619bc51..b1047173e58 100644 --- a/src/dialog/dlgreplacecuecolor.cpp +++ b/src/dialog/dlgreplacecuecolor.cpp @@ -10,6 +10,7 @@ #include "engine/controls/cuecontrol.h" #include "library/dao/cuedao.h" #include "library/queryutil.h" +#include "moc_dlgreplacecuecolor.cpp" #include "preferences/colorpalettesettings.h" #include "track/track.h" #include "util/color/predefinedcolorpalettes.h" diff --git a/src/effects/builtin/autopaneffect.h b/src/effects/builtin/autopaneffect.h index dc4141a8bee..3538698e9f3 100644 --- a/src/effects/builtin/autopaneffect.h +++ b/src/effects/builtin/autopaneffect.h @@ -1,5 +1,4 @@ -#ifndef AUTOPANEFFECT_H -#define AUTOPANEFFECT_H +#pragma once #include @@ -106,5 +105,3 @@ class AutoPanEffect : public EffectProcessorImpl { DISALLOW_COPY_AND_ASSIGN(AutoPanEffect); }; - -#endif /* AUTOPANEFFECT_H */ diff --git a/src/effects/builtin/balanceeffect.h b/src/effects/builtin/balanceeffect.h index 668409d16c1..4562c93a0ea 100644 --- a/src/effects/builtin/balanceeffect.h +++ b/src/effects/builtin/balanceeffect.h @@ -1,5 +1,4 @@ -#ifndef BALANCEEFFECT_H -#define BALANCEEFFECT_H +#pragma once #include "effects/effectprocessor.h" #include "engine/effects/engineeffect.h" @@ -54,5 +53,3 @@ class BalanceEffect : public EffectProcessorImpl { DISALLOW_COPY_AND_ASSIGN(BalanceEffect); }; - -#endif /* BALANCEEFFECT_H */ diff --git a/src/effects/builtin/bessel4lvmixeqeffect.h b/src/effects/builtin/bessel4lvmixeqeffect.h index 877cbd51fb1..80cdef73b5c 100644 --- a/src/effects/builtin/bessel4lvmixeqeffect.h +++ b/src/effects/builtin/bessel4lvmixeqeffect.h @@ -1,5 +1,4 @@ -#ifndef BESSEL4LVMIXEQEFFECT_H -#define BESSEL4LVMIXEQEFFECT_H +#pragma once #include @@ -57,5 +56,3 @@ class Bessel4LVMixEQEffect : public EffectProcessorImpl m_pLoFreqCorner; std::unique_ptr m_pHiFreqCorner; }; - -#endif // BIQUADFULLKILLEQEFFECT_H diff --git a/src/effects/builtin/bitcrushereffect.h b/src/effects/builtin/bitcrushereffect.h index 88d102719cc..b7888032a65 100644 --- a/src/effects/builtin/bitcrushereffect.h +++ b/src/effects/builtin/bitcrushereffect.h @@ -1,5 +1,4 @@ -#ifndef BITCRUSHEREFFECT_H -#define BITCRUSHEREFFECT_H +#pragma once #include @@ -49,5 +48,3 @@ class BitCrusherEffect : public EffectProcessorImpl { DISALLOW_COPY_AND_ASSIGN(BitCrusherEffect); }; - -#endif /* BITCRUSHEREFFECT_H */ diff --git a/src/effects/builtin/builtinbackend.cpp b/src/effects/builtin/builtinbackend.cpp index df8e141e9e0..a974388b661 100644 --- a/src/effects/builtin/builtinbackend.cpp +++ b/src/effects/builtin/builtinbackend.cpp @@ -1,19 +1,20 @@ +#include "effects/builtin/builtinbackend.h" #include -#include "effects/builtin/builtinbackend.h" -#include "effects/builtin/flangereffect.h" -#include "effects/builtin/bitcrushereffect.h" #include "effects/builtin/balanceeffect.h" -#include "effects/builtin/linkwitzriley8eqeffect.h" -#include "effects/builtin/bessel8lvmixeqeffect.h" #include "effects/builtin/bessel4lvmixeqeffect.h" -#include "effects/builtin/threebandbiquadeqeffect.h" +#include "effects/builtin/bessel8lvmixeqeffect.h" #include "effects/builtin/biquadfullkilleqeffect.h" -#include "effects/builtin/graphiceqeffect.h" -#include "effects/builtin/parametriceqeffect.h" +#include "effects/builtin/bitcrushereffect.h" #include "effects/builtin/filtereffect.h" +#include "effects/builtin/flangereffect.h" +#include "effects/builtin/graphiceqeffect.h" +#include "effects/builtin/linkwitzriley8eqeffect.h" #include "effects/builtin/moogladder4filtereffect.h" +#include "effects/builtin/parametriceqeffect.h" +#include "effects/builtin/threebandbiquadeqeffect.h" +#include "moc_builtinbackend.cpp" #ifndef __MACAPPSTORE__ #include "effects/builtin/reverbeffect.h" #endif diff --git a/src/effects/builtin/builtinbackend.h b/src/effects/builtin/builtinbackend.h index b797f293040..1d34083ba8d 100644 --- a/src/effects/builtin/builtinbackend.h +++ b/src/effects/builtin/builtinbackend.h @@ -1,5 +1,4 @@ -#ifndef BUILTINBACKEND_H -#define BUILTINBACKEND_H +#pragma once #include "effects/defs.h" #include "effects/effectsbackend.h" @@ -15,5 +14,3 @@ class BuiltInBackend : public EffectsBackend { return "BuiltInBackend"; } }; - -#endif /* BUILTINBACKEND_H */ diff --git a/src/effects/builtin/echoeffect.h b/src/effects/builtin/echoeffect.h index 876f623c23a..a3a04fb617c 100644 --- a/src/effects/builtin/echoeffect.h +++ b/src/effects/builtin/echoeffect.h @@ -1,5 +1,4 @@ -#ifndef ECHOEFFECT_H -#define ECHOEFFECT_H +#pragma once #include @@ -74,5 +73,3 @@ class EchoEffect : public EffectProcessorImpl { DISALLOW_COPY_AND_ASSIGN(EchoEffect); }; - -#endif /* ECHOEFFECT_H */ diff --git a/src/effects/builtin/equalizer_util.h b/src/effects/builtin/equalizer_util.h index 1ab188a826f..96700ce5965 100644 --- a/src/effects/builtin/equalizer_util.h +++ b/src/effects/builtin/equalizer_util.h @@ -1,5 +1,4 @@ -#ifndef EFFECTS_BUILTIN_EQUALIZER_UTIL_H -#define EFFECTS_BUILTIN_EQUALIZER_UTIL_H +#pragma once #include @@ -92,6 +91,3 @@ class EqualizerUtil { "To adjust frequency shelves, go to Preferences -> Equalizers."); } }; - - -#endif /* EFFECTS_BUILTIN_EQUALIZER_UTIL_H */ diff --git a/src/effects/builtin/filtereffect.h b/src/effects/builtin/filtereffect.h index b37eaa5cb7b..a7ba64c5570 100644 --- a/src/effects/builtin/filtereffect.h +++ b/src/effects/builtin/filtereffect.h @@ -1,5 +1,4 @@ -#ifndef FILTEREFFECT_H -#define FILTEREFFECT_H +#pragma once #include "effects/effect.h" #include "effects/effectprocessor.h" @@ -54,5 +53,3 @@ class FilterEffect : public EffectProcessorImpl { DISALLOW_COPY_AND_ASSIGN(FilterEffect); }; - -#endif /* FILTEREFFECT_H */ diff --git a/src/effects/builtin/flangereffect.h b/src/effects/builtin/flangereffect.h index 08275c42d49..a942f90bc68 100644 --- a/src/effects/builtin/flangereffect.h +++ b/src/effects/builtin/flangereffect.h @@ -1,5 +1,4 @@ -#ifndef FLANGEREFFECT_H -#define FLANGEREFFECT_H +#pragma once #include @@ -77,5 +76,3 @@ class FlangerEffect : public EffectProcessorImpl { DISALLOW_COPY_AND_ASSIGN(FlangerEffect); }; - -#endif /* FLANGEREFFECT_H */ diff --git a/src/effects/builtin/graphiceqeffect.h b/src/effects/builtin/graphiceqeffect.h index b4a721fbed2..b4a3c40a745 100644 --- a/src/effects/builtin/graphiceqeffect.h +++ b/src/effects/builtin/graphiceqeffect.h @@ -1,5 +1,4 @@ -#ifndef GRAPHICEQEFFECT_H -#define GRAPHICEQEFFECT_H +#pragma once #include @@ -58,5 +57,3 @@ class GraphicEQEffect : public EffectProcessorImpl { DISALLOW_COPY_AND_ASSIGN(GraphicEQEffect); }; - -#endif // GRAPHICEQEFFECT_H diff --git a/src/effects/builtin/linkwitzriley8eqeffect.h b/src/effects/builtin/linkwitzriley8eqeffect.h index 656119542f4..0bf85b3354a 100644 --- a/src/effects/builtin/linkwitzriley8eqeffect.h +++ b/src/effects/builtin/linkwitzriley8eqeffect.h @@ -1,5 +1,4 @@ -#ifndef LINKWITZRILEYEQEFFECT_H -#define LINKWITZRILEYEQEFFECT_H +#pragma once #include @@ -73,5 +72,3 @@ class LinkwitzRiley8EQEffect : public EffectProcessorImpl @@ -46,5 +45,3 @@ class MetronomeEffect : public EffectProcessorImpl { DISALLOW_COPY_AND_ASSIGN(MetronomeEffect); }; - -#endif /* METRONOMEEFFECT_H */ diff --git a/src/effects/builtin/moogladder4filtereffect.h b/src/effects/builtin/moogladder4filtereffect.h index e6acf8d4987..8f269b4905a 100644 --- a/src/effects/builtin/moogladder4filtereffect.h +++ b/src/effects/builtin/moogladder4filtereffect.h @@ -1,5 +1,4 @@ -#ifndef MOOGLADDER4FILTEREFFECT_H -#define MOOGLADDER4FILTEREFFECT_H +#pragma once #include "effects/effect.h" #include "effects/effectprocessor.h" @@ -54,5 +53,3 @@ class MoogLadder4FilterEffect : public EffectProcessorImpl #include @@ -65,5 +64,3 @@ class ParametricEQEffect : public EffectProcessorImpl { DISALLOW_COPY_AND_ASSIGN(PhaserEffect); }; - -#endif diff --git a/src/effects/builtin/reverbeffect.h b/src/effects/builtin/reverbeffect.h index 1883b536804..5708c37dcae 100644 --- a/src/effects/builtin/reverbeffect.h +++ b/src/effects/builtin/reverbeffect.h @@ -1,8 +1,7 @@ // Ported from CAPS Reverb. // This effect is GPL code. -#ifndef REVERBEFFECT_H -#define REVERBEFFECT_H +#pragma once #include @@ -61,5 +60,3 @@ class ReverbEffect : public EffectProcessorImpl { DISALLOW_COPY_AND_ASSIGN(ReverbEffect); }; - -#endif /* REVERBEFFECT_H */ diff --git a/src/effects/builtin/threebandbiquadeqeffect.h b/src/effects/builtin/threebandbiquadeqeffect.h index bf180f2cb22..308a3131d2c 100644 --- a/src/effects/builtin/threebandbiquadeqeffect.h +++ b/src/effects/builtin/threebandbiquadeqeffect.h @@ -1,5 +1,4 @@ -#ifndef THREEBANDBIQUADEQEFFECT_H -#define THREEBANDBIQUADEQEFFECT_H +#pragma once #include "control/controlproxy.h" #include "effects/effect.h" @@ -79,5 +78,3 @@ class ThreeBandBiquadEQEffect : public EffectProcessorImpl m_pLoFreqCorner; std::unique_ptr m_pHiFreqCorner; }; - -#endif // THREEBANDBIQUADEQEFFECT_H diff --git a/src/effects/builtin/tremoloeffect.h b/src/effects/builtin/tremoloeffect.h index 571a02398f9..91ad1dee418 100644 --- a/src/effects/builtin/tremoloeffect.h +++ b/src/effects/builtin/tremoloeffect.h @@ -1,5 +1,4 @@ -#ifndef TREMOLOEFFECT_H -#define TREMOLOEFFECT_H +#pragma once #include "effects/effectprocessor.h" #include "engine/effects/engineeffect.h" @@ -50,5 +49,3 @@ class TremoloEffect : public EffectProcessorImpl { DISALLOW_COPY_AND_ASSIGN(TremoloEffect); }; - -#endif /* TREMOLOEFFECT_H */ diff --git a/src/effects/effect.cpp b/src/effects/effect.cpp index 295565fa7db..7fbe2ab5183 100644 --- a/src/effects/effect.cpp +++ b/src/effects/effect.cpp @@ -1,11 +1,13 @@ +#include "effects/effect.h" + #include -#include "effects/effect.h" #include "effects/effectprocessor.h" #include "effects/effectsmanager.h" #include "effects/effectxmlelements.h" -#include "engine/effects/engineeffectchain.h" #include "engine/effects/engineeffect.h" +#include "engine/effects/engineeffectchain.h" +#include "moc_effect.cpp" #include "util/xml.h" Effect::Effect(EffectsManager* pEffectsManager, diff --git a/src/effects/effect.h b/src/effects/effect.h index 272cbfc3d10..be8fd0cd307 100644 --- a/src/effects/effect.h +++ b/src/effects/effect.h @@ -1,5 +1,4 @@ -#ifndef EFFECT_H -#define EFFECT_H +#pragma once #include #include @@ -85,5 +84,3 @@ class Effect : public QObject { DISALLOW_COPY_AND_ASSIGN(Effect); }; - -#endif /* EFFECT_H */ diff --git a/src/effects/effectbuttonparameterslot.cpp b/src/effects/effectbuttonparameterslot.cpp index bd74ca82e96..8b431486639 100644 --- a/src/effects/effectbuttonparameterslot.cpp +++ b/src/effects/effectbuttonparameterslot.cpp @@ -1,10 +1,12 @@ +#include "effects/effectbuttonparameterslot.h" + #include #include "control/controleffectknob.h" -#include "effects/effectbuttonparameterslot.h" -#include "effects/effectxmlelements.h" #include "control/controlobject.h" #include "control/controlpushbutton.h" +#include "effects/effectxmlelements.h" +#include "moc_effectbuttonparameterslot.cpp" #include "util/math.h" #include "util/xml.h" diff --git a/src/effects/effectbuttonparameterslot.h b/src/effects/effectbuttonparameterslot.h index 20a2a100085..7c5eb92fbbf 100644 --- a/src/effects/effectbuttonparameterslot.h +++ b/src/effects/effectbuttonparameterslot.h @@ -1,5 +1,4 @@ -#ifndef EFFECTBUTTONPARAMETERSLOT_H -#define EFFECTBUTTONPARAMETERSLOT_H +#pragma once #include #include @@ -47,5 +46,3 @@ class EffectButtonParameterSlot : public EffectParameterSlotBase { DISALLOW_COPY_AND_ASSIGN(EffectButtonParameterSlot); }; - -#endif // EFFECTBUTTONPARAMETERSLOT_H diff --git a/src/effects/effectchain.cpp b/src/effects/effectchain.cpp index 06954a0bcfe..06894fffaf5 100644 --- a/src/effects/effectchain.cpp +++ b/src/effects/effectchain.cpp @@ -1,13 +1,14 @@ #include "effects/effectchain.h" -#include "engine/engine.h" #include "effects/effectchainmanager.h" -#include "effects/effectsmanager.h" #include "effects/effectprocessor.h" +#include "effects/effectsmanager.h" #include "effects/effectxmlelements.h" #include "engine/effects/engineeffectchain.h" #include "engine/effects/engineeffectrack.h" #include "engine/effects/message.h" +#include "engine/engine.h" +#include "moc_effectchain.cpp" #include "util/defs.h" #include "util/sample.h" #include "util/xml.h" diff --git a/src/effects/effectchain.h b/src/effects/effectchain.h index 16b0370db92..c9f646f1fa3 100644 --- a/src/effects/effectchain.h +++ b/src/effects/effectchain.h @@ -1,5 +1,4 @@ -#ifndef EFFECTCHAIN_H -#define EFFECTCHAIN_H +#pragma once #include #include @@ -128,5 +127,3 @@ class EffectChain : public QObject { DISALLOW_COPY_AND_ASSIGN(EffectChain); }; - -#endif /* EFFECTCHAIN_H */ diff --git a/src/effects/effectchainmanager.cpp b/src/effects/effectchainmanager.cpp index 43155b96b41..eace752b324 100644 --- a/src/effects/effectchainmanager.cpp +++ b/src/effects/effectchainmanager.cpp @@ -1,11 +1,13 @@ #include "effects/effectchainmanager.h" -#include "effects/effectsmanager.h" -#include "effects/effectxmlelements.h" -#include +#include #include #include -#include +#include + +#include "effects/effectsmanager.h" +#include "effects/effectxmlelements.h" +#include "moc_effectchainmanager.cpp" EffectChainManager::EffectChainManager(UserSettingsPointer pConfig, EffectsManager* pEffectsManager) diff --git a/src/effects/effectchainmanager.h b/src/effects/effectchainmanager.h index 2b7d6fc94a1..702b6c358b9 100644 --- a/src/effects/effectchainmanager.h +++ b/src/effects/effectchainmanager.h @@ -1,5 +1,4 @@ -#ifndef EFFECTCHAINMANAGER_H -#define EFFECTCHAINMANAGER_H +#pragma once #include #include @@ -85,5 +84,3 @@ class EffectChainManager : public QObject { QSet m_registeredOutputChannels; DISALLOW_COPY_AND_ASSIGN(EffectChainManager); }; - -#endif /* EFFECTCHAINMANAGER_H */ diff --git a/src/effects/effectchainslot.cpp b/src/effects/effectchainslot.cpp index 347333bad44..1ed2c6d3281 100644 --- a/src/effects/effectchainslot.cpp +++ b/src/effects/effectchainslot.cpp @@ -1,12 +1,13 @@ #include "effects/effectchainslot.h" -#include "effects/effectrack.h" -#include "effects/effectxmlelements.h" -#include "effects/effectslot.h" +#include "control/controlencoder.h" #include "control/controlpotmeter.h" #include "control/controlpushbutton.h" -#include "control/controlencoder.h" +#include "effects/effectrack.h" +#include "effects/effectslot.h" +#include "effects/effectxmlelements.h" #include "mixer/playermanager.h" +#include "moc_effectchainslot.cpp" #include "util/math.h" #include "util/xml.h" diff --git a/src/effects/effectchainslot.h b/src/effects/effectchainslot.h index 281f73f33d7..141c7eab432 100644 --- a/src/effects/effectchainslot.h +++ b/src/effects/effectchainslot.h @@ -1,5 +1,4 @@ -#ifndef EFFECTCHAINSLOT_H -#define EFFECTCHAINSLOT_H +#pragma once #include #include @@ -169,6 +168,3 @@ class EffectChainSlot : public QObject { DISALLOW_COPY_AND_ASSIGN(EffectChainSlot); }; - - -#endif /* EFFECTCHAINSLOT_H */ diff --git a/src/effects/effectinstantiator.h b/src/effects/effectinstantiator.h index 38167a6d593..50a029b3c03 100644 --- a/src/effects/effectinstantiator.h +++ b/src/effects/effectinstantiator.h @@ -1,5 +1,4 @@ -#ifndef EFFECTINSTANTIATOR_H -#define EFFECTINSTANTIATOR_H +#pragma once #include #include "effects/effectmanifest.h" @@ -50,5 +49,3 @@ class LV2EffectProcessorInstantiator : public EffectInstantiator { }; #endif /* __LILV__ */ - -#endif /* EFFECTINSTANTIATOR_H */ diff --git a/src/effects/effectmanifest.h b/src/effects/effectmanifest.h index 63337697972..a09a57351b3 100644 --- a/src/effects/effectmanifest.h +++ b/src/effects/effectmanifest.h @@ -1,5 +1,4 @@ -#ifndef EFFECTMANIFEST_H -#define EFFECTMANIFEST_H +#pragma once #include #include @@ -195,5 +194,3 @@ class EffectManifest final { bool m_bAddDryToWet; double m_metaknobDefault; }; - -#endif /* EFFECTMANIFEST_H */ diff --git a/src/effects/effectmanifestparameter.h b/src/effects/effectmanifestparameter.h index c12caa626a7..52c5341ae69 100644 --- a/src/effects/effectmanifestparameter.h +++ b/src/effects/effectmanifestparameter.h @@ -1,5 +1,4 @@ -#ifndef EFFECTMANIFESTPARAMETER_H -#define EFFECTMANIFESTPARAMETER_H +#pragma once #include #include @@ -259,5 +258,3 @@ class EffectManifestParameter { }; QDebug operator<<(QDebug dbg, const EffectManifestParameter& parameter); - -#endif /* EFFECTMANIFESTPARAMETER_H */ diff --git a/src/effects/effectparameter.cpp b/src/effects/effectparameter.cpp index f0bd3c98370..38855618b5c 100644 --- a/src/effects/effectparameter.cpp +++ b/src/effects/effectparameter.cpp @@ -1,8 +1,10 @@ +#include "effects/effectparameter.h" + #include -#include "effects/effectparameter.h" -#include "effects/effectsmanager.h" #include "effects/effect.h" +#include "effects/effectsmanager.h" +#include "moc_effectparameter.cpp" #include "util/assert.h" EffectParameter::EffectParameter(Effect* pEffect, EffectsManager* pEffectsManager, diff --git a/src/effects/effectparameter.h b/src/effects/effectparameter.h index f6565258fa1..60049f86143 100644 --- a/src/effects/effectparameter.h +++ b/src/effects/effectparameter.h @@ -1,5 +1,4 @@ -#ifndef EFFECTPARAMETER_H -#define EFFECTPARAMETER_H +#pragma once #include #include @@ -86,6 +85,3 @@ class EffectParameter : public QObject { DISALLOW_COPY_AND_ASSIGN(EffectParameter); }; - - -#endif /* EFFECTPARAMETER_H */ diff --git a/src/effects/effectparameterslot.cpp b/src/effects/effectparameterslot.cpp index 706416aa04f..653f691364a 100644 --- a/src/effects/effectparameterslot.cpp +++ b/src/effects/effectparameterslot.cpp @@ -1,11 +1,13 @@ +#include "effects/effectparameterslot.h" + #include #include "control/controleffectknob.h" -#include "effects/effectparameterslot.h" -#include "effects/effectxmlelements.h" #include "control/controlobject.h" #include "control/controlpushbutton.h" #include "controllers/softtakeover.h" +#include "effects/effectxmlelements.h" +#include "moc_effectparameterslot.cpp" #include "util/xml.h" EffectParameterSlot::EffectParameterSlot(const QString& group, const unsigned int iParameterSlotNumber) diff --git a/src/effects/effectparameterslot.h b/src/effects/effectparameterslot.h index fdb5ec9c9a5..77b29bf6360 100644 --- a/src/effects/effectparameterslot.h +++ b/src/effects/effectparameterslot.h @@ -1,5 +1,4 @@ -#ifndef EFFECTPARAMETERSLOT_H -#define EFFECTPARAMETERSLOT_H +#pragma once #include #include @@ -64,5 +63,3 @@ class EffectParameterSlot : public EffectParameterSlotBase { DISALLOW_COPY_AND_ASSIGN(EffectParameterSlot); }; - -#endif // EFFECTPARAMETERSLOT_H diff --git a/src/effects/effectparameterslotbase.cpp b/src/effects/effectparameterslotbase.cpp index 4f1b3204903..37674621911 100644 --- a/src/effects/effectparameterslotbase.cpp +++ b/src/effects/effectparameterslotbase.cpp @@ -1,9 +1,11 @@ +#include "effects/effectparameterslotbase.h" + #include #include "control/controleffectknob.h" -#include "effects/effectparameterslotbase.h" #include "control/controlobject.h" #include "control/controlpushbutton.h" +#include "moc_effectparameterslotbase.cpp" EffectParameterSlotBase::EffectParameterSlotBase(const QString& group, const unsigned int iParameterSlotNumber) diff --git a/src/effects/effectparameterslotbase.h b/src/effects/effectparameterslotbase.h index e0ba8d95499..576d84d2111 100644 --- a/src/effects/effectparameterslotbase.h +++ b/src/effects/effectparameterslotbase.h @@ -1,5 +1,4 @@ -#ifndef EFFECTPARAMETERSLOTBASE_H -#define EFFECTPARAMETERSLOTBASE_H +#pragma once #include #include @@ -43,5 +42,3 @@ class EffectParameterSlotBase : public QObject { DISALLOW_COPY_AND_ASSIGN(EffectParameterSlotBase); }; - -#endif /* EFFECTPARAMETERSLOTBASE_H */ diff --git a/src/effects/effectprocessor.h b/src/effects/effectprocessor.h index b493511aa28..3ece55553a6 100644 --- a/src/effects/effectprocessor.h +++ b/src/effects/effectprocessor.h @@ -1,6 +1,4 @@ - -#ifndef EFFECTPROCESSOR_H -#define EFFECTPROCESSOR_H +#pragma once #include #include @@ -275,5 +273,3 @@ class EffectProcessorImpl : public EffectProcessor { EffectsManager* m_pEffectsManager; ChannelHandleMap> m_channelStateMatrix; }; - -#endif /* EFFECTPROCESSOR_H */ diff --git a/src/effects/effectrack.cpp b/src/effects/effectrack.cpp index 6c688c1eb02..f716583935c 100644 --- a/src/effects/effectrack.cpp +++ b/src/effects/effectrack.cpp @@ -1,10 +1,10 @@ #include "effects/effectrack.h" -#include "effects/effectsmanager.h" #include "effects/effectchainmanager.h" #include "effects/effectslot.h" +#include "effects/effectsmanager.h" #include "engine/effects/engineeffectrack.h" - +#include "moc_effectrack.cpp" #include "util/assert.h" EffectRack::EffectRack(EffectsManager* pEffectsManager, diff --git a/src/effects/effectrack.h b/src/effects/effectrack.h index 09c6d064cde..3e58625a2d9 100644 --- a/src/effects/effectrack.h +++ b/src/effects/effectrack.h @@ -1,5 +1,4 @@ -#ifndef EFFECTRACK_H -#define EFFECTRACK_H +#pragma once #include #include @@ -251,5 +250,3 @@ class EqualizerRack : public PerGroupRack { return formatEffectChainSlotGroupString(iRackNumber, group); } }; - -#endif /* EFFECTRACK_H */ diff --git a/src/effects/effectsbackend.cpp b/src/effects/effectsbackend.cpp index e6a3674d38b..aedc07eab62 100644 --- a/src/effects/effectsbackend.cpp +++ b/src/effects/effectsbackend.cpp @@ -1,7 +1,9 @@ +#include "effects/effectsbackend.h" + #include -#include "effects/effectsbackend.h" #include "effects/effectsmanager.h" +#include "moc_effectsbackend.cpp" EffectsBackend::EffectsBackend(QObject* pParent, EffectBackendType type) diff --git a/src/effects/effectsbackend.h b/src/effects/effectsbackend.h index e1d2c327b6c..a3b16ea4ecd 100644 --- a/src/effects/effectsbackend.h +++ b/src/effects/effectsbackend.h @@ -1,5 +1,4 @@ -#ifndef EFFECTSBACKEND_H -#define EFFECTSBACKEND_H +#pragma once #include #include @@ -72,5 +71,3 @@ class EffectsBackend : public QObject { QMap m_registeredEffects; QList m_effectIds; }; - -#endif /* EFFECTSBACKEND_H */ diff --git a/src/effects/effectslot.cpp b/src/effects/effectslot.cpp index a93e09baf03..fe7cc5e13cb 100644 --- a/src/effects/effectslot.cpp +++ b/src/effects/effectslot.cpp @@ -1,11 +1,12 @@ #include "effects/effectslot.h" -#include "effects/effectxmlelements.h" #include -#include "control/controlpushbutton.h" #include "control/controlencoder.h" #include "control/controlproxy.h" +#include "control/controlpushbutton.h" +#include "effects/effectxmlelements.h" +#include "moc_effectslot.cpp" #include "util/math.h" #include "util/xml.h" diff --git a/src/effects/effectslot.h b/src/effects/effectslot.h index 5db3a0aafe6..7225fcfea8c 100644 --- a/src/effects/effectslot.h +++ b/src/effects/effectslot.h @@ -1,5 +1,4 @@ -#ifndef EFFECTSLOT_H -#define EFFECTSLOT_H +#pragma once #include #include @@ -135,5 +134,3 @@ class EffectSlot : public QObject { DISALLOW_COPY_AND_ASSIGN(EffectSlot); }; - -#endif /* EFFECTSLOT_H */ diff --git a/src/effects/effectsmanager.cpp b/src/effects/effectsmanager.cpp index 2c0c1fdc24a..dd7be30813c 100644 --- a/src/effects/effectsmanager.cpp +++ b/src/effects/effectsmanager.cpp @@ -1,16 +1,16 @@ #include "effects/effectsmanager.h" #include - #include -#include "engine/effects/engineeffectsmanager.h" #include "effects/effectchainmanager.h" #include "effects/effectsbackend.h" #include "effects/effectslot.h" #include "engine/effects/engineeffect.h" -#include "engine/effects/engineeffectrack.h" #include "engine/effects/engineeffectchain.h" +#include "engine/effects/engineeffectrack.h" +#include "engine/effects/engineeffectsmanager.h" +#include "moc_effectsmanager.cpp" #include "util/assert.h" namespace { diff --git a/src/effects/effectsmanager.h b/src/effects/effectsmanager.h index c7d80fc76bd..74af13feb15 100644 --- a/src/effects/effectsmanager.h +++ b/src/effects/effectsmanager.h @@ -1,5 +1,4 @@ -#ifndef EFFECTSMANAGER_H -#define EFFECTSMANAGER_H +#pragma once #include #include @@ -143,6 +142,3 @@ class EffectsManager : public QObject { DISALLOW_COPY_AND_ASSIGN(EffectsManager); }; - - -#endif /* EFFECTSMANAGER_H */ diff --git a/src/effects/lv2/lv2backend.cpp b/src/effects/lv2/lv2backend.cpp index 2a5090805ce..0bf4d973cba 100644 --- a/src/effects/lv2/lv2backend.cpp +++ b/src/effects/lv2/lv2backend.cpp @@ -1,5 +1,7 @@ #include "effects/lv2/lv2backend.h" + #include "effects/lv2/lv2manifest.h" +#include "moc_lv2backend.cpp" LV2Backend::LV2Backend(QObject* pParent) : EffectsBackend(pParent, EffectBackendType::LV2) { diff --git a/src/effects/lv2/lv2backend.h b/src/effects/lv2/lv2backend.h index 1a8c3e74791..1d59d871295 100644 --- a/src/effects/lv2/lv2backend.h +++ b/src/effects/lv2/lv2backend.h @@ -1,5 +1,4 @@ -#ifndef LV2BACKEND_H -#define LV2BACKEND_H +#pragma once #include "effects/defs.h" #include "effects/effectsbackend.h" @@ -32,5 +31,3 @@ class LV2Backend : public EffectsBackend { return "LV2Backend"; } }; - -#endif // LV2BACKEND_H diff --git a/src/effects/lv2/lv2effectprocessor.h b/src/effects/lv2/lv2effectprocessor.h index d5944469652..36dc5c5fb99 100644 --- a/src/effects/lv2/lv2effectprocessor.h +++ b/src/effects/lv2/lv2effectprocessor.h @@ -1,5 +1,4 @@ -#ifndef LV2EFFECTPROCESSOR_H -#define LV2EFFECTPROCESSOR_H +#pragma once #include "effects/effectprocessor.h" #include "effects/effectmanifest.h" @@ -68,6 +67,3 @@ class LV2EffectProcessor : public EffectProcessor { EffectsManager* m_pEffectsManager; ChannelHandleMap> m_channelStateMatrix; }; - - -#endif // LV2EFFECTPROCESSOR_H diff --git a/src/effects/lv2/lv2manifest.h b/src/effects/lv2/lv2manifest.h index dbb0fa1324e..b550ab4b7c8 100644 --- a/src/effects/lv2/lv2manifest.h +++ b/src/effects/lv2/lv2manifest.h @@ -1,5 +1,4 @@ -#ifndef LV2MANIFEST_H -#define LV2MANIFEST_H +#pragma once #include "effects/effectmanifest.h" #include "effects/defs.h" @@ -43,5 +42,3 @@ class LV2Manifest { float* m_default; Status m_status; }; - -#endif // LV2MANIFEST_H diff --git a/src/encoder/encoder.cpp b/src/encoder/encoder.cpp index 3a1dc159a56..81716bea376 100644 --- a/src/encoder/encoder.cpp +++ b/src/encoder/encoder.cpp @@ -1,12 +1,5 @@ -/**************************************************************************** - encoder.cpp - encoder API for mixxx - ------------------- - copyright : (C) 2009 by Phillip Whelan - copyright : (C) 2010 by Tobias Rafreider - copyright : (C) 2017 by Josep Maria Antolín - ***************************************************************************/ - #include "encoder/encoder.h" + #include "preferences/usersettings.h" #include "recording/defs_recording.h" // TODO(XXX): __FFMPEGFILE_ENCODERS__ is currently undefined because diff --git a/src/encoder/encoder.h b/src/encoder/encoder.h index 5f918085a0a..bc47f0cc812 100644 --- a/src/encoder/encoder.h +++ b/src/encoder/encoder.h @@ -1,14 +1,4 @@ -/**************************************************************************** - encoder.h - encoder API for mixxx - ------------------- - copyright : (C) 2009 by Phillip Whelan - copyright : (C) 2010 by Tobias Rafreider - copyright : (C) 2017 by Josep Maria Antolín - ***************************************************************************/ - - -#ifndef ENCODER_H -#define ENCODER_H +#pragma once #include "util/memory.h" #include "util/types.h" @@ -69,5 +59,3 @@ class EncoderFactory { static EncoderFactory factory; QList m_formats; }; - -#endif // ENCODER_H diff --git a/src/encoder/encoderbroadcastsettings.cpp b/src/encoder/encoderbroadcastsettings.cpp index 56a45569cb5..652878c4323 100644 --- a/src/encoder/encoderbroadcastsettings.cpp +++ b/src/encoder/encoderbroadcastsettings.cpp @@ -1,10 +1,3 @@ -/** -* @file encoderbroadcastsettings.cpp -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief storage of broadcast settings for the encoders. -*/ - #include "encoder/encoderbroadcastsettings.h" #include "broadcast/defs_broadcast.h" @@ -59,4 +52,3 @@ EncoderSettings::ChannelMode EncoderBroadcastSettings::getChannelMode() const { QString EncoderBroadcastSettings::getFormat() const { return m_pProfile->getFormat(); } - diff --git a/src/encoder/encoderbroadcastsettings.h b/src/encoder/encoderbroadcastsettings.h index 875639eb99d..a6c259ab6ad 100644 --- a/src/encoder/encoderbroadcastsettings.h +++ b/src/encoder/encoderbroadcastsettings.h @@ -1,18 +1,10 @@ -/** -* @file encoderbroadcastsettings.h -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief storage of broadcast settings for the encoders. -*/ - - -#ifndef ENCODERBROADCASTSETTINGS_H -#define ENCODERBROADCASTSETTINGS_H +#pragma once #include "encoder/encodersettings.h" #include "encoder/encoder.h" #include "preferences/broadcastsettings.h" +/// Storage of broadcast settings for the encoders. class EncoderBroadcastSettings : public EncoderSettings { public: explicit EncoderBroadcastSettings(BroadcastProfilePtr profile); @@ -30,5 +22,3 @@ class EncoderBroadcastSettings : public EncoderSettings { QList m_qualList; BroadcastProfilePtr m_pProfile; }; - -#endif // ENCODERBROADCASTSETTINGS_H diff --git a/src/encoder/encodercallback.h b/src/encoder/encodercallback.h index b9912ae13ae..4c7d3c77e8f 100644 --- a/src/encoder/encodercallback.h +++ b/src/encoder/encodercallback.h @@ -1,5 +1,4 @@ -#ifndef ENCODERCALLBACK_H -#define ENCODERCALLBACK_H +#pragma once class EncoderCallback { public: @@ -13,5 +12,3 @@ class EncoderCallback { // gets stream length virtual int filelen() = 0; }; - -#endif /* ENCODERCALLBACK_H */ diff --git a/src/encoder/encoderffmpegcore.cpp b/src/encoder/encoderffmpegcore.cpp index 11bdc6e49d6..3da49e9688d 100644 --- a/src/encoder/encoderffmpegcore.cpp +++ b/src/encoder/encoderffmpegcore.cpp @@ -1,9 +1,3 @@ -// -// FFMPEG encoder class.. -// - Supports what FFMPEG is compiled to supported -// - Same interface for all codecs -// - #include "encoder/encoderffmpegcore.h" #include diff --git a/src/encoder/encoderffmpegcore.h b/src/encoder/encoderffmpegcore.h index 7ea058418d2..cb3a3082f87 100644 --- a/src/encoder/encoderffmpegcore.h +++ b/src/encoder/encoderffmpegcore.h @@ -1,15 +1,4 @@ -/*************************************************************************** - encoderffmpegcore.h - core code for ffmpeg encoders - ------------------- - copyright : (C) 2012-2013 by Tuukka Pasanen - (C) 2007 by Wesley Stessens - (C) 1994 by Xiph.org (encoder example) - (C) ???? Tobias Rafreider (broadcast and recording fixes) - ***************************************************************************/ - - -#ifndef ENCODERFFMPEGCORE_H -#define ENCODERFFMPEGCORE_H +#pragma once #include @@ -40,6 +29,10 @@ extern "C" { class EncoderCallback; +/// FFmpeg encoder class +/// +/// Supports what FFmpeg is compiled to support and provides the same +/// interface for all codecs. class EncoderFfmpegCore : public Encoder { public: #if LIBAVCODEC_VERSION_INT > 3544932 @@ -113,5 +106,3 @@ class EncoderFfmpegCore : public Encoder { EncoderFfmpegResample *m_pResample; AVStream *m_pStream; }; - -#endif diff --git a/src/encoder/encoderffmpegmp3.cpp b/src/encoder/encoderffmpegmp3.cpp index 51cf1d761ec..f972345eb3e 100644 --- a/src/encoder/encoderffmpegmp3.cpp +++ b/src/encoder/encoderffmpegmp3.cpp @@ -1,21 +1,3 @@ -/**************************************************************************** - encoderffmpegmp3.cpp - FFMPEG MP3 encoder for mixxx - ------------------- - copyright : (C) 2012-2013 by Tuukka Pasanen - (C) 2007 by Wesley Stessens - (C) 1994 by Xiph.org (encoder example) - (C) 1994 Tobias Rafreider (broadcast and recording fixes) - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - #include "encoder/encoderffmpegmp3.h" // Constructor diff --git a/src/encoder/encoderffmpegmp3.h b/src/encoder/encoderffmpegmp3.h index 53e6c2d3ee6..b5ffa4ee0df 100644 --- a/src/encoder/encoderffmpegmp3.h +++ b/src/encoder/encoderffmpegmp3.h @@ -1,31 +1,11 @@ -/**************************************************************************** - encoderffmpegmp3.cpp - FFMPEG MP3 encoder for mixxx - ------------------- - copyright : (C) 2012-2013 by Tuukka Pasanen - (C) 2007 by Wesley Stessens - (C) 1994 by Xiph.org (encoder example) - (C) 1994 Tobias Rafreider (broadcast and recording fixes) - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef ENCODERFFMPEGMP3_H -#define ENCODERFFMPEGMP3_H +#pragma once #include "encoderffmpegcore.h" class EncoderFfmpegCore; +// FFmpeg MP3 encoder class EncoderFfmpegMp3 : public EncoderFfmpegCore { public: EncoderFfmpegMp3(EncoderCallback* pCallback=NULL); }; - -#endif diff --git a/src/encoder/encoderffmpegresample.h b/src/encoder/encoderffmpegresample.h index ec9805322df..490709d5149 100644 --- a/src/encoder/encoderffmpegresample.h +++ b/src/encoder/encoderffmpegresample.h @@ -1,5 +1,4 @@ -#ifndef ENCODERFFMPEGRESAMPLE_H -#define ENCODERFFMPEGRESAMPLE_H +#pragma once #include @@ -28,5 +27,3 @@ class EncoderFfmpegResample { enum AVSampleFormat m_pInSampleFmt; }; - -#endif diff --git a/src/encoder/encoderffmpegvorbis.cpp b/src/encoder/encoderffmpegvorbis.cpp index 7c37c79610b..7c2bf1ae554 100644 --- a/src/encoder/encoderffmpegvorbis.cpp +++ b/src/encoder/encoderffmpegvorbis.cpp @@ -1,21 +1,3 @@ -/**************************************************************************** - encoderffmpegvorbis.cpp - FFMPEG OGG/Vorbis encoder for mixxx - ------------------- - copyright : (C) 2012-2013 by Tuukka Pasanen - (C) 2007 by Wesley Stessens - (C) 1994 by Xiph.org (encoder example) - (C) 1994 Tobias Rafreider (broadcast and recording fixes) - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - #include "encoder/encoderffmpegvorbis.h" // Constructor diff --git a/src/encoder/encoderffmpegvorbis.h b/src/encoder/encoderffmpegvorbis.h index a516c490a30..be40af5e5ad 100644 --- a/src/encoder/encoderffmpegvorbis.h +++ b/src/encoder/encoderffmpegvorbis.h @@ -1,31 +1,11 @@ -/**************************************************************************** - encoderffmpegvorbis.cpp - FFMPEG OGG/Vorbis encoder for mixxx - ------------------- - copyright : (C) 2012-2013 by Tuukka Pasanen - (C) 2007 by Wesley Stessens - (C) 1994 by Xiph.org (encoder example) - (C) 1994 Tobias Rafreider (broadcast and recording fixes) - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef ENCODERFFMPEGVORBIS_H -#define ENCODERFFMPEGVORBIS_H +#pragma once #include "encoderffmpegcore.h" class EncoderFfmpegCore; +/// FFmpeg OGG/Vorbis encoder class EncoderFfmpegVorbis : public EncoderFfmpegCore { public: EncoderFfmpegVorbis(EncoderCallback* pCallback=NULL); }; - -#endif diff --git a/src/encoder/encoderflacsettings.cpp b/src/encoder/encoderflacsettings.cpp index 3900d6cd136..e21f562cf32 100644 --- a/src/encoder/encoderflacsettings.cpp +++ b/src/encoder/encoderflacsettings.cpp @@ -1,11 +1,3 @@ -/** -* @file encoderflacsettings.cpp -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief storage of setting for flac encoder -*/ - - #include "encoder/encoderflacsettings.h" #include "recording/defs_recording.h" #include diff --git a/src/encoder/encoderflacsettings.h b/src/encoder/encoderflacsettings.h index da2918e97db..de5da145aff 100644 --- a/src/encoder/encoderflacsettings.h +++ b/src/encoder/encoderflacsettings.h @@ -1,17 +1,10 @@ -/** -* @file encoderflacsettings.cpp -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief storage of setting for flac encoder -*/ - -#ifndef ENCODERFLACSETTINGS_H -#define ENCODERFLACSETTINGS_H +#pragma once #include "encoder/encoderrecordingsettings.h" #include "encoder/encoder.h" #include "recording/defs_recording.h" +/// Storage of settings for FLAC encoder class EncoderFlacSettings : public EncoderRecordingSettings { public: EncoderFlacSettings(UserSettingsPointer pConfig); @@ -47,5 +40,3 @@ class EncoderFlacSettings : public EncoderRecordingSettings { QList m_qualList; UserSettingsPointer m_pConfig; }; - -#endif // ENCODERFLACSETTINGS_H diff --git a/src/encoder/encodermp3.h b/src/encoder/encodermp3.h index 901eadb5b1c..9d3b4371d16 100644 --- a/src/encoder/encodermp3.h +++ b/src/encoder/encodermp3.h @@ -1,5 +1,4 @@ -#ifndef ENCODERMP3_H -#define ENCODERMP3_H +#pragma once #include @@ -42,5 +41,3 @@ class EncoderMp3 final : public Encoder { EncoderCallback* m_pCallback; }; - -#endif diff --git a/src/encoder/encodermp3settings.cpp b/src/encoder/encodermp3settings.cpp index b5fef2c15b3..3fca377eca4 100644 --- a/src/encoder/encodermp3settings.cpp +++ b/src/encoder/encodermp3settings.cpp @@ -1,9 +1,4 @@ -/** -* @file encodermp3settings.cpp -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief storage of setting for mp3 encoder -*/ +// storage of setting for mp3 encoder #include "encoder/encodermp3settings.h" #include "recording/defs_recording.h" diff --git a/src/encoder/encodermp3settings.h b/src/encoder/encodermp3settings.h index d32245fd14a..bc057c69c8a 100644 --- a/src/encoder/encodermp3settings.h +++ b/src/encoder/encodermp3settings.h @@ -1,17 +1,10 @@ -/** -* @file encodermp3settings.cpp -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief storage of setting for mp3 encoder -*/ - -#ifndef ENCODERMP3SETTINGS_H -#define ENCODERMP3SETTINGS_H +#pragma once #include "encoder/encoderrecordingsettings.h" #include "encoder/encoder.h" #include "recording/defs_recording.h" +// Storage of settings for MP3 encoder class EncoderMp3Settings : public EncoderRecordingSettings { public: EncoderMp3Settings(UserSettingsPointer m_pConfig); @@ -51,5 +44,3 @@ class EncoderMp3Settings : public EncoderRecordingSettings { QList m_qualVBRList; UserSettingsPointer m_pConfig; }; - -#endif // ENCODERMP3SETTINGS_H diff --git a/src/encoder/encoderopus.cpp b/src/encoder/encoderopus.cpp index b2551dd6354..a36b844c5f2 100644 --- a/src/encoder/encoderopus.cpp +++ b/src/encoder/encoderopus.cpp @@ -1,6 +1,3 @@ -// encoderopus.cpp -// Create on August 15th 2017 by Palakis - #include "encoder/encoderopus.h" #include diff --git a/src/encoder/encoderopus.h b/src/encoder/encoderopus.h index 66bd42e7880..0df83cc3af1 100644 --- a/src/encoder/encoderopus.h +++ b/src/encoder/encoderopus.h @@ -1,8 +1,4 @@ -// encoderopus.h -// Create on August 15th 2017 by Palakis - -#ifndef ENCODER_ENCODEROPUS_H -#define ENCODER_ENCODEROPUS_H +#pragma once #include #include @@ -56,5 +52,3 @@ class EncoderOpus: public Encoder { ogg_int64_t m_granulePos; QMap m_opusComments; }; - -#endif // ENCODER_ENCODEROPUS_H diff --git a/src/encoder/encoderopussettings.cpp b/src/encoder/encoderopussettings.cpp index 29fe02c60c2..f37dd7b781f 100644 --- a/src/encoder/encoderopussettings.cpp +++ b/src/encoder/encoderopussettings.cpp @@ -1,6 +1,3 @@ -// encoderopussettings.cpp -// Create on August 15th 2017 by Palakis - #include #include "encoder/encoderopussettings.h" diff --git a/src/encoder/encoderopussettings.h b/src/encoder/encoderopussettings.h index 0b03d909633..197b60a6c7b 100644 --- a/src/encoder/encoderopussettings.h +++ b/src/encoder/encoderopussettings.h @@ -1,8 +1,4 @@ -// encoderopussettings.h -// Create on August 15th 2017 by Palakis - -#ifndef ENCODER_ENCODEROPUSSETTINGS_H -#define ENCODER_ENCODEROPUSSETTINGS_H +#pragma once #include "encoder/encoderrecordingsettings.h" #include "encoder/encoder.h" @@ -51,5 +47,3 @@ class EncoderOpusSettings: public EncoderRecordingSettings { QList m_qualList; QList m_radioList; }; - -#endif // ENCODER_ENCODEROPUSSETTINGS_H diff --git a/src/encoder/encodersettings.h b/src/encoder/encodersettings.h index 1559743dbe5..436dabfb1e1 100644 --- a/src/encoder/encodersettings.h +++ b/src/encoder/encodersettings.h @@ -1,17 +1,10 @@ -/** -* @file encodersettings.cpp -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief Encoder settings interface for encoders. -*/ - -#ifndef ENCODERSETTINGS_H -#define ENCODERSETTINGS_H +#pragma once #include #include #include "util/memory.h" +/// Encoder settings interface for encoders class EncoderSettings { public: class OptionsGroup { @@ -62,5 +55,3 @@ class EncoderSettings { }; typedef std::shared_ptr EncoderSettingsPointer; - -#endif // ENCODERSETTINGS_H diff --git a/src/encoder/encodersndfileflac.cpp b/src/encoder/encodersndfileflac.cpp index 435b92a5129..f7c43af4a3b 100644 --- a/src/encoder/encodersndfileflac.cpp +++ b/src/encoder/encodersndfileflac.cpp @@ -1,10 +1,3 @@ -/** -* @file encodersndfileflac.cpp -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief encoder for flac using libsndfile -*/ - #include #include "encoder/encodersndfileflac.h" diff --git a/src/encoder/encodersndfileflac.h b/src/encoder/encodersndfileflac.h index 9ecc3b850ce..c3ea02abf33 100644 --- a/src/encoder/encodersndfileflac.h +++ b/src/encoder/encodersndfileflac.h @@ -1,14 +1,4 @@ -/** -* @file encodersndfileflac.h -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief encoder for flac using libsndfile -*/ - - -#ifndef ENCODERSNDFILEFLAC_H -#define ENCODERSNDFILEFLAC_H - +#pragma once #include "encoder/encoderflacsettings.h" #ifdef Q_OS_WIN @@ -24,6 +14,7 @@ class EncoderCallback; +/// Encoder for FLAC using libsndfile class EncoderSndfileFlac : public EncoderWave { public: EncoderSndfileFlac(EncoderCallback* pCallback = nullptr); @@ -36,5 +27,3 @@ class EncoderSndfileFlac : public EncoderWave { private: double m_compression; }; - -#endif //ENCODERWAVE_H diff --git a/src/encoder/encodervorbis.cpp b/src/encoder/encodervorbis.cpp index 595897e1b47..26f1dbc8992 100644 --- a/src/encoder/encodervorbis.cpp +++ b/src/encoder/encodervorbis.cpp @@ -1,30 +1,9 @@ -/**************************************************************************** - encodervorbis.cpp - vorbis encoder for mixxx - ------------------- - copyright : (C) 2007 by Wesley Stessens - (C) 1994 by Xiph.org (encoder example) - (C) 1994 Tobias Rafreider (broadcast and recording fixes) - ***************************************************************************/ - -/* -Okay, so this is the vorbis encoder class... -It's a real mess right now. - -When I get around to cleaning things up, -I'll probably make an Encoder base class, -so we can easily add in an EncoderLame (or something) too. - -A lot of stuff has been stolen from: -http://svn.xiph.org/trunk/vorbis/examples/encoder_example.c -*/ - #include // needed for random num gen #include // needed for random num gen #include #include "encoder/encodervorbis.h" #include "encoder/encodercallback.h" -#include "errordialoghandler.h" // Automatic thresholds for switching the encoder to mono // They have been chosen by testing and to keep the same number diff --git a/src/encoder/encodervorbis.h b/src/encoder/encodervorbis.h index 6b30068e27e..dfb75aab8fe 100644 --- a/src/encoder/encodervorbis.h +++ b/src/encoder/encodervorbis.h @@ -1,14 +1,4 @@ -/*************************************************************************** - encodervorbis.h - vorbis encoder for mixxx - ------------------- - copyright : (C) 2007 by Wesley Stessens - (C) 1994 by Xiph.org (encoder example) - (C) 1994 Tobias Rafreider (broadcast and recording fixes) - ***************************************************************************/ - - -#ifndef ENCODERVORBIS_H -#define ENCODERVORBIS_H +#pragma once // this also includes vorbis/codec.h #include @@ -21,6 +11,7 @@ class EncoderCallback; +/// Vorbis encoder class EncoderVorbis : public Encoder { public: static const int MONO_BITRATE_THRESHOLD; @@ -61,5 +52,3 @@ class EncoderVorbis : public Encoder { int m_channels; QFile m_file; }; - -#endif diff --git a/src/encoder/encodervorbissettings.cpp b/src/encoder/encodervorbissettings.cpp index 4ecdd8cb2b8..551019ec764 100644 --- a/src/encoder/encodervorbissettings.cpp +++ b/src/encoder/encodervorbissettings.cpp @@ -1,10 +1,3 @@ -/** -* @file encoderwavesettings.cpp -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief storage of setting for vorbis encoder -*/ - #include "encoder/encodervorbissettings.h" #include "recording/defs_recording.h" diff --git a/src/encoder/encodervorbissettings.h b/src/encoder/encodervorbissettings.h index a422e5cdcdc..a05597d3f53 100644 --- a/src/encoder/encodervorbissettings.h +++ b/src/encoder/encodervorbissettings.h @@ -1,17 +1,10 @@ -/** -* @file encoderwavesettings.h -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief storage of setting for vorbis encoder -*/ - -#ifndef ENCODERVORBISSETTINGS_H -#define ENCODERVORBISSETTINGS_H +#pragma once #include "encoder/encoderrecordingsettings.h" #include "encoder/encoder.h" #include "recording/defs_recording.h" +/// Storage of settings for Vorbis encoder class EncoderVorbisSettings : public EncoderRecordingSettings { public: EncoderVorbisSettings(UserSettingsPointer pConfig); @@ -39,6 +32,3 @@ class EncoderVorbisSettings : public EncoderRecordingSettings { QList m_qualList; UserSettingsPointer m_pConfig; }; - - -#endif // ENCODERVORBISSETTINGS_H diff --git a/src/encoder/encoderwave.cpp b/src/encoder/encoderwave.cpp index 96682a467d8..28edcee8418 100644 --- a/src/encoder/encoderwave.cpp +++ b/src/encoder/encoderwave.cpp @@ -1,10 +1,3 @@ -/** -* @file encoderwave.cpp -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief wave/aiff "encoder" for mixxx -*/ - #include #include "encoder/encoderwave.h" diff --git a/src/encoder/encoderwave.h b/src/encoder/encoderwave.h index 6661662a969..87cdca7d3ed 100644 --- a/src/encoder/encoderwave.h +++ b/src/encoder/encoderwave.h @@ -1,18 +1,9 @@ -/** -* @file encoderwave.h -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief wave/aiff "encoder" for mixxx -*/ - -#ifndef ENCODERWAVE_H -#define ENCODERWAVE_H - +#pragma once #include "encoder/encoderwavesettings.h" #ifdef Q_OS_WIN -//Enable unicode in libsndfile on Windows -//(sf_open uses UTF-8 otherwise) +// Enable unicode in libsndfile on Windows +// (sf_open uses UTF-8 otherwise) #include #define ENABLE_SNDFILE_WINDOWS_PROTOTYPES 1 #endif @@ -24,6 +15,7 @@ class EncoderCallback; +// WAVE/AIFF "encoder" class EncoderWave : public Encoder { public: EncoderWave(EncoderCallback* pCallback = nullptr); @@ -48,5 +40,3 @@ class EncoderWave : public Encoder { SF_VIRTUAL_IO m_virtualIo; }; - -#endif //ENCODERWAVE_H diff --git a/src/encoder/encoderwavesettings.cpp b/src/encoder/encoderwavesettings.cpp index fa0a96cd1a7..531f83142fd 100644 --- a/src/encoder/encoderwavesettings.cpp +++ b/src/encoder/encoderwavesettings.cpp @@ -1,12 +1,6 @@ -/** -* @file encoderwavesettings.cpp -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief storage of setting for wave/aiff encoder -*/ +#include "encoder/encoderwavesettings.h" - #include "encoder/encoderwavesettings.h" - #include "recording/defs_recording.h" +#include "recording/defs_recording.h" const QString EncoderWaveSettings::BITS_GROUP = "BITS"; diff --git a/src/encoder/encoderwavesettings.h b/src/encoder/encoderwavesettings.h index 8a1cb56cbf8..6818591949e 100644 --- a/src/encoder/encoderwavesettings.h +++ b/src/encoder/encoderwavesettings.h @@ -1,32 +1,25 @@ -/** -* @file encoderwavesettings.h -* @author Josep Maria Antolín -* @date Feb 27 2017 -* @brief storage of setting for wave/aiff encoder -*/ - -#ifndef ENCODERWAVESETTINGS_H -#define ENCODERWAVESETTINGS_H +#pragma once #include "encoder/encoderrecordingsettings.h" #include "encoder/encoder.h" #include +/// Storage of settings for WAVE/AIFF encoder class EncoderWaveSettings : public EncoderRecordingSettings { public: EncoderWaveSettings(UserSettingsPointer pConfig, QString format); ~EncoderWaveSettings() override = default; - // Returns the list of radio options to show to the user + /// Returns the list of radio options to show to the user QList getOptionGroups() const override; - // Selects the option by its index. If it is a single-element option, - // index 0 means disabled and 1 enabled. + /// Selects the option by its index. If it is a single-element option, + /// index 0 means disabled and 1 enabled. void setGroupOption(const QString& groupCode, int optionIndex) override; - // Return the selected option of the group. If it is a single-element option, - // 0 means disabled and 1 enabled. + /// Return the selected option of the group. If it is a single-element option, + /// 0 means disabled and 1 enabled. int getSelectedOption(const QString& groupCode) const override; - // Returns the format subtype of this encoder settings. + /// Returns the format subtype of this encoder settings. QString getFormat() const override{ return m_format; } @@ -37,12 +30,3 @@ class EncoderWaveSettings : public EncoderRecordingSettings { UserSettingsPointer m_pConfig; QString m_format; }; - - - - - - - - -#endif // ENCODERWAVESETTINGS_H diff --git a/src/engine/bufferscalers/enginebufferscale.cpp b/src/engine/bufferscalers/enginebufferscale.cpp index 028c30a3d46..563e5d530df 100644 --- a/src/engine/bufferscalers/enginebufferscale.cpp +++ b/src/engine/bufferscalers/enginebufferscale.cpp @@ -1,6 +1,7 @@ #include "engine/bufferscalers/enginebufferscale.h" #include "engine/engine.h" +#include "moc_enginebufferscale.cpp" #include "util/defs.h" EngineBufferScale::EngineBufferScale() diff --git a/src/engine/bufferscalers/enginebufferscale.h b/src/engine/bufferscalers/enginebufferscale.h index ced4530fab9..4f50a97e6c7 100644 --- a/src/engine/bufferscalers/enginebufferscale.h +++ b/src/engine/bufferscalers/enginebufferscale.h @@ -1,5 +1,4 @@ -#ifndef ENGINEBUFFERSCALE_H -#define ENGINEBUFFERSCALE_H +#pragma once #include @@ -16,10 +15,6 @@ // This took me ages to figure out. // -- Albert July 17, 2010. -/** - *@author Tue & Ken Haste Andersen - */ - class EngineBufferScale : public QObject { Q_OBJECT public: @@ -79,5 +74,3 @@ class EngineBufferScale : public QObject { double m_dTempoRatio; double m_dPitchRatio; }; - -#endif diff --git a/src/engine/bufferscalers/enginebufferscalelinear.h b/src/engine/bufferscalers/enginebufferscalelinear.h index d46f342ba69..a27c11f7be0 100644 --- a/src/engine/bufferscalers/enginebufferscalelinear.h +++ b/src/engine/bufferscalers/enginebufferscalelinear.h @@ -1,5 +1,4 @@ -#ifndef ENGINEBUFFERSCALELINEAR_H -#define ENGINEBUFFERSCALELINEAR_H +#pragma once #include "engine/bufferscalers/enginebufferscale.h" #include "engine/readaheadmanager.h" @@ -45,5 +44,3 @@ class EngineBufferScaleLinear : public EngineBufferScale { double m_dCurrentFrame; double m_dNextFrame; }; - -#endif diff --git a/src/engine/bufferscalers/enginebufferscalerubberband.cpp b/src/engine/bufferscalers/enginebufferscalerubberband.cpp index fd100a6c14a..e1b5f025426 100644 --- a/src/engine/bufferscalers/enginebufferscalerubberband.cpp +++ b/src/engine/bufferscalers/enginebufferscalerubberband.cpp @@ -6,6 +6,7 @@ #include "control/controlobject.h" #include "engine/readaheadmanager.h" +#include "moc_enginebufferscalerubberband.cpp" #include "track/keyutils.h" #include "util/counter.h" #include "util/defs.h" diff --git a/src/engine/bufferscalers/enginebufferscalerubberband.h b/src/engine/bufferscalers/enginebufferscalerubberband.h index 7ee14e084c2..dbbd3064e93 100644 --- a/src/engine/bufferscalers/enginebufferscalerubberband.h +++ b/src/engine/bufferscalers/enginebufferscalerubberband.h @@ -1,5 +1,4 @@ -#ifndef ENGINEBUFFERSCALERUBBERBAND_H -#define ENGINEBUFFERSCALERUBBERBAND_H +#pragma once #include "engine/bufferscalers/enginebufferscale.h" #include "util/memory.h" @@ -47,6 +46,3 @@ class EngineBufferScaleRubberBand : public EngineBufferScale { // Holds the playback direction bool m_bBackwards; }; - - -#endif /* ENGINEBUFFERSCALERUBBERBAND_H */ diff --git a/src/engine/bufferscalers/enginebufferscalest.cpp b/src/engine/bufferscalers/enginebufferscalest.cpp index 88ed71f3386..f23aa4b936d 100644 --- a/src/engine/bufferscalers/enginebufferscalest.cpp +++ b/src/engine/bufferscalers/enginebufferscalest.cpp @@ -1,5 +1,7 @@ #include "engine/bufferscalers/enginebufferscalest.h" +#include "moc_enginebufferscalest.cpp" + // Fixes redefinition warnings from SoundTouch. #include diff --git a/src/engine/cachingreader/cachingreader.cpp b/src/engine/cachingreader/cachingreader.cpp index 592371a6863..7399e665499 100644 --- a/src/engine/cachingreader/cachingreader.cpp +++ b/src/engine/cachingreader/cachingreader.cpp @@ -1,16 +1,17 @@ -#include +#include "engine/cachingreader/cachingreader.h" + #include +#include -#include "engine/cachingreader/cachingreader.h" #include "control/controlobject.h" +#include "moc_cachingreader.cpp" #include "track/track.h" #include "util/assert.h" +#include "util/compatibility.h" #include "util/counter.h" +#include "util/logger.h" #include "util/math.h" #include "util/sample.h" -#include "util/logger.h" -#include "util/compatibility.h" - namespace { diff --git a/src/engine/cachingreader/cachingreader.h b/src/engine/cachingreader/cachingreader.h index 01529342ea1..c5f5a6ee32c 100644 --- a/src/engine/cachingreader/cachingreader.h +++ b/src/engine/cachingreader/cachingreader.h @@ -1,6 +1,3 @@ -// cachingreader.h -// Created 7/9/2009 by RJ Ryan (rryan@mit.edu) - #pragma once #include diff --git a/src/engine/cachingreader/cachingreaderchunk.h b/src/engine/cachingreader/cachingreaderchunk.h index 7e9409a9b23..b968a61dd5b 100644 --- a/src/engine/cachingreader/cachingreaderchunk.h +++ b/src/engine/cachingreader/cachingreaderchunk.h @@ -1,5 +1,4 @@ -#ifndef ENGINE_CACHINGREADERCHUNK_H -#define ENGINE_CACHINGREADERCHUNK_H +#pragma once #include "sources/audiosource.h" @@ -142,6 +141,3 @@ class CachingReaderChunkForOwner: public CachingReaderChunk { CachingReaderChunkForOwner* m_pPrev; // previous item in double-linked list CachingReaderChunkForOwner* m_pNext; // next item in double-linked list }; - - -#endif // ENGINE_CACHINGREADERCHUNK_H diff --git a/src/engine/cachingreader/cachingreaderworker.cpp b/src/engine/cachingreader/cachingreaderworker.cpp index aefd482d040..5353b7b1058 100644 --- a/src/engine/cachingreader/cachingreaderworker.cpp +++ b/src/engine/cachingreader/cachingreaderworker.cpp @@ -5,6 +5,7 @@ #include #include "control/controlobject.h" +#include "moc_cachingreaderworker.cpp" #include "sources/soundsourceproxy.h" #include "track/track.h" #include "util/compatibility.h" diff --git a/src/engine/cachingreader/cachingreaderworker.h b/src/engine/cachingreader/cachingreaderworker.h index 6118c58c94a..09801eebb88 100644 --- a/src/engine/cachingreader/cachingreaderworker.h +++ b/src/engine/cachingreader/cachingreaderworker.h @@ -1,5 +1,4 @@ -#ifndef ENGINE_CACHINGREADERWORKER_H -#define ENGINE_CACHINGREADERWORKER_H +#pragma once #include #include @@ -147,6 +146,3 @@ class CachingReaderWorker : public EngineWorker { QAtomicInt m_stop; }; - - -#endif /* ENGINE_CACHINGREADERWORKER_H */ diff --git a/src/engine/channelmixer.h b/src/engine/channelmixer.h index d58daf228d9..eb300696a31 100644 --- a/src/engine/channelmixer.h +++ b/src/engine/channelmixer.h @@ -1,5 +1,4 @@ -#ifndef CHANNELMIXER_H -#define CHANNELMIXER_H +#pragma once #include @@ -30,5 +29,3 @@ class ChannelMixer { unsigned int iSampleRate, EngineEffectsManager* pEngineEffectsManager); }; - -#endif /* CHANNELMIXER_H */ diff --git a/src/engine/channels/engineaux.cpp b/src/engine/channels/engineaux.cpp index f438cdfa141..69c668616aa 100644 --- a/src/engine/channels/engineaux.cpp +++ b/src/engine/channels/engineaux.cpp @@ -1,16 +1,13 @@ -// engineaux.cpp -// created 4/8/2011 by Bill Good (bkgood@gmail.com) -// shameless stolen from enginemicrophone.cpp (from RJ) - #include "engine/channels/engineaux.h" #include #include "control/control.h" -#include "preferences/usersettings.h" #include "control/controlaudiotaperpot.h" #include "effects/effectsmanager.h" #include "engine/effects/engineeffectsmanager.h" +#include "moc_engineaux.cpp" +#include "preferences/usersettings.h" #include "util/sample.h" EngineAux::EngineAux(const ChannelHandleAndGroup& handleGroup, EffectsManager* pEffectsManager) diff --git a/src/engine/channels/engineaux.h b/src/engine/channels/engineaux.h index 270668c04ee..aa6c8fe72e7 100644 --- a/src/engine/channels/engineaux.h +++ b/src/engine/channels/engineaux.h @@ -1,9 +1,4 @@ -// engineaux.h -// created 4/8/2011 by Bill Good (bkgood@gmail.com) -// unapologetically copied from enginemicrophone.h from RJ - -#ifndef ENGINEAUX_H -#define ENGINEAUX_H +#pragma once #include @@ -15,8 +10,8 @@ class ControlAudioTaperPot; -// EngineAux is an EngineChannel that implements a mixing source whose -// samples are fed directly from the SoundManager +/// EngineAux is an EngineChannel that implements a mixing source whose +/// samples are fed directly from the SoundManager class EngineAux : public EngineChannel, public AudioDestination { Q_OBJECT public: @@ -25,26 +20,26 @@ class EngineAux : public EngineChannel, public AudioDestination { bool isActive(); - // Called by EngineMaster whenever is requesting a new buffer of audio. + /// Called by EngineMaster whenever is requesting a new buffer of audio. virtual void process(CSAMPLE* pOutput, const int iBufferSize); virtual void collectFeatures(GroupFeatureState* pGroupFeatures) const; virtual void postProcess(const int iBufferSize) { Q_UNUSED(iBufferSize) } - // This is called by SoundManager whenever there are new samples from the - // configured input to be processed. This is run in the callback thread of - // the soundcard this AudioDestination was registered for! Beware, in the - // case of multiple soundcards, this method is not re-entrant but it may be - // concurrent with EngineMaster processing. + /// This is called by SoundManager whenever there are new samples from the + /// configured input to be processed. This is run in the callback thread of + /// the soundcard this AudioDestination was registered for! Beware, in the + /// case of multiple soundcards, this method is not re-entrant but it may be + /// concurrent with EngineMaster processing. virtual void receiveBuffer(const AudioInput& input, const CSAMPLE* pBuffer, unsigned int nFrames); - // Called by SoundManager whenever the aux input is connected to a - // soundcard input. + /// Called by SoundManager whenever the aux input is connected to a + /// soundcard input. virtual void onInputConfigured(const AudioInput& input); - // Called by SoundManager whenever the aux input is disconnected from - // a soundcard input. + /// Called by SoundManager whenever the aux input is disconnected from + /// a soundcard input. virtual void onInputUnconfigured(const AudioInput& input); private: @@ -52,5 +47,3 @@ class EngineAux : public EngineChannel, public AudioDestination { ControlAudioTaperPot* m_pPregain; bool m_wasActive; }; - -#endif // ENGINEAUX_H diff --git a/src/engine/channels/enginechannel.cpp b/src/engine/channels/enginechannel.cpp index 6cd03f9347c..e440f489944 100644 --- a/src/engine/channels/enginechannel.cpp +++ b/src/engine/channels/enginechannel.cpp @@ -1,24 +1,8 @@ -/*************************************************************************** - enginechannel.cpp - description - ------------------- - begin : Sun Apr 28 2002 - copyright : (C) 2002 by - email : -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "engine/channels/enginechannel.h" #include "control/controlobject.h" #include "control/controlpushbutton.h" +#include "moc_enginechannel.cpp" EngineChannel::EngineChannel(const ChannelHandleAndGroup& handleGroup, EngineChannel::ChannelOrientation defaultOrientation, diff --git a/src/engine/channels/enginechannel.h b/src/engine/channels/enginechannel.h index 2d71ddd9e40..0a70e4ead77 100644 --- a/src/engine/channels/enginechannel.h +++ b/src/engine/channels/enginechannel.h @@ -1,22 +1,4 @@ -/*************************************************************************** - enginechannel.h - description - ------------------- - begin : Sun Apr 28 2002 - copyright : (C) 2002 by - email : - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef ENGINECHANNEL_H -#define ENGINECHANNEL_H +#pragma once #include "control/controlproxy.h" #include "effects/effectsmanager.h" @@ -104,5 +86,3 @@ class EngineChannel : public EngineObject { ControlPushButton* m_pTalkover; bool m_bIsTalkoverChannel; }; - -#endif diff --git a/src/engine/channels/enginedeck.cpp b/src/engine/channels/enginedeck.cpp index db4daa4094b..f779893d4e3 100644 --- a/src/engine/channels/enginedeck.cpp +++ b/src/engine/channels/enginedeck.cpp @@ -6,6 +6,7 @@ #include "engine/enginebuffer.h" #include "engine/enginepregain.h" #include "engine/enginevumeter.h" +#include "moc_enginedeck.cpp" #include "util/sample.h" #include "waveform/waveformwidgetfactory.h" diff --git a/src/engine/channels/enginemicrophone.cpp b/src/engine/channels/enginemicrophone.cpp index edd32b90d87..37ecce202d1 100644 --- a/src/engine/channels/enginemicrophone.cpp +++ b/src/engine/channels/enginemicrophone.cpp @@ -1,15 +1,13 @@ -// enginemicrophone.cpp -// created 3/16/2011 by RJ Ryan (rryan@mit.edu) - #include "engine/channels/enginemicrophone.h" #include -#include "preferences/usersettings.h" #include "control/control.h" #include "control/controlaudiotaperpot.h" #include "effects/effectsmanager.h" #include "engine/effects/engineeffectsmanager.h" +#include "moc_enginemicrophone.cpp" +#include "preferences/usersettings.h" #include "util/sample.h" EngineMicrophone::EngineMicrophone(const ChannelHandleAndGroup& handleGroup, diff --git a/src/engine/channels/enginemicrophone.h b/src/engine/channels/enginemicrophone.h index 50753b63bf5..282407d3575 100644 --- a/src/engine/channels/enginemicrophone.h +++ b/src/engine/channels/enginemicrophone.h @@ -1,8 +1,4 @@ -// enginemicrophone.h -// created 3/16/2011 by RJ Ryan (rryan@mit.edu) - -#ifndef ENGINEMICROPHONE_H -#define ENGINEMICROPHONE_H +#pragma once #include @@ -59,5 +55,3 @@ class EngineMicrophone : public EngineChannel, public AudioDestination { bool m_wasActive; }; - -#endif /* ENGINEMICROPHONE_H */ diff --git a/src/engine/controls/bpmcontrol.cpp b/src/engine/controls/bpmcontrol.cpp index 52370da16db..98202c30d61 100644 --- a/src/engine/controls/bpmcontrol.cpp +++ b/src/engine/controls/bpmcontrol.cpp @@ -9,6 +9,7 @@ #include "engine/channels/enginechannel.h" #include "engine/enginebuffer.h" #include "engine/enginemaster.h" +#include "moc_bpmcontrol.cpp" #include "track/track.h" #include "util/assert.h" #include "util/duration.h" diff --git a/src/engine/controls/bpmcontrol.h b/src/engine/controls/bpmcontrol.h index fc753a2e80d..156fdca7003 100644 --- a/src/engine/controls/bpmcontrol.h +++ b/src/engine/controls/bpmcontrol.h @@ -1,5 +1,4 @@ -#ifndef BPMCONTROL_H -#define BPMCONTROL_H +#pragma once #include @@ -170,5 +169,3 @@ class BpmControl : public EngineControl { FRIEND_TEST(EngineSyncTest, UserTweakBeatDistance); FRIEND_TEST(EngineSyncTest, UserTweakPreservedInSeek); }; - -#endif // BPMCONTROL_H diff --git a/src/engine/controls/clockcontrol.cpp b/src/engine/controls/clockcontrol.cpp index f48660bb4ce..22cd4707bc9 100644 --- a/src/engine/controls/clockcontrol.cpp +++ b/src/engine/controls/clockcontrol.cpp @@ -3,6 +3,7 @@ #include "control/controlobject.h" #include "control/controlproxy.h" #include "engine/controls/enginecontrol.h" +#include "moc_clockcontrol.cpp" #include "preferences/usersettings.h" #include "track/track.h" diff --git a/src/engine/controls/clockcontrol.h b/src/engine/controls/clockcontrol.h index 5076a5cd9bc..87667db443a 100644 --- a/src/engine/controls/clockcontrol.h +++ b/src/engine/controls/clockcontrol.h @@ -1,5 +1,4 @@ -#ifndef CLOCKCONTROL_H -#define CLOCKCONTROL_H +#pragma once #include "engine/controls/enginecontrol.h" #include "preferences/usersettings.h" @@ -30,5 +29,3 @@ class ClockControl: public EngineControl { // m_pBeats is written from an engine worker thread mixxx::BeatsPointer m_pBeats; }; - -#endif /* CLOCKCONTROL_H */ diff --git a/src/engine/controls/cuecontrol.cpp b/src/engine/controls/cuecontrol.cpp index 94d9da776a0..c9c1fdffe4b 100644 --- a/src/engine/controls/cuecontrol.cpp +++ b/src/engine/controls/cuecontrol.cpp @@ -1,6 +1,3 @@ -// cuecontrol.cpp -// Created 11/5/2009 by RJ Ryan (rryan@mit.edu) - #include "engine/controls/cuecontrol.h" #include @@ -9,6 +6,7 @@ #include "control/controlobject.h" #include "control/controlpushbutton.h" #include "engine/enginebuffer.h" +#include "moc_cuecontrol.cpp" #include "preferences/colorpalettesettings.h" #include "track/track.h" #include "util/color/color.h" diff --git a/src/engine/controls/cuecontrol.h b/src/engine/controls/cuecontrol.h index e21629ab8e4..9dd4f232d98 100644 --- a/src/engine/controls/cuecontrol.h +++ b/src/engine/controls/cuecontrol.h @@ -1,8 +1,4 @@ -// cuecontrol.h -// Created 11/5/2009 by RJ Ryan (rryan@mit.edu) - -#ifndef CUECONTROL_H -#define CUECONTROL_H +#pragma once #include #include @@ -356,6 +352,3 @@ class CueControl : public EngineControl { friend class HotcueControlTest; }; - - -#endif /* CUECONTROL_H */ diff --git a/src/engine/controls/enginecontrol.cpp b/src/engine/controls/enginecontrol.cpp index 6e7afe55b03..e08dd1e9054 100644 --- a/src/engine/controls/enginecontrol.cpp +++ b/src/engine/controls/enginecontrol.cpp @@ -1,11 +1,10 @@ -// enginecontrol.cpp -// Created 7/5/2009 by RJ Ryan (rryan@mit.edu) - #include "engine/controls/enginecontrol.h" -#include "engine/enginemaster.h" + #include "engine/enginebuffer.h" +#include "engine/enginemaster.h" #include "engine/sync/enginesync.h" #include "mixer/playermanager.h" +#include "moc_enginecontrol.cpp" EngineControl::EngineControl(const QString& group, UserSettingsPointer pConfig) diff --git a/src/engine/controls/enginecontrol.h b/src/engine/controls/enginecontrol.h index d9e9904ce7a..094ab1c1d7c 100644 --- a/src/engine/controls/enginecontrol.h +++ b/src/engine/controls/enginecontrol.h @@ -1,8 +1,4 @@ -// enginecontrol.h -// Created 7/5/2009 by RJ Ryan (rryan@mit.edu) - -#ifndef ENGINECONTROL_H -#define ENGINECONTROL_H +#pragma once #include @@ -112,5 +108,3 @@ class EngineControl : public QObject { FRIEND_TEST(LoopingControlTest, LoopResizeSeek); FRIEND_TEST(LoopingControlTest, Beatjump_JumpsByBeats); }; - -#endif /* ENGINECONTROL_H */ diff --git a/src/engine/controls/keycontrol.cpp b/src/engine/controls/keycontrol.cpp index 8fac74c1fd5..874cdf5cb53 100644 --- a/src/engine/controls/keycontrol.cpp +++ b/src/engine/controls/keycontrol.cpp @@ -8,6 +8,7 @@ #include "control/controlproxy.h" #include "control/controlpushbutton.h" #include "engine/enginebuffer.h" +#include "moc_keycontrol.cpp" #include "track/keyutils.h" //static const double kLockOriginalKey = 0; diff --git a/src/engine/controls/keycontrol.h b/src/engine/controls/keycontrol.h index 7835ce3033f..ab5d66f9250 100644 --- a/src/engine/controls/keycontrol.h +++ b/src/engine/controls/keycontrol.h @@ -1,5 +1,4 @@ -#ifndef KEYCONTROL_H -#define KEYCONTROL_H +#pragma once #include "engine/controls/enginecontrol.h" #include "control/controlvalue.h" @@ -78,5 +77,3 @@ class KeyControl : public EngineControl { QAtomicInt m_updatePitchAdjustRequest; QAtomicInt m_updateRateRequest; }; - -#endif // KEYCONTROL_H diff --git a/src/engine/controls/loopingcontrol.cpp b/src/engine/controls/loopingcontrol.cpp index ca149aa9861..0a1eba5e868 100644 --- a/src/engine/controls/loopingcontrol.cpp +++ b/src/engine/controls/loopingcontrol.cpp @@ -1,6 +1,4 @@ -// loopingcontrol.cpp -// Created on Sep 23, 2008 -// Author: asantoni, rryan +#include "engine/controls/loopingcontrol.h" #include @@ -8,13 +6,13 @@ #include "control/controlpushbutton.h" #include "engine/controls/bpmcontrol.h" #include "engine/controls/enginecontrol.h" -#include "engine/controls/loopingcontrol.h" #include "engine/enginebuffer.h" +#include "moc_loopingcontrol.cpp" #include "preferences/usersettings.h" +#include "track/track.h" #include "util/compatibility.h" #include "util/math.h" #include "util/sample.h" -#include "track/track.h" double LoopingControl::s_dBeatSizes[] = { 0.03125, 0.0625, 0.125, 0.25, 0.5, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 }; diff --git a/src/engine/controls/loopingcontrol.h b/src/engine/controls/loopingcontrol.h index 3227a372769..3d492f306fa 100644 --- a/src/engine/controls/loopingcontrol.h +++ b/src/engine/controls/loopingcontrol.h @@ -1,9 +1,4 @@ -// loopingcontrol.h -// Created on Sep 23, 2008 -// Author: asantoni, rryan - -#ifndef LOOPINGCONTROL_H -#define LOOPINGCONTROL_H +#pragma once #include #include @@ -142,7 +137,6 @@ class LoopingControl : public EngineControl { ControlPushButton* m_pLoopOutButton; ControlPushButton* m_pLoopOutGotoButton; ControlPushButton* m_pLoopExitButton; - ControlPushButton* m_pLoopToggleButton; ControlPushButton* m_pReloopToggleButton; ControlPushButton* m_pReloopAndStopButton; ControlObject* m_pCOLoopScale; @@ -268,5 +262,3 @@ class BeatLoopingControl : public QObject { ControlPushButton* m_pToggle; ControlObject* m_pEnabled; }; - -#endif /* LOOPINGCONTROL_H */ diff --git a/src/engine/controls/quantizecontrol.cpp b/src/engine/controls/quantizecontrol.cpp index 28e70e274a7..c059bca51c1 100644 --- a/src/engine/controls/quantizecontrol.cpp +++ b/src/engine/controls/quantizecontrol.cpp @@ -1,7 +1,3 @@ -// QuantizeControl.cpp -// Created on Sat 5, 2011 -// Author: pwhelan - #include "engine/controls/quantizecontrol.h" #include @@ -9,9 +5,9 @@ #include "control/controlobject.h" #include "control/controlpushbutton.h" #include "engine/controls/enginecontrol.h" +#include "moc_quantizecontrol.cpp" #include "preferences/usersettings.h" #include "track/track.h" -#include "util/assert.h" QuantizeControl::QuantizeControl(const QString& group, UserSettingsPointer pConfig) diff --git a/src/engine/controls/quantizecontrol.h b/src/engine/controls/quantizecontrol.h index 03aae3fed57..8d13c06ccd3 100644 --- a/src/engine/controls/quantizecontrol.h +++ b/src/engine/controls/quantizecontrol.h @@ -1,5 +1,4 @@ -#ifndef QUANTIZECONTROL_H -#define QUANTIZECONTROL_H +#pragma once #include @@ -39,5 +38,3 @@ class QuantizeControl : public EngineControl { // m_pBeats is written from an engine worker thread mixxx::BeatsPointer m_pBeats; }; - -#endif // QUANTIZECONTROL_H diff --git a/src/engine/controls/ratecontrol.cpp b/src/engine/controls/ratecontrol.cpp index 99333b5b366..f2c4465dfe4 100644 --- a/src/engine/controls/ratecontrol.cpp +++ b/src/engine/controls/ratecontrol.cpp @@ -1,21 +1,19 @@ -// ratecontrol.cpp -// Created 7/4/2009 by RJ Ryan (rryan@mit.edu) +#include "engine/controls/ratecontrol.h" + +#include #include "control/controlobject.h" -#include "control/controlpushbutton.h" #include "control/controlpotmeter.h" -#include "control/controlttrotary.h" #include "control/controlproxy.h" -#include "util/rotary.h" -#include "util/math.h" -#include "vinylcontrol/defs_vinylcontrol.h" - +#include "control/controlpushbutton.h" +#include "control/controlttrotary.h" #include "engine/controls/bpmcontrol.h" #include "engine/controls/enginecontrol.h" -#include "engine/controls/ratecontrol.h" #include "engine/positionscratchcontroller.h" - -#include +#include "moc_ratecontrol.cpp" +#include "util/math.h" +#include "util/rotary.h" +#include "vinylcontrol/defs_vinylcontrol.h" namespace { constexpr int kRateSensitivityMin = 100; diff --git a/src/engine/controls/ratecontrol.h b/src/engine/controls/ratecontrol.h index 6daa7296ce4..54accae3e03 100644 --- a/src/engine/controls/ratecontrol.h +++ b/src/engine/controls/ratecontrol.h @@ -1,8 +1,4 @@ -// ratecontrol.h -// Created 7/4/2009 by RJ Ryan (rryan@mit.edu) - -#ifndef RATECONTROL_H -#define RATECONTROL_H +#pragma once #include @@ -168,5 +164,3 @@ public slots: // Speed for temporary rate change double m_dRateTempRampChange; }; - -#endif /* RATECONTROL_H */ diff --git a/src/engine/controls/vinylcontrolcontrol.cpp b/src/engine/controls/vinylcontrolcontrol.cpp index 951552d44ab..0684d4ea412 100644 --- a/src/engine/controls/vinylcontrolcontrol.cpp +++ b/src/engine/controls/vinylcontrolcontrol.cpp @@ -1,5 +1,6 @@ #include "engine/controls/vinylcontrolcontrol.h" +#include "moc_vinylcontrolcontrol.cpp" #include "track/track.h" #include "util/math.h" #include "vinylcontrol/vinylcontrol.h" diff --git a/src/engine/controls/vinylcontrolcontrol.h b/src/engine/controls/vinylcontrolcontrol.h index 6e684fa57c9..4b9065b924e 100644 --- a/src/engine/controls/vinylcontrolcontrol.h +++ b/src/engine/controls/vinylcontrolcontrol.h @@ -1,5 +1,4 @@ -#ifndef VINYLCONTROLCONTROL_H -#define VINYLCONTROLCONTROL_H +#pragma once #include "control/controlobject.h" #include "control/controlproxy.h" @@ -40,5 +39,3 @@ class VinylControlControl : public EngineControl { bool m_bSeekRequested; }; - -#endif /* VINYLCONTROLCONTROL_H */ diff --git a/src/engine/effects/engineeffect.h b/src/engine/effects/engineeffect.h index d42c1a6759c..4e98f64cf6b 100644 --- a/src/engine/effects/engineeffect.h +++ b/src/engine/effects/engineeffect.h @@ -1,5 +1,4 @@ -#ifndef ENGINEEFFECT_H -#define ENGINEEFFECT_H +#pragma once #include #include @@ -71,5 +70,3 @@ class EngineEffect : public EffectsRequestHandler { DISALLOW_COPY_AND_ASSIGN(EngineEffect); }; - -#endif /* ENGINEEFFECT_H */ diff --git a/src/engine/effects/engineeffectparameter.h b/src/engine/effects/engineeffectparameter.h index 888773f9f99..a60ed06a1a3 100644 --- a/src/engine/effects/engineeffectparameter.h +++ b/src/engine/effects/engineeffectparameter.h @@ -1,5 +1,4 @@ -#ifndef ENGINEEFFECTPARAMETER_H -#define ENGINEEFFECTPARAMETER_H +#pragma once #include #include @@ -85,5 +84,3 @@ class EngineEffectParameter { DISALLOW_COPY_AND_ASSIGN(EngineEffectParameter); }; - -#endif /* ENGINEEFFECTPARAMETER_H */ diff --git a/src/engine/effects/engineeffectrack.h b/src/engine/effects/engineeffectrack.h index 1ff4d542522..8e16d3ba338 100644 --- a/src/engine/effects/engineeffectrack.h +++ b/src/engine/effects/engineeffectrack.h @@ -1,5 +1,4 @@ -#ifndef ENGINEEFFECTRACK_H -#define ENGINEEFFECTRACK_H +#pragma once #include @@ -47,5 +46,3 @@ class EngineEffectRack : public EffectsRequestHandler { DISALLOW_COPY_AND_ASSIGN(EngineEffectRack); }; - -#endif /* ENGINEEFFECTRACK_H */ diff --git a/src/engine/effects/engineeffectsmanager.h b/src/engine/effects/engineeffectsmanager.h index d40406c281d..7bea240c2dd 100644 --- a/src/engine/effects/engineeffectsmanager.h +++ b/src/engine/effects/engineeffectsmanager.h @@ -1,5 +1,4 @@ -#ifndef ENGINEEFFECTSMANAGER_H -#define ENGINEEFFECTSMANAGER_H +#pragma once #include @@ -91,6 +90,3 @@ class EngineEffectsManager : public EffectsRequestHandler { mixxx::SampleBuffer m_buffer1; mixxx::SampleBuffer m_buffer2; }; - - -#endif /* ENGINEEFFECTSMANAGER_H */ diff --git a/src/engine/effects/groupfeaturestate.h b/src/engine/effects/groupfeaturestate.h index 9096caf83a0..2a34e8ad2b0 100644 --- a/src/engine/effects/groupfeaturestate.h +++ b/src/engine/effects/groupfeaturestate.h @@ -1,5 +1,4 @@ -#ifndef GROUPFEATURESTATE_H -#define GROUPFEATURESTATE_H +#pragma once #include "proto/keys.pb.h" @@ -25,5 +24,3 @@ struct GroupFeatureState { bool has_gain; double gain; }; - -#endif /* GROUPFEATURESTATE_H */ diff --git a/src/engine/effects/message.h b/src/engine/effects/message.h index 3aaa39e8cd6..17ebcc15215 100644 --- a/src/engine/effects/message.h +++ b/src/engine/effects/message.h @@ -1,5 +1,4 @@ -#ifndef MESSAGE_H -#define MESSAGE_H +#pragma once #include #include @@ -197,5 +196,3 @@ class EffectsRequestHandler { EffectsRequest& message, EffectsResponsePipe* pResponsePipe) = 0; }; - -#endif /* MESSAGE_H */ diff --git a/src/engine/enginebuffer.cpp b/src/engine/enginebuffer.cpp index 30716c9fa7a..288568b604c 100644 --- a/src/engine/enginebuffer.cpp +++ b/src/engine/enginebuffer.cpp @@ -26,6 +26,7 @@ #include "engine/readaheadmanager.h" #include "engine/sync/enginesync.h" #include "engine/sync/synccontrol.h" +#include "moc_enginebuffer.cpp" #include "preferences/usersettings.h" #include "track/beatfactory.h" #include "track/keyutils.h" diff --git a/src/engine/enginebuffer.h b/src/engine/enginebuffer.h index 49fd9cf67dc..eb7b21957e7 100644 --- a/src/engine/enginebuffer.h +++ b/src/engine/enginebuffer.h @@ -1,22 +1,4 @@ -/*************************************************************************** - enginebuffer.h - description - ------------------- - begin : Wed Feb 20 2002 - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef ENGINEBUFFER_H -#define ENGINEBUFFER_H +#pragma once #include @@ -65,10 +47,6 @@ class EngineWorkerScheduler; class VisualPlayPosition; class EngineMaster; -/** - *@author Tue and Ken Haste Andersen -*/ - // Length of audio beat marks in samples const int audioBeatMarkLen = 40; @@ -426,5 +404,3 @@ class EngineBuffer : public EngineObject { }; Q_DECLARE_OPERATORS_FOR_FLAGS(EngineBuffer::SeekRequests) - -#endif diff --git a/src/engine/enginedelay.cpp b/src/engine/enginedelay.cpp index 7a44c3bd243..aaaafbd4313 100644 --- a/src/engine/enginedelay.cpp +++ b/src/engine/enginedelay.cpp @@ -1,24 +1,9 @@ -/*************************************************************************** - enginedelay.cpp - description - ------------------- - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "enginedelay.h" -#include "control/controlproxy.h" #include "control/controlpotmeter.h" +#include "control/controlproxy.h" #include "engine/engine.h" +#include "moc_enginedelay.cpp" #include "util/assert.h" #include "util/sample.h" diff --git a/src/engine/enginedelay.h b/src/engine/enginedelay.h index 60654cb4caf..bace1255d48 100644 --- a/src/engine/enginedelay.h +++ b/src/engine/enginedelay.h @@ -1,21 +1,4 @@ -/*************************************************************************** - enginedelay.h - description - ------------------- - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef ENGINEDELAY_H -#define ENGINEDELAY_H +#pragma once #include "engine/engineobject.h" #include "preferences/usersettings.h" @@ -43,5 +26,3 @@ class EngineDelay : public EngineObject { int m_iDelayPos; int m_iDelay; }; - -#endif diff --git a/src/engine/enginemaster.cpp b/src/engine/enginemaster.cpp index 9e49dc18de8..79b99636a55 100644 --- a/src/engine/enginemaster.cpp +++ b/src/engine/enginemaster.cpp @@ -1,21 +1,18 @@ #include "engine/enginemaster.h" -#include #include #include +#include -#include "preferences/usersettings.h" -#include "control/controlaudiotaperpot.h" #include "control/controlaudiotaperpot.h" #include "control/controlpotmeter.h" #include "control/controlpushbutton.h" #include "effects/effectsmanager.h" #include "engine/channelmixer.h" -#include "engine/effects/engineeffectsmanager.h" -#include "engine/enginebuffer.h" -#include "engine/enginebuffer.h" #include "engine/channels/enginechannel.h" #include "engine/channels/enginedeck.h" +#include "engine/effects/engineeffectsmanager.h" +#include "engine/enginebuffer.h" #include "engine/enginedelay.h" #include "engine/enginetalkoverducking.h" #include "engine/enginevumeter.h" @@ -24,6 +21,8 @@ #include "engine/sidechain/enginesidechain.h" #include "engine/sync/enginesync.h" #include "mixer/playermanager.h" +#include "moc_enginemaster.cpp" +#include "preferences/usersettings.h" #include "util/defs.h" #include "util/sample.h" #include "util/timer.h" diff --git a/src/engine/enginemaster.h b/src/engine/enginemaster.h index 20beb816853..72f45fd17da 100644 --- a/src/engine/enginemaster.h +++ b/src/engine/enginemaster.h @@ -1,22 +1,4 @@ -/*************************************************************************** - enginemaster.h - description - ------------------- - begin : Sun Apr 28 2002 - copyright : (C) 2002 by - email : - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef ENGINEMASTER_H -#define ENGINEMASTER_H +#pragma once #include #include @@ -365,5 +347,3 @@ class EngineMaster : public QObject, public AudioSource { volatile bool m_bBusOutputConnected[3]; bool m_bExternalRecordBroadcastInputConnected; }; - -#endif diff --git a/src/engine/engineobject.cpp b/src/engine/engineobject.cpp index abdef17380a..43cd0987aa5 100644 --- a/src/engine/engineobject.cpp +++ b/src/engine/engineobject.cpp @@ -1,22 +1,7 @@ -/*************************************************************************** - engineobject.cpp - description - ------------------- - begin : Wed Feb 20 2002 - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "engineobject.h" +#include "moc_engineobject.cpp" + EngineObject::EngineObject() { } @@ -28,6 +13,3 @@ EngineObjectConstIn::EngineObjectConstIn() { EngineObjectConstIn::~EngineObjectConstIn() { } - - - diff --git a/src/engine/engineobject.h b/src/engine/engineobject.h index 44bcf1addf8..88de2c7e492 100644 --- a/src/engine/engineobject.h +++ b/src/engine/engineobject.h @@ -1,32 +1,10 @@ -/*************************************************************************** - engineobject.h - description - ------------------- - begin : Wed Feb 20 2002 - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef ENGINEOBJECT_H -#define ENGINEOBJECT_H +#pragma once #include #include "util/types.h" #include "engine/effects/groupfeaturestate.h" -/** - *@author Tue and Ken Haste Andersen - */ - class EngineObject : public QObject { Q_OBJECT public: @@ -51,5 +29,3 @@ class EngineObjectConstIn : public QObject { virtual void process(const CSAMPLE* pIn, CSAMPLE* pOut, const int iBufferSize) = 0; }; - -#endif diff --git a/src/engine/enginesidechaincompressor.h b/src/engine/enginesidechaincompressor.h index ca124d39b47..bc7d030c652 100644 --- a/src/engine/enginesidechaincompressor.h +++ b/src/engine/enginesidechaincompressor.h @@ -1,5 +1,4 @@ -#ifndef ENGINECOMPRESSOR_H -#define ENGINECOMPRESSOR_H +#pragma once #include "util/types.h" @@ -81,5 +80,3 @@ class EngineSideChainCompressor { CSAMPLE m_attackPerFrame; CSAMPLE m_decayPerFrame; }; - -#endif diff --git a/src/engine/enginetalkoverducking.cpp b/src/engine/enginetalkoverducking.cpp index d6f41ebea92..e4e6f9f5f01 100644 --- a/src/engine/enginetalkoverducking.cpp +++ b/src/engine/enginetalkoverducking.cpp @@ -1,6 +1,8 @@ -#include "control/controlproxy.h" #include "engine/enginetalkoverducking.h" +#include "control/controlproxy.h" +#include "moc_enginetalkoverducking.cpp" + namespace { constexpr CSAMPLE kDuckThreshold = 0.1f; diff --git a/src/engine/enginetalkoverducking.h b/src/engine/enginetalkoverducking.h index 090b683af8c..584cca291d4 100644 --- a/src/engine/enginetalkoverducking.h +++ b/src/engine/enginetalkoverducking.h @@ -1,3 +1,5 @@ +#pragma once + #include "engine/enginesidechaincompressor.h" #include "control/controlpotmeter.h" #include "control/controlpushbutton.h" diff --git a/src/engine/enginevumeter.cpp b/src/engine/enginevumeter.cpp index 666ea72f5d7..07c761ff095 100644 --- a/src/engine/enginevumeter.cpp +++ b/src/engine/enginevumeter.cpp @@ -1,7 +1,8 @@ #include "engine/enginevumeter.h" -#include "control/controlproxy.h" #include "control/controlpotmeter.h" +#include "control/controlproxy.h" +#include "moc_enginevumeter.cpp" #include "util/math.h" #include "util/sample.h" diff --git a/src/engine/engineworker.cpp b/src/engine/engineworker.cpp index 43e99141a01..228a574ebb1 100644 --- a/src/engine/engineworker.cpp +++ b/src/engine/engineworker.cpp @@ -1,8 +1,7 @@ -// engineworker.cpp -// Created 6/2/2010 by RJ Ryan (rryan@mit.edu) - #include "engine/engineworker.h" + #include "engine/engineworkerscheduler.h" +#include "moc_engineworker.cpp" EngineWorker::EngineWorker() : m_pScheduler(nullptr) { diff --git a/src/engine/engineworker.h b/src/engine/engineworker.h index 31244a34e60..b7cf735b384 100644 --- a/src/engine/engineworker.h +++ b/src/engine/engineworker.h @@ -1,8 +1,4 @@ -// engineworker.h -// Created 6/2/2010 by RJ Ryan (rryan@mit.edu) - -#ifndef ENGINEWORKER_H -#define ENGINEWORKER_H +#pragma once #include #include @@ -35,5 +31,3 @@ class EngineWorker : public QThread { EngineWorkerScheduler* m_pScheduler; std::atomic_flag m_notReady; }; - -#endif /* ENGINEWORKER_H */ diff --git a/src/engine/engineworkerscheduler.cpp b/src/engine/engineworkerscheduler.cpp index f44f296642c..9f3a3ad7f66 100644 --- a/src/engine/engineworkerscheduler.cpp +++ b/src/engine/engineworkerscheduler.cpp @@ -1,10 +1,9 @@ -// engineworkerscheduler.cpp -// Created 6/2/2010 by RJ Ryan (rryan@mit.edu) +#include "engine/engineworkerscheduler.h" #include #include "engine/engineworker.h" -#include "engine/engineworkerscheduler.h" +#include "moc_engineworkerscheduler.cpp" #include "util/event.h" EngineWorkerScheduler::EngineWorkerScheduler(QObject* pParent) diff --git a/src/engine/engineworkerscheduler.h b/src/engine/engineworkerscheduler.h index 07230673ae6..a7ecb90094e 100644 --- a/src/engine/engineworkerscheduler.h +++ b/src/engine/engineworkerscheduler.h @@ -1,5 +1,4 @@ -#ifndef ENGINEWORKERSCHEDULER_H -#define ENGINEWORKERSCHEDULER_H +#pragma once #include #include @@ -37,5 +36,3 @@ class EngineWorkerScheduler : public QThread { QMutex m_mutex; volatile bool m_bQuit; }; - -#endif /* ENGINEWORKERSCHEDULER_H */ diff --git a/src/engine/filters/enginefilter.cpp b/src/engine/filters/enginefilter.cpp index 28ba93bc969..b299f04772b 100644 --- a/src/engine/filters/enginefilter.cpp +++ b/src/engine/filters/enginefilter.cpp @@ -1,23 +1,10 @@ -/*************************************************************************** - * enginefilter.cpp - Wrapper for FidLib Filter Library * - * ---------------------- * - * copyright : (C) 2007 by John Sully * - * email : jsully@scs.ryerson.ca * - * * - **************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ +// Wrapper for FidLib Filter Library #include "engine/filters/enginefilter.h" + #include +#include "moc_enginefilter.cpp" EngineFilter::EngineFilter(char * conf, int predefinedType) : iir(0), diff --git a/src/engine/filters/enginefilter.h b/src/engine/filters/enginefilter.h index 2fabcfeed5b..0397d0ff4fe 100644 --- a/src/engine/filters/enginefilter.h +++ b/src/engine/filters/enginefilter.h @@ -1,24 +1,6 @@ -/*************************************************************************** - * enginefilter.h - Wrapper for FidLib Filter Library * - * ---------------------- * - * copyright : (C) 2007 by John Sully * - * email : jsully@scs.ryerson.ca * - * * - **************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef ENGINEFILTER_H -#define ENGINEFILTER_H - -#define MIXXX +// Wrapper for FidLib Filter Library +#pragma once + #include #include @@ -59,5 +41,3 @@ double processSampleDynamic(void *buf, const double sample); double processSampleHp(void *buf, const double sample); double processSampleBp(void *buf, const double sample); double processSampleLp(void *buf, const double sample); - -#endif diff --git a/src/engine/filters/enginefilterbessel4.cpp b/src/engine/filters/enginefilterbessel4.cpp index a47c9a46c33..8b559090a00 100644 --- a/src/engine/filters/enginefilterbessel4.cpp +++ b/src/engine/filters/enginefilterbessel4.cpp @@ -1,4 +1,6 @@ #include "engine/filters/enginefilterbessel4.h" + +#include "moc_enginefilterbessel4.cpp" #include "util/math.h" namespace { diff --git a/src/engine/filters/enginefilterbessel4.h b/src/engine/filters/enginefilterbessel4.h index 02fa3dd25ea..7e6d1b72648 100644 --- a/src/engine/filters/enginefilterbessel4.h +++ b/src/engine/filters/enginefilterbessel4.h @@ -1,5 +1,4 @@ -#ifndef ENGINEFILTERBESSEL4_H -#define ENGINEFILTERBESSEL4_H +#pragma once #include "engine/filters/enginefilteriir.h" @@ -30,5 +29,3 @@ class EngineFilterBessel4High : public EngineFilterIIR<4, IIR_HP> { EngineFilterBessel4High(int sampleRate, double freqCorner1); void setFrequencyCorners(int sampleRate, double freqCorner1); }; - -#endif // ENGINEFILTERBESSEL4_H diff --git a/src/engine/filters/enginefilterbessel8.cpp b/src/engine/filters/enginefilterbessel8.cpp index fa97b01fc75..9a5900d8f4c 100644 --- a/src/engine/filters/enginefilterbessel8.cpp +++ b/src/engine/filters/enginefilterbessel8.cpp @@ -1,4 +1,6 @@ #include "engine/filters/enginefilterbessel8.h" + +#include "moc_enginefilterbessel8.cpp" #include "util/math.h" namespace { diff --git a/src/engine/filters/enginefilterbessel8.h b/src/engine/filters/enginefilterbessel8.h index 40bcb5d314d..ff66d9eeb7e 100644 --- a/src/engine/filters/enginefilterbessel8.h +++ b/src/engine/filters/enginefilterbessel8.h @@ -1,5 +1,4 @@ -#ifndef ENGINEFILTERBESSEL8_H -#define ENGINEFILTERBESSEL8_H +#pragma once #include "engine/filters/enginefilteriir.h" @@ -30,5 +29,3 @@ class EngineFilterBessel8High : public EngineFilterIIR<8, IIR_HP> { EngineFilterBessel8High(int sampleRate, double freqCorner1); void setFrequencyCorners(int sampleRate, double freqCorner1); }; - -#endif // ENGINEFILTERBESSEL8_H diff --git a/src/engine/filters/enginefilterbiquad1.cpp b/src/engine/filters/enginefilterbiquad1.cpp index ee9572befba..c0376bc9c6f 100644 --- a/src/engine/filters/enginefilterbiquad1.cpp +++ b/src/engine/filters/enginefilterbiquad1.cpp @@ -1,6 +1,9 @@ -#include #include "engine/filters/enginefilterbiquad1.h" +#include + +#include "moc_enginefilterbiquad1.cpp" + EngineFilterBiquad1LowShelving::EngineFilterBiquad1LowShelving(int sampleRate, double centerFreq, double Q) { diff --git a/src/engine/filters/enginefilterbiquad1.h b/src/engine/filters/enginefilterbiquad1.h index 7ad767c1bef..1a88d9de931 100644 --- a/src/engine/filters/enginefilterbiquad1.h +++ b/src/engine/filters/enginefilterbiquad1.h @@ -1,5 +1,4 @@ -#ifndef ENGINEFILTERBIQUAD1_H -#define ENGINEFILTERBIQUAD1_H +#pragma once #include "engine/filters/enginefilteriir.h" @@ -74,5 +73,3 @@ class EngineFilterBiquad1High : public EngineFilterIIR<2, IIR_HP> { private: char m_spec[FIDSPEC_LENGTH]; }; - -#endif // ENGINEFILTERBIQUAD1_H diff --git a/src/engine/filters/enginefilterbutterworth4.cpp b/src/engine/filters/enginefilterbutterworth4.cpp index 6abe565b195..4d97777aa2e 100644 --- a/src/engine/filters/enginefilterbutterworth4.cpp +++ b/src/engine/filters/enginefilterbutterworth4.cpp @@ -1,5 +1,7 @@ #include "engine/filters/enginefilterbutterworth4.h" +#include "moc_enginefilterbutterworth4.cpp" + namespace { constexpr char kFidSpecLowPassButterworth4[] = "LpBu4"; constexpr char kFidSpecBandPassButterworth4[] = "BpBu4"; diff --git a/src/engine/filters/enginefilterbutterworth4.h b/src/engine/filters/enginefilterbutterworth4.h index 7133c60ca42..8867abac500 100644 --- a/src/engine/filters/enginefilterbutterworth4.h +++ b/src/engine/filters/enginefilterbutterworth4.h @@ -1,5 +1,4 @@ -#ifndef ENGINEFILTERBUTTERWORTH4_H -#define ENGINEFILTERBUTTERWORTH4_H +#pragma once #include "engine/filters/enginefilteriir.h" @@ -25,5 +24,3 @@ class EngineFilterButterworth4High : public EngineFilterIIR<4, IIR_HP> { EngineFilterButterworth4High(int sampleRate, double freqCorner1); void setFrequencyCorners(int sampleRate, double freqCorner1); }; - -#endif // ENGINEFILTERBUTTERWORTH4_H diff --git a/src/engine/filters/enginefilterbutterworth8.cpp b/src/engine/filters/enginefilterbutterworth8.cpp index ea5a134b4a2..00e503af007 100644 --- a/src/engine/filters/enginefilterbutterworth8.cpp +++ b/src/engine/filters/enginefilterbutterworth8.cpp @@ -1,5 +1,7 @@ #include "engine/filters/enginefilterbutterworth8.h" +#include "moc_enginefilterbutterworth8.cpp" + namespace { constexpr char kFidSpecLowPassButterworth8[] = "LpBu8"; constexpr char kFidSpecBandPassButterworth8[] = "BpBu8"; diff --git a/src/engine/filters/enginefilterbutterworth8.h b/src/engine/filters/enginefilterbutterworth8.h index 49f412c45ff..fd86173e6be 100644 --- a/src/engine/filters/enginefilterbutterworth8.h +++ b/src/engine/filters/enginefilterbutterworth8.h @@ -1,5 +1,4 @@ -#ifndef ENGINEFILTERBUTTERWORTH8_H -#define ENGINEFILTERBUTTERWORTH8_H +#pragma once #include "engine/filters/enginefilteriir.h" @@ -25,5 +24,3 @@ class EngineFilterButterworth8High : public EngineFilterIIR<8, IIR_HP> { EngineFilterButterworth8High(int sampleRate, double freqCorner1); void setFrequencyCorners(int sampleRate, double freqCorner1); }; - -#endif // ENGINEFILTERBUTTERWORTH8_H diff --git a/src/engine/filters/enginefilterdelay.h b/src/engine/filters/enginefilterdelay.h index e57d1ada344..0ffb26cb377 100644 --- a/src/engine/filters/enginefilterdelay.h +++ b/src/engine/filters/enginefilterdelay.h @@ -1,5 +1,4 @@ -#ifndef ENGINEFILTERDELAY_H -#define ENGINEFILTERDELAY_H +#pragma once #include "engine/engineobject.h" #include "util/assert.h" @@ -122,5 +121,3 @@ class EngineFilterDelay : public EngineObjectConstIn { CSAMPLE m_buf[SIZE]; bool m_doStart; }; - -#endif // ENGINEFILTERDELAY_H diff --git a/src/engine/filters/enginefilteriir.h b/src/engine/filters/enginefilteriir.h index d30689f0a02..b00996b9ba8 100644 --- a/src/engine/filters/enginefilteriir.h +++ b/src/engine/filters/enginefilteriir.h @@ -1,5 +1,4 @@ -#ifndef ENGINEFILTERIIR_H -#define ENGINEFILTERIIR_H +#pragma once #include #include @@ -644,6 +643,3 @@ inline double EngineFilterIIR<2, IIR_HP2>::processSample(double* coef, return val; } - - -#endif // ENGINEFILTERIIR_H diff --git a/src/engine/filters/enginefilterlinkwitzriley2.cpp b/src/engine/filters/enginefilterlinkwitzriley2.cpp index 44527f454bf..ef5704ef4b2 100644 --- a/src/engine/filters/enginefilterlinkwitzriley2.cpp +++ b/src/engine/filters/enginefilterlinkwitzriley2.cpp @@ -1,5 +1,7 @@ #include "engine/filters/enginefilterlinkwitzriley2.h" +#include "moc_enginefilterlinkwitzriley2.cpp" + namespace { constexpr char kFidSpecLowPassButterworth1[] = "LpBu1"; constexpr char kFidSpecHighPassButterworth1[] = "HpBu1"; diff --git a/src/engine/filters/enginefilterlinkwitzriley2.h b/src/engine/filters/enginefilterlinkwitzriley2.h index 229b4c5ef8b..bd9925c0eae 100644 --- a/src/engine/filters/enginefilterlinkwitzriley2.h +++ b/src/engine/filters/enginefilterlinkwitzriley2.h @@ -1,5 +1,4 @@ -#ifndef ENGINEFILTELINKWITZRILEY2_H -#define ENGINEFILTELINKWITZRILEY2_H +#pragma once #include "engine/filters/enginefilteriir.h" @@ -17,5 +16,3 @@ class EngineFilterLinkwitzRiley2High : public EngineFilterIIR<2, IIR_HP2> { EngineFilterLinkwitzRiley2High(int sampleRate, double freqCorner1); void setFrequencyCorners(int sampleRate, double freqCorner1); }; - -#endif // ENGINEFILTERLINKWITZRILEY2_H diff --git a/src/engine/filters/enginefilterlinkwitzriley4.cpp b/src/engine/filters/enginefilterlinkwitzriley4.cpp index 378314c1b72..3fec25a068e 100644 --- a/src/engine/filters/enginefilterlinkwitzriley4.cpp +++ b/src/engine/filters/enginefilterlinkwitzriley4.cpp @@ -1,5 +1,7 @@ #include "engine/filters/enginefilterlinkwitzriley4.h" +#include "moc_enginefilterlinkwitzriley4.cpp" + namespace { constexpr char kFidSpecLowPassButterworth2[] = "LpBu2"; constexpr char kFidSpecHighPassButterworth2[] = "HpBu2"; diff --git a/src/engine/filters/enginefilterlinkwitzriley4.h b/src/engine/filters/enginefilterlinkwitzriley4.h index ed179f47df5..fc9761e5aca 100644 --- a/src/engine/filters/enginefilterlinkwitzriley4.h +++ b/src/engine/filters/enginefilterlinkwitzriley4.h @@ -1,5 +1,4 @@ -#ifndef ENGINEFILTELINKWITZRILEY4_H -#define ENGINEFILTELINKWITZRILEY4_H +#pragma once #include "engine/filters/enginefilteriir.h" @@ -17,5 +16,3 @@ class EngineFilterLinkwitzRiley4High : public EngineFilterIIR<4, IIR_HP> { EngineFilterLinkwitzRiley4High(int sampleRate, double freqCorner1); void setFrequencyCorners(int sampleRate, double freqCorner1); }; - -#endif // ENGINEFILTERLINKWITZRILEY4_H diff --git a/src/engine/filters/enginefilterlinkwitzriley8.cpp b/src/engine/filters/enginefilterlinkwitzriley8.cpp index 775460590fc..c59b7e526ff 100644 --- a/src/engine/filters/enginefilterlinkwitzriley8.cpp +++ b/src/engine/filters/enginefilterlinkwitzriley8.cpp @@ -1,5 +1,7 @@ #include "engine/filters/enginefilterlinkwitzriley8.h" +#include "moc_enginefilterlinkwitzriley8.cpp" + namespace { constexpr char kFidSpecLowPassButterworth4[] = "LpBu4"; constexpr char kFidSpecHighPassButterworth4[] = "HpBu4"; diff --git a/src/engine/filters/enginefilterlinkwitzriley8.h b/src/engine/filters/enginefilterlinkwitzriley8.h index 63906af37a6..3ae5614b833 100644 --- a/src/engine/filters/enginefilterlinkwitzriley8.h +++ b/src/engine/filters/enginefilterlinkwitzriley8.h @@ -1,5 +1,4 @@ -#ifndef ENGINEFILTELINKWITZRILEY8_H -#define ENGINEFILTELINKWITZRILEY8_H +#pragma once #include "engine/filters/enginefilteriir.h" @@ -17,5 +16,3 @@ class EngineFilterLinkwitzRiley8High : public EngineFilterIIR<8, IIR_HP> { EngineFilterLinkwitzRiley8High(int sampleRate, double freqCorner1); void setFrequencyCorners(int sampleRate, double freqCorner1); }; - -#endif // ENGINEFILTERLINKWITZRILEY8_H diff --git a/src/engine/filters/enginefiltermoogladder4.cpp b/src/engine/filters/enginefiltermoogladder4.cpp index 9f3d153d5e0..dd71f71c0d9 100644 --- a/src/engine/filters/enginefiltermoogladder4.cpp +++ b/src/engine/filters/enginefiltermoogladder4.cpp @@ -1,5 +1,6 @@ #include "engine/filters/enginefiltermoogladder4.h" +#include "moc_enginefiltermoogladder4.cpp" EngineFilterMoogLadder4Low::EngineFilterMoogLadder4Low(int sampleRate, double freqCorner1, @@ -12,5 +13,3 @@ EngineFilterMoogLadder4High::EngineFilterMoogLadder4High(int sampleRate, double resonance) : EngineFilterMoogLadderBase(sampleRate, (float)freqCorner1, (float)resonance) { } - - diff --git a/src/engine/filters/enginefiltermoogladder4.h b/src/engine/filters/enginefiltermoogladder4.h index 8d4f1c44cb3..b1f33c7c70f 100644 --- a/src/engine/filters/enginefiltermoogladder4.h +++ b/src/engine/filters/enginefiltermoogladder4.h @@ -1,5 +1,4 @@ -#ifndef ENGINEFILTERMOOGLADDER4_H -#define ENGINEFILTERMOOGLADDER4_H +#pragma once // Filter based on the text "Non linear digital implementation of the moog ladder filter" // by Antti Houvilainen @@ -270,5 +269,3 @@ class EngineFilterMoogLadder4High : public EngineFilterMoogLadderBase @@ -128,5 +127,3 @@ class EngineFilterPan : public EngineObjectConstIn { bool m_doRamping; bool m_doStart; }; - -#endif // ENGINEFILTERPAN_H diff --git a/src/engine/positionscratchcontroller.h b/src/engine/positionscratchcontroller.h index ace908d1e7c..9c463d9b3cc 100644 --- a/src/engine/positionscratchcontroller.h +++ b/src/engine/positionscratchcontroller.h @@ -1,5 +1,4 @@ -#ifndef POSITIONSCRATCHCONTROLLER_H -#define POSITIONSCRATCHCONTROLLER_H +#pragma once #include #include @@ -37,5 +36,3 @@ class PositionScratchController : public QObject { double m_dMoveDelay; double m_dMouseSampeTime; }; - -#endif /* POSITIONSCRATCHCONTROLLER_H */ diff --git a/src/engine/readaheadmanager.cpp b/src/engine/readaheadmanager.cpp index d2b7257cdcc..acaca2f4995 100644 --- a/src/engine/readaheadmanager.cpp +++ b/src/engine/readaheadmanager.cpp @@ -1,6 +1,3 @@ -// readaheadmanager.cpp -// Created 8/2/2009 by RJ Ryan (rryan@mit.edu) - #include "engine/readaheadmanager.h" #include "engine/cachingreader/cachingreader.h" diff --git a/src/engine/readaheadmanager.h b/src/engine/readaheadmanager.h index c9c4f06fc52..49f5b98c64f 100644 --- a/src/engine/readaheadmanager.h +++ b/src/engine/readaheadmanager.h @@ -1,6 +1,3 @@ -// readaheadmanager.h -// Created 8/2/2009 by RJ Ryan (rryan@mit.edu) - #pragma once #include diff --git a/src/engine/sidechain/enginenetworkstream.h b/src/engine/sidechain/enginenetworkstream.h index 0aac81da18d..f09e53e9bc6 100644 --- a/src/engine/sidechain/enginenetworkstream.h +++ b/src/engine/sidechain/enginenetworkstream.h @@ -1,5 +1,4 @@ -#ifndef ENGINENETWORKSTREAM_H_ -#define ENGINENETWORKSTREAM_H_ +#pragma once #include #include @@ -62,5 +61,3 @@ class EngineNetworkStream { // onto the thread-unsafe QVector QVector m_outputWorkers; }; - -#endif /* ENGINENETWORKSTREAM_H_ */ diff --git a/src/engine/sidechain/enginerecord.cpp b/src/engine/sidechain/enginerecord.cpp index 005faae1d25..8ae573261a4 100644 --- a/src/engine/sidechain/enginerecord.cpp +++ b/src/engine/sidechain/enginerecord.cpp @@ -1,17 +1,10 @@ -/*************************************************************************** - enginerecord.cpp - class to record the mix - ------------------- - copyright : (C) 2007 by John Sully - copyright : (C) 2010 by Tobias Rafreider - email : -***************************************************************************/ - #include "engine/sidechain/enginerecord.h" #include "control/controlobject.h" #include "control/controlproxy.h" #include "encoder/encoder.h" #include "mixer/playerinfo.h" +#include "moc_enginerecord.cpp" #include "preferences/usersettings.h" #include "recording/defs_recording.h" #include "track/track.h" diff --git a/src/engine/sidechain/enginerecord.h b/src/engine/sidechain/enginerecord.h index 8559d24e059..4ef3c739334 100644 --- a/src/engine/sidechain/enginerecord.h +++ b/src/engine/sidechain/enginerecord.h @@ -1,12 +1,4 @@ -/*************************************************************************** - enginerecord.h - description - ------------------- - copyright : (C) 2007 by John Sully - email : - ***************************************************************************/ - -#ifndef ENGINERECORD_H -#define ENGINERECORD_H +#pragma once #include #include @@ -94,5 +86,3 @@ class EngineRecord : public QObject, public EncoderCallback, public SideChainWor quint64 m_cueTrack; bool m_bCueIsEnabled; }; - -#endif diff --git a/src/engine/sidechain/enginesidechain.cpp b/src/engine/sidechain/enginesidechain.cpp index 2e095de3935..447908b9914 100644 --- a/src/engine/sidechain/enginesidechain.cpp +++ b/src/engine/sidechain/enginesidechain.cpp @@ -1,19 +1,3 @@ -/*************************************************************************** - enginesidechain.cpp - ------------------- - copyright : (C) 2008 Albert Santoni - email : gamegod \a\t users.sf.net -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - // This class provides a way to do audio processing that does not need // to be executed in real-time. For example, broadcast encoding // and recording encoding can be done here. This class uses double-buffering @@ -24,11 +8,12 @@ #include "engine/sidechain/enginesidechain.h" -#include #include +#include -#include "engine/sidechain/sidechainworker.h" #include "engine/engine.h" +#include "engine/sidechain/sidechainworker.h" +#include "moc_enginesidechain.cpp" #include "util/counter.h" #include "util/event.h" #include "util/sample.h" diff --git a/src/engine/sidechain/enginesidechain.h b/src/engine/sidechain/enginesidechain.h index 2278bbf8822..15209e2fdcb 100644 --- a/src/engine/sidechain/enginesidechain.h +++ b/src/engine/sidechain/enginesidechain.h @@ -1,21 +1,4 @@ -/*************************************************************************** - enginesidechain.h - ------------------- - copyright : (C) 2008 Albert Santoni - email : gamegod \a\t users.sf.net -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - -#ifndef ENGINESIDECHAIN_H -#define ENGINESIDECHAIN_H +#pragma once #include #include @@ -71,5 +54,3 @@ class EngineSideChain : public QThread, public AudioDestination { MMutex m_workerLock; QList m_workers GUARDED_BY(m_workerLock); }; - -#endif diff --git a/src/engine/sidechain/networkinputstreamworker.cpp b/src/engine/sidechain/networkinputstreamworker.cpp index cda90395e3d..62802979266 100644 --- a/src/engine/sidechain/networkinputstreamworker.cpp +++ b/src/engine/sidechain/networkinputstreamworker.cpp @@ -1,6 +1,3 @@ -// networkinputstreamworker.cpp -// Create on August 11, 2017 by Palakis - #include NetworkInputStreamWorker::NetworkInputStreamWorker() { diff --git a/src/engine/sidechain/networkinputstreamworker.h b/src/engine/sidechain/networkinputstreamworker.h index 1e2336ea244..115154fea26 100644 --- a/src/engine/sidechain/networkinputstreamworker.h +++ b/src/engine/sidechain/networkinputstreamworker.h @@ -1,8 +1,4 @@ -// networkinputstreamworker.h -// Create on August 11, 2017 by Palakis - -#ifndef ENGINE_SIDECHAIN_NETWORKINPUTSTREAMWORKER_H -#define ENGINE_SIDECHAIN_NETWORKINPUTSTREAMWORKER_H +#pragma once #include "util/fifo.h" #include "util/sample.h" @@ -14,5 +10,3 @@ class NetworkInputStreamWorker { void setSourceFifo(FIFO* pFifo); }; - -#endif // ENGINE_SIDECHAIN_NETWORKINPUTSTREAMWORKER_H diff --git a/src/engine/sidechain/networkoutputstreamworker.h b/src/engine/sidechain/networkoutputstreamworker.h index ce520a4f4a4..813853050bb 100644 --- a/src/engine/sidechain/networkoutputstreamworker.h +++ b/src/engine/sidechain/networkoutputstreamworker.h @@ -1,5 +1,4 @@ -#ifndef NETWORKOUTPUTSTREAMWORKER_H -#define NETWORKOUTPUTSTREAMWORKER_H +#pragma once #include @@ -98,5 +97,3 @@ class NetworkOutputStreamWorker { }; typedef QSharedPointer NetworkOutputStreamWorkerPtr; - -#endif /* NETWORKSTREAMWORKER_H */ diff --git a/src/engine/sidechain/shoutconnection.cpp b/src/engine/sidechain/shoutconnection.cpp index a9f400af351..1b4171f8f76 100644 --- a/src/engine/sidechain/shoutconnection.cpp +++ b/src/engine/sidechain/shoutconnection.cpp @@ -1,6 +1,3 @@ -// shoutconnection.cpp -// Created July 4th 2017 by Stéphane Lepin - #include // These includes are only required by ignoreSigpipe, which is unix-only @@ -25,14 +22,14 @@ #ifdef __OPUS__ #include "encoder/encoderopus.h" #endif +#include "engine/sidechain/shoutconnection.h" #include "mixer/playerinfo.h" +#include "moc_shoutconnection.cpp" #include "preferences/usersettings.h" #include "recording/defs_recording.h" #include "track/track.h" #include "util/logger.h" -#include - namespace { const int kConnectRetries = 30; diff --git a/src/engine/sidechain/shoutconnection.h b/src/engine/sidechain/shoutconnection.h index 2e5dc67eab8..032774d85e6 100644 --- a/src/engine/sidechain/shoutconnection.h +++ b/src/engine/sidechain/shoutconnection.h @@ -1,8 +1,4 @@ -// shoutconnection.h -// Created July 4th 2017 by Stéphane Lepin - -#ifndef ENGINE_SIDECHAIN_SHOUTCONNECTION_H -#define ENGINE_SIDECHAIN_SHOUTCONNECTION_H +#pragma once #include @@ -166,5 +162,3 @@ class ShoutConnection }; typedef QSharedPointer ShoutConnectionPtr; - -#endif // ENGINE_SIDECHAIN_SHOUTCONNECTION_H diff --git a/src/engine/sidechain/sidechainworker.h b/src/engine/sidechain/sidechainworker.h index 514929339ab..ecc4f94c084 100644 --- a/src/engine/sidechain/sidechainworker.h +++ b/src/engine/sidechain/sidechainworker.h @@ -1,5 +1,4 @@ -#ifndef SIDECHAINWORKER_H -#define SIDECHAINWORKER_H +#pragma once #include "util/types.h" @@ -10,5 +9,3 @@ class SideChainWorker { virtual void process(const CSAMPLE* pBuffer, const int iBufferSize) = 0; virtual void shutdown() = 0; }; - -#endif /* SIDECHAINWORKER_H */ diff --git a/src/engine/sync/basesyncablelistener.h b/src/engine/sync/basesyncablelistener.h index 672645934d3..ca3376ca83f 100644 --- a/src/engine/sync/basesyncablelistener.h +++ b/src/engine/sync/basesyncablelistener.h @@ -1,5 +1,4 @@ -#ifndef BASESYNCABLELISTENER_H -#define BASESYNCABLELISTENER_H +#pragma once #include "engine/sync/syncable.h" #include "preferences/usersettings.h" @@ -71,5 +70,3 @@ class BaseSyncableListener : public SyncableListener { // addSyncableDeck. QList m_syncables; }; - -#endif /* BASESYNCABLELISTENER_H */ diff --git a/src/engine/sync/clock.h b/src/engine/sync/clock.h index da7de81de47..75d987fc2ae 100644 --- a/src/engine/sync/clock.h +++ b/src/engine/sync/clock.h @@ -1,5 +1,4 @@ -#ifndef CLOCK_H -#define CLOCK_H +#pragma once class Clock { public: @@ -11,5 +10,3 @@ class Clock { virtual double getBpm() const = 0; virtual void setMasterBpm(double bpm) = 0; }; - -#endif /* CLOCK_H */ diff --git a/src/engine/sync/enginesync.cpp b/src/engine/sync/enginesync.cpp index 62a7555abc6..bf27fbd1a72 100644 --- a/src/engine/sync/enginesync.cpp +++ b/src/engine/sync/enginesync.cpp @@ -1,21 +1,3 @@ -/*************************************************************************** - enginesync.cpp - master sync control for - maintaining beatmatching amongst n decks - ------------------- - begin : Mon Mar 12 2012 - copyright : (C) 2012 by Owen Williams - email : owilliams@mixxx.org -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "engine/sync/enginesync.h" #include @@ -24,7 +6,6 @@ #include "engine/enginebuffer.h" #include "engine/sync/internalclock.h" #include "util/assert.h" -#include "util/defs.h" #include "util/logger.h" namespace { diff --git a/src/engine/sync/enginesync.h b/src/engine/sync/enginesync.h index 29fc05ff2b1..86304cd73ed 100644 --- a/src/engine/sync/enginesync.h +++ b/src/engine/sync/enginesync.h @@ -1,23 +1,4 @@ -/*************************************************************************** - enginesync.h - master sync control for - maintaining beatmatching amongst n decks - ------------------- - begin : Mon Mar 12 2012 - copyright : (C) 2012 by Owen Williams - email : owilliams@mixxx.org -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - -#ifndef ENGINESYNC_H -#define ENGINESYNC_H +#pragma once #include "preferences/usersettings.h" #include "engine/sync/syncable.h" @@ -86,5 +67,3 @@ class EngineSync : public BaseSyncableListener { // Unsets all sync state on a Syncable. void deactivateSync(Syncable* pSyncable); }; - -#endif diff --git a/src/engine/sync/internalclock.cpp b/src/engine/sync/internalclock.cpp index 9b1b1a819d5..d12eebfdf49 100644 --- a/src/engine/sync/internalclock.cpp +++ b/src/engine/sync/internalclock.cpp @@ -6,6 +6,7 @@ #include "control/controlobject.h" #include "control/controlpushbutton.h" #include "engine/sync/enginesync.h" +#include "moc_internalclock.cpp" #include "preferences/usersettings.h" #include "util/logger.h" diff --git a/src/engine/sync/internalclock.h b/src/engine/sync/internalclock.h index aa2e6b989cc..a243b5e770c 100644 --- a/src/engine/sync/internalclock.h +++ b/src/engine/sync/internalclock.h @@ -1,5 +1,4 @@ -#ifndef INTERNALCLOCK_H -#define INTERNALCLOCK_H +#pragma once #include #include @@ -84,5 +83,3 @@ class InternalClock : public QObject, public Clock, public Syncable { // distance is m_dClockPosition / m_dBeatLength). double m_dClockPosition; }; - -#endif /* INTERNALCLOCK_H */ diff --git a/src/engine/sync/syncable.h b/src/engine/sync/syncable.h index 2f3513a1913..12d0c79ada1 100644 --- a/src/engine/sync/syncable.h +++ b/src/engine/sync/syncable.h @@ -1,5 +1,4 @@ -#ifndef SYNCABLE_H -#define SYNCABLE_H +#pragma once #include @@ -132,5 +131,3 @@ class SyncableListener { virtual Syncable* getMasterSyncable() = 0; }; - -#endif /* SYNCABLE_H */ diff --git a/src/engine/sync/synccontrol.cpp b/src/engine/sync/synccontrol.cpp index 0b869324ca0..25ebc35b1d4 100644 --- a/src/engine/sync/synccontrol.cpp +++ b/src/engine/sync/synccontrol.cpp @@ -7,6 +7,7 @@ #include "engine/controls/bpmcontrol.h" #include "engine/controls/ratecontrol.h" #include "engine/enginebuffer.h" +#include "moc_synccontrol.cpp" #include "track/track.h" #include "util/assert.h" #include "util/logger.h" diff --git a/src/engine/sync/synccontrol.h b/src/engine/sync/synccontrol.h index 3a0c3c24a63..66e797d7347 100644 --- a/src/engine/sync/synccontrol.h +++ b/src/engine/sync/synccontrol.h @@ -1,5 +1,4 @@ -#ifndef SYNCCONTROL_H -#define SYNCCONTROL_H +#pragma once #include #include @@ -135,6 +134,3 @@ class SyncControl : public EngineControl, public Syncable { // m_pBeats is written from an engine worker thread mixxx::BeatsPointer m_pBeats; }; - - -#endif /* SYNCCONTROL_H */ diff --git a/src/errordialoghandler.cpp b/src/errordialoghandler.cpp index 650a6f5dbdd..e9c4ec67192 100644 --- a/src/errordialoghandler.cpp +++ b/src/errordialoghandler.cpp @@ -1,19 +1,4 @@ -/*************************************************************************** - errordialoghandler.cpp - description - ------------------- - begin : Sun Feb 22 2009 - copyright : (C) 2009 by Sean M. Pappalardo - email : pegasus@c64.org -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ +#include "errordialoghandler.h" #include #include @@ -21,7 +6,7 @@ #include #include -#include "errordialoghandler.h" +#include "moc_errordialoghandler.cpp" #include "util/assert.h" #include "util/version.h" diff --git a/src/errordialoghandler.h b/src/errordialoghandler.h index 285546b0796..c4142be8178 100644 --- a/src/errordialoghandler.h +++ b/src/errordialoghandler.h @@ -1,22 +1,4 @@ -/*************************************************************************** - errordialoghandler.h - description - ------------------- - begin : Fri Feb 20 2009 - copyright : (C) 2009 by Sean M. Pappalardo - email : pegasus@c64.org - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef ERRORDIALOGHANDLER_H -#define ERRORDIALOGHANDLER_H +#pragma once #include #include @@ -26,13 +8,8 @@ #include "util/class.h" -/** - * Class used to allow all threads to display message boxes on error conditions - * with a custom list of standard buttons and to be able to react to them - * - *@author Sean M. Pappalardo - */ - +/** Class used to allow all threads to display message boxes on error conditions + * with a custom list of standard buttons and to be able to react to them. */ typedef enum { DLG_FATAL = 5, DLG_CRITICAL = 4, @@ -181,5 +158,3 @@ class ErrorDialogHandler : public QObject { DISALLOW_COPY_AND_ASSIGN(ErrorDialogHandler); }; - -#endif diff --git a/src/library/analysisfeature.cpp b/src/library/analysisfeature.cpp index e03220f8e7e..5ef8dd6b246 100644 --- a/src/library/analysisfeature.cpp +++ b/src/library/analysisfeature.cpp @@ -1,22 +1,18 @@ -// analysisfeature.cpp -// Created 8/23/2009 by RJ Ryan (rryan@mit.edu) -// Forked 11/11/2009 by Albert Santoni (alberts@mixxx.org) +#include "library/analysisfeature.h" #include -#include "library/library.h" -#include "library/analysisfeature.h" - +#include "controllers/keyboard/keyboardeventfilter.h" +#include "library/dlganalysis.h" #include "library/library.h" #include "library/librarytablemodel.h" #include "library/trackcollection.h" -#include "library/dlganalysis.h" -#include "widget/wlibrary.h" -#include "controllers/keyboard/keyboardeventfilter.h" +#include "moc_analysisfeature.cpp" #include "sources/soundsourceproxy.h" -#include "util/dnd.h" #include "util/debug.h" +#include "util/dnd.h" #include "util/logger.h" +#include "widget/wlibrary.h" namespace { diff --git a/src/library/analysisfeature.h b/src/library/analysisfeature.h index a66086a4e70..f9a60047c12 100644 --- a/src/library/analysisfeature.h +++ b/src/library/analysisfeature.h @@ -1,9 +1,4 @@ -// analysisfeature.h -// Created 8/23/2009 by RJ Ryan (rryan@mit.edu) -// Forked 11/11/2009 by Albert Santoni (alberts@mixxx.org) - -#ifndef ANALYSISFEATURE_H -#define ANALYSISFEATURE_H +#pragma once #include #include @@ -79,6 +74,3 @@ class AnalysisFeature : public LibraryFeature { // The title is dynamic and reflects the current progress QString m_title; }; - - -#endif /* ANALYSISFEATURE_H */ diff --git a/src/library/analysislibrarytablemodel.cpp b/src/library/analysislibrarytablemodel.cpp index 2e726fb6aaa..4eeccbf5e1b 100644 --- a/src/library/analysislibrarytablemodel.cpp +++ b/src/library/analysislibrarytablemodel.cpp @@ -1,5 +1,7 @@ #include "library/analysislibrarytablemodel.h" +#include "moc_analysislibrarytablemodel.cpp" + namespace { const QString RECENT_FILTER = "datetime_added > datetime('now', '-7 days')"; diff --git a/src/library/autodj/autodjfeature.cpp b/src/library/autodj/autodjfeature.cpp index c4e9432df9c..51160c99518 100644 --- a/src/library/autodj/autodjfeature.cpp +++ b/src/library/autodj/autodjfeature.cpp @@ -1,7 +1,3 @@ -// autodjfeature.cpp -// FORK FORK FORK on 11/1/2009 by Albert Santoni (alberts@mixxx.org) -// Created 8/23/2009 by RJ Ryan (rryan@mit.edu) - #include "library/autodj/autodjfeature.h" #include @@ -18,6 +14,7 @@ #include "library/trackset/crate/cratestorage.h" #include "library/treeitem.h" #include "mixer/playermanager.h" +#include "moc_autodjfeature.cpp" #include "sources/soundsourceproxy.h" #include "track/track.h" #include "util/compatibility.h" diff --git a/src/library/autodj/autodjprocessor.cpp b/src/library/autodj/autodjprocessor.cpp index 9e4f52c6b79..c5a1246ab50 100644 --- a/src/library/autodj/autodjprocessor.cpp +++ b/src/library/autodj/autodjprocessor.cpp @@ -6,6 +6,7 @@ #include "library/trackcollection.h" #include "mixer/basetrackplayer.h" #include "mixer/playermanager.h" +#include "moc_autodjprocessor.cpp" #include "track/track.h" #include "util/math.h" diff --git a/src/library/autodj/autodjprocessor.h b/src/library/autodj/autodjprocessor.h index 4fb7e4f52c0..1504d9c62fc 100644 --- a/src/library/autodj/autodjprocessor.h +++ b/src/library/autodj/autodjprocessor.h @@ -1,5 +1,4 @@ -#ifndef AUTODJPROCESSOR_H -#define AUTODJPROCESSOR_H +#pragma once #include #include @@ -299,5 +298,3 @@ class AutoDJProcessor : public QObject { DISALLOW_COPY_AND_ASSIGN(AutoDJProcessor); }; - -#endif /* AUTODJPROCESSOR_H */ diff --git a/src/library/autodj/dlgautodj.cpp b/src/library/autodj/dlgautodj.cpp index 14ca9d77407..2699d77d7ed 100644 --- a/src/library/autodj/dlgautodj.cpp +++ b/src/library/autodj/dlgautodj.cpp @@ -4,6 +4,7 @@ #include "library/playlisttablemodel.h" #include "library/trackcollectionmanager.h" +#include "moc_dlgautodj.cpp" #include "track/track.h" #include "util/assert.h" #include "util/compatibility.h" diff --git a/src/library/autodj/dlgautodj.h b/src/library/autodj/dlgautodj.h index 28697287d5b..de5a7499d59 100644 --- a/src/library/autodj/dlgautodj.h +++ b/src/library/autodj/dlgautodj.h @@ -1,5 +1,4 @@ -#ifndef DLGAUTODJ_H -#define DLGAUTODJ_H +#pragma once #include #include @@ -69,5 +68,3 @@ class DlgAutoDJ : public QWidget, public Ui::DlgAutoDJ, public LibraryView { QString m_enableBtnTooltip; QString m_disableBtnTooltip; }; - -#endif //DLGAUTODJ_H diff --git a/src/library/banshee/bansheedbconnection.h b/src/library/banshee/bansheedbconnection.h index d7e2df6ddde..5b59bd638d3 100644 --- a/src/library/banshee/bansheedbconnection.h +++ b/src/library/banshee/bansheedbconnection.h @@ -1,5 +1,4 @@ -#ifndef BANSHEEDBCONNECTION_H -#define BANSHEEDBCONNECTION_H +#pragma once #include #include @@ -64,5 +63,3 @@ class BansheeDbConnection QMap m_albumMap; }; - -#endif // BANSHEEDBCONNECTION_H diff --git a/src/library/banshee/bansheefeature.cpp b/src/library/banshee/bansheefeature.cpp index ee6f9a83331..faed634666c 100644 --- a/src/library/banshee/bansheefeature.cpp +++ b/src/library/banshee/bansheefeature.cpp @@ -10,6 +10,7 @@ #include "library/dao/settingsdao.h" #include "library/library.h" #include "library/trackcollectionmanager.h" +#include "moc_bansheefeature.cpp" #include "track/track.h" const QString BansheeFeature::BANSHEE_MOUNT_KEY = "mixxx.BansheeFeature.mount"; diff --git a/src/library/banshee/bansheefeature.h b/src/library/banshee/bansheefeature.h index 23e86900b82..46e9bcf695c 100644 --- a/src/library/banshee/bansheefeature.h +++ b/src/library/banshee/bansheefeature.h @@ -1,6 +1,4 @@ - -#ifndef BANSHEEFEATURE_H -#define BANSHEEFEATURE_H +#pragma once #include #include @@ -58,5 +56,3 @@ class BansheeFeature : public BaseExternalLibraryFeature { static const QString BANSHEE_MOUNT_KEY; }; - -#endif // BANSHEEFEATURE_H diff --git a/src/library/banshee/bansheeplaylistmodel.cpp b/src/library/banshee/bansheeplaylistmodel.cpp index 19cb1b028eb..3633d2ae836 100644 --- a/src/library/banshee/bansheeplaylistmodel.cpp +++ b/src/library/banshee/bansheeplaylistmodel.cpp @@ -8,6 +8,7 @@ #include "library/starrating.h" #include "library/trackcollectionmanager.h" #include "mixer/playermanager.h" +#include "moc_bansheeplaylistmodel.cpp" #include "track/beatfactory.h" #include "track/beats.h" #include "track/track.h" diff --git a/src/library/banshee/bansheeplaylistmodel.h b/src/library/banshee/bansheeplaylistmodel.h index 795bfe742c2..04cd7d01c66 100644 --- a/src/library/banshee/bansheeplaylistmodel.h +++ b/src/library/banshee/bansheeplaylistmodel.h @@ -1,5 +1,4 @@ -#ifndef BANSHEEPLAYLISTMODEL_H -#define BANSHEEPLAYLISTMODEL_H +#pragma once #include #include @@ -39,5 +38,3 @@ class BansheePlaylistModel final : public BaseSqlTableModel { int m_playlistId; QString m_tempTableName; }; - -#endif // BANSHEEPLAYLISTMODEL_H diff --git a/src/library/baseexternallibraryfeature.cpp b/src/library/baseexternallibraryfeature.cpp index 91d9751384e..75db0fbf2c6 100644 --- a/src/library/baseexternallibraryfeature.cpp +++ b/src/library/baseexternallibraryfeature.cpp @@ -6,8 +6,9 @@ #include "library/library.h" #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" -#include "widget/wlibrarysidebar.h" +#include "moc_baseexternallibraryfeature.cpp" #include "util/logger.h" +#include "widget/wlibrarysidebar.h" namespace { diff --git a/src/library/baseexternalplaylistmodel.cpp b/src/library/baseexternalplaylistmodel.cpp index d927f889653..b60910959be 100644 --- a/src/library/baseexternalplaylistmodel.cpp +++ b/src/library/baseexternalplaylistmodel.cpp @@ -5,6 +5,7 @@ #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "mixer/playermanager.h" +#include "moc_baseexternalplaylistmodel.cpp" #include "track/track.h" BaseExternalPlaylistModel::BaseExternalPlaylistModel(QObject* parent, diff --git a/src/library/baseexternalplaylistmodel.h b/src/library/baseexternalplaylistmodel.h index 8befddc6930..ba8f8b81b27 100644 --- a/src/library/baseexternalplaylistmodel.h +++ b/src/library/baseexternalplaylistmodel.h @@ -1,5 +1,4 @@ -#ifndef BASEEXTERNALPLAYLISTMODEL_H -#define BASEEXTERNALPLAYLISTMODEL_H +#pragma once #include #include @@ -37,5 +36,3 @@ class BaseExternalPlaylistModel : public BaseSqlTableModel { QString m_playlistTracksTable; QSharedPointer m_trackSource; }; - -#endif /* BASEEXTERNALPLAYLISTMODEL_H */ diff --git a/src/library/baseexternaltrackmodel.cpp b/src/library/baseexternaltrackmodel.cpp index a7e8b8e773e..3795ffe8943 100644 --- a/src/library/baseexternaltrackmodel.cpp +++ b/src/library/baseexternaltrackmodel.cpp @@ -4,6 +4,7 @@ #include "library/queryutil.h" #include "library/trackcollectionmanager.h" #include "mixer/playermanager.h" +#include "moc_baseexternaltrackmodel.cpp" #include "track/track.h" BaseExternalTrackModel::BaseExternalTrackModel(QObject* parent, diff --git a/src/library/baseexternaltrackmodel.h b/src/library/baseexternaltrackmodel.h index d7e1cf2e6dd..859267209c5 100644 --- a/src/library/baseexternaltrackmodel.h +++ b/src/library/baseexternaltrackmodel.h @@ -1,5 +1,4 @@ -#ifndef BASEEXTERNALTRACKMODEL_H -#define BASEEXTERNALTRACKMODEL_H +#pragma once #include #include @@ -29,5 +28,3 @@ class BaseExternalTrackModel : public BaseSqlTableModel { private: TrackId doGetTrackId(const TrackPointer& pTrack) const override; }; - -#endif /* BASEEXTERNALTRACKMODEL_H */ diff --git a/src/library/basesqltablemodel.cpp b/src/library/basesqltablemodel.cpp index ff8ceca9c8f..73e261a9eb8 100644 --- a/src/library/basesqltablemodel.cpp +++ b/src/library/basesqltablemodel.cpp @@ -1,5 +1,3 @@ -// Created by RJ Ryan (rryan@mit.edu) 1/29/2010 - #include "library/basesqltablemodel.h" #include @@ -12,6 +10,7 @@ #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "mixer/playermanager.h" +#include "moc_basesqltablemodel.cpp" #include "track/keyutils.h" #include "track/track.h" #include "track/trackmetadata.h" diff --git a/src/library/basetrackcache.cpp b/src/library/basetrackcache.cpp index e414a1692b4..bc8c66292c1 100644 --- a/src/library/basetrackcache.cpp +++ b/src/library/basetrackcache.cpp @@ -1,11 +1,9 @@ -// basetrackcache.cpp -// Created 7/3/2011 by RJ Ryan (rryan@mit.edu) - #include "library/basetrackcache.h" #include "library/queryutil.h" #include "library/searchqueryparser.h" #include "library/trackcollection.h" +#include "moc_basetrackcache.cpp" #include "track/globaltrackcache.h" #include "track/keyutils.h" #include "track/track.h" diff --git a/src/library/basetracktablemodel.cpp b/src/library/basetracktablemodel.cpp index 605691cd78c..e5eb6d033da 100644 --- a/src/library/basetracktablemodel.cpp +++ b/src/library/basetracktablemodel.cpp @@ -13,6 +13,7 @@ #include "library/trackcollectionmanager.h" #include "mixer/playerinfo.h" #include "mixer/playermanager.h" +#include "moc_basetracktablemodel.cpp" #include "track/track.h" #include "util/assert.h" #include "util/compatibility.h" @@ -400,19 +401,14 @@ QVariant BaseTrackTableModel::data( } if (role == Qt::BackgroundRole) { - QModelIndex colorIndex = index.sibling( - index.row(), - fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COLOR)); - if (!colorIndex.isValid()) { + const auto rgbColorValue = rawSiblingValue( + index, + ColumnCache::COLUMN_LIBRARYTABLE_COLOR); + const auto rgbColor = mixxx::RgbColor::fromQVariant(rgbColorValue); + if (!rgbColor) { return QVariant(); } - const auto trackColor = - mixxx::RgbColor::fromQVariant( - rawValue(colorIndex)); - if (!trackColor) { - return QVariant(); - } - auto bgColor = mixxx::RgbColor::toQColor(trackColor); + auto bgColor = mixxx::RgbColor::toQColor(rgbColor); DEBUG_ASSERT(bgColor.isValid()); DEBUG_ASSERT(m_backgroundColorOpacity >= 0.0); DEBUG_ASSERT(m_backgroundColorOpacity <= 1.0); @@ -431,23 +427,65 @@ QVariant BaseTrackTableModel::data( return roleValue(index, rawValue(index), role); } +QVariant BaseTrackTableModel::rawValue( + const QModelIndex& index) const { + VERIFY_OR_DEBUG_ASSERT(index.isValid()) { + return QVariant(); + } + const auto field = mapColumn(index.column()); + if (field == ColumnCache::COLUMN_LIBRARYTABLE_INVALID) { + return QVariant(); + } + return rawSiblingValue(index, field); +} + +QVariant BaseTrackTableModel::rawSiblingValue( + const QModelIndex& index, + ColumnCache::Column siblingField) const { + VERIFY_OR_DEBUG_ASSERT(index.isValid()) { + return QVariant(); + } + VERIFY_OR_DEBUG_ASSERT(siblingField != ColumnCache::COLUMN_LIBRARYTABLE_INVALID) { + return QVariant(); + } + const auto siblingColumn = fieldIndex(siblingField); + DEBUG_ASSERT(siblingColumn >= 0); + VERIFY_OR_DEBUG_ASSERT(siblingColumn != index.column()) { + // Prevent infinite recursion + return QVariant(); + } + const auto siblingIndex = index.sibling(index.row(), siblingColumn); + return rawValue(siblingIndex); +} + bool BaseTrackTableModel::setData( const QModelIndex& index, const QVariant& value, int role) { const int column = index.column(); - - // Override sets to TIMESPLAYED and redirect them to PLAYED if (role == Qt::CheckStateRole) { - const auto val = value.toInt() > 0; - if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_TIMESPLAYED)) { - QModelIndex playedIndex = index.sibling(index.row(), fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_PLAYED)); - return setData(playedIndex, val, Qt::EditRole); - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BPM)) { - QModelIndex bpmLockindex = index.sibling(index.row(), fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BPM_LOCK)); - return setData(bpmLockindex, val, Qt::EditRole); + const auto field = mapColumn(index.column()); + if (field == ColumnCache::COLUMN_LIBRARYTABLE_INVALID) { + return false; + } + const auto checked = value.toInt() > 0; + switch (field) { + case ColumnCache::COLUMN_LIBRARYTABLE_TIMESPLAYED: { + // Override sets to TIMESPLAYED and redirect them to PLAYED + QModelIndex playedIndex = index.sibling( + index.row(), + fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_PLAYED)); + return setData(playedIndex, checked, Qt::EditRole); + } + case ColumnCache::COLUMN_LIBRARYTABLE_BPM: { + QModelIndex bpmLockedIndex = index.sibling( + index.row(), + fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BPM_LOCK)); + return setData(bpmLockedIndex, checked, Qt::EditRole); + } + default: + return false; } - return false; } TrackPointer pTrack = getTrack(index); @@ -497,133 +535,263 @@ QVariant BaseTrackTableModel::roleValue( const QModelIndex& index, QVariant&& rawValue, int role) const { - const int column = index.column(); - // Format the value based on whether we are in a tooltip, - // display, or edit role + const auto field = mapColumn(index.column()); + if (field == ColumnCache::COLUMN_LIBRARYTABLE_INVALID) { + return std::move(rawValue); + } switch (role) { case Qt::ToolTipRole: - if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COLOR)) { + switch (field) { + case ColumnCache::COLUMN_LIBRARYTABLE_COLOR: return mixxx::RgbColor::toQString(mixxx::RgbColor::fromQVariant(rawValue)); - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COVERART)) { + case ColumnCache::COLUMN_LIBRARYTABLE_COVERART: return composeCoverArtToolTipHtml(index); - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_PREVIEW)) { + case ColumnCache::COLUMN_LIBRARYTABLE_PREVIEW: return QVariant(); + default: + // Same value as for Qt::DisplayRole (see below) + break; } M_FALLTHROUGH_INTENDED; case Qt::DisplayRole: - if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_DURATION)) { - bool ok; - const auto duration = rawValue.toDouble(&ok); - if (ok && duration >= 0) { - return mixxx::Duration::formatTime( - duration, - mixxx::Duration::Precision::SECONDS); + switch (field) { + case ColumnCache::COLUMN_LIBRARYTABLE_DURATION: { + if (rawValue.isNull()) { + return QVariant(); + } + double durationInSeconds; + if (rawValue.canConvert()) { + const auto duration = rawValue.value(); + VERIFY_OR_DEBUG_ASSERT(duration >= mixxx::Duration::empty()) { + return QVariant(); + } + durationInSeconds = duration.toDoubleSeconds(); } else { + VERIFY_OR_DEBUG_ASSERT(rawValue.canConvert()) { + return QVariant(); + } + bool ok; + durationInSeconds = rawValue.toDouble(&ok); + VERIFY_OR_DEBUG_ASSERT(ok && durationInSeconds >= 0) { + return QVariant(); + } + } + return mixxx::Duration::formatTime( + durationInSeconds, + mixxx::Duration::Precision::SECONDS); + } + case ColumnCache::COLUMN_LIBRARYTABLE_RATING: { + if (rawValue.isNull()) { return QVariant(); } - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_RATING)) { - VERIFY_OR_DEBUG_ASSERT(rawValue.canConvert(QMetaType::Int)) { + VERIFY_OR_DEBUG_ASSERT(rawValue.canConvert()) { return QVariant(); } - return QVariant::fromValue(StarRating(rawValue.toInt())); - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_PLAYED)) { - return rawValue.toBool(); - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_TIMESPLAYED)) { - VERIFY_OR_DEBUG_ASSERT(rawValue.canConvert(QMetaType::Int)) { + bool ok; + const auto starCount = rawValue.toInt(&ok); + VERIFY_OR_DEBUG_ASSERT(ok && starCount >= StarRating::kMinStarCount) { + return QVariant(); + } + return QVariant::fromValue(StarRating(starCount)); + } + case ColumnCache::COLUMN_LIBRARYTABLE_TIMESPLAYED: { + if (rawValue.isNull()) { + return QVariant(); + } + VERIFY_OR_DEBUG_ASSERT(rawValue.canConvert()) { return QVariant(); } - return QString("(%1)").arg(rawValue.toInt()); - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_DATETIMEADDED) || - column == fieldIndex(ColumnCache::COLUMN_PLAYLISTTRACKSTABLE_DATETIMEADDED)) { - return mixxx::localDateTimeFromUtc(mixxx::convertVariantToDateTime(rawValue)); - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BPM)) { bool ok; - const auto bpmValue = rawValue.toDouble(&ok); - if (ok && bpmValue > 0.0) { - return QString("%1").arg(bpmValue, 0, 'f', 1); + const auto timesPlayed = rawValue.toInt(&ok); + VERIFY_OR_DEBUG_ASSERT(ok && timesPlayed >= 0) { + return QVariant(); + } + return QString("(%1)").arg(timesPlayed); + } + case ColumnCache::COLUMN_LIBRARYTABLE_DATETIMEADDED: + case ColumnCache::COLUMN_PLAYLISTTRACKSTABLE_DATETIMEADDED: + VERIFY_OR_DEBUG_ASSERT(rawValue.canConvert()) { + return QVariant(); + } + return mixxx::localDateTimeFromUtc(rawValue.toDateTime()); + case ColumnCache::COLUMN_LIBRARYTABLE_BPM: { + mixxx::Bpm bpm; + if (!rawValue.isNull()) { + if (rawValue.canConvert()) { + bpm = rawValue.value(); + } else { + VERIFY_OR_DEBUG_ASSERT(rawValue.canConvert()) { + return QVariant(); + } + bool ok; + const auto bpmValue = rawValue.toDouble(&ok); + VERIFY_OR_DEBUG_ASSERT(ok) { + return QVariant(); + } + bpm = mixxx::Bpm(bpmValue); + } + } + if (bpm.hasValue()) { + return QString("%1").arg(bpm.getValue(), 0, 'f', 1); } else { return QChar('-'); } - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BPM_LOCK)) { - return rawValue.toBool(); - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_YEAR)) { - return mixxx::TrackMetadata::formatCalendarYear(rawValue.toString()); - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_TRACKNUMBER)) { - const auto trackNumber = rawValue.toInt(0); - if (trackNumber > 0) { - return std::move(rawValue); - } else { - // clear invalid values + } + case ColumnCache::COLUMN_LIBRARYTABLE_YEAR: { + if (rawValue.isNull()) { + return QVariant(); + } + VERIFY_OR_DEBUG_ASSERT(rawValue.canConvert()) { + return QVariant(); + } + bool ok; + const auto year = mixxx::TrackMetadata::formatCalendarYear(rawValue.toString(), &ok); + if (!ok) { return QVariant(); } - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BITRATE)) { - int bitrateValue = rawValue.toInt(0); - if (bitrateValue > 0) { + return year; + } + case ColumnCache::COLUMN_LIBRARYTABLE_BITRATE: { + if (rawValue.isNull()) { + return QVariant(); + } + if (rawValue.canConvert()) { + // return value as is return std::move(rawValue); } else { - // clear invalid values - return QVariant(); + VERIFY_OR_DEBUG_ASSERT(rawValue.canConvert()) { + return QVariant(); + } + bool ok; + const auto bitrateValue = rawValue.toInt(&ok); + VERIFY_OR_DEBUG_ASSERT(ok) { + return QVariant(); + } + if (mixxx::audio::Bitrate(bitrateValue).isValid()) { + // return value as is + return std::move(rawValue); + } else { + // clear invalid values + return QVariant(); + } } - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_KEY)) { + } + case ColumnCache::COLUMN_LIBRARYTABLE_KEY: { // If we know the semantic key via the LIBRARYTABLE_KEY_ID // column (as opposed to the string representation of the key // currently stored in the DB) then lookup the key and render it // using the user's selected notation. - int keyIdColumn = fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_KEY_ID); - if (keyIdColumn == -1) { - // Otherwise, just use the column value + const QVariant keyCodeValue = rawSiblingValue( + index, + ColumnCache::COLUMN_LIBRARYTABLE_KEY_ID); + if (keyCodeValue.isNull()) { + // Otherwise, just use the column value as is return std::move(rawValue); } - mixxx::track::io::key::ChromaticKey key = - KeyUtils::keyFromNumericValue( - index.sibling(index.row(), keyIdColumn).data().toInt()); + // Convert or clear invalid values + VERIFY_OR_DEBUG_ASSERT(keyCodeValue.canConvert()) { + return QVariant(); + } + bool ok; + const auto keyCode = keyCodeValue.toInt(&ok); + VERIFY_OR_DEBUG_ASSERT(ok) { + return QVariant(); + } + const auto key = KeyUtils::keyFromNumericValue(keyCode); if (key == mixxx::track::io::key::INVALID) { - // clear invalid values return QVariant(); } - // Render this key with the user-provided notation. + // Render the key with the user-provided notation return KeyUtils::keyToString(key); - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_REPLAYGAIN)) { - bool ok; - const auto gainValue = rawValue.toDouble(&ok); - return ok ? mixxx::ReplayGain::ratioToString(gainValue) : QString(); } - // Otherwise, just use the column value + case ColumnCache::COLUMN_LIBRARYTABLE_REPLAYGAIN: { + if (rawValue.isNull()) { + return QVariant(); + } + double rgRatio; + if (rawValue.canConvert()) { + rgRatio = rawValue.value().getRatio(); + } else { + VERIFY_OR_DEBUG_ASSERT(rawValue.canConvert()) { + return QVariant(); + } + bool ok; + rgRatio = rawValue.toDouble(&ok); + VERIFY_OR_DEBUG_ASSERT(ok) { + return QVariant(); + } + } + return mixxx::ReplayGain::ratioToString(rgRatio); + } + case ColumnCache::COLUMN_LIBRARYTABLE_CHANNELS: + // Not yet supported + DEBUG_ASSERT(rawValue.isNull()); + break; + case ColumnCache::COLUMN_LIBRARYTABLE_SAMPLERATE: + // Not yet supported + DEBUG_ASSERT(rawValue.isNull()); + break; + case ColumnCache::COLUMN_LIBRARYTABLE_URL: + // Not yet supported + DEBUG_ASSERT(rawValue.isNull()); + break; + default: + // Otherwise, just use the column value + break; + } break; case Qt::EditRole: - if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BPM)) { + switch (field) { + case ColumnCache::COLUMN_LIBRARYTABLE_BPM: { bool ok; const auto bpmValue = rawValue.toDouble(&ok); - return ok ? bpmValue : 0.0; - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_TIMESPLAYED)) { + return ok ? bpmValue : mixxx::Bpm().getValue(); + } + case ColumnCache::COLUMN_LIBRARYTABLE_TIMESPLAYED: return index.sibling( - index.row(), fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_PLAYED)) - .data() - .toBool(); - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_RATING)) { - VERIFY_OR_DEBUG_ASSERT(rawValue.canConvert(QMetaType::Int)) { + index.row(), + fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_PLAYED)) + .data() + .toBool(); + case ColumnCache::COLUMN_LIBRARYTABLE_RATING: + VERIFY_OR_DEBUG_ASSERT(rawValue.canConvert()) { return QVariant(); } return QVariant::fromValue(StarRating(rawValue.toInt())); + default: + // Otherwise, just use the column value + break; } - // Otherwise, just use the column value break; - case Qt::CheckStateRole: - if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_TIMESPLAYED)) { - bool played = index.sibling( - index.row(), fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_PLAYED)) - .data() - .toBool(); - return played ? Qt::Checked : Qt::Unchecked; - } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BPM)) { - bool locked = index.sibling( - index.row(), fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BPM_LOCK)) - .data() - .toBool(); - return locked ? Qt::Checked : Qt::Unchecked; + case Qt::CheckStateRole: { + QVariant boolValue; + switch (field) { + case ColumnCache::COLUMN_LIBRARYTABLE_PREVIEW: + boolValue = rawValue; + break; + case ColumnCache::COLUMN_LIBRARYTABLE_TIMESPLAYED: + boolValue = rawSiblingValue( + index, + ColumnCache::COLUMN_LIBRARYTABLE_PLAYED); + break; + case ColumnCache::COLUMN_LIBRARYTABLE_BPM: + boolValue = rawSiblingValue( + index, + ColumnCache::COLUMN_LIBRARYTABLE_BPM_LOCK); + break; + default: + // No check state supported + return QVariant(); } - // No check state supported - return QVariant(); + // Flags in the database are stored as integers that are + // convertible to bool. + if (!boolValue.isNull() && boolValue.canConvert()) { + return boolValue.toBool() ? Qt::Checked : Qt::Unchecked; + } else { + // Undecidable + return Qt::PartiallyChecked; + } + } default: DEBUG_ASSERT(!"unexpected role"); break; diff --git a/src/library/basetracktablemodel.h b/src/library/basetracktablemodel.h index 81b58337a09..f3fb96967bd 100644 --- a/src/library/basetracktablemodel.h +++ b/src/library/basetracktablemodel.h @@ -149,8 +149,58 @@ class BaseTrackTableModel : public QAbstractTableModel, public TrackModel { virtual Qt::ItemFlags readWriteFlags( const QModelIndex& index) const; + /// At least one of the following functions must be overridden, + /// because each default implementation will call the other + /// function!! + /// + /// Return the raw data value at the given index. + /// + /// Expected types by ColumnCache field (pass-through = not validated): + /// COLUMN_LIBRARYTABLE_ID: DbId::value_type (pass-through) + /// COLUMN_LIBRARYTABLE_ARTIST: QString (pass-through) + /// COLUMN_LIBRARYTABLE_TITLE: QString (pass-through) + /// COLUMN_LIBRARYTABLE_ALBUM: QString (pass-through) + /// COLUMN_LIBRARYTABLE_ALBUMARTIST: QString (pass-through) + /// COLUMN_LIBRARYTABLE_YEAR: QString (pass-through) + /// COLUMN_LIBRARYTABLE_GENRE: QString (pass-through) + /// COLUMN_LIBRARYTABLE_COMPOSER: QString (pass-through) + /// COLUMN_LIBRARYTABLE_GROUPING: QString (pass-through) + /// COLUMN_LIBRARYTABLE_TRACKNUMBER: QString (pass-through) + /// COLUMN_LIBRARYTABLE_FILETYPE: QString (pass-through) + /// COLUMN_LIBRARYTABLE_NATIVELOCATION: QString (pass-through) + /// COLUMN_LIBRARYTABLE_COMMENT: QString (pass-through) + /// COLUMN_LIBRARYTABLE_DURATION: double (seconds)/mixxx::Duration + /// COLUMN_LIBRARYTABLE_BITRATE: int (kbps)/mixxx::audio::Bitrate + /// COLUMN_LIBRARYTABLE_BPM: double (beats per minute)/mixxx::Bpm + /// COLUMN_LIBRARYTABLE_REPLAYGAIN: double (ratio)/mixxx::ReplayGain + /// COLUMN_LIBRARYTABLE_URL: QString (unsupported) + /// COLUMN_LIBRARYTABLE_SAMPLERATE: int (Hz)/mixxx::audio::SampleRate (unsupported) + /// COLUMN_LIBRARYTABLE_WAVESUMMARYHEX: QVariant (pass-through) + /// COLUMN_LIBRARYTABLE_CHANNELS: int/mixxx::audio::ChannelCount (unsupported) + /// COLUMN_LIBRARYTABLE_MIXXXDELETED: bool (pass-through) + /// COLUMN_LIBRARYTABLE_DATETIMEADDED: QDateTime + /// COLUMN_LIBRARYTABLE_HEADERPARSED: bool (pass-through) + /// COLUMN_LIBRARYTABLE_TIMESPLAYED: int + /// COLUMN_LIBRARYTABLE_PLAYED: bool + /// COLUMN_LIBRARYTABLE_RATING: int + /// COLUMN_LIBRARYTABLE_KEY: QString (literal key name, pass-through) + /// COLUMN_LIBRARYTABLE_KEY_ID: int (internal key code) + /// COLUMN_LIBRARYTABLE_BPM_LOCK: bool + /// COLUMN_LIBRARYTABLE_PREVIEW: bool + /// COLUMN_LIBRARYTABLE_COLOR: mixxx::RgbColor::code_t + /// COLUMN_LIBRARYTABLE_COVERART: virtual column for CoverArtDelegate + /// COLUMN_LIBRARYTABLE_COVERART_SOURCE: int (pass-through) + /// COLUMN_LIBRARYTABLE_COVERART_TYPE: int (pass-through) + /// COLUMN_LIBRARYTABLE_COVERART_LOCATION: QString (pass-through) + /// COLUMN_LIBRARYTABLE_COVERART_COLOR: mixxx::RgbColor::code_t (pass-through) + /// COLUMN_LIBRARYTABLE_COVERART_DIGEST: QByteArray (pass-through) + /// COLUMN_LIBRARYTABLE_COVERART_HASH: quint16 (pass-through) + /// COLUMN_PLAYLISTTABLE_DATETIMEADDED: QDateTime virtual QVariant rawValue( - const QModelIndex& index) const = 0; + const QModelIndex& index) const; + virtual QVariant rawSiblingValue( + const QModelIndex& index, + ColumnCache::Column siblingField) const; // Reimplement in derived classes to handle columns other // then COLUMN_LIBRARYTABLE diff --git a/src/library/bpmdelegate.cpp b/src/library/bpmdelegate.cpp index 826b7ce82b8..6c8b5d8eb57 100644 --- a/src/library/bpmdelegate.cpp +++ b/src/library/bpmdelegate.cpp @@ -1,13 +1,15 @@ -#include -#include +#include "library/bpmdelegate.h" + #include -#include +#include +#include +#include #include +#include #include -#include -#include "library/bpmdelegate.h" #include "library/trackmodel.h" +#include "moc_bpmdelegate.cpp" // We override the typical QDoubleSpinBox editor by registering this class with // a QItemEditorFactory for the BPMDelegate. diff --git a/src/library/bpmdelegate.h b/src/library/bpmdelegate.h index b6919b2b31d..02db4ad09b5 100644 --- a/src/library/bpmdelegate.h +++ b/src/library/bpmdelegate.h @@ -1,5 +1,4 @@ -#ifndef BPMDELEGATE_H -#define BPMDELEGATE_H +#pragma once #include #include @@ -22,5 +21,3 @@ class BPMDelegate : public TableItemDelegate { QCheckBox* m_pCheckBox; QItemEditorFactory* m_pFactory; }; - -#endif // BPMDELEGATE_H diff --git a/src/library/browse/browsefeature.cpp b/src/library/browse/browsefeature.cpp index 3906e03e145..68aee79d227 100644 --- a/src/library/browse/browsefeature.cpp +++ b/src/library/browse/browsefeature.cpp @@ -1,5 +1,4 @@ -// browsefeature.cpp -// Created 9/8/2009 by RJ Ryan (rryan@mit.edu) +#include "library/browse/browsefeature.h" #include #include @@ -11,16 +10,16 @@ #include #include "controllers/keyboard/keyboardeventfilter.h" -#include "library/browse/browsefeature.h" #include "library/library.h" #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "library/treeitem.h" +#include "moc_browsefeature.cpp" #include "track/track.h" #include "util/memory.h" #include "widget/wlibrary.h" -#include "widget/wlibrarytextbrowser.h" #include "widget/wlibrarysidebar.h" +#include "widget/wlibrarytextbrowser.h" namespace { diff --git a/src/library/browse/browsefeature.h b/src/library/browse/browsefeature.h index 0cab0654fe2..a90fdded19a 100644 --- a/src/library/browse/browsefeature.h +++ b/src/library/browse/browsefeature.h @@ -1,8 +1,4 @@ -// browsefeature.h -// Created 9/8/2009 by RJ Ryan (rryan@mit.edu) - -#ifndef BROWSEFEATURE_H -#define BROWSEFEATURE_H +#pragma once #include #include @@ -80,5 +76,3 @@ class BrowseFeature : public LibraryFeature { QIcon m_icon; QPointer m_pSidebarWidget; }; - -#endif // BROWSEFEATURE_H diff --git a/src/library/browse/browsetablemodel.cpp b/src/library/browse/browsetablemodel.cpp index 4575a079493..6ee77cd2efc 100644 --- a/src/library/browse/browsetablemodel.cpp +++ b/src/library/browse/browsetablemodel.cpp @@ -16,6 +16,7 @@ #include "library/trackcollectionmanager.h" #include "mixer/playerinfo.h" #include "mixer/playermanager.h" +#include "moc_browsetablemodel.cpp" #include "track/track.h" #include "util/compatibility.h" #include "widget/wlibrarytableview.h" diff --git a/src/library/browse/browsetablemodel.h b/src/library/browse/browsetablemodel.h index 560d74c9f70..eb95e63c4dd 100644 --- a/src/library/browse/browsetablemodel.h +++ b/src/library/browse/browsetablemodel.h @@ -1,5 +1,4 @@ -#ifndef BROWSETABLEMODEL_H -#define BROWSETABLEMODEL_H +#pragma once #include #include @@ -93,5 +92,3 @@ class BrowseTableModel final : public QStandardItemModel, public virtual TrackMo QMap m_sortColumnIdByColumnIndex; }; - -#endif diff --git a/src/library/browse/browsethread.cpp b/src/library/browse/browsethread.cpp index a6d9e520c88..24a9a250f5a 100644 --- a/src/library/browse/browsethread.cpp +++ b/src/library/browse/browsethread.cpp @@ -2,12 +2,15 @@ * browsethread.cpp (C) 2011 Tobias Rafreider */ +#include "library/browse/browsethread.h" + #include #include #include #include #include "library/browse/browsetablemodel.h" +#include "moc_browsethread.cpp" #include "sources/soundsourceproxy.h" #include "track/track.h" #include "util/datetime.h" diff --git a/src/library/browse/browsethread.h b/src/library/browse/browsethread.h index cee56c2dade..08c15630d21 100644 --- a/src/library/browse/browsethread.h +++ b/src/library/browse/browsethread.h @@ -2,8 +2,7 @@ * browsethread.h (C) 2011 Tobias Rafreider */ -#ifndef BROWSETHREAD_H -#define BROWSETHREAD_H +#pragma once #include #include @@ -55,5 +54,3 @@ class BrowseThread : public QThread { static QWeakPointer m_weakInstanceRef; }; - -#endif // BROWSETHREAD_H diff --git a/src/library/browse/foldertreemodel.cpp b/src/library/browse/foldertreemodel.cpp index b55d2de6289..b8081529dcb 100644 --- a/src/library/browse/foldertreemodel.cpp +++ b/src/library/browse/foldertreemodel.cpp @@ -12,9 +12,10 @@ #include -#include "library/treeitem.h" -#include "library/browse/foldertreemodel.h" #include "library/browse/browsefeature.h" +#include "library/browse/foldertreemodel.h" +#include "library/treeitem.h" +#include "moc_foldertreemodel.cpp" #include "util/file.h" FolderTreeModel::FolderTreeModel(QObject *parent) diff --git a/src/library/browse/foldertreemodel.h b/src/library/browse/foldertreemodel.h index 240e26b4472..2bff73671a3 100644 --- a/src/library/browse/foldertreemodel.h +++ b/src/library/browse/foldertreemodel.h @@ -1,5 +1,4 @@ -#ifndef FOLDER_TREE_MODEL -#define FOLDER_TREE_MODEL +#pragma once #include #include @@ -27,5 +26,3 @@ class FolderTreeModel : public TreeItemModel { // Used for memoizing the results of directoryHasChildren mutable QHash m_directoryCache; }; - -#endif diff --git a/src/library/colordelegate.cpp b/src/library/colordelegate.cpp index 49d2c4edeb1..453939c96ec 100644 --- a/src/library/colordelegate.cpp +++ b/src/library/colordelegate.cpp @@ -6,6 +6,7 @@ #include #include "library/trackmodel.h" +#include "moc_colordelegate.cpp" #include "util/color/rgbcolor.h" ColorDelegate::ColorDelegate(QTableView* pTableView) diff --git a/src/library/columncache.cpp b/src/library/columncache.cpp index 590112915b1..417513b2ff5 100644 --- a/src/library/columncache.cpp +++ b/src/library/columncache.cpp @@ -1,10 +1,10 @@ #include "library/columncache.h" -#include "library/dao/trackschema.h" #include "library/dao/playlistdao.h" +#include "library/dao/trackschema.h" +#include "moc_columncache.cpp" - - ColumnCache::ColumnCache(const QStringList& columns) { +ColumnCache::ColumnCache(const QStringList& columns) { m_pKeyNotationCP = new ControlProxy("[Library]", "key_notation", this); m_pKeyNotationCP->connectValueChanged(this, &ColumnCache::slotSetKeySortOrder); diff --git a/src/library/columncache.h b/src/library/columncache.h index de32e1767b6..23f5c8004b2 100644 --- a/src/library/columncache.h +++ b/src/library/columncache.h @@ -1,5 +1,4 @@ -#ifndef COLUMNCACHE_H -#define COLUMNCACHE_H +#pragma once #include #include @@ -122,5 +121,3 @@ class ColumnCache : public QObject { private slots: void slotSetKeySortOrder(double); }; - -#endif /* COLUMNCACHE_H */ diff --git a/src/library/coverartcache.cpp b/src/library/coverartcache.cpp index 8e5b0786688..54152645e7f 100644 --- a/src/library/coverartcache.cpp +++ b/src/library/coverartcache.cpp @@ -6,6 +6,7 @@ #include #include "library/coverartutils.h" +#include "moc_coverartcache.cpp" #include "track/track.h" #include "util/compatibility.h" #include "util/logger.h" diff --git a/src/library/coverartdelegate.cpp b/src/library/coverartdelegate.cpp index 4926f556e69..244e1977028 100644 --- a/src/library/coverartdelegate.cpp +++ b/src/library/coverartdelegate.cpp @@ -6,6 +6,7 @@ #include "library/coverartcache.h" #include "library/dao/trackschema.h" #include "library/trackmodel.h" +#include "moc_coverartdelegate.cpp" #include "track/track.h" #include "util/logger.h" diff --git a/src/library/dao/analysisdao.h b/src/library/dao/analysisdao.h index 3a7992832d7..1519b30f226 100644 --- a/src/library/dao/analysisdao.h +++ b/src/library/dao/analysisdao.h @@ -1,5 +1,4 @@ -#ifndef ANALYSISDAO_H -#define ANALYSISDAO_H +#pragma once #include #include @@ -67,5 +66,3 @@ class AnalysisDao : public DAO { const UserSettingsPointer m_pConfig; }; - -#endif // ANALYSISDAO_H diff --git a/src/library/dao/autodjcratesdao.cpp b/src/library/dao/autodjcratesdao.cpp index be651b4e2cd..8b762ac9043 100644 --- a/src/library/dao/autodjcratesdao.cpp +++ b/src/library/dao/autodjcratesdao.cpp @@ -1,5 +1,7 @@ #include "library/dao/autodjcratesdao.h" +#include "moc_autodjcratesdao.cpp" + #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) #include #endif diff --git a/src/library/dao/cuedao.cpp b/src/library/dao/cuedao.cpp index d72e69e3507..afab8ab2ec4 100644 --- a/src/library/dao/cuedao.cpp +++ b/src/library/dao/cuedao.cpp @@ -1,6 +1,3 @@ -// cuedao.cpp -// Created 10/26/2009 by RJ Ryan (rryan@mit.edu) - #include "library/dao/cuedao.h" #include diff --git a/src/library/dao/libraryhashdao.cpp b/src/library/dao/libraryhashdao.cpp index 32cc824cb0b..4e0e1347e90 100644 --- a/src/library/dao/libraryhashdao.cpp +++ b/src/library/dao/libraryhashdao.cpp @@ -1,4 +1,3 @@ - #include #include #include diff --git a/src/library/dao/libraryhashdao.h b/src/library/dao/libraryhashdao.h index e3e4b4bf470..0f16cefa5b7 100644 --- a/src/library/dao/libraryhashdao.h +++ b/src/library/dao/libraryhashdao.h @@ -1,5 +1,4 @@ -#ifndef LIBRARYHASHDAO_H -#define LIBRARYHASHDAO_H +#pragma once #include #include @@ -26,5 +25,3 @@ class LibraryHashDAO : public DAO { const bool deleted, const bool verified); QStringList getDeletedDirectories(); }; - -#endif //LIBRARYHASHDAO_H diff --git a/src/library/dao/playlistdao.cpp b/src/library/dao/playlistdao.cpp index 522eea5f186..a6d7bea1c49 100644 --- a/src/library/dao/playlistdao.cpp +++ b/src/library/dao/playlistdao.cpp @@ -1,5 +1,7 @@ #include "library/dao/playlistdao.h" +#include "moc_playlistdao.cpp" + #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) #include #endif @@ -11,6 +13,7 @@ #include "library/trackcollection.h" #include "track/track.h" #include "util/compatibility.h" +#include "util/db/fwdsqlquery.h" #include "util/math.h" PlaylistDAO::PlaylistDAO() @@ -227,6 +230,53 @@ void PlaylistDAO::deletePlaylist(const int playlistId) { } } +int PlaylistDAO::deleteAllPlaylistsWithFewerTracks( + PlaylistDAO::HiddenType type, int minNumberOfTracks) { + VERIFY_OR_DEBUG_ASSERT(minNumberOfTracks > 0) { + return 0; // nothing to do, probably unintended invocation + } + + QSqlQuery query(m_database); + query.prepare(QStringLiteral( + "SELECT id FROM Playlists " + "WHERE (SELECT count(playlist_id) FROM PlaylistTracks WHERE " + "Playlists.ID = PlaylistTracks.playlist_id) < :length AND " + "Playlists.hidden = :hidden")); + query.bindValue(":hidden", static_cast(type)); + query.bindValue(":length", minNumberOfTracks); + if (!query.exec()) { + LOG_FAILED_QUERY(query); + return -1; + } + + QStringList idStringList; + while (query.next()) { + idStringList.append(query.value(0).toString()); + } + if (idStringList.isEmpty()) { + return 0; + } + QString idString = idStringList.join(","); + + qInfo() << "Deleting" << idStringList.size() << "playlists of type" << type + << "that contain fewer than" << minNumberOfTracks << "tracks"; + + auto deleteTracks = FwdSqlQuery(m_database, + QString("DELETE FROM PlaylistTracks WHERE playlist_id IN (%1)") + .arg(idString)); + if (!deleteTracks.execPrepared()) { + return -1; + } + + auto deletePlaylists = FwdSqlQuery(m_database, + QString("DELETE FROM Playlists WHERE id IN (%1)").arg(idString)); + if (!deletePlaylists.execPrepared()) { + return -1; + } + + return idStringList.length(); +} + void PlaylistDAO::renamePlaylist(const int playlistId, const QString& newName) { QSqlQuery query(m_database); query.prepare(QStringLiteral( diff --git a/src/library/dao/playlistdao.h b/src/library/dao/playlistdao.h index d1bd3208872..dc4c24f1851 100644 --- a/src/library/dao/playlistdao.h +++ b/src/library/dao/playlistdao.h @@ -1,5 +1,4 @@ -#ifndef PLAYLISTDAO_H -#define PLAYLISTDAO_H +#pragma once #include #include @@ -59,6 +58,10 @@ class PlaylistDAO : public QObject, public virtual DAO { int createUniquePlaylist(QString* pName, const HiddenType type = PLHT_NOT_HIDDEN); // Delete a playlist void deletePlaylist(const int playlistId); + /// Delete Playlists with fewer entries then "length" + /// Needs to be called inside a transaction. + /// @return number of deleted playlists, -1 on error + int deleteAllPlaylistsWithFewerTracks(PlaylistDAO::HiddenType type, int minNumberOfTracks); // Rename a playlist void renamePlaylist(const int playlistId, const QString& newName); // Lock or unlock a playlist @@ -147,5 +150,3 @@ class PlaylistDAO : public QObject, public virtual DAO { AutoDJProcessor* m_pAutoDJProcessor; DISALLOW_COPY_AND_ASSIGN(PlaylistDAO); }; - -#endif //PLAYLISTDAO_H diff --git a/src/library/dao/trackdao.cpp b/src/library/dao/trackdao.cpp index 70eb148c917..1d3b8d4a365 100644 --- a/src/library/dao/trackdao.cpp +++ b/src/library/dao/trackdao.cpp @@ -18,6 +18,7 @@ #include "library/dao/trackschema.h" #include "library/queryutil.h" #include "library/trackset/crate/cratestorage.h" +#include "moc_trackdao.cpp" #include "sources/soundsourceproxy.h" #include "track/beatfactory.h" #include "track/beats.h" @@ -540,13 +541,13 @@ void bindTrackLibraryValues( pTrackLibraryQuery->bindValue(":replaygain_peak", trackInfo.getReplayGain().getPeak()); pTrackLibraryQuery->bindValue(":channels", - static_cast(trackMetadata.getChannelCount())); + static_cast(trackMetadata.getStreamInfo().getSignalInfo().getChannelCount())); pTrackLibraryQuery->bindValue(":samplerate", - static_cast(trackMetadata.getSampleRate())); + static_cast(trackMetadata.getStreamInfo().getSignalInfo().getSampleRate())); pTrackLibraryQuery->bindValue(":bitrate", - static_cast(trackMetadata.getBitrate())); + static_cast(trackMetadata.getStreamInfo().getBitrate())); pTrackLibraryQuery->bindValue(":duration", - trackMetadata.getDuration().toDoubleSeconds()); + trackMetadata.getStreamInfo().getDuration().toDoubleSeconds()); pTrackLibraryQuery->bindValue(":header_parsed", track.getMetadataSynchronized() ? 1 : 0); diff --git a/src/library/dao/trackdao.h b/src/library/dao/trackdao.h index 12b29737134..a805b19f40d 100644 --- a/src/library/dao/trackdao.h +++ b/src/library/dao/trackdao.h @@ -1,5 +1,4 @@ -#ifndef TRACKDAO_H -#define TRACKDAO_H +#pragma once #include #include @@ -184,5 +183,3 @@ class TrackDAO : public QObject, public virtual DAO, public virtual GlobalTrackC }; Q_DECLARE_OPERATORS_FOR_FLAGS(TrackDAO::ResolveTrackIdFlags) - -#endif //TRACKDAO_H diff --git a/src/library/dlganalysis.cpp b/src/library/dlganalysis.cpp index 87a2a113e6a..ce76e7e44dd 100644 --- a/src/library/dlganalysis.cpp +++ b/src/library/dlganalysis.cpp @@ -1,15 +1,17 @@ +#include "library/dlganalysis.h" + #include -#include "widget/wwidget.h" -#include "widget/wskincolor.h" -#include "widget/wanalysislibrarytableview.h" #include "analyzer/analyzerprogress.h" #include "library/dao/trackschema.h" -#include "library/trackcollectionmanager.h" -#include "library/dlganalysis.h" #include "library/library.h" -#include "widget/wlibrary.h" +#include "library/trackcollectionmanager.h" +#include "moc_dlganalysis.cpp" #include "util/assert.h" +#include "widget/wanalysislibrarytableview.h" +#include "widget/wlibrary.h" +#include "widget/wskincolor.h" +#include "widget/wwidget.h" DlgAnalysis::DlgAnalysis(WLibrary* parent, UserSettingsPointer pConfig, diff --git a/src/library/dlganalysis.h b/src/library/dlganalysis.h index 5e8b7a9cd25..e279fcfc8a9 100644 --- a/src/library/dlganalysis.h +++ b/src/library/dlganalysis.h @@ -1,5 +1,4 @@ -#ifndef DLGANALYSIS_H -#define DLGANALYSIS_H +#pragma once #include #include @@ -63,5 +62,3 @@ class DlgAnalysis : public QWidget, public Ui::DlgAnalysis, public virtual Libra WAnalysisLibraryTableView* m_pAnalysisLibraryTableView; AnalysisLibraryTableModel* m_pAnalysisLibraryTableModel; }; - -#endif //DLGTRIAGE_H diff --git a/src/library/dlgcoverartfullsize.cpp b/src/library/dlgcoverartfullsize.cpp index de8e402c8bd..e6eaa7cd45e 100644 --- a/src/library/dlgcoverartfullsize.cpp +++ b/src/library/dlgcoverartfullsize.cpp @@ -7,6 +7,7 @@ #include "library/coverartcache.h" #include "library/coverartutils.h" +#include "moc_dlgcoverartfullsize.cpp" #include "track/track.h" #include "util/widgethelper.h" diff --git a/src/library/dlghidden.cpp b/src/library/dlghidden.cpp index d06f2105f3e..f61d0e2cf70 100644 --- a/src/library/dlghidden.cpp +++ b/src/library/dlghidden.cpp @@ -2,9 +2,10 @@ #include "library/hiddentablemodel.h" #include "library/trackcollectionmanager.h" +#include "moc_dlghidden.cpp" +#include "util/assert.h" #include "widget/wlibrary.h" #include "widget/wtracktableview.h" -#include "util/assert.h" DlgHidden::DlgHidden( WLibrary* parent, diff --git a/src/library/dlgmissing.cpp b/src/library/dlgmissing.cpp index a6255e31c52..e67e6a2338d 100644 --- a/src/library/dlgmissing.cpp +++ b/src/library/dlgmissing.cpp @@ -2,9 +2,10 @@ #include "library/missingtablemodel.h" #include "library/trackcollectionmanager.h" +#include "moc_dlgmissing.cpp" +#include "util/assert.h" #include "widget/wlibrary.h" #include "widget/wtracktableview.h" -#include "util/assert.h" DlgMissing::DlgMissing( WLibrary* parent, diff --git a/src/library/dlgtagfetcher.cpp b/src/library/dlgtagfetcher.cpp index 86fe9551f0c..fef419f9f1b 100644 --- a/src/library/dlgtagfetcher.cpp +++ b/src/library/dlgtagfetcher.cpp @@ -3,6 +3,7 @@ #include #include +#include "moc_dlgtagfetcher.cpp" #include "track/track.h" #include "track/tracknumbers.h" diff --git a/src/library/dlgtrackinfo.cpp b/src/library/dlgtrackinfo.cpp index 90ea34db020..864db930863 100644 --- a/src/library/dlgtrackinfo.cpp +++ b/src/library/dlgtrackinfo.cpp @@ -8,6 +8,7 @@ #include "library/coverartutils.h" #include "library/dlgtagfetcher.h" #include "library/trackmodel.h" +#include "moc_dlgtrackinfo.cpp" #include "preferences/colorpalettesettings.h" #include "sources/soundsourceproxy.h" #include "track/beatfactory.h" diff --git a/src/library/dlgtrackmetadataexport.cpp b/src/library/dlgtrackmetadataexport.cpp index 7c580717f1c..15dd2997db0 100644 --- a/src/library/dlgtrackmetadataexport.cpp +++ b/src/library/dlgtrackmetadataexport.cpp @@ -2,6 +2,7 @@ #include +#include "moc_dlgtrackmetadataexport.cpp" namespace mixxx { diff --git a/src/library/export/trackexportdlg.cpp b/src/library/export/trackexportdlg.cpp index 8efdea6aae5..d185e390433 100644 --- a/src/library/export/trackexportdlg.cpp +++ b/src/library/export/trackexportdlg.cpp @@ -1,9 +1,10 @@ #include "library/export/trackexportdlg.h" -#include #include +#include #include +#include "moc_trackexportdlg.cpp" #include "util/assert.h" TrackExportDlg::TrackExportDlg(QWidget *parent, diff --git a/src/library/export/trackexportdlg.h b/src/library/export/trackexportdlg.h index b63956c554d..f4b2776aeb8 100644 --- a/src/library/export/trackexportdlg.h +++ b/src/library/export/trackexportdlg.h @@ -1,5 +1,4 @@ -#ifndef DLGTRACKEXPORT_H -#define DLGTRACKEXPORT_H +#pragma once #include #include @@ -50,5 +49,3 @@ class TrackExportDlg : public QDialog, public Ui::DlgTrackExport { TrackPointerList m_tracks; TrackExportWorker* m_worker; }; - -#endif // DLGTRACKEXPORT_H diff --git a/src/library/export/trackexportwizard.cpp b/src/library/export/trackexportwizard.cpp index ddbfa8fd56a..12aee6081a3 100644 --- a/src/library/export/trackexportwizard.cpp +++ b/src/library/export/trackexportwizard.cpp @@ -2,9 +2,10 @@ #include #include -#include #include +#include +#include "moc_trackexportwizard.cpp" #include "util/assert.h" void TrackExportWizard::exportTracks() { diff --git a/src/library/export/trackexportwizard.h b/src/library/export/trackexportwizard.h index 9c9971e0c25..9954b8fa39f 100644 --- a/src/library/export/trackexportwizard.h +++ b/src/library/export/trackexportwizard.h @@ -6,8 +6,7 @@ // FLAC -> AIFF for CDJ // * Export sidecar metadata files for import into Mixxx -#ifndef TRACKEXPORT_H -#define TRACKEXPORT_H +#pragma once #include #include @@ -39,5 +38,3 @@ class TrackExportWizard : public QObject { QScopedPointer m_dialog; QScopedPointer m_worker; }; - -#endif // TRACKEXPORT_H diff --git a/src/library/export/trackexportworker.cpp b/src/library/export/trackexportworker.cpp index 38406eccdc5..dd9a16f5677 100644 --- a/src/library/export/trackexportworker.cpp +++ b/src/library/export/trackexportworker.cpp @@ -4,6 +4,7 @@ #include #include +#include "moc_trackexportworker.cpp" #include "track/track.h" namespace { diff --git a/src/library/export/trackexportworker.h b/src/library/export/trackexportworker.h index 0bd2ea36954..353abc002ff 100644 --- a/src/library/export/trackexportworker.h +++ b/src/library/export/trackexportworker.h @@ -1,5 +1,4 @@ -#ifndef TRACKEXPORTWORKER_H -#define TRACKEXPORTWORKER_H +#pragma once #include #include @@ -86,5 +85,3 @@ class TrackExportWorker : public QThread { const QString m_destDir; const TrackPointerList m_tracks; }; - -#endif // TRACKEXPORTWORKER_H diff --git a/src/library/externaltrackcollection.cpp b/src/library/externaltrackcollection.cpp index ce5f38b2114..13556b7a30f 100644 --- a/src/library/externaltrackcollection.cpp +++ b/src/library/externaltrackcollection.cpp @@ -1,5 +1,6 @@ #include "library/externaltrackcollection.h" +#include "moc_externaltrackcollection.cpp" void ExternalTrackCollection::relocateTracks( const QList& relocatedTracks) { diff --git a/src/library/hiddentablemodel.cpp b/src/library/hiddentablemodel.cpp index 99d902ab961..db1a488d387 100644 --- a/src/library/hiddentablemodel.cpp +++ b/src/library/hiddentablemodel.cpp @@ -3,6 +3,7 @@ #include "library/dao/trackschema.h" #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" +#include "moc_hiddentablemodel.cpp" HiddenTableModel::HiddenTableModel(QObject* parent, TrackCollectionManager* pTrackCollectionManager) diff --git a/src/library/hiddentablemodel.h b/src/library/hiddentablemodel.h index 685a47e7569..f2fabc9d3e5 100644 --- a/src/library/hiddentablemodel.h +++ b/src/library/hiddentablemodel.h @@ -1,5 +1,4 @@ -#ifndef HIDDENTABLEMODEL_H -#define HIDDENTABLEMODEL_H +#pragma once #include "library/basesqltablemodel.h" @@ -17,5 +16,3 @@ class HiddenTableModel final : public BaseSqlTableModel { Qt::ItemFlags flags(const QModelIndex &index) const final; Capabilities getCapabilities() const final; }; - -#endif diff --git a/src/library/itunes/itunesfeature.cpp b/src/library/itunes/itunesfeature.cpp index 524720e7c24..d7fc40a5f5f 100644 --- a/src/library/itunes/itunesfeature.cpp +++ b/src/library/itunes/itunesfeature.cpp @@ -1,22 +1,23 @@ -#include -#include -#include -#include +#include "library/itunes/itunesfeature.h" + +#include #include +#include #include -#include +#include +#include #include -#include - -#include "library/itunes/itunesfeature.h" +#include +#include +#include "library/baseexternalplaylistmodel.h" +#include "library/baseexternaltrackmodel.h" #include "library/basetrackcache.h" #include "library/dao/settingsdao.h" -#include "library/baseexternaltrackmodel.h" -#include "library/baseexternalplaylistmodel.h" -#include "library/queryutil.h" #include "library/library.h" +#include "library/queryutil.h" #include "library/trackcollectionmanager.h" +#include "moc_itunesfeature.cpp" #include "util/lcs.h" #include "util/sandbox.h" #include "widget/wlibrarysidebar.h" diff --git a/src/library/itunes/itunesfeature.h b/src/library/itunes/itunesfeature.h index 92358e9dcb7..a3cd26b1ffe 100644 --- a/src/library/itunes/itunesfeature.h +++ b/src/library/itunes/itunesfeature.h @@ -1,8 +1,4 @@ -// itunesfeaturefeature.h -// Created 8/23/2009 by RJ Ryan (rryan@mit.edu) - -#ifndef ITUNESFEATURE_H -#define ITUNESFEATURE_H +#pragma once #include #include @@ -75,5 +71,3 @@ class ITunesFeature : public BaseExternalLibraryFeature { QPointer m_pSidebarWidget; QIcon m_icon; }; - -#endif // ITUNESFEATURE_H diff --git a/src/library/library.cpp b/src/library/library.cpp index f3110a9f0ea..9df60d3583a 100644 --- a/src/library/library.cpp +++ b/src/library/library.cpp @@ -32,6 +32,7 @@ #include "library/trackset/setlogfeature.h" #include "library/traktor/traktorfeature.h" #include "mixer/playermanager.h" +#include "moc_library.cpp" #include "recording/recordingmanager.h" #include "util/assert.h" #include "util/db/dbconnectionpooled.h" diff --git a/src/library/library_preferences.h b/src/library/library_preferences.h index a30a452fa7c..3622c99dcfd 100644 --- a/src/library/library_preferences.h +++ b/src/library/library_preferences.h @@ -1,8 +1,5 @@ -#ifndef LIBRARY_PREFERENCES_H -#define LIBRARY_PREFERENCES_H +#pragma once #define PREF_LEGACY_LIBRARY_DIR ConfigKey("[Playlist]","Directory") #define PREF_LIBRARY_EDIT_METADATA_DEFAULT false - -#endif /* LIBRARY_PREFERENCES_H */ diff --git a/src/library/librarycontrol.cpp b/src/library/librarycontrol.cpp index 17b96919b81..bfc0deffc0e 100644 --- a/src/library/librarycontrol.cpp +++ b/src/library/librarycontrol.cpp @@ -12,6 +12,7 @@ #include "library/library.h" #include "library/libraryview.h" #include "mixer/playermanager.h" +#include "moc_librarycontrol.cpp" #include "widget/wlibrary.h" #include "widget/wlibrarysidebar.h" #include "widget/wsearchlineedit.h" diff --git a/src/library/librarycontrol.h b/src/library/librarycontrol.h index ed799773ae6..c04bf9ecdd1 100644 --- a/src/library/librarycontrol.h +++ b/src/library/librarycontrol.h @@ -1,5 +1,4 @@ -#ifndef LIBRARYMIDICONTROL_H -#define LIBRARYMIDICONTROL_H +#pragma once #include @@ -175,5 +174,3 @@ class LibraryControl : public QObject { ControlProxy m_numPreviewDecks; std::map> m_loadToGroupControllers; }; - -#endif //LIBRARYMIDICONTROL_H diff --git a/src/library/libraryfeature.cpp b/src/library/libraryfeature.cpp index 1458ad1cf67..bf3a0e2e621 100644 --- a/src/library/libraryfeature.cpp +++ b/src/library/libraryfeature.cpp @@ -1,13 +1,11 @@ -// libraryfeature.cpp -// Created 8/17/2009 by RJ Ryan (rryan@mit.edu) +#include "library/libraryfeature.h" #include -#include "library/libraryfeature.h" - #include "library/library.h" #include "library/parserm3u.h" #include "library/parserpls.h" +#include "moc_libraryfeature.cpp" #include "util/logger.h" // KEEP THIS cpp file to tell scons that moc should be called on the class!!! diff --git a/src/library/libraryfeature.h b/src/library/libraryfeature.h index c0fd1d3d837..465b48c23f2 100644 --- a/src/library/libraryfeature.h +++ b/src/library/libraryfeature.h @@ -1,8 +1,4 @@ -// libraryfeature.h -// Created 8/17/2009 by RJ Ryan (rryan@mit.edu) - -#ifndef LIBRARYFEATURE_H -#define LIBRARYFEATURE_H +#pragma once #include #include @@ -139,5 +135,3 @@ class LibraryFeature : public QObject { private: QStringList getPlaylistFiles(QFileDialog::FileMode mode) const; }; - -#endif /* LIBRARYFEATURE_H */ diff --git a/src/library/librarytablemodel.cpp b/src/library/librarytablemodel.cpp index 57ebf573038..1ee4db36ef3 100644 --- a/src/library/librarytablemodel.cpp +++ b/src/library/librarytablemodel.cpp @@ -5,6 +5,7 @@ #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "mixer/playermanager.h" +#include "moc_librarytablemodel.cpp" LibraryTableModel::LibraryTableModel(QObject* parent, TrackCollectionManager* pTrackCollectionManager, diff --git a/src/library/librarytablemodel.h b/src/library/librarytablemodel.h index 0ab2a6c4b56..b5a6c359cba 100644 --- a/src/library/librarytablemodel.h +++ b/src/library/librarytablemodel.h @@ -1,5 +1,4 @@ -#ifndef LIBRARYTABLEMODEL_H -#define LIBRARYTABLEMODEL_H +#pragma once #include "library/basesqltablemodel.h" @@ -18,5 +17,3 @@ class LibraryTableModel : public BaseSqlTableModel { int addTracks(const QModelIndex& index, const QList& locations) final; TrackModel::Capabilities getCapabilities() const final; }; - -#endif diff --git a/src/library/libraryview.h b/src/library/libraryview.h index 3b6ab8897b0..112c294ca2a 100644 --- a/src/library/libraryview.h +++ b/src/library/libraryview.h @@ -4,8 +4,7 @@ /// LibraryView is an abstract interface that all views to be used with the /// Library widget should support. -#ifndef LIBRARYVIEW_H -#define LIBRARYVIEW_H +#pragma once #include @@ -47,5 +46,3 @@ class LibraryView { virtual void assignPreviousTrackColor(){}; virtual void assignNextTrackColor(){}; }; - -#endif /* LIBRARYVIEW_H */ diff --git a/src/library/locationdelegate.cpp b/src/library/locationdelegate.cpp index cf48a9a1a71..43438d58e6e 100644 --- a/src/library/locationdelegate.cpp +++ b/src/library/locationdelegate.cpp @@ -2,6 +2,7 @@ #include +#include "moc_locationdelegate.cpp" LocationDelegate::LocationDelegate(QTableView* pTableView) : TableItemDelegate(pTableView) { diff --git a/src/library/missingtablemodel.cpp b/src/library/missingtablemodel.cpp index 7c3db673c30..59ea189cc71 100644 --- a/src/library/missingtablemodel.cpp +++ b/src/library/missingtablemodel.cpp @@ -1,8 +1,9 @@ #include "library/missingtablemodel.h" +#include "library/dao/trackschema.h" #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" -#include "library/dao/trackschema.h" +#include "moc_missingtablemodel.cpp" namespace { diff --git a/src/library/mixxxlibraryfeature.cpp b/src/library/mixxxlibraryfeature.cpp index 3a71ea69a6f..8117328d579 100644 --- a/src/library/mixxxlibraryfeature.cpp +++ b/src/library/mixxxlibraryfeature.cpp @@ -1,6 +1,3 @@ -// mixxxlibraryfeature.cpp -// Created 8/23/2009 by RJ Ryan (rryan@mit.edu) - #include "library/mixxxlibraryfeature.h" #include @@ -18,6 +15,7 @@ #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "library/treeitem.h" +#include "moc_mixxxlibraryfeature.cpp" #include "sources/soundsourceproxy.h" #include "util/dnd.h" #include "widget/wlibrary.h" diff --git a/src/library/mixxxlibraryfeature.h b/src/library/mixxxlibraryfeature.h index b40fe005a8e..3dc0700fdea 100644 --- a/src/library/mixxxlibraryfeature.h +++ b/src/library/mixxxlibraryfeature.h @@ -1,8 +1,4 @@ -// mixxxlibraryfeature.h -// Created 8/23/2009 by RJ Ryan (rryan@mit.edu) - -#ifndef MIXXXLIBRARYFEATURE_H -#define MIXXXLIBRARYFEATURE_H +#pragma once #include #include @@ -65,5 +61,3 @@ class MixxxLibraryFeature final : public LibraryFeature { DlgMissing* m_pMissingView; DlgHidden* m_pHiddenView; }; - -#endif /* MIXXXLIBRARYFEATURE_H */ diff --git a/src/library/parser.cpp b/src/library/parser.cpp index 5a8ab4bd3bc..eca875f3682 100644 --- a/src/library/parser.cpp +++ b/src/library/parser.cpp @@ -19,11 +19,6 @@ #include "library/parser.h" -/** - @author Ingo Kossyk (kossyki@cs.tu-berlin.de) - **/ - - Parser::Parser() { } diff --git a/src/library/parser.h b/src/library/parser.h index 53e617e497a..4a666bdde81 100644 --- a/src/library/parser.h +++ b/src/library/parser.h @@ -11,8 +11,7 @@ // // -#ifndef PARSER_H -#define PARSER_H +#pragma once /**Developer Information: This is the rootclass for all parser classes for the Importer class. @@ -60,5 +59,3 @@ class Parser : public QObject { const QString& playlistEntry, const QString& basePath = QString()); }; - -#endif diff --git a/src/library/parsercsv.cpp b/src/library/parsercsv.cpp index 9e237bcbfde..83a0dd10651 100644 --- a/src/library/parsercsv.cpp +++ b/src/library/parsercsv.cpp @@ -14,10 +14,12 @@ #include "library/parsercsv.h" -#include -#include #include #include +#include +#include + +#include "moc_parsercsv.cpp" ParserCsv::ParserCsv() : Parser() { } diff --git a/src/library/parsercsv.h b/src/library/parsercsv.h index ee15981292c..ecf1e1167ed 100644 --- a/src/library/parsercsv.h +++ b/src/library/parsercsv.h @@ -11,8 +11,7 @@ // Copyright: See COPYING file that comes with this distribution // // -#ifndef PARSERCSV_H -#define PARSERCSV_H +#pragma once #include #include @@ -39,5 +38,3 @@ class ParserCsv : public Parser }; - -#endif diff --git a/src/library/parserm3u.cpp b/src/library/parserm3u.cpp index fbd5dbc6056..cfab773c2ba 100644 --- a/src/library/parserm3u.cpp +++ b/src/library/parserm3u.cpp @@ -13,15 +13,13 @@ #include "library/parserm3u.h" -#include #include #include -#include #include +#include +#include -/** - @author Ingo Kossyk (kossyki@cs.tu-berlin.de) - **/ +#include "moc_parserm3u.cpp" /** ToDo: diff --git a/src/library/parserm3u.h b/src/library/parserm3u.h index 1ff21494719..1b8829fa8d0 100644 --- a/src/library/parserm3u.h +++ b/src/library/parserm3u.h @@ -10,8 +10,7 @@ // Copyright: See COPYING file that comes with this distribution // // -#ifndef PARSERM3U_H -#define PARSERM3U_H +#pragma once #include #include @@ -39,5 +38,3 @@ class ParserM3u : public Parser }; - -#endif diff --git a/src/library/parserpls.cpp b/src/library/parserpls.cpp index e224aec67be..522d47bffcc 100644 --- a/src/library/parserpls.cpp +++ b/src/library/parserpls.cpp @@ -12,15 +12,13 @@ // #include "library/parserpls.h" -#include -#include #include #include +#include #include +#include -/** - @author Ingo Kossyk (kossyki@cs.tu-berlin.de) - **/ +#include "moc_parserpls.cpp" /** ToDo: diff --git a/src/library/parserpls.h b/src/library/parserpls.h index 4f8ba7cbce6..a7ca089da3a 100644 --- a/src/library/parserpls.h +++ b/src/library/parserpls.h @@ -9,8 +9,7 @@ // Copyright: See COPYING file that comes with this distribution // // -#ifndef PARSERPLS_H -#define PARSERPLS_H +#pragma once #include "library/parser.h" @@ -35,5 +34,3 @@ class ParserPls : public Parser { QString getFilePath(QTextStream*, const QString& basePath); }; - -#endif diff --git a/src/library/playlisttablemodel.cpp b/src/library/playlisttablemodel.cpp index 2962d023751..3332f7e0620 100644 --- a/src/library/playlisttablemodel.cpp +++ b/src/library/playlisttablemodel.cpp @@ -5,6 +5,7 @@ #include "library/queryutil.h" #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" +#include "moc_playlisttablemodel.cpp" PlaylistTableModel::PlaylistTableModel(QObject* parent, TrackCollectionManager* pTrackCollectionManager, diff --git a/src/library/previewbuttondelegate.cpp b/src/library/previewbuttondelegate.cpp index b244c68ac82..f97f0508924 100644 --- a/src/library/previewbuttondelegate.cpp +++ b/src/library/previewbuttondelegate.cpp @@ -8,6 +8,7 @@ #include "library/trackmodel.h" #include "mixer/playerinfo.h" #include "mixer/playermanager.h" +#include "moc_previewbuttondelegate.cpp" #include "track/track.h" #include "widget/wlibrarytableview.h" diff --git a/src/library/proxytrackmodel.cpp b/src/library/proxytrackmodel.cpp index 32316194e59..ee463eb4712 100644 --- a/src/library/proxytrackmodel.cpp +++ b/src/library/proxytrackmodel.cpp @@ -1,5 +1,4 @@ -// proxytrackmodel.cpp -// Created 10/22/2009 by RJ Ryan (rryan@mit.edu) +#include "library/proxytrackmodel.h" #include "library/proxytrackmodel.h" diff --git a/src/library/queryutil.h b/src/library/queryutil.h index fe28dba7779..7c22376d8df 100644 --- a/src/library/queryutil.h +++ b/src/library/queryutil.h @@ -1,5 +1,4 @@ -#ifndef QUERYUTIL_H -#define QUERYUTIL_H +#pragma once #include #include @@ -42,9 +41,14 @@ class ScopedTransaction { return false; } bool result = m_database.commit(); - qDebug() << "Committing transaction on" - << m_database.connectionName() - << "result:" << result; + if (result) { + qDebug() << "Committing transaction successfully on" + << m_database.connectionName(); + } else { + qInfo() << "Committing transaction failed on" + << m_database.connectionName() + << ":" << m_database.lastError(); + } m_active = false; return result; } @@ -97,5 +101,3 @@ class FieldEscaper final { QSqlDatabase m_database; mutable QSqlField m_stringField; }; - -#endif /* QUERYUTIL_H */ diff --git a/src/library/recording/dlgrecording.cpp b/src/library/recording/dlgrecording.cpp index 292a7a14911..16805bc69fc 100644 --- a/src/library/recording/dlgrecording.cpp +++ b/src/library/recording/dlgrecording.cpp @@ -4,6 +4,7 @@ #include "control/controlobject.h" #include "library/trackcollectionmanager.h" +#include "moc_dlgrecording.cpp" #include "util/assert.h" #include "widget/wlibrary.h" #include "widget/wskincolor.h" diff --git a/src/library/recording/recordingfeature.cpp b/src/library/recording/recordingfeature.cpp index 26a8998fa99..43655334291 100644 --- a/src/library/recording/recordingfeature.cpp +++ b/src/library/recording/recordingfeature.cpp @@ -1,14 +1,13 @@ -// recordingfeature.cpp -// Created 03/26/2010 by Tobias Rafreider +#include "library/recording/recordingfeature.h" +#include "controllers/keyboard/keyboardeventfilter.h" +#include "library/library.h" #include "library/recording/dlgrecording.h" -#include "track/track.h" #include "library/treeitem.h" -#include "library/recording/recordingfeature.h" -#include "library/library.h" -#include "widget/wlibrary.h" -#include "controllers/keyboard/keyboardeventfilter.h" +#include "moc_recordingfeature.cpp" #include "recording/recordingmanager.h" +#include "track/track.h" +#include "widget/wlibrary.h" namespace { diff --git a/src/library/recording/recordingfeature.h b/src/library/recording/recordingfeature.h index 2fb8234f73c..61b26ad7821 100644 --- a/src/library/recording/recordingfeature.h +++ b/src/library/recording/recordingfeature.h @@ -1,8 +1,4 @@ -// recordingfeature.h -// Created 03/26/2010 by Tobias Rafreider - -#ifndef RECORDING_FEATURE_H -#define RECORDING_FEATURE_H +#pragma once #include #include @@ -45,5 +41,3 @@ class RecordingFeature final : public LibraryFeature { FolderTreeModel m_childModel; }; - -#endif diff --git a/src/library/rekordbox/rekordbox_anlz.h b/src/library/rekordbox/rekordbox_anlz.h index d4cab6ee1c0..0cd43827d81 100644 --- a/src/library/rekordbox/rekordbox_anlz.h +++ b/src/library/rekordbox/rekordbox_anlz.h @@ -1,5 +1,4 @@ -#ifndef REKORDBOX_ANLZ_H_ -#define REKORDBOX_ANLZ_H_ +#pragma once // This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild @@ -1039,5 +1038,3 @@ class rekordbox_anlz_t : public kaitai::kstruct { rekordbox_anlz_t* _root() const { return m__root; } kaitai::kstruct* _parent() const { return m__parent; } }; - -#endif // REKORDBOX_ANLZ_H_ diff --git a/src/library/rekordbox/rekordbox_pdb.h b/src/library/rekordbox/rekordbox_pdb.h index bb920b62ac8..9b251b59364 100644 --- a/src/library/rekordbox/rekordbox_pdb.h +++ b/src/library/rekordbox/rekordbox_pdb.h @@ -1,5 +1,4 @@ -#ifndef REKORDBOX_PDB_H_ -#define REKORDBOX_PDB_H_ +#pragma once // This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild @@ -1756,5 +1755,3 @@ class rekordbox_pdb_t : public kaitai::kstruct { rekordbox_pdb_t* _root() const { return m__root; } kaitai::kstruct* _parent() const { return m__parent; } }; - -#endif // REKORDBOX_PDB_H_ diff --git a/src/library/rekordbox/rekordboxfeature.cpp b/src/library/rekordbox/rekordboxfeature.cpp index bb452d372c3..7a1adade130 100644 --- a/src/library/rekordbox/rekordboxfeature.cpp +++ b/src/library/rekordbox/rekordboxfeature.cpp @@ -1,6 +1,3 @@ -// rekordboxfeature.cpp -// Created 05/24/2019 by Evan Dekker - #include "library/rekordbox/rekordboxfeature.h" #include @@ -21,6 +18,7 @@ #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "library/treeitem.h" +#include "moc_rekordboxfeature.cpp" #include "track/beatmap.h" #include "track/cue.h" #include "track/keyfactory.h" diff --git a/src/library/rekordbox/rekordboxfeature.h b/src/library/rekordbox/rekordboxfeature.h index 8f41aa22710..c1388cef3f1 100644 --- a/src/library/rekordbox/rekordboxfeature.h +++ b/src/library/rekordbox/rekordboxfeature.h @@ -1,6 +1,3 @@ -// rekordboxfeature.h -// Created 05/24/2019 by Evan Dekker - // This feature reads tracks, playlists and folders from removable Recordbox // prepared devices (USB drives, etc), by parsing the binary *.PDB files // stored on each removable device. It does not read the locally stored @@ -25,8 +22,7 @@ // https://github.com/Deep-Symmetry/crate-digger/blob/master/src/main/kaitai/rekordbox_pdb.ksy -#ifndef REKORDBOX_FEATURE_H -#define REKORDBOX_FEATURE_H +#pragma once #include #include @@ -96,5 +92,3 @@ class RekordboxFeature : public BaseExternalLibraryFeature { QSharedPointer m_trackSource; QIcon m_icon; }; - -#endif // REKORDBOX_FEATURE_H diff --git a/src/library/rhythmbox/rhythmboxfeature.cpp b/src/library/rhythmbox/rhythmboxfeature.cpp index 3ae7f61ba03..7c907aa85bc 100644 --- a/src/library/rhythmbox/rhythmboxfeature.cpp +++ b/src/library/rhythmbox/rhythmboxfeature.cpp @@ -1,17 +1,18 @@ +#include "library/rhythmbox/rhythmboxfeature.h" + #include -#include #include #include +#include -#include "library/rhythmbox/rhythmboxfeature.h" - -#include "library/baseexternaltrackmodel.h" #include "library/baseexternalplaylistmodel.h" +#include "library/baseexternaltrackmodel.h" #include "library/library.h" +#include "library/queryutil.h" #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "library/treeitem.h" -#include "library/queryutil.h" +#include "moc_rhythmboxfeature.cpp" RhythmboxFeature::RhythmboxFeature(Library* pLibrary, UserSettingsPointer pConfig) : BaseExternalLibraryFeature(pLibrary, pConfig), diff --git a/src/library/rhythmbox/rhythmboxfeature.h b/src/library/rhythmbox/rhythmboxfeature.h index 40607659a33..fd2ef67f76c 100644 --- a/src/library/rhythmbox/rhythmboxfeature.h +++ b/src/library/rhythmbox/rhythmboxfeature.h @@ -1,8 +1,4 @@ -// rhythmboxfeature.h -// Created 8/23/2009 by RJ Ryan (rryan@mit.edu) - -#ifndef RHYTHMBOXFEATURE_H -#define RHYTHMBOXFEATURE_H +#pragma once #include #include @@ -64,5 +60,3 @@ class RhythmboxFeature : public BaseExternalLibraryFeature { QSharedPointer m_trackSource; QIcon m_icon; }; - -#endif // RHYTHMBOXFEATURE_H diff --git a/src/library/scanner/importfilestask.cpp b/src/library/scanner/importfilestask.cpp index 7d124cb2860..7b3b6704409 100644 --- a/src/library/scanner/importfilestask.cpp +++ b/src/library/scanner/importfilestask.cpp @@ -1,6 +1,7 @@ #include "library/scanner/importfilestask.h" #include "library/scanner/libraryscanner.h" +#include "moc_importfilestask.cpp" #include "track/trackfile.h" #include "util/timer.h" diff --git a/src/library/scanner/libraryscanner.cpp b/src/library/scanner/libraryscanner.cpp index 5c82ee5288f..5aa3e2858e5 100644 --- a/src/library/scanner/libraryscanner.cpp +++ b/src/library/scanner/libraryscanner.cpp @@ -6,6 +6,7 @@ #include "library/scanner/recursivescandirectorytask.h" #include "library/scanner/scannertask.h" #include "library/scanner/scannerutil.h" +#include "moc_libraryscanner.cpp" #include "sources/soundsourceproxy.h" #include "track/track.h" #include "util/db/dbconnectionpooled.h" diff --git a/src/library/scanner/libraryscanner.h b/src/library/scanner/libraryscanner.h index 8bda84b91cb..ee0de3478b0 100644 --- a/src/library/scanner/libraryscanner.h +++ b/src/library/scanner/libraryscanner.h @@ -1,5 +1,4 @@ -#ifndef MIXXX_LIBRARYSCANNER_H -#define MIXXX_LIBRARYSCANNER_H +#pragma once #include @@ -123,5 +122,3 @@ class LibraryScanner : public QThread { QStringList m_libraryRootDirs; QScopedPointer m_pProgressDlg; }; - -#endif // MIXXX_LIBRARYSCANNER_H diff --git a/src/library/scanner/libraryscannerdlg.cpp b/src/library/scanner/libraryscannerdlg.cpp index ff1ee8ec12b..3acf76dde20 100644 --- a/src/library/scanner/libraryscannerdlg.cpp +++ b/src/library/scanner/libraryscannerdlg.cpp @@ -1,27 +1,11 @@ -/*************************************************************************** - LibraryScannerDlg.cpp - shows library scanning - progress - ------------------- - begin : 11/27/2007 - copyright : (C) 2007 Albert Santoni and Adam Davison - email : gamegod \a\t users.sf.net -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ +#include "library/scanner/libraryscannerdlg.h" #include #include #include #include -#include "library/scanner/libraryscannerdlg.h" +#include "moc_libraryscannerdlg.cpp" LibraryScannerDlg::LibraryScannerDlg(QWidget* parent, Qt::WindowFlags f) : QWidget(parent, f), diff --git a/src/library/scanner/libraryscannerdlg.h b/src/library/scanner/libraryscannerdlg.h index 3db2b6d1a40..076427335f7 100644 --- a/src/library/scanner/libraryscannerdlg.h +++ b/src/library/scanner/libraryscannerdlg.h @@ -1,23 +1,4 @@ -/*************************************************************************** - LibraryScannerDlg.cpp - shows library scanning - progress - ------------------- - begin : 11/27/2007 - copyright : (C) 2007 Albert Santoni and Adam Davison - email : gamegod \a\t users.sf.net -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - -#ifndef LIBRARYSCANNERDLG_H -#define LIBRARYSCANNERDLG_H +#pragma once #include #include @@ -46,5 +27,3 @@ class LibraryScannerDlg : public QWidget { PerformanceTimer m_timer; bool m_bCancelled; }; - -#endif diff --git a/src/library/scanner/recursivescandirectorytask.cpp b/src/library/scanner/recursivescandirectorytask.cpp index a2ce203f043..243a552a6df 100644 --- a/src/library/scanner/recursivescandirectorytask.cpp +++ b/src/library/scanner/recursivescandirectorytask.cpp @@ -1,10 +1,11 @@ +#include "library/scanner/recursivescandirectorytask.h" + #include #include -#include "library/scanner/recursivescandirectorytask.h" - -#include "library/scanner/libraryscanner.h" #include "library/scanner/importfilestask.h" +#include "library/scanner/libraryscanner.h" +#include "moc_recursivescandirectorytask.cpp" #include "util/timer.h" RecursiveScanDirectoryTask::RecursiveScanDirectoryTask( diff --git a/src/library/scanner/scannerglobal.h b/src/library/scanner/scannerglobal.h index 6feedeb12d2..e97d0e19cc7 100644 --- a/src/library/scanner/scannerglobal.h +++ b/src/library/scanner/scannerglobal.h @@ -1,5 +1,4 @@ -#ifndef SCANNERGLOBAL_H -#define SCANNERGLOBAL_H +#pragma once #include #include @@ -223,5 +222,3 @@ class ScannerGlobal { }; typedef QSharedPointer ScannerGlobalPointer; - -#endif /* SCANNERGLOBAL_H */ diff --git a/src/library/scanner/scannertask.cpp b/src/library/scanner/scannertask.cpp index 27f80daa292..6d55a415124 100644 --- a/src/library/scanner/scannertask.cpp +++ b/src/library/scanner/scannertask.cpp @@ -1,5 +1,7 @@ #include "library/scanner/scannertask.h" + #include "library/scanner/libraryscanner.h" +#include "moc_scannertask.cpp" ScannerTask::ScannerTask(LibraryScanner* pScanner, const ScannerGlobalPointer scannerGlobal) diff --git a/src/library/scanner/scannertask.h b/src/library/scanner/scannertask.h index ca27f6ea10b..7f96a21cd19 100644 --- a/src/library/scanner/scannertask.h +++ b/src/library/scanner/scannertask.h @@ -1,5 +1,4 @@ -#ifndef SCANNERTASK_H -#define SCANNERTASK_H +#pragma once #include #include @@ -41,5 +40,3 @@ class ScannerTask : public QObject, public QRunnable { private: bool m_success; }; - -#endif /* SCANNERTASK_H */ diff --git a/src/library/scanner/scannerutil.h b/src/library/scanner/scannerutil.h index 7ddf918cb81..e5cf7c34910 100644 --- a/src/library/scanner/scannerutil.h +++ b/src/library/scanner/scannerutil.h @@ -1,5 +1,4 @@ -#ifndef SCANNERUTIL_H -#define SCANNERUTIL_H +#pragma once #include #include @@ -31,5 +30,3 @@ class ScannerUtil { private: ScannerUtil() {} }; - -#endif /* SCANNERUTIL_H */ diff --git a/src/library/searchqueryparser.h b/src/library/searchqueryparser.h index 07038df9922..9878149c0a7 100644 --- a/src/library/searchqueryparser.h +++ b/src/library/searchqueryparser.h @@ -1,5 +1,4 @@ -#ifndef SEARCHQUERYPARSER_H -#define SEARCHQUERYPARSER_H +#pragma once #include #include @@ -45,5 +44,3 @@ class SearchQueryParser { DISALLOW_COPY_AND_ASSIGN(SearchQueryParser); }; - -#endif /* SEARCHQUERYPARSER_H */ diff --git a/src/library/serato/seratofeature.cpp b/src/library/serato/seratofeature.cpp index 63688d1e1ec..9abbd1b0ea6 100644 --- a/src/library/serato/seratofeature.cpp +++ b/src/library/serato/seratofeature.cpp @@ -1,6 +1,3 @@ -// seratofeature.cpp -// Created 2020-01-31 by Jan Holthuis - #include "library/serato/seratofeature.h" #include @@ -15,6 +12,7 @@ #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "library/treeitem.h" +#include "moc_seratofeature.cpp" #include "track/beatfactory.h" #include "track/cue.h" #include "track/keyfactory.h" diff --git a/src/library/sidebarmodel.cpp b/src/library/sidebarmodel.cpp index 697a6a30a24..3d454ffa600 100644 --- a/src/library/sidebarmodel.cpp +++ b/src/library/sidebarmodel.cpp @@ -1,11 +1,13 @@ -#include -#include +#include "library/sidebarmodel.h" + #include +#include +#include +#include "library/browse/browsefeature.h" #include "library/libraryfeature.h" -#include "library/sidebarmodel.h" #include "library/treeitem.h" -#include "library/browse/browsefeature.h" +#include "moc_sidebarmodel.cpp" #include "util/assert.h" namespace { @@ -374,8 +376,6 @@ bool SidebarModel::dragMoveAccept(const QModelIndex& index, const QUrl& url) { // Translates an index from the child models to an index of the sidebar models QModelIndex SidebarModel::translateSourceIndex(const QModelIndex& index) { - QModelIndex translatedIndex; - /* These method is called from the slot functions below. * QObject::sender() return the object which emitted the signal * handled by the slot functions. @@ -388,6 +388,13 @@ QModelIndex SidebarModel::translateSourceIndex(const QModelIndex& index) { return QModelIndex(); } + return translateIndex(index, model); +} + +QModelIndex SidebarModel::translateIndex( + const QModelIndex& index, const QAbstractItemModel* model) { + QModelIndex translatedIndex; + if (index.isValid()) { TreeItem* item = (TreeItem*)index.internalPointer(); translatedIndex = createIndex(index.row(), index.column(), item); diff --git a/src/library/sidebarmodel.h b/src/library/sidebarmodel.h index 807e893200c..25cee03ecf0 100644 --- a/src/library/sidebarmodel.h +++ b/src/library/sidebarmodel.h @@ -1,8 +1,4 @@ -// sidebarmodel.h -// Created 8/21/09 by RJ Ryan (rryan@mit.edu) - -#ifndef SIDEBARMODEL_H -#define SIDEBARMODEL_H +#pragma once #include #include @@ -40,6 +36,9 @@ class SidebarModel : public QAbstractItemModel { bool dragMoveAccept(const QModelIndex& index, const QUrl& url); bool hasChildren(const QModelIndex& parent = QModelIndex()) const override; bool hasTrackTable(const QModelIndex& index) const; + QModelIndex translateChildIndex(const QModelIndex& index) { + return translateIndex(index, index.model()); + } public slots: void pressed(const QModelIndex& index); @@ -76,6 +75,7 @@ class SidebarModel : public QAbstractItemModel { private: QModelIndex translateSourceIndex(const QModelIndex& parent); + QModelIndex translateIndex(const QModelIndex& index, const QAbstractItemModel* model); void featureRenamed(LibraryFeature*); QList m_sFeatures; unsigned int m_iDefaultSelectedIndex; /** Index of the item in the sidebar model to select at startup. */ @@ -86,5 +86,3 @@ class SidebarModel : public QAbstractItemModel { void startPressedUntilClickedTimer(const QModelIndex& pressedIndex); void stopPressedUntilClickedTimer(); }; - -#endif /* SIDEBARMODEL_H */ diff --git a/src/library/songdownloader.cpp b/src/library/songdownloader.cpp index 1eb211dd761..ad95cf784e4 100644 --- a/src/library/songdownloader.cpp +++ b/src/library/songdownloader.cpp @@ -5,6 +5,7 @@ #include #include +#include "moc_songdownloader.cpp" #include "util/compatibility.h" #include "util/version.h" diff --git a/src/library/songdownloader.h b/src/library/songdownloader.h index 88fa54e3246..7e08427352b 100644 --- a/src/library/songdownloader.h +++ b/src/library/songdownloader.h @@ -1,5 +1,4 @@ -#ifndef SONGDOWNLOADER_H -#define SONGDOWNLOADER_H +#pragma once #include #include @@ -38,5 +37,3 @@ class SongDownloader : public QObject { QNetworkReply* m_pReply; QNetworkRequest* m_pRequest; }; - -#endif // SONGDOWNLOADER_H diff --git a/src/library/stardelegate.cpp b/src/library/stardelegate.cpp index 125a058076b..8d000e605ae 100644 --- a/src/library/stardelegate.cpp +++ b/src/library/stardelegate.cpp @@ -1,20 +1,3 @@ -/*************************************************************************** - stardelegate.cpp - ------------------- - copyright : (C) 2010 Tobias Rafreider - copyright : (C) 2009 Nokia Corporation - -***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - #include "library/stardelegate.h" #include @@ -23,6 +6,7 @@ #include "library/stareditor.h" #include "library/starrating.h" #include "library/tableitemdelegate.h" +#include "moc_stardelegate.cpp" StarDelegate::StarDelegate(QTableView* pTableView) : TableItemDelegate(pTableView), diff --git a/src/library/stardelegate.h b/src/library/stardelegate.h index 999c65e2ffc..27ce03f1311 100644 --- a/src/library/stardelegate.h +++ b/src/library/stardelegate.h @@ -1,23 +1,4 @@ -/*************************************************************************** - stardelegate.h - ------------------- - copyright : (C) 2010 Tobias Rafreider - copyright : (C) 2009 Nokia Corporation - -***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - - -#ifndef STARDELEGATE_H -#define STARDELEGATE_H +#pragma once #include "library/tableitemdelegate.h" @@ -57,5 +38,3 @@ class StarDelegate : public TableItemDelegate { QPersistentModelIndex m_currentEditedCellIndex; bool m_isOneCellInEditMode; }; - -#endif diff --git a/src/library/stareditor.cpp b/src/library/stareditor.cpp index 37cf43a1a1c..92a7c919b96 100644 --- a/src/library/stareditor.cpp +++ b/src/library/stareditor.cpp @@ -1,41 +1,21 @@ -/*************************************************************************** - stareditor.cpp - ------------------- - copyright : (C) 2010 Tobias Rafreider - copyright : (C) 2009 Nokia Corporation - -***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -/*************************************************************************** - * * - * StarEditor inherits QWidget and is used by StarDelegate to let the user * - * edit a star rating in the library using the mouse. * - * * - * The class has been adapted from the official "Star Delegate Example", * - * see http://doc.trolltech.com/4.5/itemviews-stardelegate.html * - ***************************************************************************/ +#include "library/stareditor.h" #include -#include "library/stareditor.h" #include "library/starrating.h" +#include "moc_stareditor.cpp" #include "util/painterscope.h" -/* - * We enable mouse tracking on the widget so we can follow the cursor even - * when the user doesn't hold down any mouse button. We also turn on - * QWidget's auto-fill background feature to obtain an opaque background. - * (Without the call, the view's background would shine through the editor.) - */ +// We enable mouse tracking on the widget so we can follow the cursor even +// when the user doesn't hold down any mouse button. We also turn on +// QWidget's auto-fill background feature to obtain an opaque background. +// (Without the call, the view's background would shine through the editor.) + +/// StarEditor inherits QWidget and is used by StarDelegate to let the user +/// edit a star rating in the library using the mouse. +/// +/// The class has been adapted from the official "Star Delegate Example", +/// see http://doc.trolltech.com/4.5/itemviews-stardelegate.html StarEditor::StarEditor(QWidget *parent, QTableView* pTableView, const QModelIndex& index, const QStyleOptionViewItem& option) diff --git a/src/library/stareditor.h b/src/library/stareditor.h index 7dd75fb67bb..6393473830c 100644 --- a/src/library/stareditor.h +++ b/src/library/stareditor.h @@ -1,31 +1,4 @@ -/*************************************************************************** - stareditor.h - ------------------- - copyright : (C) 2010 Tobias Rafreider - copyright : (C) 2009 Nokia Corporation - -***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -/*************************************************************************** - * * - * StarEditor inherits QWidget and is used by StarDelegate to let the user * - * edit a star rating in the library using the mouse. * - * * - * The class has been adapted from the official "Star Delegate Example", * - * see http://doc.trolltech.com/4.5/itemviews-stardelegate.html * - ***************************************************************************/ - -#ifndef STAREDITOR_H -#define STAREDITOR_H +#pragma once #include #include @@ -74,5 +47,3 @@ class StarEditor : public QWidget { QStyleOptionViewItem m_styleOption; StarRating m_starRating; }; - -#endif diff --git a/src/library/starrating.cpp b/src/library/starrating.cpp index a64941482a6..c062b28b70a 100644 --- a/src/library/starrating.cpp +++ b/src/library/starrating.cpp @@ -8,9 +8,13 @@ // Magic number? Explain what this factor affects and how const int PaintingScaleFactor = 15; -StarRating::StarRating(int starCount, int maxStarCount) - : m_myStarCount(starCount), - m_myMaxStarCount(maxStarCount) { +StarRating::StarRating( + int starCount, + int maxStarCount) + : m_starCount(starCount), + m_maxStarCount(maxStarCount) { + DEBUG_ASSERT(m_starCount >= kMinStarCount); + DEBUG_ASSERT(m_starCount <= m_maxStarCount); // 1st star cusp at 0° of the unit circle whose center is shifted to adapt the 0,0-based paint area m_starPolygon << QPointF(1.0, 0.5); for (int i = 1; i < 5; ++i) { @@ -26,7 +30,7 @@ StarRating::StarRating(int starCount, int maxStarCount) } QSize StarRating::sizeHint() const { - return PaintingScaleFactor * QSize(m_myMaxStarCount, 1); + return PaintingScaleFactor * QSize(m_maxStarCount, 1); } void StarRating::paint(QPainter *painter, const QRect &rect) const { @@ -41,8 +45,8 @@ void StarRating::paint(QPainter *painter, const QRect &rect) const { //determine number of stars that are possible to paint int n = rect.width() / PaintingScaleFactor; - for (int i = 0; i < m_myMaxStarCount && idrawPolygon(m_starPolygon, Qt::WindingFill); } else { painter->drawPolygon(m_diamondPolygon, Qt::WindingFill); diff --git a/src/library/starrating.h b/src/library/starrating.h index df21447758f..2a7d1319450 100644 --- a/src/library/starrating.h +++ b/src/library/starrating.h @@ -4,6 +4,8 @@ #include #include +#include "track/trackrecord.h" + QT_FORWARD_DECLARE_CLASS(QPainter); QT_FORWARD_DECLARE_CLASS(QRect); @@ -18,21 +20,32 @@ class StarRating { public: enum EditMode { Editable, ReadOnly }; - StarRating(int starCount = 1, int maxStarCount = 5); + static constexpr int kMinStarCount = 0; + + explicit StarRating( + int starCount = kMinStarCount, + int maxStarCount = mixxx::TrackRecord::kMaxRating - mixxx::TrackRecord::kMinRating); void paint(QPainter* painter, const QRect& rect) const; QSize sizeHint() const; - int starCount() const { return m_myStarCount; } - int maxStarCount() const { return m_myMaxStarCount; } - void setStarCount(int starCount) { m_myStarCount = starCount; } - void setMaxStarCount(int maxStarCount) { m_myMaxStarCount = maxStarCount; } + int starCount() const { + return m_starCount; + } + int maxStarCount() const { + return m_maxStarCount; + } + void setStarCount(int starCount) { + DEBUG_ASSERT(starCount >= kMinStarCount); + DEBUG_ASSERT(starCount <= m_maxStarCount); + m_starCount = starCount; + } private: QPolygonF m_starPolygon; QPolygonF m_diamondPolygon; - int m_myStarCount; - int m_myMaxStarCount; + int m_starCount; + int m_maxStarCount; }; Q_DECLARE_METATYPE(StarRating) diff --git a/src/library/tableitemdelegate.cpp b/src/library/tableitemdelegate.cpp index 191fc4fec9b..48f8d70f258 100644 --- a/src/library/tableitemdelegate.cpp +++ b/src/library/tableitemdelegate.cpp @@ -3,6 +3,7 @@ #include #include +#include "moc_tableitemdelegate.cpp" #include "util/painterscope.h" #include "widget/wtracktableview.h" diff --git a/src/library/trackcollection.cpp b/src/library/trackcollection.cpp index 18cf5c2d0d8..d1e7f163541 100644 --- a/src/library/trackcollection.cpp +++ b/src/library/trackcollection.cpp @@ -1,8 +1,9 @@ -#include - #include "library/trackcollection.h" +#include + #include "library/basetrackcache.h" +#include "moc_trackcollection.cpp" #include "track/globaltrackcache.h" #include "util/assert.h" #include "util/db/sqltransaction.h" diff --git a/src/library/trackcollectionmanager.cpp b/src/library/trackcollectionmanager.cpp index ead9ab786ae..5b5d593a18f 100644 --- a/src/library/trackcollectionmanager.cpp +++ b/src/library/trackcollectionmanager.cpp @@ -3,6 +3,7 @@ #include "library/externaltrackcollection.h" #include "library/scanner/libraryscanner.h" #include "library/trackcollection.h" +#include "moc_trackcollectionmanager.cpp" #include "sources/soundsourceproxy.h" #include "track/track.h" #include "util/assert.h" diff --git a/src/library/trackloader.cpp b/src/library/trackloader.cpp index 65f8c88afc0..c399f3fa160 100644 --- a/src/library/trackloader.cpp +++ b/src/library/trackloader.cpp @@ -2,13 +2,12 @@ #include #include - #include #include "library/trackcollectionmanager.h" +#include "moc_trackloader.cpp" #include "util/logger.h" - namespace mixxx { namespace { diff --git a/src/library/trackprocessing.cpp b/src/library/trackprocessing.cpp index 6f5c0103aee..f5d8abd4f71 100644 --- a/src/library/trackprocessing.cpp +++ b/src/library/trackprocessing.cpp @@ -4,6 +4,7 @@ #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" +#include "moc_trackprocessing.cpp" #include "util/logger.h" namespace mixxx { diff --git a/src/library/trackset/baseplaylistfeature.cpp b/src/library/trackset/baseplaylistfeature.cpp index dddb0e29184..92a4a5cf0b8 100644 --- a/src/library/trackset/baseplaylistfeature.cpp +++ b/src/library/trackset/baseplaylistfeature.cpp @@ -16,11 +16,18 @@ #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "library/treeitem.h" +#include "library/treeitemmodel.h" +#include "moc_baseplaylistfeature.cpp" #include "track/track.h" #include "util/assert.h" #include "widget/wlibrary.h" +#include "widget/wlibrarysidebar.h" #include "widget/wlibrarytextbrowser.h" +namespace { +constexpr QChar kUnsafeFilenameReplacement = '-'; +} + BasePlaylistFeature::BasePlaylistFeature( Library* pLibrary, UserSettingsPointer pConfig, @@ -108,11 +115,11 @@ void BasePlaylistFeature::initActions() { connect(&m_playlistDao, &PlaylistDAO::added, this, - &BasePlaylistFeature::slotPlaylistTableChanged); + &BasePlaylistFeature::slotPlaylistTableChangedAndSelect); connect(&m_playlistDao, &PlaylistDAO::lockChanged, this, - &BasePlaylistFeature::slotPlaylistTableChanged); + &BasePlaylistFeature::slotPlaylistTableChangedAndScrollTo); connect(&m_playlistDao, &PlaylistDAO::deleted, this, @@ -139,7 +146,7 @@ void BasePlaylistFeature::initActions() { int BasePlaylistFeature::playlistIdFromIndex(const QModelIndex& index) { TreeItem* item = static_cast(index.internalPointer()); if (item == nullptr) { - return -1; + return kInvalidPlaylistId; } bool ok = false; @@ -147,36 +154,67 @@ int BasePlaylistFeature::playlistIdFromIndex(const QModelIndex& index) { if (ok) { return playlistId; } else { - return -1; + return kInvalidPlaylistId; + } +} + +void BasePlaylistFeature::selectPlaylistInSidebar(int playlistId, bool select) { + if (!m_pSidebarWidget) { + return; + } + if (playlistId == kInvalidPlaylistId) { + return; + } + QModelIndex index = indexFromPlaylistId(playlistId); + if (index.isValid() && m_pSidebarWidget) { + m_pSidebarWidget->selectChildIndex(index, select); } } void BasePlaylistFeature::activateChild(const QModelIndex& index) { //qDebug() << "BasePlaylistFeature::activateChild()" << index; int playlistId = playlistIdFromIndex(index); - if (playlistId != -1) { - m_pPlaylistTableModel->setTableModel(playlistId); - emit showTrackModel(m_pPlaylistTableModel); - emit enableCoverArtDisplay(true); + if (playlistId == kInvalidPlaylistId) { + return; } + + m_pPlaylistTableModel->setTableModel(playlistId); + emit showTrackModel(m_pPlaylistTableModel); + emit enableCoverArtDisplay(true); + // Update selection + emit featureSelect(this, m_lastRightClickedIndex); + + if (!m_pSidebarWidget) { + return; + } + m_pSidebarWidget->selectChildIndex(index); } void BasePlaylistFeature::activatePlaylist(int playlistId) { - //qDebug() << "BasePlaylistFeature::activatePlaylist()" << playlistId; + // qDebug() << "BasePlaylistFeature::activatePlaylist()" << playlistId; + if (playlistId == kInvalidPlaylistId) { + return; + } QModelIndex index = indexFromPlaylistId(playlistId); - if (playlistId != -1 && index.isValid()) { - m_pPlaylistTableModel->setTableModel(playlistId); - emit showTrackModel(m_pPlaylistTableModel); - emit enableCoverArtDisplay(true); - // Update selection - emit featureSelect(this, m_lastRightClickedIndex); - activateChild(m_lastRightClickedIndex); + if (!index.isValid()) { + return; + } + + m_lastRightClickedIndex = index; + m_pPlaylistTableModel->setTableModel(playlistId); + emit showTrackModel(m_pPlaylistTableModel); + emit enableCoverArtDisplay(true); + // Update selection + emit featureSelect(this, m_lastRightClickedIndex); + if (!m_pSidebarWidget) { + return; } + m_pSidebarWidget->selectChildIndex(m_lastRightClickedIndex); } void BasePlaylistFeature::slotRenamePlaylist() { int playlistId = playlistIdFromIndex(m_lastRightClickedIndex); - if (playlistId == -1) { + if (playlistId == kInvalidPlaylistId) { return; } QString oldName = m_playlistDao.getPlaylistName(playlistId); @@ -205,7 +243,7 @@ void BasePlaylistFeature::slotRenamePlaylist() { int existingId = m_playlistDao.getPlaylistIdFromName(newName); - if (existingId != -1) { + if (existingId != kInvalidPlaylistId) { QMessageBox::warning(NULL, tr("Renaming Playlist Failed"), tr("A playlist by that name already exists.")); @@ -223,7 +261,7 @@ void BasePlaylistFeature::slotRenamePlaylist() { void BasePlaylistFeature::slotDuplicatePlaylist() { int oldPlaylistId = playlistIdFromIndex(m_lastRightClickedIndex); - if (oldPlaylistId == -1) { + if (oldPlaylistId == kInvalidPlaylistId) { return; } @@ -248,7 +286,7 @@ void BasePlaylistFeature::slotDuplicatePlaylist() { int existingId = m_playlistDao.getPlaylistIdFromName(name); - if (existingId != -1) { + if (existingId != kInvalidPlaylistId) { QMessageBox::warning(NULL, tr("Playlist Creation Failed"), tr("A playlist by that name already exists.")); @@ -263,7 +301,7 @@ void BasePlaylistFeature::slotDuplicatePlaylist() { int newPlaylistId = m_playlistDao.createPlaylist(name); - if (newPlaylistId != -1 && + if (newPlaylistId != kInvalidPlaylistId && m_playlistDao.copyPlaylistTracks(oldPlaylistId, newPlaylistId)) { activatePlaylist(newPlaylistId); } @@ -271,7 +309,7 @@ void BasePlaylistFeature::slotDuplicatePlaylist() { void BasePlaylistFeature::slotTogglePlaylistLock() { int playlistId = playlistIdFromIndex(m_lastRightClickedIndex); - if (playlistId == -1) { + if (playlistId == kInvalidPlaylistId) { return; } bool locked = !m_playlistDao.isPlaylistLocked(playlistId); @@ -299,7 +337,7 @@ void BasePlaylistFeature::slotCreatePlaylist() { int existingId = m_playlistDao.getPlaylistIdFromName(name); - if (existingId != -1) { + if (existingId != kInvalidPlaylistId) { QMessageBox::warning(NULL, tr("Playlist Creation Failed"), tr("A playlist by that name already exists.")); @@ -314,7 +352,7 @@ void BasePlaylistFeature::slotCreatePlaylist() { int playlistId = m_playlistDao.createPlaylist(name); - if (playlistId != -1) { + if (playlistId != kInvalidPlaylistId) { activatePlaylist(playlistId); } else { QMessageBox::warning(NULL, @@ -323,10 +361,37 @@ void BasePlaylistFeature::slotCreatePlaylist() { } } +/// Returns a playlist that is a sibling inside the same parent +/// as the start index +int BasePlaylistFeature::getSiblingPlaylistIdOf(QModelIndex& start) { + for (int i = start.row() + 1; i >= (start.row() - 1); i -= 2) { + QModelIndex nextIndex = start.sibling(i, start.column()); + if (nextIndex.isValid()) { + TreeItem* pTreeItem = m_childModel.getItem(nextIndex); + DEBUG_ASSERT(pTreeItem != nullptr); + if (!pTreeItem->hasChildren()) { + return playlistIdFromIndex(nextIndex); + } + } + } + return kInvalidPlaylistId; +} + void BasePlaylistFeature::slotDeletePlaylist() { //qDebug() << "slotDeletePlaylist() row:" << m_lastRightClickedIndex.data(); + if (!m_lastRightClickedIndex.isValid()) { + return; + } + int playlistId = playlistIdFromIndex(m_lastRightClickedIndex); - if (playlistId == -1) { + if (playlistId == kInvalidPlaylistId) { + return; + } + + // we will switch to the sibling if the deleted playlist is currently active + bool wasActive = m_pPlaylistTableModel->getPlaylist() == playlistId; + + VERIFY_OR_DEBUG_ASSERT(playlistId >= 0) { return; } @@ -336,13 +401,17 @@ void BasePlaylistFeature::slotDeletePlaylist() { return; } - if (m_lastRightClickedIndex.isValid()) { - VERIFY_OR_DEBUG_ASSERT(playlistId >= 0) { - return; - } + int siblingId = getSiblingPlaylistIdOf(m_lastRightClickedIndex); - m_playlistDao.deletePlaylist(playlistId); - activate(); + m_playlistDao.deletePlaylist(playlistId); + + if (siblingId == kInvalidPlaylistId) { + return; + } + if (wasActive) { + activatePlaylist(siblingId); + } else if (m_pSidebarWidget) { + m_pSidebarWidget->selectChildIndex(indexFromPlaylistId(siblingId), false); } } @@ -403,7 +472,7 @@ void BasePlaylistFeature::slotCreateImportPlaylist() { m_pConfig->set(ConfigKey("[Library]", "LastImportExportPlaylistDirectory"), ConfigValue(fileName.dir().absolutePath())); - int lastPlaylistId = -1; + int lastPlaylistId = kInvalidPlaylistId; // For each selected element create a different playlist. for (const QString& playlistFile : playlist_files) { @@ -424,12 +493,12 @@ void BasePlaylistFeature::slotCreateImportPlaylist() { // Check name int existingId = m_playlistDao.getPlaylistIdFromName(name); - validNameGiven = (existingId == -1); + validNameGiven = (existingId == kInvalidPlaylistId); ++i; } lastPlaylistId = m_playlistDao.createPlaylist(name); - if (lastPlaylistId != -1) { + if (lastPlaylistId != kInvalidPlaylistId) { m_pPlaylistTableModel->setTableModel(lastPlaylistId); } else { QMessageBox::warning(NULL, @@ -445,10 +514,12 @@ void BasePlaylistFeature::slotCreateImportPlaylist() { void BasePlaylistFeature::slotExportPlaylist() { int playlistId = playlistIdFromIndex(m_lastRightClickedIndex); - if (playlistId == -1) { + if (playlistId == kInvalidPlaylistId) { return; } QString playlistName = m_playlistDao.getPlaylistName(playlistId); + // replace separator character with something generic + playlistName = playlistName.replace(QDir::separator(), kUnsafeFilenameReplacement); qDebug() << "Export playlist" << playlistName; QString lastPlaylistDirectory = m_pConfig->getValue( @@ -599,6 +670,12 @@ void BasePlaylistFeature::bindLibraryWidget(WLibrary* libraryWidget, libraryWidget->registerView(m_rootViewName, edit); } +void BasePlaylistFeature::bindSidebarWidget(WLibrarySidebar* pSidebarWidget) { + // store the sidebar widget pointer for later use in onRightClickChild + DEBUG_ASSERT(!m_pSidebarWidget); + m_pSidebarWidget = pSidebarWidget; +} + void BasePlaylistFeature::htmlLinkClicked(const QUrl& link) { if (QString(link.path()) == "create") { slotCreatePlaylist(); @@ -607,44 +684,6 @@ void BasePlaylistFeature::htmlLinkClicked(const QUrl& link) { } } -/** - * Purpose: When inserting or removing playlists, - * we require the sidebar model not to reset. - * This method queries the database and does dynamic insertion -*/ -QModelIndex BasePlaylistFeature::constructChildModel(int selected_id) { - QList data_list; - int selected_row = -1; - - int row = 0; - const QList playlistLabels = createPlaylistLabels(); - for (const auto& idAndLabel : playlistLabels) { - int playlistId = idAndLabel.id; - QString playlistLabel = idAndLabel.label; - - if (selected_id == playlistId) { - // save index for selection - selected_row = row; - } - - // Create the TreeItem whose parent is the invisible root item - TreeItem* item = new TreeItem(playlistLabel, playlistId); - item->setBold(m_playlistsSelectedTrackIsIn.contains(playlistId)); - - decorateChild(item, playlistId); - data_list.append(item); - - ++row; - } - - // Append all the newly created TreeItems in a dynamic way to the childmodel - m_childModel.insertTreeItemRows(data_list, 0); - if (selected_row == -1) { - return QModelIndex(); - } - return m_childModel.index(selected_row, 0); -} - void BasePlaylistFeature::updateChildModel(int playlistId) { QString playlistLabel = fetchPlaylistLabel(playlistId); @@ -671,14 +710,14 @@ void BasePlaylistFeature::clearChildModel() { QModelIndex BasePlaylistFeature::indexFromPlaylistId(int playlistId) { QVariant variantId = QVariant(playlistId); - for (int row = 0; row < m_childModel.rowCount(); ++row) { - QModelIndex index = m_childModel.index(row, 0); - TreeItem* pTreeItem = m_childModel.getItem(index); - DEBUG_ASSERT(pTreeItem != nullptr); - if (!pTreeItem->hasChildren() && // leaf node - pTreeItem->getData() == variantId) { - return index; - } + QModelIndexList results = m_childModel.match( + m_childModel.getRootIndex(), + TreeItemModel::kDataRole, + variantId, + 1, + Qt::MatchWrap | Qt::MatchExactly | Qt::MatchRecursive); + if (!results.isEmpty()) { + return results.front(); } return QModelIndex(); } @@ -689,26 +728,39 @@ void BasePlaylistFeature::slotTrackSelected(TrackPointer pTrack) { if (pTrack) { trackId = pTrack->getId(); } - m_playlistDao.getPlaylistsTrackIsIn(trackId, &m_playlistsSelectedTrackIsIn); + m_playlistDao.getPlaylistsTrackIsIn(trackId, &m_playlistIdsOfSelectedTrack); - // Set all playlists the track is in bold (or if there is no track selected, - // clear all the bolding). for (int row = 0; row < m_childModel.rowCount(); ++row) { QModelIndex index = m_childModel.index(row, 0); TreeItem* pTreeItem = m_childModel.getItem(index); DEBUG_ASSERT(pTreeItem != nullptr); - if (!pTreeItem->hasChildren()) { // leaf node - bool ok; - int playlistId = pTreeItem->getData().toInt(&ok); - VERIFY_OR_DEBUG_ASSERT(ok) { - continue; + markTreeItem(pTreeItem); + } + + m_childModel.triggerRepaint(); +} + +void BasePlaylistFeature::markTreeItem(TreeItem* pTreeItem) { + bool ok; + int playlistId = pTreeItem->getData().toInt(&ok); + if (ok) { + bool shouldBold = m_playlistIdsOfSelectedTrack.contains(playlistId); + pTreeItem->setBold(shouldBold); + if (shouldBold && pTreeItem->hasParent()) { + TreeItem* item = pTreeItem; + // extra parents, because -Werror=parentheses + while ((item = item->parent())) { + item->setBold(true); } - bool shouldBold = m_playlistsSelectedTrackIsIn.contains(playlistId); - pTreeItem->setBold(shouldBold); } } + if (pTreeItem->hasChildren()) { + QList children = pTreeItem->children(); - m_childModel.triggerRepaint(); + for (int i = 0; i < children.size(); i++) { + markTreeItem(children.at(i)); + } + } } void BasePlaylistFeature::slotResetSelectedTrack() { diff --git a/src/library/trackset/baseplaylistfeature.h b/src/library/trackset/baseplaylistfeature.h index f2ee571d522..60b18cb9a33 100644 --- a/src/library/trackset/baseplaylistfeature.h +++ b/src/library/trackset/baseplaylistfeature.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -18,6 +19,9 @@ class KeyboardEventFilter; class PlaylistTableModel; class TrackCollectionManager; class TreeItem; +class WLibrarySidebar; + +constexpr int kInvalidPlaylistId = -1; class BasePlaylistFeature : public BaseTrackSetFeature { Q_OBJECT @@ -33,6 +37,9 @@ class BasePlaylistFeature : public BaseTrackSetFeature { void bindLibraryWidget(WLibrary* libraryWidget, KeyboardEventFilter* keyboard) override; + void bindSidebarWidget(WLibrarySidebar* pSidebarWidget) override; + void selectPlaylistInSidebar(int playlistId, bool select = true); + int getSiblingPlaylistIdOf(QModelIndex& start); public slots: void activateChild(const QModelIndex& index) override; @@ -40,6 +47,14 @@ class BasePlaylistFeature : public BaseTrackSetFeature { virtual void htmlLinkClicked(const QUrl& link); virtual void slotPlaylistTableChanged(int playlistId) = 0; + void slotPlaylistTableChangedAndSelect(int playlistId) { + slotPlaylistTableChanged(playlistId); + selectPlaylistInSidebar(playlistId); + }; + void slotPlaylistTableChangedAndScrollTo(int playlistId) { + slotPlaylistTableChanged(playlistId); + selectPlaylistInSidebar(playlistId, false); + }; virtual void slotPlaylistTableRenamed(int playlistId, const QString& newName) = 0; virtual void slotPlaylistContentChanged(QSet playlistIds) = 0; void slotCreatePlaylist(); @@ -66,10 +81,8 @@ class BasePlaylistFeature : public BaseTrackSetFeature { QString label; }; - virtual QModelIndex constructChildModel(int selected_id); virtual void updateChildModel(int selected_id); virtual void clearChildModel(); - virtual QList createPlaylistLabels() = 0; virtual QString fetchPlaylistLabel(int playlistId) = 0; virtual void decorateChild(TreeItem* pChild, int playlistId) = 0; virtual void addToAutoDJ(PlaylistDAO::AutoDJSendLoc loc); @@ -81,6 +94,7 @@ class BasePlaylistFeature : public BaseTrackSetFeature { PlaylistDAO& m_playlistDao; QModelIndex m_lastRightClickedIndex; + QPointer m_pSidebarWidget; QAction* m_pCreatePlaylistAction; QAction* m_pDeletePlaylistAction; @@ -97,6 +111,7 @@ class BasePlaylistFeature : public BaseTrackSetFeature { QAction* m_pAnalyzePlaylistAction; PlaylistTableModel* m_pPlaylistTableModel; + QSet m_playlistIdsOfSelectedTrack; private slots: void slotTrackSelected(TrackPointer pTrack); @@ -105,8 +120,7 @@ class BasePlaylistFeature : public BaseTrackSetFeature { private: void initActions(); virtual QString getRootViewHtml() const = 0; + void markTreeItem(TreeItem* pTreeItem); TrackPointer m_pSelectedTrack; - - QSet m_playlistsSelectedTrackIsIn; }; diff --git a/src/library/trackset/basetracksetfeature.cpp b/src/library/trackset/basetracksetfeature.cpp index 4ef8abfd71c..35d7d407351 100644 --- a/src/library/trackset/basetracksetfeature.cpp +++ b/src/library/trackset/basetracksetfeature.cpp @@ -1,5 +1,7 @@ #include "library/trackset/basetracksetfeature.h" +#include "moc_basetracksetfeature.cpp" + BaseTrackSetFeature::BaseTrackSetFeature( Library* pLibrary, UserSettingsPointer pConfig, diff --git a/src/library/trackset/crate/cratefeature.cpp b/src/library/trackset/crate/cratefeature.cpp index d45ae2d32be..b42d0a26131 100644 --- a/src/library/trackset/crate/cratefeature.cpp +++ b/src/library/trackset/crate/cratefeature.cpp @@ -18,6 +18,7 @@ #include "library/trackcollectionmanager.h" #include "library/trackset/crate/cratefeaturehelper.h" #include "library/treeitem.h" +#include "moc_cratefeature.cpp" #include "sources/soundsourceproxy.h" #include "track/track.h" #include "util/dnd.h" diff --git a/src/library/trackset/crate/cratefeaturehelper.cpp b/src/library/trackset/crate/cratefeaturehelper.cpp index 47e1f9a3771..a92ea6727dc 100644 --- a/src/library/trackset/crate/cratefeaturehelper.cpp +++ b/src/library/trackset/crate/cratefeaturehelper.cpp @@ -4,6 +4,7 @@ #include #include "library/trackcollection.h" +#include "moc_cratefeaturehelper.cpp" CrateFeatureHelper::CrateFeatureHelper( TrackCollection* pTrackCollection, diff --git a/src/library/trackset/crate/cratetablemodel.cpp b/src/library/trackset/crate/cratetablemodel.cpp index 140e1f05008..34586a133de 100644 --- a/src/library/trackset/crate/cratetablemodel.cpp +++ b/src/library/trackset/crate/cratetablemodel.cpp @@ -6,6 +6,7 @@ #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "mixer/playermanager.h" +#include "moc_cratetablemodel.cpp" #include "track/track.h" #include "util/db/fwdsqlquery.h" diff --git a/src/library/trackset/playlistfeature.cpp b/src/library/trackset/playlistfeature.cpp index 72770d49039..6f07ce493e5 100644 --- a/src/library/trackset/playlistfeature.cpp +++ b/src/library/trackset/playlistfeature.cpp @@ -12,6 +12,7 @@ #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "library/treeitem.h" +#include "moc_playlistfeature.cpp" #include "sources/soundsourceproxy.h" #include "util/db/dbconnection.h" #include "util/dnd.h" @@ -46,7 +47,7 @@ PlaylistFeature::PlaylistFeature(Library* pLibrary, UserSettingsPointer pConfig) // construct child model std::unique_ptr pRootItem = TreeItem::newRoot(this); m_childModel.setRootItem(std::move(pRootItem)); - constructChildModel(-1); + constructChildModel(kInvalidPlaylistId); } QVariant PlaylistFeature::title() { @@ -57,11 +58,6 @@ QIcon PlaylistFeature::getIcon() { return m_icon; } -void PlaylistFeature::bindSidebarWidget(WLibrarySidebar* pSidebarWidget) { - // store the sidebar widget pointer for later use in onRightClickChild - m_pSidebarWidget = pSidebarWidget; -} - void PlaylistFeature::onRightClick(const QPoint& globalPos) { m_lastRightClickedIndex = QModelIndex(); QMenu menu(m_pSidebarWidget); @@ -236,6 +232,43 @@ QString PlaylistFeature::fetchPlaylistLabel(int playlistId) { return QString(); } +/// Purpose: When inserting or removing playlists, +/// we require the sidebar model not to reset. +/// This method queries the database and does dynamic insertion +/// @param selectedId entry which should be selected +QModelIndex PlaylistFeature::constructChildModel(int selectedId) { + QList data_list; + int selectedRow = -1; + + int row = 0; + const QList playlistLabels = createPlaylistLabels(); + for (const auto& idAndLabel : playlistLabels) { + int playlistId = idAndLabel.id; + QString playlistLabel = idAndLabel.label; + + if (selectedId == playlistId) { + // save index for selection + selectedRow = row; + } + + // Create the TreeItem whose parent is the invisible root item + TreeItem* item = new TreeItem(playlistLabel, playlistId); + item->setBold(m_playlistIdsOfSelectedTrack.contains(playlistId)); + + decorateChild(item, playlistId); + data_list.append(item); + + ++row; + } + + // Append all the newly created TreeItems in a dynamic way to the childmodel + m_childModel.insertTreeItemRows(data_list, 0); + if (selectedRow == -1) { + return QModelIndex(); + } + return m_childModel.index(selectedRow, 0); +} + void PlaylistFeature::decorateChild(TreeItem* item, int playlistId) { if (m_playlistDao.isPlaylistLocked(playlistId)) { item->setIcon( diff --git a/src/library/trackset/playlistfeature.h b/src/library/trackset/playlistfeature.h index 86bb000d5c5..2fe64869d8c 100644 --- a/src/library/trackset/playlistfeature.h +++ b/src/library/trackset/playlistfeature.h @@ -27,8 +27,6 @@ class PlaylistFeature : public BasePlaylistFeature { QVariant title() override; QIcon getIcon() override; - void bindSidebarWidget(WLibrarySidebar* pSidebarWidget) override; - bool dropAcceptChild(const QModelIndex& index, const QList& urls, QObject* pSource) override; @@ -44,12 +42,12 @@ class PlaylistFeature : public BasePlaylistFeature { void slotPlaylistTableRenamed(int playlistId, const QString& newName) override; protected: - QList createPlaylistLabels() override; QString fetchPlaylistLabel(int playlistId) override; - void decorateChild(TreeItem* pChild, int playlist_id) override; + void decorateChild(TreeItem* pChild, int playlistId) override; + QList createPlaylistLabels(); + QModelIndex constructChildModel(int selectedId); private: QString getRootViewHtml() const override; const QIcon m_icon; - QPointer m_pSidebarWidget; }; diff --git a/src/library/trackset/setlogfeature.cpp b/src/library/trackset/setlogfeature.cpp index c658be13d44..da4fb1896da 100644 --- a/src/library/trackset/setlogfeature.cpp +++ b/src/library/trackset/setlogfeature.cpp @@ -7,17 +7,23 @@ #include "control/controlobject.h" #include "library/library.h" #include "library/playlisttablemodel.h" +#include "library/queryutil.h" #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "library/treeitem.h" #include "mixer/playerinfo.h" #include "mixer/playermanager.h" +#include "moc_setlogfeature.cpp" #include "track/track.h" #include "util/compatibility.h" #include "widget/wlibrary.h" #include "widget/wlibrarysidebar.h" #include "widget/wtracktableview.h" +namespace { +constexpr int kNumToplevelHistoryEntries = 5; +} + SetlogFeature::SetlogFeature( Library* pLibrary, UserSettingsPointer pConfig) @@ -30,21 +36,26 @@ SetlogFeature::SetlogFeature( "mixxx.db.model.setlog", /*keep deleted tracks*/ true), QStringLiteral("SETLOGHOME")), - m_playlistId(-1), + m_playlistId(kInvalidPlaylistId), m_libraryWidget(nullptr), m_icon(QStringLiteral(":/images/library/ic_library_history.svg")) { + // clear old empty entries + ScopedTransaction transaction(pLibrary->trackCollections()->internalCollection()->database()); + m_playlistDao.deleteAllPlaylistsWithFewerTracks(PlaylistDAO::HiddenType::PLHT_SET_LOG, 1); + transaction.commit(); + //construct child model m_childModel.setRootItem(TreeItem::newRoot(this)); - constructChildModel(-1); + constructChildModel(kInvalidPlaylistId); - m_pJoinWithPreviousAction = new QAction(tr("Join with previous"), this); + m_pJoinWithPreviousAction = new QAction(tr("Join with previous (below)"), this); connect(m_pJoinWithPreviousAction, &QAction::triggered, this, &SetlogFeature::slotJoinWithPrevious); - m_pGetNewPlaylist = new QAction(tr("Create new history playlist"), this); - connect(m_pGetNewPlaylist, + m_pStartNewPlaylist = new QAction(tr("Finish current and start new"), this); + connect(m_pStartNewPlaylist, &QAction::triggered, this, &SetlogFeature::slotGetNewPlaylist); @@ -57,7 +68,7 @@ SetlogFeature::~SetlogFeature() { // If the history playlist we created doesn't have any tracks in it then // delete it so we don't end up with tons of empty playlists. This is mostly // for developers since they regularly open Mixxx without loading a track. - if (m_playlistId != -1 && + if (m_playlistId != kInvalidPlaylistId && m_playlistDao.tracksInPlaylist(m_playlistId) == 0) { m_playlistDao.deletePlaylist(m_playlistId); } @@ -81,11 +92,6 @@ void SetlogFeature::bindLibraryWidget( m_libraryWidget = libraryWidget; } -void SetlogFeature::bindSidebarWidget(WLibrarySidebar* pSidebarWidget) { - // store the sidebar widget pointer for later use in onRightClickChild - m_pSidebarWidget = pSidebarWidget; -} - void SetlogFeature::onRightClick(const QPoint& globalPos) { Q_UNUSED(globalPos); m_lastRightClickedIndex = QModelIndex(); @@ -101,8 +107,11 @@ void SetlogFeature::onRightClickChild(const QPoint& globalPos, const QModelIndex //Save the model index so we can get it in the action slots... m_lastRightClickedIndex = index; - QString playlistName = index.data().toString(); - int playlistId = m_playlistDao.getPlaylistIdFromName(playlistName); + int playlistId = index.data(TreeItemModel::kDataRole).toInt(); + // not a real entry + if (playlistId == kInvalidPlaylistId) { + return; + } bool locked = m_playlistDao.isPlaylistLocked(playlistId); m_pDeletePlaylistAction->setEnabled(!locked); @@ -123,28 +132,33 @@ void SetlogFeature::onRightClickChild(const QPoint& globalPos, const QModelIndex menu.addAction(m_pDeletePlaylistAction); menu.addAction(m_pLockPlaylistAction); } - if (index.row() > 0) { + if (index.sibling(index.row() + 1, index.column()).isValid()) { // The very first setlog cannot be joint menu.addAction(m_pJoinWithPreviousAction); } - if (playlistId == m_playlistId && m_playlistDao.tracksInPlaylist(m_playlistId) != 0) { + if (playlistId == m_playlistId) { // Todays playlists can change ! - menu.addAction(m_pGetNewPlaylist); + m_pStartNewPlaylist->setEnabled(m_playlistDao.tracksInPlaylist(m_playlistId) > 0); + menu.addAction(m_pStartNewPlaylist); } menu.addSeparator(); menu.addAction(m_pExportPlaylistAction); menu.exec(globalPos); } -QList SetlogFeature::createPlaylistLabels() { - QList playlistLabels; +/// Purpose: When inserting or removing playlists, +/// we require the sidebar model not to reset. +/// This method queries the database and does dynamic insertion +/// Use a custom model in the history for grouping by year +/// @param selectedId row which should be selected +QModelIndex SetlogFeature::constructChildModel(int selectedId) { // Setup the sidebar playlist model QSqlTableModel playlistTableModel(this, m_pLibrary->trackCollections()->internalCollection()->database()); playlistTableModel.setTable("Playlists"); playlistTableModel.setFilter("hidden=2"); // PLHT_SET_LOG playlistTableModel.setSort( - playlistTableModel.fieldIndex("id"), Qt::AscendingOrder); + playlistTableModel.fieldIndex("id"), Qt::DescendingOrder); playlistTableModel.select(); while (playlistTableModel.canFetchMore()) { playlistTableModel.fetchMore(); @@ -152,6 +166,13 @@ QList SetlogFeature::createPlaylistLabels() { QSqlRecord record = playlistTableModel.record(); int nameColumn = record.indexOf("name"); int idColumn = record.indexOf("id"); + int createdColumn = record.indexOf("date_created"); + + QMap groups; + + QList itemList; + // Generous estimate (number of years the db is used ;)) + itemList.reserve(kNumToplevelHistoryEntries + 15); for (int row = 0; row < playlistTableModel.rowCount(); ++row) { int id = @@ -162,12 +183,48 @@ QList SetlogFeature::createPlaylistLabels() { playlistTableModel .data(playlistTableModel.index(row, nameColumn)) .toString(); - BasePlaylistFeature::IdAndLabel idAndLabel; - idAndLabel.id = id; - idAndLabel.label = name; - playlistLabels.append(idAndLabel); + QDateTime dateCreated = + playlistTableModel + .data(playlistTableModel.index(row, createdColumn)) + .toDateTime(); + + // Create the TreeItem whose parent is the invisible root item + if (row >= kNumToplevelHistoryEntries) { + int yearCreated = dateCreated.date().year(); + + auto i = groups.find(yearCreated); + TreeItem* groupItem; + if (i != groups.end() && i.key() == yearCreated) { + groupItem = i.value(); + } else { + groupItem = new TreeItem(QString::number(yearCreated), kInvalidPlaylistId); + groups.insert(yearCreated, groupItem); + itemList.append(groupItem); + } + + auto item = std::make_unique(name, id); + item->setBold(m_playlistIdsOfSelectedTrack.contains(id)); + + decorateChild(item.get(), id); + + groupItem->appendChild(std::move(item)); + } else { + TreeItem* item = new TreeItem(name, id); + item->setBold(m_playlistIdsOfSelectedTrack.contains(id)); + + decorateChild(item, id); + + itemList.append(item); + } } - return playlistLabels; + + // Append all the newly created TreeItems in a dynamic way to the childmodel + m_childModel.insertTreeItemRows(itemList, 0); + + if (selectedId) { + return indexFromPlaylistId(selectedId); + } + return QModelIndex(); } QString SetlogFeature::fetchPlaylistLabel(int playlistId) { @@ -210,11 +267,11 @@ void SetlogFeature::slotGetNewPlaylist() { QString set_log_name; set_log_name = QDate::currentDate().toString(Qt::ISODate); - set_log_name_format = set_log_name + " (%1)"; + set_log_name_format = set_log_name + " #%1"; int i = 1; // calculate name of the todays setlog - while (m_playlistDao.getPlaylistIdFromName(set_log_name) != -1) { + while (m_playlistDao.getPlaylistIdFromName(set_log_name) != kInvalidPlaylistId) { set_log_name = set_log_name_format.arg(++i); } @@ -222,7 +279,7 @@ void SetlogFeature::slotGetNewPlaylist() { m_playlistId = m_playlistDao.createPlaylist( set_log_name, PlaylistDAO::PLHT_SET_LOG); - if (m_playlistId == -1) { + if (m_playlistId == kInvalidPlaylistId) { qDebug() << "Setlog playlist Creation Failed"; qDebug() << "An unknown error occurred while creating playlist: " << set_log_name; @@ -230,6 +287,7 @@ void SetlogFeature::slotGetNewPlaylist() { reloadChildModel(m_playlistId); // For moving selection emit showTrackModel(m_pPlaylistTableModel); + activatePlaylist(m_playlistId); } void SetlogFeature::slotJoinWithPrevious() { @@ -279,9 +337,11 @@ void SetlogFeature::slotJoinWithPrevious() { << " previous:" << previousPlaylistId; if (m_playlistDao.copyPlaylistTracks( currentPlaylistId, previousPlaylistId)) { + m_lastRightClickedIndex = constructChildModel(previousPlaylistId); m_playlistDao.deletePlaylist(currentPlaylistId); reloadChildModel(previousPlaylistId); // For moving selection emit showTrackModel(m_pPlaylistTableModel); + activatePlaylist(previousPlaylistId); } } } @@ -389,33 +449,36 @@ void SetlogFeature::slotPlaylistTableRenamed(int playlistId, const QString& newN clearChildModel(); m_lastRightClickedIndex = constructChildModel(playlistId); if (type != PlaylistDAO::PLHT_UNKNOWN) { - activatePlaylist(playlistId); + if (playlistId == m_pPlaylistTableModel->getPlaylist()) { + activatePlaylist(playlistId); + } else if (m_pSidebarWidget) { + m_pSidebarWidget->selectChildIndex(indexFromPlaylistId(playlistId), false); + } + } + } +} + +void SetlogFeature::activate() { + activatePlaylist(m_playlistId); +} + +void SetlogFeature::activatePlaylist(int playlistId) { + //qDebug() << "BasePlaylistFeature::activatePlaylist()" << playlistId; + QModelIndex index = indexFromPlaylistId(playlistId); + if (playlistId != kInvalidPlaylistId && index.isValid()) { + m_pPlaylistTableModel->setTableModel(playlistId); + emit showTrackModel(m_pPlaylistTableModel); + emit enableCoverArtDisplay(true); + // Update selection only, if it is not the current playlist + // since we want the root item to be the current playlist as well + if (playlistId != m_playlistId) { + emit featureSelect(this, index); + activateChild(index); } } } QString SetlogFeature::getRootViewHtml() const { - QString playlistsTitle = tr("History"); - QString playlistsSummary = - tr("The history section automatically keeps a list of tracks you " - "play in your DJ sets."); - QString playlistsSummary2 = - tr("This is handy for remembering what worked in your DJ sets, " - "posting set-lists, or reporting your plays to licensing " - "organizations."); - QString playlistsSummary3 = - tr("Every time you start Mixxx, a new history section is created. " - "You can export it as a playlist in various formats or play it " - "again with Auto DJ."); - QString playlistsSummary4 = - tr("You can join the current history session with a previous one " - "by right-clicking and selecting \"Join with previous\"."); - - QString html; - html.append(QStringLiteral("

%1

").arg(playlistsTitle)); - html.append(QStringLiteral("

%1

").arg(playlistsSummary)); - html.append(QStringLiteral("

%1

").arg(playlistsSummary2)); - html.append(QStringLiteral("

%1

").arg(playlistsSummary3)); - html.append(QStringLiteral("

%1

").arg(playlistsSummary4)); - return html; + // Instead of the help text, the history shows the current entry instead + return QString(); } diff --git a/src/library/trackset/setlogfeature.h b/src/library/trackset/setlogfeature.h index 2165588a1ee..70fa0083c82 100644 --- a/src/library/trackset/setlogfeature.h +++ b/src/library/trackset/setlogfeature.h @@ -20,16 +20,17 @@ class SetlogFeature : public BasePlaylistFeature { void bindLibraryWidget(WLibrary* libraryWidget, KeyboardEventFilter* keyboard) override; - void bindSidebarWidget(WLibrarySidebar* pSidebarWidget) override; + void activatePlaylist(int playlistId) override; public slots: void onRightClick(const QPoint& globalPos) override; void onRightClickChild(const QPoint& globalPos, const QModelIndex& index) override; void slotJoinWithPrevious(); void slotGetNewPlaylist(); + void activate() override; protected: - QList createPlaylistLabels() override; + QModelIndex constructChildModel(int selectedId); QString fetchPlaylistLabel(int playlistId) override; void decorateChild(TreeItem* pChild, int playlistId) override; @@ -45,9 +46,8 @@ class SetlogFeature : public BasePlaylistFeature { std::list m_recentTracks; QAction* m_pJoinWithPreviousAction; - QAction* m_pGetNewPlaylist; + QAction* m_pStartNewPlaylist; int m_playlistId; WLibrary* m_libraryWidget; - QPointer m_pSidebarWidget; const QIcon m_icon; }; diff --git a/src/library/trackset/tracksettablemodel.cpp b/src/library/trackset/tracksettablemodel.cpp index fa6aefbbef0..f27bd25efae 100644 --- a/src/library/trackset/tracksettablemodel.cpp +++ b/src/library/trackset/tracksettablemodel.cpp @@ -1,6 +1,7 @@ -#include "tracksettablemodel.h" +#include "library/trackset/tracksettablemodel.h" #include "mixer/playermanager.h" +#include "moc_tracksettablemodel.cpp" TrackSetTableModel::TrackSetTableModel( QObject* parent, diff --git a/src/library/traktor/traktorfeature.cpp b/src/library/traktor/traktorfeature.cpp index 29bad73e25c..4ef58f721b8 100644 --- a/src/library/traktor/traktorfeature.cpp +++ b/src/library/traktor/traktorfeature.cpp @@ -1,22 +1,20 @@ -// traktorfeature.cpp -// Created 9/26/2010 by Tobias Rafreider +#include "library/traktor/traktorfeature.h" -#include -#include -#include #include +#include #include #include +#include +#include -#include "library/traktor/traktorfeature.h" - +#include "library/library.h" #include "library/librarytablemodel.h" #include "library/missingtablemodel.h" #include "library/queryutil.h" -#include "library/library.h" #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "library/treeitem.h" +#include "moc_traktorfeature.cpp" #include "util/sandbox.h" namespace { diff --git a/src/library/traktor/traktorfeature.h b/src/library/traktor/traktorfeature.h index 79e5f9ae149..b685eb11937 100644 --- a/src/library/traktor/traktorfeature.h +++ b/src/library/traktor/traktorfeature.h @@ -1,8 +1,4 @@ -// traktorfeature.h -// Created 9/26/2010 by Tobias Rafreider - -#ifndef TRAKTOR_FEATURE_H -#define TRAKTOR_FEATURE_H +#pragma once #include #include @@ -80,5 +76,3 @@ class TraktorFeature : public BaseExternalLibraryFeature { QSharedPointer m_trackSource; QIcon m_icon; }; - -#endif // TRAKTOR_FEATURE_H diff --git a/src/library/treeitem.h b/src/library/treeitem.h index 92a8b958877..d265a71fdfa 100644 --- a/src/library/treeitem.h +++ b/src/library/treeitem.h @@ -95,7 +95,7 @@ class TreeItem final { // take ownership of children items void insertChildren(int row, QList& children); void removeChildren(int row, int count); - + void insertChild(int row, TreeItem* pChild); ///////////////////////////////////////////////////////////////////////// // Payload @@ -135,7 +135,6 @@ class TreeItem final { QString label = QString(), QVariant data = QVariant()); - void insertChild(int row, TreeItem* pChild); void initFeatureRecursively(LibraryFeature* pFeature); // The library feature is inherited from the parent. diff --git a/src/library/treeitemmodel.cpp b/src/library/treeitemmodel.cpp index b9c5905cdc7..787c5b8e1f0 100644 --- a/src/library/treeitemmodel.cpp +++ b/src/library/treeitemmodel.cpp @@ -1,6 +1,7 @@ #include "library/treeitemmodel.h" #include "library/treeitem.h" +#include "moc_treeitemmodel.cpp" /* * Just a word about how the TreeItem objects and TreeItemModels are used in general: @@ -129,8 +130,10 @@ QModelIndex TreeItemModel::parent(const QModelIndex& index) const { TreeItem *childItem = static_cast(index.internalPointer()); TreeItem *parentItem = childItem->parent(); - if (parentItem == getRootItem()) { + if (!parentItem) { return QModelIndex(); + } else if (parentItem == getRootItem()) { + return createIndex(0, 0, getRootItem()); } else { return createIndex(parentItem->parentRow(), 0, parentItem); } @@ -161,6 +164,10 @@ TreeItem* TreeItemModel::setRootItem(std::unique_ptr pRootItem) { return getRootItem(); } +const QModelIndex TreeItemModel::getRootIndex() { + return createIndex(0, 0, getRootItem()); +} + /** * Before you can resize the data model dynamically by using 'insertRows' and 'removeRows' * make sure you have initialized diff --git a/src/library/treeitemmodel.h b/src/library/treeitemmodel.h index 0856f36721c..78c6e68ac47 100644 --- a/src/library/treeitemmodel.h +++ b/src/library/treeitemmodel.h @@ -1,5 +1,4 @@ -#ifndef TREE_ITEM_MODEL_H -#define TREE_ITEM_MODEL_H +#pragma once #include #include @@ -37,6 +36,8 @@ class TreeItemModel : public QAbstractItemModel { TreeItem* getRootItem() const { return m_pRootItem.get(); } + /// Returns the QModelIndex of the Root element. + const QModelIndex getRootIndex(); // Return the underlying TreeItem. // If the index is invalid, the root item is returned. @@ -48,5 +49,3 @@ class TreeItemModel : public QAbstractItemModel { private: std::unique_ptr m_pRootItem; }; - -#endif diff --git a/src/main.cpp b/src/main.cpp index 31685a54cab..4cf913ed125 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,20 +1,3 @@ -/*************************************************************************** - main.cpp - description - ------------------- - begin : Mon Feb 18 09:48:17 CET 2002 - copyright : (C) 2002 by Tue and Ken Haste Andersen - email : -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include #include #include @@ -104,17 +87,8 @@ int main(int argc, char * argv[]) { // the main thread. Bug #1748636. ErrorDialogHandler::instance(); - mixxx::Logging::initialize(args.getSettingsPath(), - args.getLogLevel(), - args.getLogFlushLevel(), - args.getDebugAssertBreak()); - MixxxApplication app(argc, argv); - VERIFY_OR_DEBUG_ASSERT(SoundSourceProxy::registerProviders()) { - qCritical() << "Failed to register any SoundSource providers"; - return kFatalErrorOnStartupExitCode; - } #ifdef __APPLE__ QDir dir(QApplication::applicationDirPath()); diff --git a/src/mixer/auxiliary.cpp b/src/mixer/auxiliary.cpp index 2f410443121..7f4e224bb3e 100644 --- a/src/mixer/auxiliary.cpp +++ b/src/mixer/auxiliary.cpp @@ -1,8 +1,9 @@ #include "mixer/auxiliary.h" #include "control/controlproxy.h" -#include "engine/enginemaster.h" #include "engine/channels/engineaux.h" +#include "engine/enginemaster.h" +#include "moc_auxiliary.cpp" #include "soundio/soundmanager.h" #include "soundio/soundmanagerutil.h" diff --git a/src/mixer/auxiliary.h b/src/mixer/auxiliary.h index 7f9f378f2bd..209cfa0d62e 100644 --- a/src/mixer/auxiliary.h +++ b/src/mixer/auxiliary.h @@ -1,5 +1,4 @@ -#ifndef MIXER_AUXILIARY_H -#define MIXER_AUXILIARY_H +#pragma once #include #include @@ -33,5 +32,3 @@ class Auxiliary : public BasePlayer { parented_ptr m_pInputConfigured; parented_ptr m_pAuxMasterEnabled; }; - -#endif /* MIXER_AUXILIARY_H */ diff --git a/src/mixer/baseplayer.cpp b/src/mixer/baseplayer.cpp index 0b8948b81bf..e5dd965f0f9 100644 --- a/src/mixer/baseplayer.cpp +++ b/src/mixer/baseplayer.cpp @@ -1,5 +1,7 @@ #include "mixer/baseplayer.h" +#include "moc_baseplayer.cpp" + BasePlayer::BasePlayer(QObject* pParent, const QString& group) : QObject(pParent), m_group(group) { diff --git a/src/mixer/baseplayer.h b/src/mixer/baseplayer.h index 5d02d5fcd70..ae7905ce95a 100644 --- a/src/mixer/baseplayer.h +++ b/src/mixer/baseplayer.h @@ -1,5 +1,4 @@ -#ifndef MIXER_BASEPLAYER_H -#define MIXER_BASEPLAYER_H +#pragma once #include #include @@ -17,5 +16,3 @@ class BasePlayer : public QObject { private: const QString m_group; }; - -#endif /* MIXER_BASEPLAYER_H */ diff --git a/src/mixer/basetrackplayer.cpp b/src/mixer/basetrackplayer.cpp index 215ac264f0f..92e43b53ebb 100644 --- a/src/mixer/basetrackplayer.cpp +++ b/src/mixer/basetrackplayer.cpp @@ -12,6 +12,7 @@ #include "engine/sync/enginesync.h" #include "mixer/playerinfo.h" #include "mixer/playermanager.h" +#include "moc_basetrackplayer.cpp" #include "sources/soundsourceproxy.h" #include "track/track.h" #include "util/sandbox.h" diff --git a/src/mixer/basetrackplayer.h b/src/mixer/basetrackplayer.h index 190eab8637a..8e6186d99f2 100644 --- a/src/mixer/basetrackplayer.h +++ b/src/mixer/basetrackplayer.h @@ -1,5 +1,4 @@ -#ifndef MIXER_BASETRACKPLAYER_H -#define MIXER_BASETRACKPLAYER_H +#pragma once #include #include @@ -159,5 +158,3 @@ class BaseTrackPlayerImpl : public BaseTrackPlayer { parented_ptr m_pVinylControlEnabled; parented_ptr m_pVinylControlStatus; }; - -#endif // MIXER_BASETRACKPLAYER_H diff --git a/src/mixer/deck.cpp b/src/mixer/deck.cpp index 98cb4466344..06be4a5bbf1 100644 --- a/src/mixer/deck.cpp +++ b/src/mixer/deck.cpp @@ -1,5 +1,7 @@ #include "mixer/deck.h" +#include "moc_deck.cpp" + Deck::Deck(QObject* pParent, UserSettingsPointer pConfig, EngineMaster* pMixingEngine, diff --git a/src/mixer/microphone.cpp b/src/mixer/microphone.cpp index aa3ddcaf670..f08a556dbb7 100644 --- a/src/mixer/microphone.cpp +++ b/src/mixer/microphone.cpp @@ -1,8 +1,9 @@ #include "mixer/microphone.h" #include "control/controlproxy.h" -#include "engine/enginemaster.h" #include "engine/channels/enginemicrophone.h" +#include "engine/enginemaster.h" +#include "moc_microphone.cpp" #include "soundio/soundmanager.h" #include "soundio/soundmanagerutil.h" diff --git a/src/mixer/microphone.h b/src/mixer/microphone.h index 58f8c2b2658..9b3b14e8a71 100644 --- a/src/mixer/microphone.h +++ b/src/mixer/microphone.h @@ -1,5 +1,4 @@ -#ifndef MIXER_MICROPHONE_H -#define MIXER_MICROPHONE_H +#pragma once #include #include @@ -33,5 +32,3 @@ class Microphone : public BasePlayer { parented_ptr m_pInputConfigured; parented_ptr m_pTalkoverEnabled; }; - -#endif /* MIXER_MICROPHONE_H */ diff --git a/src/mixer/playerinfo.cpp b/src/mixer/playerinfo.cpp index f0511d4dfe7..ee894310fb8 100644 --- a/src/mixer/playerinfo.cpp +++ b/src/mixer/playerinfo.cpp @@ -1,19 +1,4 @@ -/*************************************************************************** - playerinfo.cpp - Helper class to have easy access - to a lot of data (singleton) - ------------------- - copyright : (C) 2007 by Wesley Stessens - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - +// Helper class to have easy access #include "mixer/playerinfo.h" #include @@ -22,6 +7,7 @@ #include "engine/channels/enginechannel.h" #include "engine/enginexfader.h" #include "mixer/playermanager.h" +#include "moc_playerinfo.cpp" #include "track/track.h" namespace { diff --git a/src/mixer/playerinfo.h b/src/mixer/playerinfo.h index 7d6cb574c7b..2b06412cb09 100644 --- a/src/mixer/playerinfo.h +++ b/src/mixer/playerinfo.h @@ -1,21 +1,5 @@ -/*************************************************************************** - playerinfo.h - Helper class to have easy access - to a lot of data (singleton) - ------------------- - copyright : (C) 2007 by Wesley Stessens - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef MIXER_PLAYERINFO_H -#define MIXER_PLAYERINFO_H +// Helper class to have easy access +#pragma once #include #include @@ -78,5 +62,3 @@ class PlayerInfo : public QObject { static PlayerInfo* m_pPlayerinfo; }; - -#endif /* MIXER_PLAYERINFO_H */ diff --git a/src/mixer/playermanager.cpp b/src/mixer/playermanager.cpp index 04a4dc3d37c..75bb78ca42f 100644 --- a/src/mixer/playermanager.cpp +++ b/src/mixer/playermanager.cpp @@ -14,6 +14,7 @@ #include "mixer/previewdeck.h" #include "mixer/sampler.h" #include "mixer/samplerbank.h" +#include "moc_playermanager.cpp" #include "preferences/dialog/dlgprefdeck.h" #include "soundio/soundmanager.h" #include "track/track.h" diff --git a/src/mixer/previewdeck.cpp b/src/mixer/previewdeck.cpp index e6e63c36e4a..dee63bfb584 100644 --- a/src/mixer/previewdeck.cpp +++ b/src/mixer/previewdeck.cpp @@ -1,5 +1,7 @@ #include "mixer/previewdeck.h" +#include "moc_previewdeck.cpp" + PreviewDeck::PreviewDeck(QObject* pParent, UserSettingsPointer pConfig, EngineMaster* pMixingEngine, diff --git a/src/mixer/previewdeck.h b/src/mixer/previewdeck.h index 71c4d36467e..2da64603c49 100644 --- a/src/mixer/previewdeck.h +++ b/src/mixer/previewdeck.h @@ -1,5 +1,4 @@ -#ifndef MIXER_PREVIEWDECK_H -#define MIXER_PREVIEWDECK_H +#pragma once #include "mixer/basetrackplayer.h" @@ -15,5 +14,3 @@ class PreviewDeck : public BaseTrackPlayerImpl { const ChannelHandleAndGroup& handleGroup); ~PreviewDeck() override = default; }; - -#endif /* MIXER_PREVIEWDECK_H */ diff --git a/src/mixer/sampler.cpp b/src/mixer/sampler.cpp index 1531129ecb4..1ee1aef8c6c 100644 --- a/src/mixer/sampler.cpp +++ b/src/mixer/sampler.cpp @@ -1,6 +1,7 @@ #include "mixer/sampler.h" #include "control/controlobject.h" +#include "moc_sampler.cpp" Sampler::Sampler(QObject* pParent, UserSettingsPointer pConfig, diff --git a/src/mixer/samplerbank.cpp b/src/mixer/samplerbank.cpp index 84c67965443..435835e48b3 100644 --- a/src/mixer/samplerbank.cpp +++ b/src/mixer/samplerbank.cpp @@ -6,6 +6,7 @@ #include "control/controlpushbutton.h" #include "mixer/playermanager.h" #include "mixer/sampler.h" +#include "moc_samplerbank.cpp" #include "track/track.h" #include "util/assert.h" diff --git a/src/mixer/samplerbank.h b/src/mixer/samplerbank.h index dbf6c3a291a..748f2587abe 100644 --- a/src/mixer/samplerbank.h +++ b/src/mixer/samplerbank.h @@ -1,5 +1,4 @@ -#ifndef MIXER_SAMPLERBANK_H -#define MIXER_SAMPLERBANK_H +#pragma once #include #include "util/memory.h" @@ -30,5 +29,3 @@ class SamplerBank : public QObject { std::unique_ptr m_pCOSaveBank; ControlProxy* m_pCONumSamplers; }; - -#endif /* MIXER_SAMPLERBANK_H */ diff --git a/src/mixxx.cpp b/src/mixxx.cpp index dd4c14c5a15..3add3279d9f 100644 --- a/src/mixxx.cpp +++ b/src/mixxx.cpp @@ -16,6 +16,7 @@ #include "effects/builtin/builtinbackend.h" #include "effects/effectsmanager.h" #include "engine/enginemaster.h" +#include "moc_mixxx.cpp" #include "preferences/constants.h" #include "preferences/dialog/dlgprefeq.h" #include "preferences/dialog/dlgpreferences.h" @@ -151,6 +152,24 @@ MixxxMainWindow::MixxxMainWindow(QApplication* pApp, const CmdlineArgs& args) m_runtime_timer.start(); mixxx::Time::start(); + QString settingsPath = args.getSettingsPath(); +#ifdef __APPLE__ + if (!args.getSettingsPathSet()) { + settingsPath = Sandbox::migrateOldSettings(); + } +#endif + + mixxx::Logging::initialize( + settingsPath, + args.getLogLevel(), + args.getLogFlushLevel(), + args.getDebugAssertBreak()); + + VERIFY_OR_DEBUG_ASSERT(SoundSourceProxy::registerProviders()) { + qCritical() << "Failed to register any SoundSource providers"; + return; + } + Version::logBuildDetails(); // Only record stats in developer mode. diff --git a/src/mixxxapplication.cpp b/src/mixxxapplication.cpp index d4bf7165419..c626ab1f234 100644 --- a/src/mixxxapplication.cpp +++ b/src/mixxxapplication.cpp @@ -7,6 +7,7 @@ #include "audio/types.h" #include "control/controlproxy.h" #include "library/trackset/crate/crateid.h" +#include "moc_mixxxapplication.cpp" #include "soundio/soundmanagerutil.h" #include "track/track.h" #include "track/trackref.h" diff --git a/src/mixxxapplication.h b/src/mixxxapplication.h index a9a5a67524f..cb1f2449441 100644 --- a/src/mixxxapplication.h +++ b/src/mixxxapplication.h @@ -1,5 +1,4 @@ -#ifndef MIXXXAPPLICATION_H -#define MIXXXAPPLICATION_H +#pragma once #include @@ -21,5 +20,3 @@ class MixxxApplication : public QApplication { ControlProxy* m_pTouchShift; }; - -#endif // MIXXXAPPLICATION_H diff --git a/src/musicbrainz/chromaprinter.cpp b/src/musicbrainz/chromaprinter.cpp index 88f758435bb..e59f67b53a6 100644 --- a/src/musicbrainz/chromaprinter.cpp +++ b/src/musicbrainz/chromaprinter.cpp @@ -5,6 +5,7 @@ #include #include +#include "moc_chromaprinter.cpp" #include "sources/audiosourcestereoproxy.h" #include "sources/soundsourceproxy.h" #include "track/track.h" diff --git a/src/musicbrainz/chromaprinter.h b/src/musicbrainz/chromaprinter.h index 9f127424f0f..681605fb974 100644 --- a/src/musicbrainz/chromaprinter.h +++ b/src/musicbrainz/chromaprinter.h @@ -1,5 +1,4 @@ -#ifndef CHROMAPRINTER_H -#define CHROMAPRINTER_H +#pragma once #include @@ -12,5 +11,3 @@ class ChromaPrinter: public QObject { explicit ChromaPrinter(QObject* parent = NULL); QString getFingerprint(TrackPointer pTrack); }; - -#endif //CHROMAPRINTER_H diff --git a/src/musicbrainz/crc.h b/src/musicbrainz/crc.h index fea8816a851..5cf5c8d5c43 100644 --- a/src/musicbrainz/crc.h +++ b/src/musicbrainz/crc.h @@ -13,8 +13,7 @@ * ReflectOut = True * Algorithm = table-driven *****************************************************************************/ -#ifndef __CRC_H__ -#define __CRC_H__ +#pragma once #include #include @@ -79,5 +78,3 @@ crc_t crc_update(crc_t crc, const unsigned char *data, size_t data_len); #ifdef __cplusplus } /* closing brace for extern "C" */ #endif - -#endif /* __CRC_H__ */ diff --git a/src/musicbrainz/gzip.cpp b/src/musicbrainz/gzip.cpp index 66ee8837874..d0a88e3c48f 100644 --- a/src/musicbrainz/gzip.cpp +++ b/src/musicbrainz/gzip.cpp @@ -1,7 +1,3 @@ -/***************************************************************************** - * Author: Lukáš Lalinský * - *****************************************************************************/ - #include "musicbrainz/crc.h" #include "musicbrainz/gzip.h" diff --git a/src/musicbrainz/gzip.h b/src/musicbrainz/gzip.h index 9808026afd0..de23909fe2c 100644 --- a/src/musicbrainz/gzip.h +++ b/src/musicbrainz/gzip.h @@ -1,12 +1,5 @@ -/***************************************************************************** - * Author: Lukáš Lalinský * - *****************************************************************************/ - -#ifndef FPSUBMIT_GZIP_H_ -#define FPSUBMIT_GZIP_H_ +#pragma once #include QByteArray gzipCompress(const QByteArray &data); - -#endif diff --git a/src/musicbrainz/tagfetcher.cpp b/src/musicbrainz/tagfetcher.cpp index 6126f17241f..37364e564fc 100644 --- a/src/musicbrainz/tagfetcher.cpp +++ b/src/musicbrainz/tagfetcher.cpp @@ -3,6 +3,7 @@ #include #include +#include "moc_tagfetcher.cpp" #include "musicbrainz/chromaprinter.h" #include "track/track.h" #include "util/thread_affinity.h" diff --git a/src/musicbrainz/web/acoustidlookuptask.cpp b/src/musicbrainz/web/acoustidlookuptask.cpp index 297ce48a410..c79578a0d4c 100644 --- a/src/musicbrainz/web/acoustidlookuptask.cpp +++ b/src/musicbrainz/web/acoustidlookuptask.cpp @@ -4,6 +4,7 @@ #include #include +#include "moc_acoustidlookuptask.cpp" #include "musicbrainz/gzip.h" #include "util/assert.h" #include "util/logger.h" diff --git a/src/musicbrainz/web/musicbrainzrecordingstask.cpp b/src/musicbrainz/web/musicbrainzrecordingstask.cpp index d3d6b0efd1b..fd191c996df 100644 --- a/src/musicbrainz/web/musicbrainzrecordingstask.cpp +++ b/src/musicbrainz/web/musicbrainzrecordingstask.cpp @@ -4,6 +4,7 @@ #include #include "defs_urls.h" +#include "moc_musicbrainzrecordingstask.cpp" #include "musicbrainz/gzip.h" #include "musicbrainz/musicbrainzxml.h" #include "network/httpstatuscode.h" diff --git a/src/network/jsonwebtask.cpp b/src/network/jsonwebtask.cpp index 7f566e7168c..d959149aa3b 100644 --- a/src/network/jsonwebtask.cpp +++ b/src/network/jsonwebtask.cpp @@ -6,6 +6,7 @@ #include #include // std::once_flag +#include "moc_jsonwebtask.cpp" #include "util/counter.h" #include "util/logger.h" #include "util/thread_affinity.h" diff --git a/src/network/webtask.cpp b/src/network/webtask.cpp index 49cc3fc8197..534c582b225 100644 --- a/src/network/webtask.cpp +++ b/src/network/webtask.cpp @@ -3,6 +3,7 @@ #include #include // std::once_flag +#include "moc_webtask.cpp" #include "util/assert.h" #include "util/counter.h" #include "util/logger.h" diff --git a/src/preferences/beatdetectionsettings.h b/src/preferences/beatdetectionsettings.h index 1731f2158ad..b247e8413cf 100644 --- a/src/preferences/beatdetectionsettings.h +++ b/src/preferences/beatdetectionsettings.h @@ -1,5 +1,4 @@ -#ifndef PREFERENCES_BEATDETECTIONSETTINGS_H -#define PREFERENCES_BEATDETECTIONSETTINGS_H +#pragma once #include "preferences/usersettings.h" @@ -61,5 +60,3 @@ class BeatDetectionSettings { private: UserSettingsPointer m_pConfig; }; - -#endif /* PREFERENCES_BEATDETECTIONSETTINGS_H */ diff --git a/src/preferences/broadcastprofile.cpp b/src/preferences/broadcastprofile.cpp index 9502c8590dd..3912a1bb2c0 100644 --- a/src/preferences/broadcastprofile.cpp +++ b/src/preferences/broadcastprofile.cpp @@ -1,6 +1,3 @@ -// broadcastprofile.cpp -// Created June 2nd 2017 by Stéphane Lepin - #include #include #include @@ -15,14 +12,14 @@ using namespace QKeychain; #endif // __QTKEYCHAIN__ #include "broadcast/defs_broadcast.h" -#include "recording/defs_recording.h" +#include "broadcastprofile.h" #include "defs_urls.h" +#include "moc_broadcastprofile.cpp" +#include "recording/defs_recording.h" #include "util/compatibility.h" -#include "util/xml.h" -#include "util/memory.h" #include "util/logger.h" - -#include "broadcastprofile.h" +#include "util/memory.h" +#include "util/xml.h" namespace { constexpr const char* kDoctype = "broadcastprofile"; diff --git a/src/preferences/broadcastprofile.h b/src/preferences/broadcastprofile.h index b72713f1918..17592f98c9b 100644 --- a/src/preferences/broadcastprofile.h +++ b/src/preferences/broadcastprofile.h @@ -1,8 +1,4 @@ -// broadcastprofile.h -// Created June 2nd 2017 by Stéphane Lepin - -#ifndef BROADCASTPROFILE_H -#define BROADCASTPROFILE_H +#pragma once #include #include @@ -199,5 +195,3 @@ class BroadcastProfile : public QObject { QAtomicInt m_connectionStatus; }; - -#endif // BROADCASTPROFILE_H diff --git a/src/preferences/broadcastsettings.cpp b/src/preferences/broadcastsettings.cpp index 53d08b6aa56..4378257de7a 100644 --- a/src/preferences/broadcastsettings.cpp +++ b/src/preferences/broadcastsettings.cpp @@ -1,11 +1,13 @@ +#include "preferences/broadcastsettings.h" + #include -#include -#include #include +#include +#include #include "broadcast/defs_broadcast.h" #include "defs_urls.h" -#include "preferences/broadcastsettings.h" +#include "moc_broadcastsettings.cpp" #include "util/logger.h" #include "util/memory.h" diff --git a/src/preferences/broadcastsettings.h b/src/preferences/broadcastsettings.h index ec48f9c2e53..6af26e568bf 100644 --- a/src/preferences/broadcastsettings.h +++ b/src/preferences/broadcastsettings.h @@ -1,5 +1,4 @@ -#ifndef PREFERENCES_BROADCASTSETTINGS_H -#define PREFERENCES_BROADCASTSETTINGS_H +#pragma once #include #include @@ -49,5 +48,3 @@ class BroadcastSettings : public QObject { }; typedef QSharedPointer BroadcastSettingsPointer; - -#endif /* PREFERENCES_BROADCASTSETTINGS_H */ diff --git a/src/preferences/broadcastsettingsmodel.cpp b/src/preferences/broadcastsettingsmodel.cpp index 2ec2401fd2f..33ebcb895d8 100644 --- a/src/preferences/broadcastsettingsmodel.cpp +++ b/src/preferences/broadcastsettingsmodel.cpp @@ -1,10 +1,9 @@ -// broadcastsettingsmodel.cpp -// Created on August 7th by Stéphane Lepin (Palakis) - -#include +#include "preferences/broadcastsettingsmodel.h" #include +#include "moc_broadcastsettingsmodel.cpp" + namespace { const int kColumnEnabled = 0; const int kColumnName = 1; diff --git a/src/preferences/broadcastsettingsmodel.h b/src/preferences/broadcastsettingsmodel.h index 5100638dcf2..84d13622756 100644 --- a/src/preferences/broadcastsettingsmodel.h +++ b/src/preferences/broadcastsettingsmodel.h @@ -1,8 +1,4 @@ -// broadcastsettingsmodel.h -// Created on August 7th by Stéphane Lepin (Palakis) - -#ifndef PREFERENCES_BROADCASTSETTINGSMODEL_H -#define PREFERENCES_BROADCASTSETTINGSMODEL_H +#pragma once #include #include @@ -47,5 +43,3 @@ class BroadcastSettingsModel : public QAbstractTableModel { QMap m_profiles; }; - -#endif // PREFERENCES_BROADCASTSETTINGSMODEL_H diff --git a/src/preferences/colorpaletteeditor.cpp b/src/preferences/colorpaletteeditor.cpp index 6d15a6c887c..23d709f3ec0 100644 --- a/src/preferences/colorpaletteeditor.cpp +++ b/src/preferences/colorpaletteeditor.cpp @@ -10,6 +10,7 @@ #include #include +#include "moc_colorpaletteeditor.cpp" #include "preferences/colorpalettesettings.h" #include "util/color/predefinedcolorpalettes.h" diff --git a/src/preferences/colorpaletteeditormodel.cpp b/src/preferences/colorpaletteeditormodel.cpp index 328ccf16b0b..d0f2d1a4255 100644 --- a/src/preferences/colorpaletteeditormodel.cpp +++ b/src/preferences/colorpaletteeditormodel.cpp @@ -1,5 +1,7 @@ #include "preferences/colorpaletteeditormodel.h" +#include "moc_colorpaletteeditormodel.cpp" + namespace { QIcon toQIcon(const QColor& color) { diff --git a/src/preferences/configobject.h b/src/preferences/configobject.h index c68cb7ff1c7..229f8c8a9dd 100644 --- a/src/preferences/configobject.h +++ b/src/preferences/configobject.h @@ -1,5 +1,4 @@ -#ifndef PREFERENCES_CONFIGOBJECT_H -#define PREFERENCES_CONFIGOBJECT_H +#pragma once #include #include @@ -203,5 +202,3 @@ template class ConfigObject { // not be opened; otherwise true. bool parse(); }; - -#endif // PREFERENCES_CONFIGOBJECT_H diff --git a/src/preferences/constants.h b/src/preferences/constants.h index 4bc73c32ec9..57f96a3b247 100644 --- a/src/preferences/constants.h +++ b/src/preferences/constants.h @@ -1,5 +1,4 @@ -#ifndef PREFERENCES_CONSTANTS_H -#define PREFERENCES_CONSTANTS_H +#pragma once namespace mixxx { @@ -19,5 +18,3 @@ enum class ScreenSaverPreference { }; } // namespace mixxx - -#endif /* PREFERENCES_CONSTANTS_H */ diff --git a/src/preferences/dialog/dlgprefautodj.cpp b/src/preferences/dialog/dlgprefautodj.cpp index 8dbdcdddf7c..47e95e209e3 100644 --- a/src/preferences/dialog/dlgprefautodj.cpp +++ b/src/preferences/dialog/dlgprefautodj.cpp @@ -1,5 +1,7 @@ #include "preferences/dialog/dlgprefautodj.h" +#include "moc_dlgprefautodj.cpp" + DlgPrefAutoDJ::DlgPrefAutoDJ(QWidget* pParent, UserSettingsPointer pConfig) : DlgPreferencePage(pParent), diff --git a/src/preferences/dialog/dlgprefautodj.h b/src/preferences/dialog/dlgprefautodj.h index 174c75d0eb0..56dc245ad77 100644 --- a/src/preferences/dialog/dlgprefautodj.h +++ b/src/preferences/dialog/dlgprefautodj.h @@ -1,5 +1,4 @@ -#ifndef DLGPREFAUTODJ_H -#define DLGPREFAUTODJ_H +#pragma once #include @@ -30,5 +29,3 @@ class DlgPrefAutoDJ : public DlgPreferencePage, public Ui::DlgPrefAutoDJDlg { private: UserSettingsPointer m_pConfig; }; - -#endif /* DLGPREFAUTODJ_H */ diff --git a/src/preferences/dialog/dlgprefbeats.cpp b/src/preferences/dialog/dlgprefbeats.cpp index b5c1d5e6dab..c02494e8743 100644 --- a/src/preferences/dialog/dlgprefbeats.cpp +++ b/src/preferences/dialog/dlgprefbeats.cpp @@ -3,6 +3,7 @@ #include "analyzer/analyzerbeats.h" #include "control/controlobject.h" #include "defs_urls.h" +#include "moc_dlgprefbeats.cpp" DlgPrefBeats::DlgPrefBeats(QWidget* parent, UserSettingsPointer pConfig) : DlgPreferencePage(parent), diff --git a/src/preferences/dialog/dlgprefbeats.h b/src/preferences/dialog/dlgprefbeats.h index 80700e0698b..69a6bf2db2d 100644 --- a/src/preferences/dialog/dlgprefbeats.h +++ b/src/preferences/dialog/dlgprefbeats.h @@ -1,9 +1,4 @@ -// Created on: 28/apr/2011 -// Author: vittorio - - -#ifndef DLGPREFBEATS_H -#define DLGPREFBEATS_H +#pragma once #include #include @@ -55,5 +50,3 @@ class DlgPrefBeats : public DlgPreferencePage, public Ui::DlgBeatsDlg { bool m_bReanalyze; bool m_bReanalyzeImported; }; - -#endif // DLGPREFBEATS_H diff --git a/src/preferences/dialog/dlgprefbroadcast.cpp b/src/preferences/dialog/dlgprefbroadcast.cpp index 525f2c6dd33..17bc3bf6717 100644 --- a/src/preferences/dialog/dlgprefbroadcast.cpp +++ b/src/preferences/dialog/dlgprefbroadcast.cpp @@ -17,11 +17,12 @@ #endif #include "broadcast/defs_broadcast.h" -#include "recording/defs_recording.h" #include "control/controlproxy.h" #include "defs_urls.h" -#include "preferences/dialog/dlgprefbroadcast.h" #include "encoder/encodersettings.h" +#include "moc_dlgprefbroadcast.cpp" +#include "preferences/dialog/dlgprefbroadcast.h" +#include "recording/defs_recording.h" #include "util/logger.h" namespace { diff --git a/src/preferences/dialog/dlgprefbroadcast.h b/src/preferences/dialog/dlgprefbroadcast.h index 6c9db8e17c3..f8e78c1862f 100644 --- a/src/preferences/dialog/dlgprefbroadcast.h +++ b/src/preferences/dialog/dlgprefbroadcast.h @@ -1,5 +1,4 @@ -#ifndef DLGPREFBROADCAST_H -#define DLGPREFBROADCAST_H +#pragma once #include #include @@ -57,5 +56,3 @@ class DlgPrefBroadcast : public DlgPreferencePage, public Ui::DlgPrefBroadcastDl ControlProxy* m_pBroadcastEnabled; BroadcastProfilePtr m_pProfileListSelection; }; - -#endif diff --git a/src/preferences/dialog/dlgprefcolors.cpp b/src/preferences/dialog/dlgprefcolors.cpp index 7180dfb6254..13e71fadfcd 100644 --- a/src/preferences/dialog/dlgprefcolors.cpp +++ b/src/preferences/dialog/dlgprefcolors.cpp @@ -9,6 +9,7 @@ #include "dialog/dlgreplacecuecolor.h" #include "library/library.h" #include "library/trackcollection.h" +#include "moc_dlgprefcolors.cpp" #include "util/color/predefinedcolorpalettes.h" #include "util/compatibility.h" #include "util/math.h" diff --git a/src/preferences/dialog/dlgprefcrossfader.cpp b/src/preferences/dialog/dlgprefcrossfader.cpp index 2bc152fc7b0..dad7a374eac 100644 --- a/src/preferences/dialog/dlgprefcrossfader.cpp +++ b/src/preferences/dialog/dlgprefcrossfader.cpp @@ -1,9 +1,11 @@ +#include "preferences/dialog/dlgprefcrossfader.h" + #include #include -#include "preferences/dialog/dlgprefcrossfader.h" #include "control/controlobject.h" #include "engine/enginexfader.h" +#include "moc_dlgprefcrossfader.cpp" #include "util/math.h" #include "util/rescaler.h" diff --git a/src/preferences/dialog/dlgprefcrossfader.h b/src/preferences/dialog/dlgprefcrossfader.h index 1574fbcf504..a6b1a3290db 100644 --- a/src/preferences/dialog/dlgprefcrossfader.h +++ b/src/preferences/dialog/dlgprefcrossfader.h @@ -1,5 +1,4 @@ -#ifndef DLGPREFCROSSFADER_H -#define DLGPREFCROSSFADER_H +#pragma once #include @@ -46,5 +45,3 @@ class DlgPrefCrossfader : public DlgPreferencePage, public Ui::DlgPrefCrossfader bool m_xFaderReverse; }; - -#endif diff --git a/src/preferences/dialog/dlgprefdeck.cpp b/src/preferences/dialog/dlgprefdeck.cpp index 27b47470023..412954e9f49 100644 --- a/src/preferences/dialog/dlgprefdeck.cpp +++ b/src/preferences/dialog/dlgprefdeck.cpp @@ -1,9 +1,11 @@ -#include +#include "preferences/dialog/dlgprefdeck.h" + #include -#include #include -#include +#include #include +#include +#include #include "control/controlobject.h" #include "control/controlproxy.h" @@ -14,7 +16,7 @@ #include "mixer/playerinfo.h" #include "mixer/playermanager.h" #include "mixxx.h" -#include "preferences/dialog/dlgprefdeck.h" +#include "moc_dlgprefdeck.cpp" #include "preferences/usersettings.h" #include "util/compatibility.h" #include "util/duration.h" @@ -34,12 +36,8 @@ constexpr int kDefaultRateRampSensitivity = 250; } DlgPrefDeck::DlgPrefDeck(QWidget* parent, - MixxxMainWindow* mixxx, - PlayerManager* pPlayerManager, UserSettingsPointer pConfig) : DlgPreferencePage(parent), - m_mixxx(mixxx), - m_pPlayerManager(pPlayerManager), m_pConfig(pConfig), m_pControlTrackTimeDisplay(std::make_unique( ConfigKey("[Controls]", "ShowDurationRemaining"))), diff --git a/src/preferences/dialog/dlgprefdeck.h b/src/preferences/dialog/dlgprefdeck.h index dde7bff85a7..7a97c668f8f 100644 --- a/src/preferences/dialog/dlgprefdeck.h +++ b/src/preferences/dialog/dlgprefdeck.h @@ -49,16 +49,11 @@ enum class KeyunlockMode { KeepLockedKey }; -/** - *@author Tue & Ken Haste Andersen - */ - class DlgPrefDeck : public DlgPreferencePage, public Ui::DlgPrefDeckDlg { Q_OBJECT public: - DlgPrefDeck(QWidget *parent, MixxxMainWindow *mixxx, - PlayerManager* pPlayerManager, - UserSettingsPointer pConfig); + DlgPrefDeck(QWidget* parent, + UserSettingsPointer pConfig); ~DlgPrefDeck() override; public slots: @@ -102,8 +97,6 @@ class DlgPrefDeck : public DlgPreferencePage, public Ui::DlgPrefDeckDlg { void setRateRangeForAllDecks(int rangePercent); void setRateDirectionForAllDecks(bool inverted); - MixxxMainWindow* const m_mixxx; - PlayerManager* const m_pPlayerManager; const UserSettingsPointer m_pConfig; const std::unique_ptr m_pControlTrackTimeDisplay; @@ -129,7 +122,6 @@ class DlgPrefDeck : public DlgPreferencePage, public Ui::DlgPrefDeckDlg { bool m_bSetIntroStartAtMainCue; bool m_bDisallowTrackLoadToPlayingDeck; bool m_bCloneDeckOnLoadDoubleTap; - bool m_bAssignHotcueColors; int m_iRateRangePercent; bool m_bRateDownIncreasesSpeed; diff --git a/src/preferences/dialog/dlgprefeffects.cpp b/src/preferences/dialog/dlgprefeffects.cpp index d1122e6ade7..34e2b5c3e37 100644 --- a/src/preferences/dialog/dlgprefeffects.cpp +++ b/src/preferences/dialog/dlgprefeffects.cpp @@ -1,8 +1,9 @@ #include "preferences/dialog/dlgprefeffects.h" -#include "effects/effectsmanager.h" #include "effects/effectmanifest.h" #include "effects/effectsbackend.h" +#include "effects/effectsmanager.h" +#include "moc_dlgprefeffects.cpp" DlgPrefEffects::DlgPrefEffects(QWidget* pParent, UserSettingsPointer pConfig, diff --git a/src/preferences/dialog/dlgprefeffects.h b/src/preferences/dialog/dlgprefeffects.h index 1694c4e146c..c787804bc1b 100644 --- a/src/preferences/dialog/dlgprefeffects.h +++ b/src/preferences/dialog/dlgprefeffects.h @@ -1,5 +1,4 @@ -#ifndef DLGPREFEFFECTS_H -#define DLGPREFEFFECTS_H +#pragma once #include @@ -31,7 +30,4 @@ class DlgPrefEffects : public DlgPreferencePage, public Ui::DlgPrefEffectsDlg { EffectSettingsModel m_availableEffectsModel; UserSettingsPointer m_pConfig; EffectsManager* m_pEffectsManager; - EffectSettingsModel* m_pAvailableEffectsModel; }; - -#endif /* DLGPREFEFFECTS_H */ diff --git a/src/preferences/dialog/dlgprefeq.cpp b/src/preferences/dialog/dlgprefeq.cpp index cd22f5c82c3..e20ab978ca7 100644 --- a/src/preferences/dialog/dlgprefeq.cpp +++ b/src/preferences/dialog/dlgprefeq.cpp @@ -1,20 +1,3 @@ -/*************************************************************************** - dlgprefeq.cpp - description - ------------------- - begin : Thu Jun 7 2007 - copyright : (C) 2007 by John Sully - email : jsully@scs.ryerson.ca -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "preferences/dialog/dlgprefeq.h" #include @@ -30,6 +13,7 @@ #include "effects/effectslot.h" #include "engine/filters/enginefilterbessel4.h" #include "mixer/playermanager.h" +#include "moc_dlgprefeq.cpp" #include "util/math.h" const QString kConfigKey = "[Mixer Profile]"; diff --git a/src/preferences/dialog/dlgprefeq.h b/src/preferences/dialog/dlgprefeq.h index d0f80d0273d..f6c10c96291 100644 --- a/src/preferences/dialog/dlgprefeq.h +++ b/src/preferences/dialog/dlgprefeq.h @@ -1,22 +1,4 @@ -/*************************************************************************** - dlgprefeq.h - description - ------------------- - begin : Thu Jun 7 2007 - copyright : (C) 2007 by John Sully - email : jsully@scs.ryerson.ca - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DLGPREFEQ_H -#define DLGPREFEQ_H +#pragma once #include #include @@ -28,9 +10,6 @@ #include "effects/effectsmanager.h" #include "effects/effectrack.h" -/** - *@author John Sully - */ class DlgPrefEQ : public DlgPreferencePage, public Ui::DlgPrefEQDlg { Q_OBJECT public: @@ -109,5 +88,3 @@ class DlgPrefEQ : public DlgPreferencePage, public Ui::DlgPrefEQDlg { bool m_bEqAutoReset; bool m_bGainAutoReset; }; - -#endif diff --git a/src/preferences/dialog/dlgpreferences.cpp b/src/preferences/dialog/dlgpreferences.cpp index c8d7f3c484c..072cc112595 100644 --- a/src/preferences/dialog/dlgpreferences.cpp +++ b/src/preferences/dialog/dlgpreferences.cpp @@ -1,34 +1,19 @@ -/*************************************************************************** - dlgpreferences.cpp - description - ------------------ - begin : Sun Jun 30 2002 - copyright : (C) 2002 by Tue & Ken Haste Andersen - email : haste@diku.dk -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ +#include "preferences/dialog/dlgpreferences.h" +#include #include #include -#include -#include -#include #include #include #include +#include +#include +#include -#include "preferences/dialog/dlgpreferences.h" - -#include "preferences/dialog/dlgprefsound.h" -#include "preferences/dialog/dlgpreflibrary.h" #include "controllers/dlgprefcontrollers.h" +#include "moc_dlgpreferences.cpp" +#include "preferences/dialog/dlgpreflibrary.h" +#include "preferences/dialog/dlgprefsound.h" #ifdef __VINYLCONTROL__ #include "preferences/dialog/dlgprefvinyl.h" @@ -64,7 +49,6 @@ #include "controllers/controllermanager.h" #include "library/library.h" #include "library/trackcollectionmanager.h" -#include "mixxx.h" #include "skin/skinloader.h" #include "util/widgethelper.h" @@ -75,6 +59,7 @@ DlgPreferences::DlgPreferences(MixxxMainWindow* mixxx, SkinLoader* pSkinLoader, #ifndef __LILV__ Q_UNUSED(pLV2Backend); #endif /* __LILV__ */ + Q_UNUSED(pPlayerManager); setupUi(this); contentsTreeWidget->setHeaderHidden(true); @@ -94,7 +79,7 @@ DlgPreferences::DlgPreferences(MixxxMainWindow* mixxx, SkinLoader* pSkinLoader, // Construct widgets for use in tabs. m_soundPage = PreferencesPage( - new DlgPrefSound(this, soundman, pPlayerManager, m_pConfig), + new DlgPrefSound(this, soundman, m_pConfig), createTreeItem(tr("Sound Hardware"), QIcon(":/images/preferences/ic_preferences_soundhardware.svg"))); addPageWidget(m_soundPage); @@ -138,7 +123,7 @@ DlgPreferences::DlgPreferences(MixxxMainWindow* mixxx, SkinLoader* pSkinLoader, createTreeItem(tr("Colors"), QIcon(":/images/preferences/ic_preferences_colors.svg")))); addPageWidget(PreferencesPage( - new DlgPrefDeck(this, mixxx, pPlayerManager, m_pConfig), + new DlgPrefDeck(this, m_pConfig), createTreeItem(tr("Decks"), QIcon(":/images/preferences/ic_preferences_decks.svg")))); addPageWidget(PreferencesPage( diff --git a/src/preferences/dialog/dlgpreferences.h b/src/preferences/dialog/dlgpreferences.h index 0091bda062b..ac05188f402 100644 --- a/src/preferences/dialog/dlgpreferences.h +++ b/src/preferences/dialog/dlgpreferences.h @@ -1,22 +1,4 @@ -/*************************************************************************** - dlgpreferences.h - description - ------------------- - begin : Sun Jun 30 2002 - copyright : (C) 2002 by Tue & Ken Haste Andersen - email : haste@diku.dk - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DLGPREFERENCES_H -#define DLGPREFERENCES_H +#pragma once #include #include @@ -130,10 +112,6 @@ DlgPreferences(MixxxMainWindow* mixxx, UserSettingsPointer m_pConfig; PreferencesPage m_soundPage; DlgPrefControllers* m_pControllersDlg; - DlgPrefColors* m_colorsPage; - QTreeWidgetItem* m_pColorsButton; QSize m_pageSizeHint; }; - -#endif diff --git a/src/preferences/dialog/dlgprefinterface.cpp b/src/preferences/dialog/dlgprefinterface.cpp index 6d684f951fe..698c5e2f480 100644 --- a/src/preferences/dialog/dlgprefinterface.cpp +++ b/src/preferences/dialog/dlgprefinterface.cpp @@ -12,6 +12,7 @@ #include "control/controlproxy.h" #include "defs_urls.h" #include "mixxx.h" +#include "moc_dlgprefinterface.cpp" #include "preferences/usersettings.h" #include "skin/legacyskinparser.h" #include "skin/skinloader.h" @@ -335,19 +336,13 @@ void DlgPrefInterface::slotSetTooltips() { } } -void DlgPrefInterface::notifyLocaleRebootNecessary() { +void DlgPrefInterface::notifyRebootNecessary() { // make the fact that you have to restart mixxx more obvious QMessageBox::information( this, tr("Information"), tr("Mixxx must be restarted before the new locale setting will take effect.")); } -void DlgPrefInterface::notifySkinRebootNecessary() { - // make the fact that you have to restart mixxx more obvious - QMessageBox::information( - this, tr("Information"), tr("Mixxx must be restarted to load the new skin.")); -} - void DlgPrefInterface::slotSetScheme(int) { QString newScheme = ComboBoxSchemeconf->currentText(); if (m_colorScheme != newScheme) { @@ -420,21 +415,15 @@ void DlgPrefInterface::slotApply() { } if (locale != m_localeOnUpdate) { - notifyLocaleRebootNecessary(); + notifyRebootNecessary(); // hack to prevent showing the notification when pressing "Okay" after "Apply" m_localeOnUpdate = locale; } if (m_bRebootMixxxView) { - // Require restarting Mixxx to apply the new skin in order to work around - // macOS skin change crash. https://bugs.launchpad.net/mixxx/+bug/1877487 -#ifdef __APPLE__ - notifySkinRebootNecessary(); -#else m_mixxx->rebootMixxxView(); // Allow switching skins multiple times without closing the dialog m_skinOnUpdate = m_skin; -#endif } m_bRebootMixxxView = false; } diff --git a/src/preferences/dialog/dlgprefinterface.h b/src/preferences/dialog/dlgprefinterface.h index 248f5a63058..1dfe7aaf6e2 100644 --- a/src/preferences/dialog/dlgprefinterface.h +++ b/src/preferences/dialog/dlgprefinterface.h @@ -1,22 +1,4 @@ -/*************************************************************************** - dlgprefcontrols.h - description - ------------------- - begin : Sat Jul 5 2003 - copyright : (C) 2003 by Tue & Ken Haste Andersen - email : haste@diku.dk - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DLGPREFCONTROLS_H -#define DLGPREFCONTROLS_H +#pragma once #include @@ -32,10 +14,6 @@ class PlayerManager; class MixxxMainWindow; class ControlObject; -/** - *@author Tue & Ken Haste Andersen - */ - class DlgPrefInterface : public DlgPreferencePage, public Ui::DlgPrefControlsDlg { Q_OBJECT public: @@ -57,8 +35,7 @@ class DlgPrefInterface : public DlgPreferencePage, public Ui::DlgPrefControlsDlg void slotSetScaleFactorAuto(bool checked); private: - void notifyLocaleRebootNecessary(); - void notifySkinRebootNecessary(); + void notifyRebootNecessary(); void loadTooltipPreferenceFromConfig(); // Because the CueDefault list is out of order, we have to set the combo @@ -87,5 +64,3 @@ class DlgPrefInterface : public DlgPreferencePage, public Ui::DlgPrefControlsDlg bool m_bRebootMixxxView; }; - -#endif diff --git a/src/preferences/dialog/dlgprefkey.cpp b/src/preferences/dialog/dlgprefkey.cpp index 908c27e10df..02bd789e665 100644 --- a/src/preferences/dialog/dlgprefkey.cpp +++ b/src/preferences/dialog/dlgprefkey.cpp @@ -1,20 +1,3 @@ -/*************************************************************************** - dlgprefkey.cpp - description - ------------------- - begin : Thu Jun 7 2012 - copyright : (C) 2012 by Keith Salisbury - email : keithsalisbury@gmail.com -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "preferences/dialog/dlgprefkey.h" #include @@ -22,6 +5,7 @@ #include "analyzer/analyzerkey.h" #include "control/controlproxy.h" +#include "moc_dlgprefkey.cpp" #include "util/compatibility.h" #include "util/xml.h" diff --git a/src/preferences/dialog/dlgprefkey.h b/src/preferences/dialog/dlgprefkey.h index f25c6ff68de..f76a02babc0 100644 --- a/src/preferences/dialog/dlgprefkey.h +++ b/src/preferences/dialog/dlgprefkey.h @@ -1,5 +1,4 @@ -#ifndef DLGPREFKEY_H -#define DLGPREFKEY_H +#pragma once #include #include @@ -54,5 +53,3 @@ class DlgPrefKey : public DlgPreferencePage, Ui::DlgPrefKeyDlg { bool m_bFastAnalysisEnabled; bool m_bReanalyzeEnabled; }; - -#endif diff --git a/src/preferences/dialog/dlgpreflibrary.cpp b/src/preferences/dialog/dlgpreflibrary.cpp index 3a10196317a..c5702dd549a 100644 --- a/src/preferences/dialog/dlgpreflibrary.cpp +++ b/src/preferences/dialog/dlgpreflibrary.cpp @@ -1,16 +1,18 @@ +#include "preferences/dialog/dlgpreflibrary.h" + +#include #include -#include #include #include -#include -#include -#include #include #include #include +#include +#include +#include -#include "preferences/dialog/dlgpreflibrary.h" #include "library/dlgtrackmetadataexport.h" +#include "moc_dlgpreflibrary.cpp" #include "sources/soundsourceproxy.h" #include "widget/wsearchlineedit.h" diff --git a/src/preferences/dialog/dlgpreflibrary.h b/src/preferences/dialog/dlgpreflibrary.h index 9adde26be43..09bbd9a3360 100644 --- a/src/preferences/dialog/dlgpreflibrary.h +++ b/src/preferences/dialog/dlgpreflibrary.h @@ -1,5 +1,4 @@ -#ifndef DLGPREFLIBRARY_H -#define DLGPREFLIBRARY_H +#pragma once #include #include @@ -12,10 +11,6 @@ #include "preferences/dlgpreferencepage.h" #include "preferences/usersettings.h" -/** - *@author Tue & Ken Haste Andersen - */ - class DlgPrefLibrary : public DlgPreferencePage, public Ui::DlgPrefLibraryDlg { Q_OBJECT public: @@ -72,5 +67,3 @@ class DlgPrefLibrary : public DlgPreferencePage, public Ui::DlgPrefLibraryDlg { QFont m_originalTrackTableFont; int m_iOriginalTrackTableRowHeight; }; - -#endif diff --git a/src/preferences/dialog/dlgpreflibrarydlg.ui b/src/preferences/dialog/dlgpreflibrarydlg.ui index 2bf8adfc40e..25d0a4c701d 100644 --- a/src/preferences/dialog/dlgpreflibrarydlg.ui +++ b/src/preferences/dialog/dlgpreflibrarydlg.ui @@ -7,7 +7,7 @@ 0 0 593 - 867 + 1049
@@ -131,7 +131,7 @@ - Export: Write modified track metadata from the library into file tags + Automatically write modified track metadata from the library into file tags diff --git a/src/preferences/dialog/dlgpreflv2.cpp b/src/preferences/dialog/dlgpreflv2.cpp index 3896bde93a1..ba4fb42fc8d 100644 --- a/src/preferences/dialog/dlgpreflv2.cpp +++ b/src/preferences/dialog/dlgpreflv2.cpp @@ -1,14 +1,16 @@ -#include -#include -#include -#include +#include "dlgpreflv2.h" + #include +#include +#include #include +#include +#include -#include "dlgpreflv2.h" #include "control/controlobject.h" -#include "util/math.h" #include "effects/effectsmanager.h" +#include "moc_dlgpreflv2.cpp" +#include "util/math.h" DlgPrefLV2::DlgPrefLV2(QWidget* pParent, LV2Backend* lv2Backend, UserSettingsPointer pConfig, diff --git a/src/preferences/dialog/dlgpreflv2.h b/src/preferences/dialog/dlgpreflv2.h index ff38c07020c..b3c9318d6c9 100644 --- a/src/preferences/dialog/dlgpreflv2.h +++ b/src/preferences/dialog/dlgpreflv2.h @@ -1,5 +1,4 @@ -#ifndef DLGPREFLV2_H -#define DLGPREFLV2_H +#pragma once #include #include @@ -37,5 +36,3 @@ class DlgPrefLV2 : public DlgPreferencePage, public Ui::DlgPrefLV2Dlg { int m_iCheckedParameters; EffectsManager* m_pEffectsManager; }; - -#endif diff --git a/src/preferences/dialog/dlgprefmodplug.cpp b/src/preferences/dialog/dlgprefmodplug.cpp index 8a5097a0ab1..f3c28fc221c 100644 --- a/src/preferences/dialog/dlgprefmodplug.cpp +++ b/src/preferences/dialog/dlgprefmodplug.cpp @@ -1,9 +1,9 @@ +#include "preferences/dialog/dlgprefmodplug.h" #include -#include "preferences/dialog/dlgprefmodplug.h" +#include "moc_dlgprefmodplug.cpp" #include "preferences/dialog/ui_dlgprefmodplugdlg.h" - #include "preferences/usersettings.h" #include "sources/soundsourcemodplug.h" diff --git a/src/preferences/dialog/dlgprefmodplug.h b/src/preferences/dialog/dlgprefmodplug.h index 87b967c8899..1e59f528f6a 100644 --- a/src/preferences/dialog/dlgprefmodplug.h +++ b/src/preferences/dialog/dlgprefmodplug.h @@ -1,8 +1,6 @@ -// dlgprefmodplug.h - modplug settings dialog -// created 2013 by Stefan Nuernberger +// modplug settings dialog -#ifndef DLGPREFMODPLUG_H -#define DLGPREFMODPLUG_H +#pragma once #include #include "preferences/usersettings.h" @@ -32,5 +30,3 @@ class DlgPrefModplug : public DlgPreferencePage { Ui::DlgPrefModplug* m_pUi; UserSettingsPointer m_pConfig; }; - -#endif // DLGPREFMODPLUG_H diff --git a/src/preferences/dialog/dlgprefnovinyl.cpp b/src/preferences/dialog/dlgprefnovinyl.cpp index 836b692af1b..fb9afe21d4c 100644 --- a/src/preferences/dialog/dlgprefnovinyl.cpp +++ b/src/preferences/dialog/dlgprefnovinyl.cpp @@ -1,23 +1,8 @@ -/*************************************************************************** - DlgPrefNoVinyl.cpp - description - ------------------- - begin : Thu Feb 24 2011 - copyright : (C) 2011 by Owen Williams - email : owen-bugs@ywwg.com -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - +#include "preferences/dialog/dlgprefnovinyl.h" #include -#include "preferences/dialog/dlgprefnovinyl.h" + +#include "moc_dlgprefnovinyl.cpp" DlgPrefNoVinyl::DlgPrefNoVinyl(QWidget * parent, SoundManager * soundman, UserSettingsPointer _config) diff --git a/src/preferences/dialog/dlgprefnovinyl.h b/src/preferences/dialog/dlgprefnovinyl.h index 4ce69633973..b03d9237b8e 100644 --- a/src/preferences/dialog/dlgprefnovinyl.h +++ b/src/preferences/dialog/dlgprefnovinyl.h @@ -1,22 +1,4 @@ -/*************************************************************************** - dlgprefnovinyl.h - description - ------------------- - begin : Thu Feb 24 2011 - copyright : (C) 2011 by Owen Williams - email : owen-bugs@ywwg.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DLGPREFNOVINYL_H -#define DLGPREFNOVINYL_H +#pragma once #include @@ -26,16 +8,9 @@ class SoundManager; -/** - *@author Stefan Langhammer - *@author Albert Santoni - */ - class DlgPrefNoVinyl : public DlgPreferencePage, Ui::DlgPrefNoVinylDlg { Q_OBJECT public: DlgPrefNoVinyl(QWidget *parent, SoundManager* soundman, UserSettingsPointer _config); virtual ~DlgPrefNoVinyl(); }; - -#endif diff --git a/src/preferences/dialog/dlgprefrecord.cpp b/src/preferences/dialog/dlgprefrecord.cpp index 68c13f46ebf..1df36538edc 100644 --- a/src/preferences/dialog/dlgprefrecord.cpp +++ b/src/preferences/dialog/dlgprefrecord.cpp @@ -1,12 +1,14 @@ +#include "preferences/dialog/dlgprefrecord.h" + #include #include -#include "preferences/dialog/dlgprefrecord.h" -#include "recording/defs_recording.h" #include "control/controlobject.h" +#include "control/controlproxy.h" #include "encoder/encoder.h" #include "encoder/encodermp3settings.h" -#include "control/controlproxy.h" +#include "moc_dlgprefrecord.cpp" +#include "recording/defs_recording.h" #include "util/sandbox.h" namespace { diff --git a/src/preferences/dialog/dlgprefrecord.h b/src/preferences/dialog/dlgprefrecord.h index f07f8b25e51..c6ff03eb252 100644 --- a/src/preferences/dialog/dlgprefrecord.h +++ b/src/preferences/dialog/dlgprefrecord.h @@ -1,5 +1,4 @@ -#ifndef DLGPREFRECORD_H -#define DLGPREFRECORD_H +#pragma once #include #include @@ -55,5 +54,3 @@ class DlgPrefRecord : public DlgPreferencePage, public Ui::DlgPrefRecordDlg { QList m_formatButtons; QList m_optionWidgets; }; - -#endif diff --git a/src/preferences/dialog/dlgprefreplaygain.cpp b/src/preferences/dialog/dlgprefreplaygain.cpp index 3eff1a2f31f..60204421920 100644 --- a/src/preferences/dialog/dlgprefreplaygain.cpp +++ b/src/preferences/dialog/dlgprefreplaygain.cpp @@ -1,6 +1,7 @@ #include "preferences/dialog/dlgprefreplaygain.h" #include "control/controlobject.h" +#include "moc_dlgprefreplaygain.cpp" #include "util/math.h" namespace { diff --git a/src/preferences/dialog/dlgprefreplaygain.h b/src/preferences/dialog/dlgprefreplaygain.h index 7204f123024..6153a51f2ad 100644 --- a/src/preferences/dialog/dlgprefreplaygain.h +++ b/src/preferences/dialog/dlgprefreplaygain.h @@ -1,5 +1,4 @@ -#ifndef DLGPREFREPLAYGAIN_H -#define DLGPREFREPLAYGAIN_H +#pragma once #include #include @@ -45,5 +44,3 @@ class DlgPrefReplayGain: public DlgPreferencePage, QButtonGroup m_analysisButtonGroup; }; - -#endif /* DLGPREFREPLAYGAIN_H */ diff --git a/src/preferences/dialog/dlgprefsound.cpp b/src/preferences/dialog/dlgprefsound.cpp index b6edcf7c5bd..7309f936d74 100644 --- a/src/preferences/dialog/dlgprefsound.cpp +++ b/src/preferences/dialog/dlgprefsound.cpp @@ -1,39 +1,27 @@ -/** - * @file dlgprefsound.cpp - * @author Bill Good - * @date 20100625 - */ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +#include "preferences/dialog/dlgprefsound.h" -#include #include -#include "preferences/dialog/dlgprefsound.h" -#include "preferences/dialog/dlgprefsounditem.h" +#include + +#include "control/controlproxy.h" #include "engine/enginebuffer.h" #include "engine/enginemaster.h" #include "mixer/playermanager.h" +#include "moc_dlgprefsound.cpp" +#include "preferences/dialog/dlgprefsounditem.h" #include "soundio/soundmanager.h" #include "util/rlimit.h" #include "util/scopedoverridecursor.h" -#include "control/controlproxy.h" /** * Construct a new sound preferences pane. Initializes and populates all the * all the controls to the values obtained from SoundManager. */ -DlgPrefSound::DlgPrefSound(QWidget* pParent, SoundManager* pSoundManager, - PlayerManager* pPlayerManager, UserSettingsPointer pSettings) +DlgPrefSound::DlgPrefSound(QWidget* pParent, + SoundManager* pSoundManager, + UserSettingsPointer pSettings) : DlgPreferencePage(pParent), m_pSoundManager(pSoundManager), - m_pPlayerManager(pPlayerManager), m_pSettings(pSettings), m_config(pSoundManager), m_settingsModified(false), diff --git a/src/preferences/dialog/dlgprefsound.h b/src/preferences/dialog/dlgprefsound.h index 6682555925d..8eea151afe0 100644 --- a/src/preferences/dialog/dlgprefsound.h +++ b/src/preferences/dialog/dlgprefsound.h @@ -1,20 +1,4 @@ -/** - * @file dlgprefsound.h - * @author Bill Good - * @date 20100625 - */ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DLGPREFSOUND_H -#define DLGPREFSOUND_H +#pragma once #include "defs_urls.h" #include "preferences/dialog/ui_dlgprefsounddlg.h" @@ -44,7 +28,6 @@ class DlgPrefSound : public DlgPreferencePage, public Ui::DlgPrefSoundDlg { Q_OBJECT; public: DlgPrefSound(QWidget *parent, SoundManager *soundManager, - PlayerManager* pPlayerManager, UserSettingsPointer pSettings); virtual ~DlgPrefSound(); @@ -99,7 +82,6 @@ class DlgPrefSound : public DlgPreferencePage, public Ui::DlgPrefSoundDlg { bool eventFilter(QObject* object, QEvent* event) override; SoundManager *m_pSoundManager; - PlayerManager *m_pPlayerManager; UserSettingsPointer m_pSettings; SoundManagerConfig m_config; ControlProxy* m_pMasterAudioLatencyOverloadCount; @@ -119,5 +101,3 @@ class DlgPrefSound : public DlgPreferencePage, public Ui::DlgPrefSoundDlg { bool m_bSkipConfigClear; bool m_loading; }; - -#endif diff --git a/src/preferences/dialog/dlgprefsounditem.cpp b/src/preferences/dialog/dlgprefsounditem.cpp index 8877950fcd6..e493d608559 100644 --- a/src/preferences/dialog/dlgprefsounditem.cpp +++ b/src/preferences/dialog/dlgprefsounditem.cpp @@ -1,21 +1,8 @@ -/** - * @file dlgprefsounditem.cpp - * @author Bill Good - * @date 20100704 - */ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +#include "preferences/dialog/dlgprefsounditem.h" #include -#include "preferences/dialog/dlgprefsounditem.h" +#include "moc_dlgprefsounditem.cpp" #include "soundio/sounddevice.h" #include "soundio/soundmanagerconfig.h" #include "util/compatibility.h" diff --git a/src/preferences/dialog/dlgprefsounditem.h b/src/preferences/dialog/dlgprefsounditem.h index efe88ec05ae..25b778054dc 100644 --- a/src/preferences/dialog/dlgprefsounditem.h +++ b/src/preferences/dialog/dlgprefsounditem.h @@ -1,20 +1,4 @@ -/** - * @file dlgprefsounditem.h - * @author Bill Good - * @date 20100704 - */ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DLGPREFSOUNDITEM_H -#define DLGPREFSOUNDITEM_H +#pragma once #include "preferences/dialog/ui_dlgprefsounditem.h" #include "soundio/soundmanagerutil.h" @@ -69,5 +53,3 @@ class DlgPrefSoundItem : public QWidget, public Ui::DlgPrefSoundItem { QPoint m_savedChannel; bool m_inhibitSettingChanged; }; - -#endif diff --git a/src/preferences/dialog/dlgprefvinyl.cpp b/src/preferences/dialog/dlgprefvinyl.cpp index 118f7ab8b4a..31c09ba830d 100644 --- a/src/preferences/dialog/dlgprefvinyl.cpp +++ b/src/preferences/dialog/dlgprefvinyl.cpp @@ -1,33 +1,15 @@ -/*************************************************************************** - dlgprefvinyl.cpp - description - ------------------- - begin : Thu Oct 23 2006 - copyright : (C) 2006 by Stefan Langhammer - (C) 2007 by Albert Santoni - email : stefan.langhammer@9elements.com - gamegod \a\t users.sf.net -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ +#include "preferences/dialog/dlgprefvinyl.h" #include -#include "preferences/dialog/dlgprefvinyl.h" - #include "control/controlobject.h" #include "control/controlproxy.h" +#include "defs_urls.h" #include "mixer/playermanager.h" +#include "moc_dlgprefvinyl.cpp" +#include "util/platform.h" #include "vinylcontrol/defs_vinylcontrol.h" #include "vinylcontrol/vinylcontrolmanager.h" -#include "defs_urls.h" -#include "util/platform.h" DlgPrefVinyl::DlgPrefVinyl(QWidget * parent, VinylControlManager *pVCMan, UserSettingsPointer _config) @@ -166,7 +148,7 @@ void DlgPrefVinyl::slotVinylType4Changed(const QString& text) { LeadinTime4->setValue(getDefaultLeadIn(text)); } -/** @brief Performs any necessary actions that need to happen when the prefs dialog is opened */ +/// Performs any necessary actions that need to happen when the prefs dialog is opened. void DlgPrefVinyl::slotShow() { if (m_pVCManager) { for (int i = 0; i < kMaximumVinylControlInputs; ++i) { @@ -180,7 +162,7 @@ void DlgPrefVinyl::slotShow() { } } -/** @brief Performs any necessary actions that need to happen when the prefs dialog is closed */ +/** Performs any necessary actions that need to happen when the prefs dialog is closed. */ void DlgPrefVinyl::slotHide() { if (m_pVCManager) { for (int i = 0; i < kMaximumVinylControlInputs; ++i) { diff --git a/src/preferences/dialog/dlgprefvinyl.h b/src/preferences/dialog/dlgprefvinyl.h index 778dfe6bdd0..16f6fd20c1c 100644 --- a/src/preferences/dialog/dlgprefvinyl.h +++ b/src/preferences/dialog/dlgprefvinyl.h @@ -1,22 +1,4 @@ -/*************************************************************************** - dlgprefvinyl.h - description - ------------------- - begin : Thu Oct 23 2006 - copyright : (C) 2006 by Stefan Langhammer - email : stefan.langhammer@9elements.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DLGPREFVINYL_H -#define DLGPREFVINYL_H +#pragma once #include #include @@ -71,5 +53,3 @@ class DlgPrefVinyl : public DlgPreferencePage, Ui::DlgPrefVinylDlg { QList m_COSpeeds; ControlProxy* m_pNumDecks; }; - -#endif diff --git a/src/preferences/dialog/dlgprefwaveform.cpp b/src/preferences/dialog/dlgprefwaveform.cpp index 75e376082db..48ac7bae01e 100644 --- a/src/preferences/dialog/dlgprefwaveform.cpp +++ b/src/preferences/dialog/dlgprefwaveform.cpp @@ -1,12 +1,13 @@ #include "preferences/dialog/dlgprefwaveform.h" -#include "mixxx.h" -#include "library/library.h" #include "library/dao/analysisdao.h" +#include "library/library.h" +#include "mixxx.h" +#include "moc_dlgprefwaveform.cpp" #include "preferences/waveformsettings.h" -#include "waveform/waveformwidgetfactory.h" -#include "waveform/renderers/waveformwidgetrenderer.h" #include "util/db/dbconnectionpooled.h" +#include "waveform/renderers/waveformwidgetrenderer.h" +#include "waveform/waveformwidgetfactory.h" DlgPrefWaveform::DlgPrefWaveform(QWidget* pParent, MixxxMainWindow* pMixxx, UserSettingsPointer pConfig, Library* pLibrary) @@ -215,8 +216,7 @@ void DlgPrefWaveform::slotResetToDefaults() { // Default zoom level is 3 in WaveformWidgetFactory. defaultZoomComboBox->setCurrentIndex(3 + 1); - // Don't synchronize zoom by default. - synchronizeZoomCheckBox->setChecked(false); + synchronizeZoomCheckBox->setChecked(true); // RGB overview. waveformOverviewComboBox->setCurrentIndex(2); diff --git a/src/preferences/dialog/dlgprefwaveform.h b/src/preferences/dialog/dlgprefwaveform.h index 339038d07ad..e3325cf1ec6 100644 --- a/src/preferences/dialog/dlgprefwaveform.h +++ b/src/preferences/dialog/dlgprefwaveform.h @@ -1,5 +1,4 @@ -#ifndef DLGPREFWAVEFORM_H -#define DLGPREFWAVEFORM_H +#pragma once #include @@ -48,6 +47,3 @@ class DlgPrefWaveform : public DlgPreferencePage, public Ui::DlgPrefWaveformDlg Library* m_pLibrary; MixxxMainWindow* m_pMixxx; }; - - -#endif /* DLGPREFWAVEFORM_H */ diff --git a/src/preferences/dlgpreferencepage.cpp b/src/preferences/dlgpreferencepage.cpp index c1782ffc23b..61b912b4419 100644 --- a/src/preferences/dlgpreferencepage.cpp +++ b/src/preferences/dlgpreferencepage.cpp @@ -1,6 +1,7 @@ #include "preferences/dlgpreferencepage.h" #include "defs_urls.h" +#include "moc_dlgpreferencepage.cpp" DlgPreferencePage::DlgPreferencePage(QWidget* pParent) : QWidget(pParent) { diff --git a/src/preferences/effectsettingsmodel.cpp b/src/preferences/effectsettingsmodel.cpp index 8e380fcdc34..780a1c450f5 100644 --- a/src/preferences/effectsettingsmodel.cpp +++ b/src/preferences/effectsettingsmodel.cpp @@ -1,5 +1,6 @@ -#include +#include "preferences/effectsettingsmodel.h" +#include "moc_effectsettingsmodel.cpp" namespace { const int kColumnEnabled = 0; diff --git a/src/preferences/effectsettingsmodel.h b/src/preferences/effectsettingsmodel.h index c89bea82eb5..471ef5bc6b7 100644 --- a/src/preferences/effectsettingsmodel.h +++ b/src/preferences/effectsettingsmodel.h @@ -1,5 +1,4 @@ -#ifndef PREFERENCES_EFFECTSETTINGSMODEL_H -#define PREFERENCES_EFFECTSETTINGSMODEL_H +#pragma once #include #include @@ -49,5 +48,3 @@ class EffectSettingsModel : public QAbstractTableModel { private: QList m_profiles; }; - -#endif // PREFERENCES_EFFECTSETTINGSMODEL_H diff --git a/src/preferences/keydetectionsettings.h b/src/preferences/keydetectionsettings.h index 5f059891806..c547764bdf9 100644 --- a/src/preferences/keydetectionsettings.h +++ b/src/preferences/keydetectionsettings.h @@ -1,5 +1,4 @@ -#ifndef PREFERENCES_KEYDETECTIONSETTINGS_H -#define PREFERENCES_KEYDETECTIONSETTINGS_H +#pragma once #include "preferences/usersettings.h" @@ -68,5 +67,3 @@ class KeyDetectionSettings { private: UserSettingsPointer m_pConfig; }; - -#endif /* PREFERENCES_KEYDETECTIONSETTINGS_H */ diff --git a/src/preferences/replaygainsettings.h b/src/preferences/replaygainsettings.h index 4ce83b77f0b..c5a3ae66ac1 100644 --- a/src/preferences/replaygainsettings.h +++ b/src/preferences/replaygainsettings.h @@ -1,5 +1,4 @@ -#ifndef PREFERENCES_REPLAYGAINSETTINGS_H -#define PREFERENCES_REPLAYGAINSETTINGS_H +#pragma once #include "preferences/usersettings.h" #include "track/track_decl.h" @@ -28,5 +27,3 @@ class ReplayGainSettings { // Pointer to config object UserSettingsPointer m_pConfig; }; - -#endif /* PREFERENCES_REPLAYGAINSETTINGS_H */ diff --git a/src/preferences/upgrade.cpp b/src/preferences/upgrade.cpp index fc810ed0237..caea917b326 100644 --- a/src/preferences/upgrade.cpp +++ b/src/preferences/upgrade.cpp @@ -1,20 +1,3 @@ -/*************************************************************************** - upgrade.cpp - description - ------------------- - begin : Fri Mar 13 2009 - copyright : (C) 2009 by Sean M. Pappalardo - email : pegasus@c64.org -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "preferences/upgrade.h" #include diff --git a/src/preferences/upgrade.h b/src/preferences/upgrade.h index 60fe57454b0..d382d9a8ef8 100644 --- a/src/preferences/upgrade.h +++ b/src/preferences/upgrade.h @@ -1,22 +1,4 @@ -/*************************************************************************** - upgrade.h - description - ------------------- - begin : Mon Apr 13 2009 - copyright : (C) 2009 by Sean M. Pappalardo - email : pegasus@c64.org -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - -#ifndef PREFERENCES_UPGRADE_H -#define PREFERENCES_UPGRADE_H +#pragma once #include "preferences/usersettings.h" @@ -35,5 +17,3 @@ class Upgrade { bool m_bFirstRun; bool m_bRescanLibrary; }; - -#endif /* PREFERENCES_UPGRADE_H */ diff --git a/src/preferences/usersettings.h b/src/preferences/usersettings.h index dcaa4163a8e..7e58dfe01ea 100644 --- a/src/preferences/usersettings.h +++ b/src/preferences/usersettings.h @@ -1,5 +1,4 @@ -#ifndef PREFERENCES_USERSETTINGS_H -#define PREFERENCES_USERSETTINGS_H +#pragma once #include #include @@ -35,5 +34,3 @@ typedef QWeakPointer UserSettingsWeakPointer; m_pConfig->setValue(ConfigKey(preference_group, preference_item), \ value); \ } - -#endif /* PREFERENCES_USERSETTINGS_H */ diff --git a/src/preferences/waveformsettings.h b/src/preferences/waveformsettings.h index 3b9ce951e66..073e465bca5 100644 --- a/src/preferences/waveformsettings.h +++ b/src/preferences/waveformsettings.h @@ -1,5 +1,4 @@ -#ifndef PREFERENCES_WAVEFORMSETTINGS_H -#define PREFERENCES_WAVEFORMSETTINGS_H +#pragma once #include "preferences/usersettings.h" @@ -30,5 +29,3 @@ class WaveformSettings { private: UserSettingsPointer m_pConfig; }; - -#endif /* PREFERENCES_WAVEFORMSETTINGS_H */ diff --git a/src/recording/defs_recording.h b/src/recording/defs_recording.h index 67f1f7de518..15de72aec20 100644 --- a/src/recording/defs_recording.h +++ b/src/recording/defs_recording.h @@ -1,5 +1,4 @@ -#ifndef __RECORDING_DEFS_H__ -#define __RECORDING_DEFS_H__ +#pragma once #define RECORDING_PREF_KEY "[Recording]" #define ENCODING_WAVE "WAV" @@ -32,5 +31,3 @@ #define SIZE_1GB Q_UINT64_C(1'070'000'000) #define SIZE_2GB Q_UINT64_C(2'140'000'000) #define SIZE_4GB Q_UINT64_C(4'280'000'000) - -#endif diff --git a/src/recording/recordingmanager.cpp b/src/recording/recordingmanager.cpp index 027d8a15de9..2f0a4a28a65 100644 --- a/src/recording/recordingmanager.cpp +++ b/src/recording/recordingmanager.cpp @@ -12,6 +12,7 @@ #include "engine/sidechain/enginerecord.h" #include "engine/sidechain/enginesidechain.h" #include "errordialoghandler.h" +#include "moc_recordingmanager.cpp" #include "recording/defs_recording.h" #define MIN_DISK_FREE 1024 * 1024 * 1024ll // one gibibyte diff --git a/src/skin/colorschemeparser.cpp b/src/skin/colorschemeparser.cpp index ce0a221d000..481152f39f2 100644 --- a/src/skin/colorschemeparser.cpp +++ b/src/skin/colorschemeparser.cpp @@ -1,4 +1,3 @@ - #include "skin/colorschemeparser.h" #include "widget/wpixmapstore.h" diff --git a/src/skin/colorschemeparser.h b/src/skin/colorschemeparser.h index 6decd79a92f..95ea0a33120 100644 --- a/src/skin/colorschemeparser.h +++ b/src/skin/colorschemeparser.h @@ -1,5 +1,4 @@ -#ifndef COLORSCHEMEPARSER_H -#define COLORSCHEMEPARSER_H +#pragma once #include "preferences/usersettings.h" #include "skin/legacyskinparser.h" @@ -20,5 +19,3 @@ class ColorSchemeParser { ColorSchemeParser() { } ~ColorSchemeParser() { } }; - -#endif /* COLORSCHEMEPARSER_H */ diff --git a/src/skin/imgcolor.h b/src/skin/imgcolor.h index aced3157a6a..1253e7cd462 100644 --- a/src/skin/imgcolor.h +++ b/src/skin/imgcolor.h @@ -1,22 +1,4 @@ -/*************************************************************************** - imgcolor.h - description - ------------------- - begin : 14 April 2007 - copyright : (C) 2007 by Adam Davison - email : adamdavison@gmail.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef IMGCOLOR_H -#define IMGCOLOR_H +#pragma once #include "imgsource.h" @@ -88,5 +70,3 @@ class ImgHSVTweak : public ImgColorProcessor { m_hconst, m_sconst, m_vconst; float m_hfact, m_sfact, m_vfact; }; -#endif - diff --git a/src/skin/imginvert.cpp b/src/skin/imginvert.cpp index 3f06a48eecb..6e29086affc 100644 --- a/src/skin/imginvert.cpp +++ b/src/skin/imginvert.cpp @@ -6,4 +6,3 @@ QColor ImgInvert::doColorCorrection(const QColor& c) const { 0xff - c.blue(), c.alpha()); } - diff --git a/src/skin/imginvert.h b/src/skin/imginvert.h index fbcea21b93c..2e26031a3f4 100644 --- a/src/skin/imginvert.h +++ b/src/skin/imginvert.h @@ -1,22 +1,4 @@ -/*************************************************************************** - imginvert.h - description - ------------------- - begin : 14 April 2007 - copyright : (C) 2007 by Adam Davison - email : adamdavison@gmail.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef IMGINVERT_H -#define IMGINVERT_H +#pragma once #include "imgsource.h" @@ -26,6 +8,3 @@ class ImgInvert : public ImgColorProcessor { inline ImgInvert(ImgSource* parent) : ImgColorProcessor(parent) {} QColor doColorCorrection(const QColor& c) const override; }; - -#endif - diff --git a/src/skin/imgloader.cpp b/src/skin/imgloader.cpp index 1b97e8f1df6..439ec6722f4 100644 --- a/src/skin/imgloader.cpp +++ b/src/skin/imgloader.cpp @@ -1,4 +1,3 @@ - #include #include diff --git a/src/skin/imgloader.h b/src/skin/imgloader.h index cd34541397f..b295244e1c1 100644 --- a/src/skin/imgloader.h +++ b/src/skin/imgloader.h @@ -1,22 +1,4 @@ -/*************************************************************************** - imgloader.h - description - ------------------- - begin : 14 April 2007 - copyright : (C) 2007 by Adam Davison - email : adamdavison@gmail.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef IMGLOADER_H -#define IMGLOADER_H +#pragma once #include "imgsource.h" @@ -26,6 +8,3 @@ class ImgLoader : public ImgSource { ImgLoader(); QImage* getImage(const QString &fileName, double scaleFactor) const override; }; - -#endif - diff --git a/src/skin/imgsource.h b/src/skin/imgsource.h index 9e26cce47f5..216c95e2b51 100644 --- a/src/skin/imgsource.h +++ b/src/skin/imgsource.h @@ -1,22 +1,4 @@ -/*************************************************************************** - imgsource.h - description - ------------------- - begin : 14 April 2007 - copyright : (C) 2007 by Adam Davison - email : adamdavison@gmail.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef IMGSOURCE_H -#define IMGSOURCE_H +#pragma once #include #include @@ -136,5 +118,3 @@ class ImgColorProcessor : public ImgProcessor { bool willCorrectColors() const override { return true; } }; - -#endif diff --git a/src/skin/launchimage.cpp b/src/skin/launchimage.cpp index 6e145e0f71c..8751ed2495e 100644 --- a/src/skin/launchimage.cpp +++ b/src/skin/launchimage.cpp @@ -7,6 +7,8 @@ #include #include +#include "moc_launchimage.cpp" + LaunchImage::LaunchImage(QWidget* pParent, const QString& styleSheet) : QWidget(pParent) { if (styleSheet.isEmpty()) { @@ -65,4 +67,3 @@ void LaunchImage::paintEvent(QPaintEvent *) QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } - diff --git a/src/skin/legacyskinparser.cpp b/src/skin/legacyskinparser.cpp index 49e6dfac601..22e6bf30c37 100644 --- a/src/skin/legacyskinparser.cpp +++ b/src/skin/legacyskinparser.cpp @@ -1,6 +1,3 @@ -// legacyskinparser.cpp -// Created 9/19/2010 by RJ Ryan (rryan@mit.edu) - #include "skin/legacyskinparser.h" #include @@ -22,6 +19,7 @@ #include "library/library.h" #include "mixer/basetrackplayer.h" #include "mixer/playermanager.h" +#include "moc_legacyskinparser.cpp" #include "recording/recordingmanager.h" #include "skin/colorschemeparser.h" #include "skin/launchimage.h" diff --git a/src/skin/pixmapsource.h b/src/skin/pixmapsource.h index 4ae1ffd924a..25126731264 100644 --- a/src/skin/pixmapsource.h +++ b/src/skin/pixmapsource.h @@ -1,5 +1,4 @@ -#ifndef PIXMAPSOURCE_H -#define PIXMAPSOURCE_H +#pragma once #include #include @@ -29,5 +28,3 @@ class PixmapSource final { QByteArray m_svgSourceData; enum Type m_eType; }; - -#endif /* PIXMAPSOURCE_H */ diff --git a/src/skin/skinloader.cpp b/src/skin/skinloader.cpp index 2cd7e9f5fbb..4afc1a501d2 100644 --- a/src/skin/skinloader.cpp +++ b/src/skin/skinloader.cpp @@ -1,6 +1,3 @@ -// skinloader.cpp -// Created 6/21/2010 by RJ Ryan (rryan@mit.edu) - #include "skin/skinloader.h" #include diff --git a/src/skin/skinparser.h b/src/skin/skinparser.h index 928f60c3273..3e906c6503e 100644 --- a/src/skin/skinparser.h +++ b/src/skin/skinparser.h @@ -1,5 +1,4 @@ -#ifndef SKINPARSER_H -#define SKINPARSER_H +#pragma once #include #include @@ -12,5 +11,3 @@ class SkinParser { virtual bool canParse(const QString& skinPath) = 0; virtual QWidget* parseSkin(const QString& skinPath, QWidget* pParent) = 0; }; - -#endif /* SKINPARSER_H */ diff --git a/src/skin/tooltips.cpp b/src/skin/tooltips.cpp index 06d83cb5637..d32039aaa57 100644 --- a/src/skin/tooltips.cpp +++ b/src/skin/tooltips.cpp @@ -1,5 +1,7 @@ #include "skin/tooltips.h" +#include "moc_tooltips.cpp" + Tooltips::Tooltips() { addStandardTooltips(); } diff --git a/src/skin/tooltips.h b/src/skin/tooltips.h index 35b2fc05ec7..047be54abfb 100644 --- a/src/skin/tooltips.h +++ b/src/skin/tooltips.h @@ -1,5 +1,4 @@ -#ifndef TOOLTIPS_H -#define TOOLTIPS_H +#pragma once #include #include @@ -19,6 +18,3 @@ class Tooltips : public QObject { QHash m_tooltips; }; - - -#endif /* TOOLTIPS_H */ diff --git a/src/soundio/sounddevice.cpp b/src/soundio/sounddevice.cpp index 40e4b75257f..209f65141e2 100644 --- a/src/soundio/sounddevice.cpp +++ b/src/soundio/sounddevice.cpp @@ -1,20 +1,3 @@ -/*************************************************************************** - sounddevice.cpp - ------------------- - begin : Sun Aug 12, 2007, past my bedtime - copyright : (C) 2007 Albert Santoni - email : gamegod \a\t users.sf.net -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "soundio/sounddevice.h" #include diff --git a/src/soundio/sounddevice.h b/src/soundio/sounddevice.h index 5a9b103bc04..da42f418f37 100644 --- a/src/soundio/sounddevice.h +++ b/src/soundio/sounddevice.h @@ -1,22 +1,4 @@ -/*************************************************************************** - sounddevice.cpp - ------------------- - begin : Sun Aug 12, 2007, past my bedtime - copyright : (C) 2007 Albert Santoni - email : gamegod \a\t users.sf.net - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef SOUNDDEVICE_H -#define SOUNDDEVICE_H +#pragma once #include #include @@ -108,5 +90,3 @@ class SoundDevice { }; typedef QSharedPointer SoundDevicePointer; - -#endif diff --git a/src/soundio/sounddeviceerror.h b/src/soundio/sounddeviceerror.h index 7fac1d7c41b..7d6968b1fe9 100644 --- a/src/soundio/sounddeviceerror.h +++ b/src/soundio/sounddeviceerror.h @@ -1,5 +1,4 @@ -#ifndef SOUNDDEVICEERROR_H -#define SOUNDDEVICEERROR_H +#pragma once // Used for returning errors from sounddevice functions. enum SoundDeviceError { @@ -10,5 +9,3 @@ enum SoundDeviceError { SOUNDDEVICE_ERROR_EXCESSIVE_INPUT_CHANNEL, SOUNDDEVICE_ERROR_DEVICE_COUNT }; - -#endif /* SOUNDDEVICEERROR_H */ diff --git a/src/soundio/sounddevicenetwork.cpp b/src/soundio/sounddevicenetwork.cpp index 57d147e269d..bce818e71f0 100644 --- a/src/soundio/sounddevicenetwork.cpp +++ b/src/soundio/sounddevicenetwork.cpp @@ -2,19 +2,20 @@ #include -#include "waveform/visualplayposition.h" -#include "util/timer.h" -#include "util/trace.h" -#include "control/controlproxy.h" #include "control/controlobject.h" -#include "util/denormalsarezero.h" +#include "control/controlproxy.h" #include "engine/sidechain/enginenetworkstream.h" #include "float.h" +#include "moc_sounddevicenetwork.cpp" #include "soundio/sounddevice.h" #include "soundio/soundmanager.h" #include "soundio/soundmanagerutil.h" +#include "util/denormalsarezero.h" #include "util/logger.h" #include "util/sample.h" +#include "util/timer.h" +#include "util/trace.h" +#include "waveform/visualplayposition.h" namespace { const int kNetworkLatencyFrames = 8192; // 185 ms @ 44100 Hz diff --git a/src/soundio/sounddevicenetwork.h b/src/soundio/sounddevicenetwork.h index 3d28aeb8443..7c5b8686e79 100644 --- a/src/soundio/sounddevicenetwork.h +++ b/src/soundio/sounddevicenetwork.h @@ -1,5 +1,4 @@ -#ifndef SOUNDDEVICENETWORK_H -#define SOUNDDEVICENETWORK_H +#pragma once #include #include @@ -103,5 +102,3 @@ class SoundDeviceNetworkThread : public QThread { SoundDeviceNetwork* m_pParent; bool m_stop; }; - -#endif // SOUNDDEVICENETWORK_H diff --git a/src/soundio/sounddevicenotfound.h b/src/soundio/sounddevicenotfound.h index 2e33dbf7f99..7ff817d4805 100644 --- a/src/soundio/sounddevicenotfound.h +++ b/src/soundio/sounddevicenotfound.h @@ -1,5 +1,4 @@ -#ifndef SOUNDDEVICENOTFOUND_H -#define SOUNDDEVICENOTFOUND_H +#pragma once #include @@ -38,5 +37,3 @@ class SoundDeviceNotFound : public SoundDevice { return 44100; } }; - -#endif // SOUNDDEVICENOTFOUND_H diff --git a/src/soundio/soundmanager.cpp b/src/soundio/soundmanager.cpp index e5c69268d9f..65993a9383a 100644 --- a/src/soundio/soundmanager.cpp +++ b/src/soundio/soundmanager.cpp @@ -1,26 +1,10 @@ -/** - * @file soundmanager.cpp - * @author Albert Santoni - * @author Bill Good - * @date 20070815 - */ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "soundio/soundmanager.h" -#include -#include // for memcpy and strcmp +#include #include -#include +#include +#include // for memcpy and strcmp #include "control/controlobject.h" #include "control/controlproxy.h" @@ -28,13 +12,14 @@ #include "engine/enginemaster.h" #include "engine/sidechain/enginenetworkstream.h" #include "engine/sidechain/enginesidechain.h" +#include "moc_soundmanager.cpp" #include "soundio/sounddevice.h" #include "soundio/sounddevicenetwork.h" #include "soundio/sounddevicenotfound.h" #include "soundio/sounddeviceportaudio.h" #include "soundio/soundmanagerutil.h" -#include "util/compatibility.h" #include "util/cmdlineargs.h" +#include "util/compatibility.h" #include "util/defs.h" #include "util/sample.h" #include "util/sleep.h" diff --git a/src/soundio/soundmanagerconfig.cpp b/src/soundio/soundmanagerconfig.cpp index 6e77113c218..1ffa35fb7b9 100644 --- a/src/soundio/soundmanagerconfig.cpp +++ b/src/soundio/soundmanagerconfig.cpp @@ -1,18 +1,3 @@ -/** - * @file soundmanagerconfig.cpp - * @author Bill Good - * @date 20100709 - */ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - #include #include "soundio/soundmanagerconfig.h" diff --git a/src/soundio/soundmanagerconfig.h b/src/soundio/soundmanagerconfig.h index 0e030ebcdd9..d158ae3cd6f 100644 --- a/src/soundio/soundmanagerconfig.h +++ b/src/soundio/soundmanagerconfig.h @@ -1,20 +1,4 @@ -/** - * @file soundmanagerconfig.h - * @author Bill Good - * @date 20100709 - */ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef SOUNDMANAGERCONFIG_H -#define SOUNDMANAGERCONFIG_H +#pragma once #ifndef SOUNDMANAGERCONFIG_FILENAME #define SOUNDMANAGERCONFIG_FILENAME "soundconfig.xml" @@ -103,4 +87,3 @@ class SoundManagerConfig { bool m_bExternalRecordBroadcastConnected; SoundManager* m_pSoundManager; }; -#endif diff --git a/src/soundio/soundmanagerutil.cpp b/src/soundio/soundmanagerutil.cpp index 1381313c589..f64cfd8b533 100644 --- a/src/soundio/soundmanagerutil.cpp +++ b/src/soundio/soundmanagerutil.cpp @@ -1,18 +1,3 @@ -/** - * @file soundmanagerutil.cpp - * @author Bill Good - * @date 20100611 - */ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - #include "soundio/soundmanagerutil.h" #include "engine/channels/enginechannel.h" diff --git a/src/sources/mp3decoding.h b/src/sources/mp3decoding.h index bf272c7cdc1..00fa1041feb 100644 --- a/src/sources/mp3decoding.h +++ b/src/sources/mp3decoding.h @@ -1,5 +1,4 @@ -#ifndef MIXXX_MP3DECODING_H -#define MIXXX_MP3DECODING_H +#pragma once #include "util/types.h" @@ -12,5 +11,3 @@ namespace mixxx { constexpr SINT kMp3SeekFramePrefetchCount = 29; } // namespace mixxx - -#endif // MIXXX_MP3DECODING_H diff --git a/src/sources/soundsourcemodplug.cpp b/src/sources/soundsourcemodplug.cpp index 4d1520e5b04..9fd98a767a1 100644 --- a/src/sources/soundsourcemodplug.cpp +++ b/src/sources/soundsourcemodplug.cpp @@ -108,11 +108,14 @@ SoundSourceModPlug::importTrackMetadataAndCoverImage( pTrackMetadata->refTrackInfo().setComment(QString(ModPlug::ModPlug_GetMessage(pModFile))); pTrackMetadata->refTrackInfo().setTitle(QString(ModPlug::ModPlug_GetName(pModFile))); - pTrackMetadata->setChannelCount(audio::ChannelCount(kChannelCount)); - pTrackMetadata->setSampleRate(audio::SampleRate(kSampleRate)); - pTrackMetadata->setBitrate(audio::Bitrate(8)); - pTrackMetadata->setDuration(Duration::fromMillis(ModPlug::ModPlug_GetLength(pModFile))); - ModPlug::ModPlug_Unload(pModFile); + pTrackMetadata->setStreamInfo(audio::StreamInfo{ + audio::SignalInfo{ + audio::ChannelCount(kChannelCount), + audio::SampleRate(kSampleRate), + }, + audio::Bitrate(8), + Duration::fromMillis(ModPlug::ModPlug_GetLength(pModFile)), + }); return std::make_pair(ImportResult::Succeeded, QFileInfo(modFile).lastModified()); } diff --git a/src/sources/soundsourceopus.cpp b/src/sources/soundsourceopus.cpp index c5ade898601..9cf9eaad10d 100644 --- a/src/sources/soundsourceopus.cpp +++ b/src/sources/soundsourceopus.cpp @@ -138,17 +138,18 @@ SoundSourceOpus::importTrackMetadataAndCoverImage( return imported; } - pTrackMetadata->setChannelCount( - audio::ChannelCount(op_channel_count(pOggOpusFile, -1))); - pTrackMetadata->setSampleRate( - kSampleRate); - pTrackMetadata->setBitrate( - audio::Bitrate(op_bitrate(pOggOpusFile, -1) / 1000)); // Cast to double is required for duration with sub-second precision const double dTotalFrames = op_pcm_total(pOggOpusFile, -1); const auto duration = Duration::fromMicros( - static_cast(1000000 * dTotalFrames / pTrackMetadata->getSampleRate())); - pTrackMetadata->setDuration(duration); + static_cast(1000000 * dTotalFrames / kSampleRate)); + pTrackMetadata->setStreamInfo(audio::StreamInfo{ + audio::SignalInfo{ + audio::ChannelCount(op_channel_count(pOggOpusFile, -1)), + kSampleRate, + }, + audio::Bitrate(op_bitrate(pOggOpusFile, -1) / 1000), + duration, + }); #ifndef TAGLIB_HAS_OPUSFILE const OpusTags* l_ptrOpusTags = op_tags(pOggOpusFile, -1); diff --git a/src/sources/soundsourceproxy.cpp b/src/sources/soundsourceproxy.cpp index 1347579439a..6bbc9d3981e 100644 --- a/src/sources/soundsourceproxy.cpp +++ b/src/sources/soundsourceproxy.cpp @@ -347,15 +347,34 @@ QImage SoundSourceProxy::importTemporaryCoverImage( ExportTrackMetadataResult SoundSourceProxy::exportTrackMetadataBeforeSaving(Track* pTrack) { DEBUG_ASSERT(pTrack); - const auto trackFile = pTrack->getFileInfo(); - mixxx::MetadataSourcePointer pMetadataSource = - SoundSourceProxy(trackFile.toUrl()).m_pSoundSource; + const auto fileInfo = pTrack->getFileInfo(); + mixxx::MetadataSourcePointer pMetadataSource; + { + auto proxy = SoundSourceProxy(fileInfo.toUrl()); + // Ensure that the actual audio properties of the + // stream are available before exporting metadata. + // This might be needed for converting sample positions + // to time positions and vice versa. + if (!pTrack->hasStreamInfoFromSource()) { + auto pAudioSource = proxy.openAudioSource(); + if (pAudioSource) { + pTrack->updateStreamInfoFromSource( + pAudioSource->getStreamInfo()); + DEBUG_ASSERT(pTrack->hasStreamInfoFromSource()); + } else { + kLogger.warning() + << "Failed to update stream info from audio " + "source before exporting metadata"; + } + } + pMetadataSource = proxy.m_pSoundSource; + } if (pMetadataSource) { return pTrack->exportMetadata(pMetadataSource); } else { kLogger.warning() << "Unable to export track metadata into file" - << trackFile.location(); + << fileInfo.location(); return ExportTrackMetadataResult::Skipped; } } @@ -669,7 +688,6 @@ QImage SoundSourceProxy::importCoverImage() const { mixxx::AudioSourcePointer SoundSourceProxy::openAudioSource( const mixxx::AudioSource::OpenParams& params) { - DEBUG_ASSERT(m_pTrack); auto openMode = mixxx::SoundSource::OpenMode::Strict; int attemptCount = 0; while (m_pProvider && m_pSoundSource && !m_pAudioSource) { @@ -678,13 +696,17 @@ mixxx::AudioSourcePointer SoundSourceProxy::openAudioSource( m_pSoundSource->open(openMode, params); if (openResult == mixxx::SoundSource::OpenResult::Succeeded) { if (m_pSoundSource->verifyReadable()) { + // The internal m_pTrack might be null when opening the AudioSource + // before exporting metadata. In this case the caller (this class) + // is responsible for updating the stream info if needed. + if (!m_pTrack) { + return m_pSoundSource; + } m_pAudioSource = mixxx::AudioSourceTrackProxy::create(m_pTrack, m_pSoundSource); DEBUG_ASSERT(m_pAudioSource); // Overwrite metadata with actual audio properties - if (m_pTrack) { - m_pTrack->updateAudioPropertiesFromStream( - m_pAudioSource->getStreamInfo()); - } + m_pTrack->updateStreamInfoFromSource( + m_pAudioSource->getStreamInfo()); return m_pAudioSource; } kLogger.warning() diff --git a/src/sources/urlresource.h b/src/sources/urlresource.h index 747daf68c74..e9397137069 100644 --- a/src/sources/urlresource.h +++ b/src/sources/urlresource.h @@ -1,5 +1,4 @@ -#ifndef MIXXX_URLRESOURCE_H -#define MIXXX_URLRESOURCE_H +#pragma once #include "util/assert.h" @@ -41,5 +40,3 @@ class UrlResource { }; } // namespace mixxx - -#endif // MIXXX_URLRESOURCE_H diff --git a/src/sources/v1/legacyaudiosource.h b/src/sources/v1/legacyaudiosource.h index 983e7ba3222..1651bec322d 100644 --- a/src/sources/v1/legacyaudiosource.h +++ b/src/sources/v1/legacyaudiosource.h @@ -1,5 +1,4 @@ -#ifndef MIXXX_LEGACYAUDIOSOURCE_H -#define MIXXX_LEGACYAUDIOSOURCE_H +#pragma once #include "util/types.h" @@ -36,5 +35,3 @@ class LegacyAudioSource { }; } // namespace mixxx - -#endif // MIXXX_LEGACYAUDIOSOURCE_H diff --git a/src/sources/v1/legacyaudiosourceadapter.h b/src/sources/v1/legacyaudiosourceadapter.h index 40aa362b702..61dd8f2d59d 100644 --- a/src/sources/v1/legacyaudiosourceadapter.h +++ b/src/sources/v1/legacyaudiosourceadapter.h @@ -1,5 +1,4 @@ -#ifndef MIXXX_LEGACYAUDIOSOURCEADAPTER_H -#define MIXXX_LEGACYAUDIOSOURCEADAPTER_H +#pragma once #include "sources/v1/legacyaudiosource.h" @@ -24,5 +23,3 @@ class LegacyAudioSourceAdapter : public virtual /*implements*/ IAudioSourceReade }; } // namespace mixxx - -#endif // MIXXX_LEGACYAUDIOSOURCEADAPTER_H diff --git a/src/test/baseeffecttest.h b/src/test/baseeffecttest.h index 566f3d00257..7e945bb2c32 100644 --- a/src/test/baseeffecttest.h +++ b/src/test/baseeffecttest.h @@ -1,5 +1,4 @@ -#ifndef BASEEFFECTTEST_H -#define BASEEFFECTTEST_H +#pragma once #include #include @@ -80,6 +79,3 @@ class BaseEffectTest : public MixxxTest { TestEffectBackend* m_pTestBackend; QScopedPointer m_pEffectsManager; }; - - -#endif /* BASEEFFECTTEST_H */ diff --git a/src/test/mockedenginebackendtest.h b/src/test/mockedenginebackendtest.h index 8d33143673e..3b06886f26b 100644 --- a/src/test/mockedenginebackendtest.h +++ b/src/test/mockedenginebackendtest.h @@ -1,5 +1,4 @@ -#ifndef MOCKENGINEBACKENDTEST_H_ -#define MOCKENGINEBACKENDTEST_H_ +#pragma once #include #include @@ -96,5 +95,3 @@ class MockedEngineBackendTest : public BaseSignalPathTest { MockScaler *m_pMockScaleKeylock1, *m_pMockScaleKeylock2, *m_pMockScaleKeylock3; TrackPointer m_pTrack1, m_pTrack2, m_pTrack3; }; - -#endif /* MOCKEDENGINEBACKENDTEST_H_ */ diff --git a/src/test/trackexport_test.cpp b/src/test/trackexport_test.cpp index 1227c0b1859..d897eba5205 100644 --- a/src/test/trackexport_test.cpp +++ b/src/test/trackexport_test.cpp @@ -6,6 +6,7 @@ #include #include +#include "moc_trackexport_test.cpp" #include "track/track.h" FakeOverwriteAnswerer::~FakeOverwriteAnswerer() { } diff --git a/src/test/trackexport_test.h b/src/test/trackexport_test.h index 359d4db727d..00a543bf6ae 100644 --- a/src/test/trackexport_test.h +++ b/src/test/trackexport_test.h @@ -1,3 +1,5 @@ +#pragma once + #include "library/export/trackexportworker.h" #include diff --git a/src/test/trackmetadata_test.cpp b/src/test/trackmetadata_test.cpp index aec136ab0c2..af16af07fe6 100644 --- a/src/test/trackmetadata_test.cpp +++ b/src/test/trackmetadata_test.cpp @@ -66,10 +66,15 @@ TEST_F(TrackMetadataTest, mergeImportedMetadata) { // Existing track metadata (stored in the database) without extra properties mixxx::TrackRecord oldTrackRecord; mixxx::TrackMetadata* pOldTrackMetadata = oldTrackRecord.ptrMetadata(); - pOldTrackMetadata->setBitrate(mixxx::audio::Bitrate(100)); - pOldTrackMetadata->setChannelCount(mixxx::audio::ChannelCount(1)); - pOldTrackMetadata->setDuration(mixxx::Duration::fromSeconds(60)); - pOldTrackMetadata->setSampleRate(mixxx::audio::SampleRate(10000)); + pOldTrackMetadata->setStreamInfo( + mixxx::audio::StreamInfo{ + mixxx::audio::SignalInfo{ + mixxx::audio::ChannelCount(1), + mixxx::audio::SampleRate(10000), + }, + mixxx::audio::Bitrate(100), + mixxx::Duration::fromSeconds(60), + }); mixxx::TrackInfo* pOldTrackInfo = pOldTrackMetadata->ptrTrackInfo(); pOldTrackInfo->setArtist("old artist"); pOldTrackInfo->setBpm(mixxx::Bpm(100)); @@ -89,10 +94,15 @@ TEST_F(TrackMetadataTest, mergeImportedMetadata) { // Imported track metadata (from file tags) with extra properties mixxx::TrackMetadata newTrackMetadata; - newTrackMetadata.setBitrate(mixxx::audio::Bitrate(200)); - newTrackMetadata.setChannelCount(mixxx::audio::ChannelCount(2)); - newTrackMetadata.setDuration(mixxx::Duration::fromSeconds(120)); - newTrackMetadata.setSampleRate(mixxx::audio::SampleRate(20000)); + newTrackMetadata.setStreamInfo( + mixxx::audio::StreamInfo{ + mixxx::audio::SignalInfo{ + mixxx::audio::ChannelCount(2), + mixxx::audio::SampleRate(20000), + }, + mixxx::audio::Bitrate(200), + mixxx::Duration::fromSeconds(120), + }); mixxx::TrackInfo* pNewTrackInfo = newTrackMetadata.ptrTrackInfo(); pNewTrackInfo->setArtist("new artist"); pNewTrackInfo->setBpm(mixxx::Bpm(200)); @@ -149,10 +159,7 @@ TEST_F(TrackMetadataTest, mergeImportedMetadata) { mergedTrackRecord.mergeImportedMetadata(newTrackMetadata); mixxx::TrackMetadata* pMergedTrackMetadata = mergedTrackRecord.ptrMetadata(); - EXPECT_EQ(pOldTrackMetadata->getBitrate(), pMergedTrackMetadata->getBitrate()); - EXPECT_EQ(pOldTrackMetadata->getChannelCount(), pMergedTrackMetadata->getChannelCount()); - EXPECT_EQ(pOldTrackMetadata->getDuration(), pMergedTrackMetadata->getDuration()); - EXPECT_EQ(pOldTrackMetadata->getSampleRate(), pMergedTrackMetadata->getSampleRate()); + EXPECT_EQ(pOldTrackMetadata->getStreamInfo(), pMergedTrackMetadata->getStreamInfo()); mixxx::TrackInfo* pMergedTrackInfo = pMergedTrackMetadata->ptrTrackInfo(); EXPECT_EQ(pOldTrackInfo->getArtist(), pMergedTrackInfo->getArtist()); EXPECT_EQ(pOldTrackInfo->getBpm(), pMergedTrackInfo->getBpm()); diff --git a/src/track/beatfactory.h b/src/track/beatfactory.h index c6c941bea80..84012ef4a85 100644 --- a/src/track/beatfactory.h +++ b/src/track/beatfactory.h @@ -1,5 +1,4 @@ -#ifndef BEATFACTORY_H -#define BEATFACTORY_H +#pragma once #include @@ -39,5 +38,3 @@ class BeatFactory { private: static void deleteBeats(mixxx::Beats* pBeats); }; - -#endif /* BEATFACTORY_H */ diff --git a/src/track/beatgrid.h b/src/track/beatgrid.h index 8ea9056951c..bd4747cc799 100644 --- a/src/track/beatgrid.h +++ b/src/track/beatgrid.h @@ -1,5 +1,4 @@ -#ifndef BEATGRID_H -#define BEATGRID_H +#pragma once #include @@ -98,5 +97,3 @@ class BeatGrid final : public Beats { }; } // namespace mixxx - -#endif /* BEATGRID_H */ diff --git a/src/track/beatmap.h b/src/track/beatmap.h index d6ad4e7b325..d3f05c25911 100644 --- a/src/track/beatmap.h +++ b/src/track/beatmap.h @@ -5,8 +5,7 @@ * Author: vittorio */ -#ifndef BEATMAP_H_ -#define BEATMAP_H_ +#pragma once #include @@ -113,4 +112,3 @@ class BeatMap final : public Beats { }; } // namespace mixxx -#endif /* BEATMAP_H_ */ diff --git a/src/track/beats.cpp b/src/track/beats.cpp index 307f0a6b9ab..58d90a96599 100644 --- a/src/track/beats.cpp +++ b/src/track/beats.cpp @@ -1,6 +1,7 @@ - #include "track/beats.h" +#include "moc_beats.cpp" + namespace mixxx { int Beats::numBeatsInRange(double dStartSample, double dEndSample) { diff --git a/src/track/beats.h b/src/track/beats.h index cdd155e97d3..c3ae7e568e5 100644 --- a/src/track/beats.h +++ b/src/track/beats.h @@ -1,5 +1,4 @@ -#ifndef BEATS_H -#define BEATS_H +#pragma once #include #include @@ -174,4 +173,3 @@ class Beats : public QObject { }; } // namespace mixxx -#endif /* BEATS_H */ diff --git a/src/track/beatutils.h b/src/track/beatutils.h index 10a6a8b49fd..46814da6fb9 100644 --- a/src/track/beatutils.h +++ b/src/track/beatutils.h @@ -1,8 +1,4 @@ -// Created on: 30/nov/2011 -// Author: vittorio - -#ifndef BEATUTILS_H_ -#define BEATUTILS_H_ +#pragma once // to tell the msvs compiler about `isnan` #include "util/math.h" @@ -86,5 +82,3 @@ class BeatUtils { const int sampleRate, QMap* frequencyHistogram); }; - -#endif /* BEATUTILS_H_ */ diff --git a/src/track/bpm.h b/src/track/bpm.h index 83b415ced48..117b9946649 100644 --- a/src/track/bpm.h +++ b/src/track/bpm.h @@ -1,5 +1,4 @@ -#ifndef MIXXX_BPM_H -#define MIXXX_BPM_H +#pragma once #include @@ -101,5 +100,3 @@ QDebug operator<<(QDebug dbg, const Bpm& arg) { Q_DECLARE_TYPEINFO(mixxx::Bpm, Q_MOVABLE_TYPE); Q_DECLARE_METATYPE(mixxx::Bpm) - -#endif // MIXXX_BPM_H diff --git a/src/track/cue.cpp b/src/track/cue.cpp index cb3cd17e9fc..16ef540b088 100644 --- a/src/track/cue.cpp +++ b/src/track/cue.cpp @@ -1,12 +1,10 @@ -// cue.cpp -// Created 10/26/2009 by RJ Ryan (rryan@mit.edu) - #include "track/cue.h" #include #include #include "engine/engine.h" +#include "moc_cue.cpp" #include "util/assert.h" #include "util/color/color.h" #include "util/color/predefinedcolorpalettes.h" diff --git a/src/track/globaltrackcache.cpp b/src/track/globaltrackcache.cpp index 6d16ff6783c..32a73b56155 100644 --- a/src/track/globaltrackcache.cpp +++ b/src/track/globaltrackcache.cpp @@ -2,6 +2,7 @@ #include +#include "moc_globaltrackcache.cpp" #include "track/track.h" #include "util/assert.h" #include "util/logger.h" diff --git a/src/track/keyfactory.h b/src/track/keyfactory.h index 246d7f0a18f..72ce8c873b3 100644 --- a/src/track/keyfactory.h +++ b/src/track/keyfactory.h @@ -1,5 +1,4 @@ -#ifndef KEYFACTORY_H -#define KEYFACTORY_H +#pragma once #include #include @@ -30,5 +29,3 @@ class KeyFactory { const QHash& extraVersionInfo, const int iSampleRate, const int iTotalSamples); }; - -#endif /* KEYFACTORY_H */ diff --git a/src/track/keys.h b/src/track/keys.h index faa0f2f7b4d..ddc0b414c16 100644 --- a/src/track/keys.h +++ b/src/track/keys.h @@ -1,5 +1,4 @@ -#ifndef KEYS_H -#define KEYS_H +#pragma once #include #include @@ -53,5 +52,3 @@ class Keys final { // For private constructor access. friend class KeyFactory; }; - -#endif /* KEYS_H */ diff --git a/src/track/keyutils.h b/src/track/keyutils.h index b23f999dae7..5ac8d19dc0a 100644 --- a/src/track/keyutils.h +++ b/src/track/keyutils.h @@ -1,5 +1,4 @@ -#ifndef KEYUTILS_H -#define KEYUTILS_H +#pragma once #include #include @@ -162,5 +161,3 @@ class KeyUtils { static QMap s_notation; static QMap s_reverseNotation; }; - -#endif /* KEYUTILS_H */ diff --git a/src/track/replaygain.h b/src/track/replaygain.h index 8f47ed44bfc..9c943e828cc 100644 --- a/src/track/replaygain.h +++ b/src/track/replaygain.h @@ -1,5 +1,4 @@ -#ifndef MIXXX_REPLAYGAIN_H -#define MIXXX_REPLAYGAIN_H +#pragma once #include "util/types.h" @@ -123,5 +122,3 @@ QDebug operator<<(QDebug dbg, const ReplayGain& arg) { Q_DECLARE_TYPEINFO(mixxx::ReplayGain, Q_MOVABLE_TYPE); Q_DECLARE_METATYPE(mixxx::ReplayGain) - -#endif // MIXXX_REPLAYGAIN_H diff --git a/src/track/taglib/trackmetadata_file.cpp b/src/track/taglib/trackmetadata_file.cpp index d9e95a6b667..f3b1ee7ff00 100644 --- a/src/track/taglib/trackmetadata_file.cpp +++ b/src/track/taglib/trackmetadata_file.cpp @@ -25,22 +25,22 @@ void readAudioProperties( DEBUG_ASSERT(pTrackMetadata); // NOTE(uklotzde): All audio properties will be updated - // with the actual (and more precise) values when reading - // the audio data for this track. Often those properties - // stored in tags don't match with the corresponding - // audio data in the file. - pTrackMetadata->setChannelCount( - audio::ChannelCount(audioProperties.channels())); - pTrackMetadata->setSampleRate( - audio::SampleRate(audioProperties.sampleRate())); - pTrackMetadata->setBitrate( - audio::Bitrate(audioProperties.bitrate())); + // with the actual (and more precise) values when opening + // the audio source for this track. Often those properties + // stored in tags are imprecise and don't match the actual + // audio data of the stream. + pTrackMetadata->setStreamInfo(audio::StreamInfo { + audio::SignalInfo{ + audio::ChannelCount(audioProperties.channels()), + audio::SampleRate(audioProperties.sampleRate()), + }, + audio::Bitrate(audioProperties.bitrate()), #if (TAGLIB_HAS_LENGTH_IN_MILLISECONDS) - const auto duration = Duration::fromMillis(audioProperties.lengthInMilliseconds()); + Duration::fromMillis(audioProperties.lengthInMilliseconds()), #else - const auto duration = Duration::fromSeconds(audioProperties.length()); + Duration::fromSeconds(audioProperties.length()), #endif - pTrackMetadata->setDuration(duration); + }); } } // anonymous namespace diff --git a/src/track/track.cpp b/src/track/track.cpp index e269d90dae9..745b43027cd 100644 --- a/src/track/track.cpp +++ b/src/track/track.cpp @@ -1,10 +1,10 @@ #include "track/track.h" #include -#include #include #include "engine/engine.h" +#include "moc_track.cpp" #include "track/beatfactory.h" #include "track/beatmap.h" #include "track/trackref.h" @@ -419,18 +419,18 @@ void Track::setDateAdded(const QDateTime& dateAdded) { void Track::setDuration(mixxx::Duration duration) { QMutexLocker lock(&m_qMutex); - VERIFY_OR_DEBUG_ASSERT(!m_streamInfo || - m_streamInfo->getDuration() <= mixxx::Duration::empty() || - m_streamInfo->getDuration() == duration) { + VERIFY_OR_DEBUG_ASSERT(!m_streamInfoFromSource || + m_streamInfoFromSource->getDuration() <= mixxx::Duration::empty() || + m_streamInfoFromSource->getDuration() == duration) { kLogger.warning() << "Cannot override stream duration:" - << m_streamInfo->getDuration() + << m_streamInfoFromSource->getDuration() << "->" << duration; return; } if (compareAndSet( - m_record.refMetadata().ptrDuration(), + m_record.refMetadata().refStreamInfo().ptrDuration(), duration)) { markDirtyAndUnlock(&lock); } @@ -442,25 +442,19 @@ void Track::setDuration(double duration) { double Track::getDuration(DurationRounding rounding) const { QMutexLocker lock(&m_qMutex); + const auto durationSeconds = + m_record.getMetadata().getStreamInfo().getDuration().toDoubleSeconds(); switch (rounding) { case DurationRounding::SECONDS: - return std::round(m_record.getMetadata().getDuration().toDoubleSeconds()); + return std::round(durationSeconds); default: - return m_record.getMetadata().getDuration().toDoubleSeconds(); + return durationSeconds; } } QString Track::getDurationText(mixxx::Duration::Precision precision) const { - double duration; - if (precision == mixxx::Duration::Precision::SECONDS) { - // Round to full seconds before formatting for consistency: - // getDurationText() should always display the same number - // as getDuration(DurationRounding::SECONDS) = getDurationInt() - duration = getDuration(DurationRounding::SECONDS); - } else { - duration = getDuration(DurationRounding::NONE); - } - return mixxx::Duration::formatTime(duration, precision); + QMutexLocker lock(&m_qMutex); + return m_record.getMetadata().getDurationText(precision); } QString Track::getTitle() const { @@ -653,38 +647,39 @@ void Track::setType(const QString& sType) { int Track::getSampleRate() const { QMutexLocker lock(&m_qMutex); - return m_record.getMetadata().getSampleRate(); + return m_record.getMetadata().getStreamInfo().getSignalInfo().getSampleRate(); } int Track::getChannels() const { QMutexLocker lock(&m_qMutex); - return m_record.getMetadata().getChannelCount(); + return m_record.getMetadata().getStreamInfo().getSignalInfo().getChannelCount(); } int Track::getBitrate() const { QMutexLocker lock(&m_qMutex); - return m_record.getMetadata().getBitrate(); + return m_record.getMetadata().getStreamInfo().getBitrate(); } QString Track::getBitrateText() const { - return QString("%1").arg(getBitrate()); + QMutexLocker lock(&m_qMutex); + return m_record.getMetadata().getBitrateText(); } void Track::setBitrate(int iBitrate) { QMutexLocker lock(&m_qMutex); const mixxx::audio::Bitrate bitrate(iBitrate); - VERIFY_OR_DEBUG_ASSERT(!m_streamInfo || - !m_streamInfo->getBitrate().isValid() || - m_streamInfo->getBitrate() == bitrate) { + VERIFY_OR_DEBUG_ASSERT(!m_streamInfoFromSource || + !m_streamInfoFromSource->getBitrate().isValid() || + m_streamInfoFromSource->getBitrate() == bitrate) { kLogger.warning() << "Cannot override stream bitrate:" - << m_streamInfo->getBitrate() + << m_streamInfoFromSource->getBitrate() << "->" << bitrate; return; } if (compareAndSet( - m_record.refMetadata().ptrBitrate(), + m_record.refMetadata().refStreamInfo().ptrBitrate(), bitrate)) { markDirtyAndUnlock(&lock); } @@ -788,10 +783,10 @@ void Track::setCuePoint(CuePosition cue) { void Track::shiftCuePositionsMillis(double milliseconds) { QMutexLocker lock(&m_qMutex); - VERIFY_OR_DEBUG_ASSERT(m_streamInfo) { + VERIFY_OR_DEBUG_ASSERT(m_streamInfoFromSource) { return; } - double frames = m_streamInfo->getSignalInfo().millis2frames(milliseconds); + double frames = m_streamInfoFromSource->getSignalInfo().millis2frames(milliseconds); for (const CuePointer& pCue : qAsConst(m_cuePoints)) { pCue->shiftPositionFrames(frames); } @@ -918,7 +913,7 @@ Track::ImportStatus Track::importBeats( // existing cue points. m_pBeatsImporterPending.reset(); return ImportStatus::Complete; - } else if (m_streamInfo) { + } else if (m_streamInfoFromSource) { // Replace existing cue points with imported cue // points immediately importPendingBeatsMarkDirtyAndUnlock(&lock); @@ -952,14 +947,14 @@ bool Track::importPendingBeatsWhileLocked() { } // The sample rate can only be trusted after the audio // stream has been opened. - DEBUG_ASSERT(m_streamInfo); + DEBUG_ASSERT(m_streamInfoFromSource); // The sample rate is supposed to be consistent - DEBUG_ASSERT(m_streamInfo->getSignalInfo().getSampleRate() == - m_record.getMetadata().getSampleRate()); + DEBUG_ASSERT(m_streamInfoFromSource->getSignalInfo().getSampleRate() == + m_record.getMetadata().getStreamInfo().getSignalInfo().getSampleRate()); mixxx::BeatsPointer pBeats(new mixxx::BeatMap(*this, - static_cast(m_streamInfo->getSignalInfo().getSampleRate()), + static_cast(m_streamInfoFromSource->getSignalInfo().getSampleRate()), m_pBeatsImporterPending->importBeatsAndApplyTimingOffset( - getLocation(), *m_streamInfo))); + getLocation(), *m_streamInfoFromSource))); DEBUG_ASSERT(m_pBeatsImporterPending->isEmpty()); m_pBeatsImporterPending.reset(); return setBeatsWhileLocked(pBeats); @@ -993,7 +988,7 @@ Track::ImportStatus Track::importCueInfos( // existing cue points. m_pCueInfoImporterPending.reset(); return ImportStatus::Complete; - } else if (m_streamInfo) { + } else if (m_streamInfoFromSource) { // Replace existing cue points with imported cue // points immediately importPendingCueInfosMarkDirtyAndUnlock(&lock); @@ -1077,17 +1072,17 @@ bool Track::importPendingCueInfosWhileLocked() { } // The sample rate can only be trusted after the audio // stream has been opened. - DEBUG_ASSERT(m_streamInfo); + DEBUG_ASSERT(m_streamInfoFromSource); const auto sampleRate = - m_streamInfo->getSignalInfo().getSampleRate(); + m_streamInfoFromSource->getSignalInfo().getSampleRate(); // The sample rate is supposed to be consistent DEBUG_ASSERT(sampleRate == - m_record.getMetadata().getSampleRate()); + m_record.getMetadata().getStreamInfo().getSignalInfo().getSampleRate()); QList cuePoints; cuePoints.reserve(m_pCueInfoImporterPending->size()); const auto cueInfos = m_pCueInfoImporterPending->importCueInfosAndApplyTimingOffset( - getLocation(), m_streamInfo->getSignalInfo()); + getLocation(), m_streamInfoFromSource->getSignalInfo()); for (const auto& cueInfo : cueInfos) { CuePointer pCue(new Cue(cueInfo, sampleRate, true)); // While this method could be called from any thread, @@ -1431,48 +1426,45 @@ void Track::setAudioProperties( mixxx::audio::SampleRate sampleRate, mixxx::audio::Bitrate bitrate, mixxx::Duration duration) { + setAudioProperties(mixxx::audio::StreamInfo{ + mixxx::audio::SignalInfo{ + channelCount, + sampleRate, + }, + bitrate, + duration, + }); +} + +void Track::setAudioProperties( + const mixxx::audio::StreamInfo& streamInfo) { QMutexLocker lock(&m_qMutex); - DEBUG_ASSERT(!m_streamInfo); - bool dirty = false; - if (compareAndSet( - m_record.refMetadata().ptrChannelCount(), - channelCount)) { - dirty = true; - } + // These properties are stored separately in the database + // and are also imported from file tags. They will be + // overriden by the actual properties from the audio + // source later. + DEBUG_ASSERT(!m_streamInfoFromSource); if (compareAndSet( - m_record.refMetadata().ptrSampleRate(), - sampleRate)) { - dirty = true; - } - if (compareAndSet( - m_record.refMetadata().ptrBitrate(), - bitrate)) { - dirty = true; - } - if (compareAndSet( - m_record.refMetadata().ptrDuration(), - duration)) { - dirty = true; - } - if (dirty) { + m_record.refMetadata().ptrStreamInfo(), + streamInfo)) { markDirtyAndUnlock(&lock); } } -void Track::updateAudioPropertiesFromStream( +void Track::updateStreamInfoFromSource( mixxx::audio::StreamInfo&& streamInfo) { QMutexLocker lock(&m_qMutex); - VERIFY_OR_DEBUG_ASSERT(!m_streamInfo || - *m_streamInfo == streamInfo) { + VERIFY_OR_DEBUG_ASSERT(!m_streamInfoFromSource || + *m_streamInfoFromSource == streamInfo) { kLogger.warning() << "Varying stream properties:" - << *m_streamInfo + << *m_streamInfoFromSource << "->" << streamInfo; } - bool updated = m_record.refMetadata().updateAudioPropertiesFromStream( + bool updated = m_record.refMetadata().updateStreamInfoFromSource( streamInfo); - m_streamInfo = std::make_optional(std::move(streamInfo)); + m_streamInfoFromSource = std::make_optional(std::move(streamInfo)); bool importBeats = m_pBeatsImporterPending && !m_pBeatsImporterPending->isEmpty(); bool importCueInfos = m_pCueInfoImporterPending && !m_pCueInfoImporterPending->isEmpty(); diff --git a/src/track/track.h b/src/track/track.h index 5e7f3057b33..57d6272d950 100644 --- a/src/track/track.h +++ b/src/track/track.h @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -214,6 +215,10 @@ class Track : public QObject { int getRating() const; // Sets rating void setRating(int); + /// Resets the rating + void resetRating() { + setRating(mixxx::TrackRecord::kNoRating); + } // Get URL for track QString getURL() const; @@ -342,6 +347,8 @@ class Track : public QObject { mixxx::audio::SampleRate sampleRate, mixxx::audio::Bitrate bitrate, mixxx::Duration duration); + void setAudioProperties( + const mixxx::audio::StreamInfo& streamInfo); signals: void waveformUpdated(); @@ -423,10 +430,15 @@ class Track : public QObject { mixxx::MetadataSourcePointer pMetadataSource); // Information about the actual properties of the - // audio stream is only available after opening it. - // On this occasion the audio properties of the track - // need to be updated to reflect these values. - void updateAudioPropertiesFromStream( + // audio stream is only available after opening the + // source at least once. On this occasion the metadata + // stream info of the track need to be updated to reflect + // these values. + bool hasStreamInfoFromSource() const { + QMutexLocker lock(&m_qMutex); + return static_cast(m_streamInfoFromSource); + } + void updateStreamInfoFromSource( mixxx::audio::StreamInfo&& streamInfo); // Mutex protecting access to object @@ -450,7 +462,7 @@ class Track : public QObject { // Reliable information about the PCM audio stream // that only becomes available when opening the // corresponding file. - std::optional m_streamInfo; + std::optional m_streamInfoFromSource; // The list of cue points for the track QList m_cuePoints; diff --git a/src/track/trackmetadata.cpp b/src/track/trackmetadata.cpp index 692326ea0ba..b36c00fb383 100644 --- a/src/track/trackmetadata.cpp +++ b/src/track/trackmetadata.cpp @@ -13,68 +13,91 @@ const Logger kLogger("TrackMetadata"); /*static*/ constexpr int TrackMetadata::kCalendarYearInvalid; -bool TrackMetadata::updateAudioPropertiesFromStream( +bool TrackMetadata::updateStreamInfoFromSource( const audio::StreamInfo& streamInfo) { bool changed = false; const auto streamChannelCount = streamInfo.getSignalInfo().getChannelCount(); if (streamChannelCount.isValid() && - streamChannelCount != getChannelCount()) { - if (getChannelCount().isValid()) { + streamChannelCount != getStreamInfo().getSignalInfo().getChannelCount()) { + if (getStreamInfo().getSignalInfo().getChannelCount().isValid()) { kLogger.debug() << "Modifying channel count:" - << getChannelCount() + << getStreamInfo().getSignalInfo().getChannelCount() << "->" << streamChannelCount; } - setChannelCount(streamChannelCount); + refStreamInfo().refSignalInfo().setChannelCount(streamChannelCount); changed = true; } const auto streamSampleRate = streamInfo.getSignalInfo().getSampleRate(); if (streamSampleRate.isValid() && - streamSampleRate != getSampleRate()) { - if (getSampleRate().isValid()) { + streamSampleRate != getStreamInfo().getSignalInfo().getSampleRate()) { + if (getStreamInfo().getSignalInfo().getSampleRate().isValid()) { kLogger.debug() << "Modifying sample rate:" - << getSampleRate() + << getStreamInfo().getSignalInfo().getSampleRate() << "->" << streamSampleRate; } - setSampleRate(streamSampleRate); + refStreamInfo().refSignalInfo().setSampleRate(streamSampleRate); changed = true; } const auto streamBitrate = streamInfo.getBitrate(); if (streamBitrate.isValid() && - streamBitrate != getBitrate()) { - if (getBitrate().isValid()) { + streamBitrate != getStreamInfo().getBitrate()) { + if (getStreamInfo().getSignalInfo().isValid()) { kLogger.debug() << "Modifying bitrate:" - << getBitrate() + << getStreamInfo().getSignalInfo() << "->" << streamBitrate; } - setBitrate(streamBitrate); + refStreamInfo().setBitrate(streamBitrate); changed = true; } const auto streamDuration = streamInfo.getDuration(); if (streamDuration > Duration::empty() && - streamDuration != getDuration()) { - if (getDuration() > Duration::empty()) { + streamDuration != getStreamInfo().getDuration()) { + if (getStreamInfo().getDuration() > Duration::empty()) { kLogger.debug() << "Modifying duration:" - << getDuration() + << getStreamInfo().getDuration() << "->" << streamDuration; } - setDuration(streamDuration); + refStreamInfo().setDuration(streamDuration); changed = true; } return changed; } +QString TrackMetadata::getBitrateText() const { + if (!getStreamInfo().getBitrate().isValid()) { + return QString(); + } + return QString::number(getStreamInfo().getBitrate()) + + QChar(' ') + + audio::Bitrate::unit(); +} + +QString TrackMetadata::getDurationText( + Duration::Precision precision) const { + double durationSeconds; + if (precision == Duration::Precision::SECONDS) { + // Round to full seconds before formatting for consistency + // getDurationText() should always display the same number + // as getDurationSecondsRounded() + durationSeconds = getDurationSecondsRounded(); + } else { + durationSeconds = getStreamInfo().getDuration().toDoubleSeconds(); + } + return Duration::formatTime(durationSeconds, precision); +} + int TrackMetadata::parseCalendarYear(const QString& year, bool* pValid) { const QDateTime dateTime(parseDateTime(year)); if (0 < dateTime.date().year()) { @@ -154,22 +177,16 @@ bool TrackMetadata::anyFileTagsModified( } bool operator==(const TrackMetadata& lhs, const TrackMetadata& rhs) { - return lhs.getAlbumInfo() == rhs.getAlbumInfo() && - lhs.getTrackInfo() == rhs.getTrackInfo() && - lhs.getChannelCount() == rhs.getChannelCount() && - lhs.getSampleRate() == rhs.getSampleRate() && - lhs.getBitrate() == rhs.getBitrate() && - lhs.getDuration() == rhs.getDuration(); + return lhs.getStreamInfo() == rhs.getStreamInfo() && + lhs.getAlbumInfo() == rhs.getAlbumInfo() && + lhs.getTrackInfo() == rhs.getTrackInfo(); } QDebug operator<<(QDebug dbg, const TrackMetadata& arg) { dbg << "TrackMetadata{"; + arg.dbgStreamInfo(dbg); arg.dbgTrackInfo(dbg); arg.dbgAlbumInfo(dbg); - arg.dbgBitrate(dbg); - arg.dbgChannelCount(dbg); - arg.dbgDuration(dbg); - arg.dbgSampleRate(dbg); dbg << '}'; return dbg; } diff --git a/src/track/trackmetadata.h b/src/track/trackmetadata.h index bae8ee188e2..e01dc1b9cdc 100644 --- a/src/track/trackmetadata.h +++ b/src/track/trackmetadata.h @@ -2,27 +2,18 @@ #include -#include "audio/types.h" +#include "audio/streaminfo.h" #include "track/albuminfo.h" #include "track/trackinfo.h" namespace mixxx { -namespace audio { - -class StreamInfo; - -} // namespace audio - class TrackMetadata final { // Audio properties // - read-only // - stored in file tags // - adjusted when opening the audio stream (if available) - MIXXX_DECL_PROPERTY(audio::ChannelCount, channels, ChannelCount) - MIXXX_DECL_PROPERTY(audio::SampleRate, sampleRate, SampleRate) - MIXXX_DECL_PROPERTY(audio::Bitrate, bitrate, Bitrate) - MIXXX_DECL_PROPERTY(Duration, duration, Duration) + MIXXX_DECL_PROPERTY(audio::StreamInfo, streamInfo, StreamInfo) // Track properties // - read-write @@ -39,7 +30,7 @@ class TrackMetadata final { TrackMetadata& operator=(TrackMetadata&&) = default; TrackMetadata& operator=(const TrackMetadata&) = default; - bool updateAudioPropertiesFromStream( + bool updateStreamInfoFromSource( const audio::StreamInfo& streamInfo); // Adjusts floating-point values to match their string representation @@ -57,6 +48,14 @@ class TrackMetadata final { const TrackMetadata& importedFromFile, Bpm::Comparison cmpBpm = Bpm::Comparison::Default) const; + QString getBitrateText() const; + + double getDurationSecondsRounded() const { + return std::round(getStreamInfo().getDuration().toDoubleSeconds()); + } + QString getDurationText( + Duration::Precision precision) const; + // Parse an format date/time values according to ISO 8601 static QDate parseDate(const QString& str) { return QDate::fromString(str.trimmed().replace(" ", ""), Qt::ISODate); diff --git a/src/track/tracknumbers.h b/src/track/tracknumbers.h index 70a8cdc9b5c..6e9e6ef66ec 100644 --- a/src/track/tracknumbers.h +++ b/src/track/tracknumbers.h @@ -1,5 +1,4 @@ -#ifndef TRACKNUMBERS_H -#define TRACKNUMBERS_H +#pragma once #include #include @@ -123,5 +122,3 @@ bool operator!=(const TrackNumbers& lhs, const TrackNumbers& rhs) { Q_DECLARE_TYPEINFO(TrackNumbers, Q_MOVABLE_TYPE); Q_DECLARE_METATYPE(TrackNumbers) - -#endif // TRACKNUMBERS_H diff --git a/src/track/trackrecord.h b/src/track/trackrecord.h index 1a9d2ae369d..bf819acc647 100644 --- a/src/track/trackrecord.h +++ b/src/track/trackrecord.h @@ -66,8 +66,15 @@ class TrackRecord final { TrackRecord& operator=(TrackRecord&&) = default; TrackRecord& operator=(const TrackRecord&) = default; + static constexpr int kMinRating = 0; + static constexpr int kMaxRating = 5; + static constexpr int kNoRating = kMinRating; + + static bool isValidRating(int rating) { + return rating >= kMinRating && rating <= kMaxRating; + } bool hasRating() const { - return getRating() > 0; + return getRating() != kNoRating; } void setKeys(const Keys& keys); diff --git a/src/util/alphabetafilter.h b/src/util/alphabetafilter.h index 4eea8ae185c..71367c541b5 100644 --- a/src/util/alphabetafilter.h +++ b/src/util/alphabetafilter.h @@ -1,16 +1,4 @@ -/*************************************************************************** - alphabetafilter.h - description - ------------------- -begin : Wed May 12 2010 -copyright : (C) 2010 by Sean M. Pappalardo -email : spappalardo@mixxx.org - -This is essentially just a C++ version of xwax's pitch.h, - which is Copyright (C) 2010 Mark Hills -***************************************************************************/ - -#ifndef ALPHABETAFILTER_H -#define ALPHABETAFILTER_H +#pragma once // This is a simple alpha-beta filter. It follows the example from Wikipedia // closely: http://en.wikipedia.org/wiki/Alpha_beta_filter @@ -18,6 +6,9 @@ This is essentially just a C++ version of xwax's pitch.h, // Given an initial position and velocity, learning parameters alpha and beta, // and a series of input observations of the distance travelled, the filter // predicts the real position and velocity. +// +// This is essentially just a C++ version of xwax's pitch.h, +// which is Copyright (C) 2010 Mark Hills class AlphaBetaFilter { public: AlphaBetaFilter() @@ -77,5 +68,3 @@ class AlphaBetaFilter { // State of the rate calculation filter double m_dt, m_x, m_v, m_alpha, m_beta; }; - -#endif diff --git a/src/util/battery/battery.cpp b/src/util/battery/battery.cpp index b637c45fe29..7bb6effc876 100644 --- a/src/util/battery/battery.cpp +++ b/src/util/battery/battery.cpp @@ -1,5 +1,7 @@ #include "util/battery/battery.h" +#include "moc_battery.cpp" + // Do not include platform-specific battery implementation unless we are built // with battery support (__BATTERY__). #ifdef __BATTERY__ diff --git a/src/util/battery/battery.h b/src/util/battery/battery.h index 7f41035fe3e..3e9fdc82fa0 100644 --- a/src/util/battery/battery.h +++ b/src/util/battery/battery.h @@ -1,5 +1,4 @@ -#ifndef UTIL_BATTERY_BATTERY_H -#define UTIL_BATTERY_BATTERY_H +#pragma once #include "util/timer.h" @@ -46,5 +45,3 @@ class Battery : public QObject { private: GuiTickTimer m_timer; }; - -#endif /* UTIL_BATTERY_BATTERY_H */ diff --git a/src/util/battery/batterylinux.h b/src/util/battery/batterylinux.h index 92161718052..eb1e5e059d9 100644 --- a/src/util/battery/batterylinux.h +++ b/src/util/battery/batterylinux.h @@ -1,5 +1,4 @@ -#ifndef UTIL_BATTERY_BATTERYLINUX_H -#define UTIL_BATTERY_BATTERYLINUX_H +#pragma once #include "util/battery/battery.h" @@ -14,5 +13,3 @@ class BatteryLinux : public Battery { private: void* m_client; }; - -#endif /* UTIL_BATTERY_BATTERYLINUX_H */ diff --git a/src/util/battery/batterymac.h b/src/util/battery/batterymac.h index 04921f741c7..77656e06933 100644 --- a/src/util/battery/batterymac.h +++ b/src/util/battery/batterymac.h @@ -1,5 +1,4 @@ -#ifndef UTIL_BATTERY_BATTERYMAC_H -#define UTIL_BATTERY_BATTERYMAC_H +#pragma once #include "util/battery/battery.h" @@ -11,5 +10,3 @@ class BatteryMac : public Battery { protected: void read() override; }; - -#endif /* UTIL_BATTERY_BATTERYMAC_H */ diff --git a/src/util/battery/batterywindows.cpp b/src/util/battery/batterywindows.cpp index 1482dea7ec6..437e9072d61 100644 --- a/src/util/battery/batterywindows.cpp +++ b/src/util/battery/batterywindows.cpp @@ -1,8 +1,5 @@ #include "util/battery/batterywindows.h" -// tell windows we target XP and later -// http://msdn.microsoft.com/en-us/library/windows/desktop/aa372693(v=vs.85).aspx -#define _WIN32_WINNT 0x0400 #include #include #include diff --git a/src/util/battery/batterywindows.h b/src/util/battery/batterywindows.h index 6dcf64402fa..4981d11ed68 100644 --- a/src/util/battery/batterywindows.h +++ b/src/util/battery/batterywindows.h @@ -1,5 +1,4 @@ -#ifndef UTIL_BATTERY_BATTERYWINDOWS_H -#define UTIL_BATTERY_BATTERYWINDOWS_H +#pragma once #include "util/battery/battery.h" @@ -11,5 +10,3 @@ class BatteryWindows : public Battery { protected: void read() override; }; - -#endif /* UTIL_BATTERY_BATTERYWINDOWS_H */ diff --git a/src/util/circularbuffer.h b/src/util/circularbuffer.h index 3d6ccfc91d8..1fe650f2415 100644 --- a/src/util/circularbuffer.h +++ b/src/util/circularbuffer.h @@ -1,5 +1,4 @@ -#ifndef CIRCULARBUFFER_H -#define CIRCULARBUFFER_H +#pragma once #include @@ -93,5 +92,3 @@ class CircularBuffer { unsigned int m_iWritePos; unsigned int m_iReadPos; }; - -#endif /* CIRCULARBUFFER_H */ diff --git a/src/util/class.h b/src/util/class.h index c9e32d7cfcc..ad313c561fd 100644 --- a/src/util/class.h +++ b/src/util/class.h @@ -1,10 +1,7 @@ -#ifndef MIXXX_UTIL_CLASS_H -#define MIXXX_UTIL_CLASS_H +#pragma once // A macro to disallow the copy constructor and operator= functions // This should be used in the private: declarations for a class #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \ void operator=(const TypeName&) - -#endif /* MIXXX_UTIL_CLASS_H */ diff --git a/src/util/console.cpp b/src/util/console.cpp index 3edb34f44e5..58997708866 100644 --- a/src/util/console.cpp +++ b/src/util/console.cpp @@ -1,4 +1,3 @@ - #include "console.h" #include diff --git a/src/util/console.h b/src/util/console.h index f209994118d..ceaa93d01a1 100644 --- a/src/util/console.h +++ b/src/util/console.h @@ -1,6 +1,4 @@ - -#ifndef CONSOLE_H_ -#define CONSOLE_H_ +#pragma once #ifdef __WINDOWS__ #include @@ -21,5 +19,3 @@ class Console { TCHAR m_oldTitle[MAX_PATH]; #endif }; - -#endif /* CONSOLE_H_ */ diff --git a/src/util/counter.h b/src/util/counter.h index d69f645750b..b859d091961 100644 --- a/src/util/counter.h +++ b/src/util/counter.h @@ -1,5 +1,4 @@ -#ifndef COUNTER_H -#define COUNTER_H +#pragma once #include "util/stat.h" @@ -26,5 +25,3 @@ class Counter { private: QString m_tag; }; - -#endif /* COUNTER_H */ diff --git a/src/util/db/dbconnection.h b/src/util/db/dbconnection.h index dfe91dbf860..847604a42bc 100644 --- a/src/util/db/dbconnection.h +++ b/src/util/db/dbconnection.h @@ -1,6 +1,4 @@ -#ifndef MIXXX_DBCONNECTION_H -#define MIXXX_DBCONNECTION_H - +#pragma once #include #include @@ -68,6 +66,3 @@ class DbConnection final { }; } // namespace mixxx - - -#endif // MIXXX_DBCONNECTION_H diff --git a/src/util/db/dbconnectionpool.h b/src/util/db/dbconnectionpool.h index 1ecfd8ed511..bc9b3ce2580 100644 --- a/src/util/db/dbconnectionpool.h +++ b/src/util/db/dbconnectionpool.h @@ -1,6 +1,4 @@ -#ifndef MIXXX_DBCONNECTIONPOOL_H -#define MIXXX_DBCONNECTIONPOOL_H - +#pragma once #include #include @@ -65,6 +63,3 @@ class DbConnectionPool final { }; } // namespace mixxx - - -#endif // MIXXX_DBCONNECTIONPOOL_H diff --git a/src/util/db/dbconnectionpooled.h b/src/util/db/dbconnectionpooled.h index 6eb31e6fd01..69d0d0f3abb 100644 --- a/src/util/db/dbconnectionpooled.h +++ b/src/util/db/dbconnectionpooled.h @@ -1,6 +1,4 @@ -#ifndef MIXXX_DBCONNECTIONPOOLED_H -#define MIXXX_DBCONNECTIONPOOLED_H - +#pragma once #include @@ -40,6 +38,3 @@ class DbConnectionPooled final { }; } // namespace mixxx - - -#endif // MIXXX_DBCONNECTIONPOOLED_H diff --git a/src/util/db/dbentity.h b/src/util/db/dbentity.h index 968cdc2d4e2..605075d09cc 100644 --- a/src/util/db/dbentity.h +++ b/src/util/db/dbentity.h @@ -1,6 +1,4 @@ -#ifndef MIXXX_DBENTITY_H -#define MIXXX_DBENTITY_H - +#pragma once #include "util/db/dbid.h" @@ -31,6 +29,3 @@ class DbEntity { private: T m_id; }; - - -#endif // MIXXX_DBENTITY_H diff --git a/src/util/db/dbfieldindex.h b/src/util/db/dbfieldindex.h index c39688e1d48..fc156e3556b 100644 --- a/src/util/db/dbfieldindex.h +++ b/src/util/db/dbfieldindex.h @@ -1,6 +1,4 @@ -#ifndef MIXXX_DBFIELDINDEX_H -#define MIXXX_DBFIELDINDEX_H - +#pragma once // Type-safe wrapper with a default constructor that encapsulates // field indices of QSqlRecord. @@ -27,6 +25,3 @@ class DbFieldIndex { }; Q_DECLARE_METATYPE(DbFieldIndex) - - -#endif // MIXXX_DBFIELDINDEX_H diff --git a/src/util/db/fwdsqlquery.h b/src/util/db/fwdsqlquery.h index 2ab24135874..39a0463023c 100644 --- a/src/util/db/fwdsqlquery.h +++ b/src/util/db/fwdsqlquery.h @@ -60,6 +60,10 @@ class FwdSqlQuery: protected QSqlQuery { bindValue(placeholder, value.toVariant()); } + QString executedQuery() const { + return QSqlQuery::executedQuery(); + } + // Execute the prepared query and log errors on failure. // // Please note, that the member function exec() inherited diff --git a/src/util/db/fwdsqlqueryselectresult.h b/src/util/db/fwdsqlqueryselectresult.h index 8bfe0fbfc94..cf94908cb3e 100644 --- a/src/util/db/fwdsqlqueryselectresult.h +++ b/src/util/db/fwdsqlqueryselectresult.h @@ -1,6 +1,4 @@ -#ifndef MIXXX_FWDSQLQUERYSELECTRESULT_H -#define MIXXX_FWDSQLQUERYSELECTRESULT_H - +#pragma once #include "util/db/fwdsqlquery.h" #include "util/db/sqlqueryfinisher.h" @@ -49,6 +47,3 @@ class FwdSqlQuerySelectResult { FwdSqlQuery m_query; SqlQueryFinisher m_queryFinisher; }; - - -#endif // MIXXX_FWDSQLQUERYSELECTRESULT_H diff --git a/src/util/db/sqllikewildcardescaper.h b/src/util/db/sqllikewildcardescaper.h index 06ebc88fb2e..fd3329bbc20 100644 --- a/src/util/db/sqllikewildcardescaper.h +++ b/src/util/db/sqllikewildcardescaper.h @@ -1,6 +1,4 @@ -#ifndef MIXXX_SQLLIKEWILDCARDESCAPER_H -#define MIXXX_SQLLIKEWILDCARDESCAPER_H - +#pragma once #include @@ -17,6 +15,3 @@ class SqlLikeWildcardEscaper final { private: SqlLikeWildcardEscaper() = delete; // utility class }; - - -#endif // MIXXX_SQLLIKEWILDCARDESCAPER_H diff --git a/src/util/db/sqllikewildcards.h b/src/util/db/sqllikewildcards.h index ef7cb026bca..cc357014b2b 100644 --- a/src/util/db/sqllikewildcards.h +++ b/src/util/db/sqllikewildcards.h @@ -1,12 +1,7 @@ -#ifndef MIXXX_SQLLIKEWILDCARDS_H -#define MIXXX_SQLLIKEWILDCARDS_H - +#pragma once #include const QChar kSqlLikeMatchOne = '_'; const QChar kSqlLikeMatchAll = '%'; - - -#endif // MIXXX_SQLLIKEWILDCARDS_H diff --git a/src/util/db/sqlqueryfinisher.h b/src/util/db/sqlqueryfinisher.h index 299bb7733b1..a6fc06902cc 100644 --- a/src/util/db/sqlqueryfinisher.h +++ b/src/util/db/sqlqueryfinisher.h @@ -1,6 +1,4 @@ -#ifndef MIXXX_SQLQUERYFINISHER_H -#define MIXXX_SQLQUERYFINISHER_H - +#pragma once #include @@ -33,6 +31,3 @@ class SqlQueryFinisher final { QSqlQuery m_query; // implicitly shared }; - - -#endif // MIXXX_SQLQUERYFINISHER_H diff --git a/src/util/db/sqlstorage.h b/src/util/db/sqlstorage.h index 7b5fb461a55..463bdeb34a8 100644 --- a/src/util/db/sqlstorage.h +++ b/src/util/db/sqlstorage.h @@ -1,6 +1,4 @@ -#ifndef MIXXX_SQLSTORAGE_H -#define MIXXX_SQLSTORAGE_H - +#pragma once #include @@ -47,6 +45,3 @@ class SqlStorage { SqlStorage& operator=(const SqlStorage&) = delete; }; - - -#endif // MIXXX_SQLSTORAGE_H diff --git a/src/util/db/sqlstringformatter.h b/src/util/db/sqlstringformatter.h index 98b3b6ca02a..9ca732f78b0 100644 --- a/src/util/db/sqlstringformatter.h +++ b/src/util/db/sqlstringformatter.h @@ -1,6 +1,4 @@ -#ifndef MIXXX_SQLSTRINGFORMATTER_H -#define MIXXX_SQLSTRINGFORMATTER_H - +#pragma once #include #include @@ -28,6 +26,3 @@ class SqlStringFormatter final { private: SqlStringFormatter() = delete; // utility class }; - - -#endif // MIXXX_SQLSTRINGFORMATTER_H diff --git a/src/util/db/sqlsubselectmode.h b/src/util/db/sqlsubselectmode.h index 7ab5db1d25c..048e135549d 100644 --- a/src/util/db/sqlsubselectmode.h +++ b/src/util/db/sqlsubselectmode.h @@ -1,11 +1,6 @@ -#ifndef MIXXX_SQLSUBSELECTMODE_H -#define MIXXX_SQLSUBSELECTMODE_H - +#pragma once enum SqlSubselectMode { SQL_SUBSELECT_IN, SQL_SUBSELECT_NOT_IN, }; - - -#endif // MIXXX_SQLSUBSELECTMODE_H diff --git a/src/util/db/sqltransaction.h b/src/util/db/sqltransaction.h index 8a172cea5a1..42ae8a0ad0b 100644 --- a/src/util/db/sqltransaction.h +++ b/src/util/db/sqltransaction.h @@ -1,6 +1,4 @@ -#ifndef MIXXX_SQLTRANSACTION_H -#define MIXXX_SQLTRANSACTION_H - +#pragma once #include @@ -30,6 +28,3 @@ class SqlTransaction final { QSqlDatabase m_database; bool m_active; }; - - -#endif // MIXXX_SQLTRANSACTION_H diff --git a/src/util/debug.h b/src/util/debug.h index f405e70b8a4..6adb46b6c37 100644 --- a/src/util/debug.h +++ b/src/util/debug.h @@ -1,5 +1,4 @@ -#ifndef DEBUG_H -#define DEBUG_H +#pragma once #include #include @@ -44,5 +43,3 @@ inline void reportCriticalErrorAndQuit(const QString& message) { dialogHandler->requestErrorDialog(DLG_CRITICAL, message, true); } } - -#endif /* DEBUG_H */ diff --git a/src/util/defs.h b/src/util/defs.h index f34bf34f99b..a2ce1b2502a 100644 --- a/src/util/defs.h +++ b/src/util/defs.h @@ -1,10 +1,7 @@ -#ifndef DEFS_H -#define DEFS_H +#pragma once // Maximum buffer length to each EngineObject::process call. //TODO: Replace this with mixxx::AudioParameters::bufferSize() const unsigned int MAX_BUFFER_LEN = 160000; const int kMaxNumberOfDecks = 4; - -#endif /* DEFS_H */ diff --git a/src/util/denormalsarezero.h b/src/util/denormalsarezero.h index 694463d0394..6e4eb838a3d 100644 --- a/src/util/denormalsarezero.h +++ b/src/util/denormalsarezero.h @@ -1,4 +1,3 @@ - #pragma once // This was copied from the gcc header pmmintrin.h which requires SSE3 diff --git a/src/util/desktophelper.cpp b/src/util/desktophelper.cpp index 670c0cca74c..06faae00cd7 100644 --- a/src/util/desktophelper.cpp +++ b/src/util/desktophelper.cpp @@ -1,4 +1,3 @@ - #include "util/desktophelper.h" #include @@ -173,4 +172,3 @@ void DesktopHelper::openInFileBrowser(const QStringList& paths) { } } // namespace mixxx - diff --git a/src/util/event.h b/src/util/event.h index 65a19c5cf64..d03e04535da 100644 --- a/src/util/event.h +++ b/src/util/event.h @@ -1,5 +1,4 @@ -#ifndef EVENT_H -#define EVENT_H +#pragma once #include #include @@ -39,5 +38,3 @@ class Event { static bool start(const char*) = delete; static bool end(const char*) = delete; }; - -#endif /* EVENT_H */ diff --git a/src/util/experiment.h b/src/util/experiment.h index 507cc67c67d..1dc77e9ef2c 100644 --- a/src/util/experiment.h +++ b/src/util/experiment.h @@ -1,5 +1,4 @@ -#ifndef EXPERIMENT_H -#define EXPERIMENT_H +#pragma once #include @@ -47,5 +46,3 @@ class Experiment { static volatile Mode s_mode; }; - -#endif /* EXPERIMENT_H */ diff --git a/src/util/fifo.h b/src/util/fifo.h index 0b22ee9bbf5..dac6b28a1b5 100644 --- a/src/util/fifo.h +++ b/src/util/fifo.h @@ -1,5 +1,4 @@ -#ifndef FIFO_H -#define FIFO_H +#pragma once #include "pa_ringbuffer.h" @@ -69,5 +68,3 @@ class FIFO { PaUtilRingBuffer m_ringBuffer; DISALLOW_COPY_AND_ASSIGN(FIFO); }; - -#endif /* FIFO_H */ diff --git a/src/util/file.h b/src/util/file.h index c0b5b35cf66..d1950d0ca95 100644 --- a/src/util/file.h +++ b/src/util/file.h @@ -1,5 +1,4 @@ -#ifndef FILE_H -#define FILE_H +#pragma once #include #include @@ -34,5 +33,3 @@ class MDir { QDir m_dir; SecurityTokenPointer m_pSecurityToken; }; - -#endif /* FILE_H */ diff --git a/src/util/font.h b/src/util/font.h index 25a997689e6..f5b760e8e1d 100644 --- a/src/util/font.h +++ b/src/util/font.h @@ -1,5 +1,4 @@ -#ifndef FONT_H -#define FONT_H +#pragma once #include #include @@ -65,5 +64,3 @@ class FontUtils { private: FontUtils() {} }; - -#endif /* FONT_H */ diff --git a/src/util/fpclassify.h b/src/util/fpclassify.h index c1df4fdedd8..b27dccefea4 100644 --- a/src/util/fpclassify.h +++ b/src/util/fpclassify.h @@ -1,5 +1,4 @@ -#ifndef UTIL_FPCLASSIFY_H -#define UTIL_FPCLASSIFY_H +#pragma once #ifdef _MSC_VER @@ -34,5 +33,3 @@ int util_isnan(double x); int util_isinf(double x); #endif - -#endif // UTIL_FPCLASSIFY_H diff --git a/src/util/logger.h b/src/util/logger.h index b6c09641f28..01efefaa9b2 100644 --- a/src/util/logger.h +++ b/src/util/logger.h @@ -1,6 +1,4 @@ -#ifndef MIXXX_UTIL_LOGGER_H -#define MIXXX_UTIL_LOGGER_H - +#pragma once #include #include @@ -75,6 +73,3 @@ class Logger final { }; } // namespace mixxx - - -#endif /* MIXXX_UTIL_LOGGER_H */ diff --git a/src/util/mac.h b/src/util/mac.h index ce70571ae8e..bf005dc67fe 100644 --- a/src/util/mac.h +++ b/src/util/mac.h @@ -1,6 +1,5 @@ // Platform-specific helpers for OS X and iOS. -#ifndef MAC_H -#define MAC_H +#pragma once #include @@ -11,5 +10,3 @@ QString CFStringToQString(CFStringRef str); CFStringRef QStringToCFString(const QString& str); #endif - -#endif /* MAC_H */ diff --git a/src/util/math.h b/src/util/math.h index 1cd2c84210c..5e842a8bfc9 100644 --- a/src/util/math.h +++ b/src/util/math.h @@ -1,20 +1,12 @@ #pragma once -// Causes MSVC to define M_PI and friends. -// http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx -// Our SConscript defines this but check anyway. -#ifdef __WINDOWS__ -#ifndef _USE_MATH_DEFINES -#define _USE_MATH_DEFINES -#endif -#endif - #include -#include -// Note: Because of our fpclassify hack, we actually need to include both, -// the c and the c++ version of the math header. -// From GCC 6.1.1 math.h depends on cmath, which fails to compile if included -// after our fpclassify hack + +#include +// Note: Because of our fpclassify hack, we actually need to include both, +// the c and the c++ version of the math header. +// From GCC 6.1.1 math.h depends on cmath, which fails to compile if included +// after our fpclassify hack #include #include diff --git a/src/util/mutex.h b/src/util/mutex.h index a46f8dee356..bf0bc17b2bd 100644 --- a/src/util/mutex.h +++ b/src/util/mutex.h @@ -1,5 +1,4 @@ -#ifndef UTIL_MUTEX_H -#define UTIL_MUTEX_H +#pragma once // Thread annotation aware variants of locks, read-write locks and scoped // lockers. This allows us to use Clang thread safety analysis in Mixxx. @@ -85,5 +84,3 @@ class SCOPED_CAPABILITY MReadLocker { private: QReadLocker m_locker; }; - -#endif /* UTIL_MUTEX_H */ diff --git a/src/util/path.h b/src/util/path.h index 92afba759f5..073e862290e 100644 --- a/src/util/path.h +++ b/src/util/path.h @@ -1,5 +1,4 @@ -#ifndef PATH_H -#define PATH_H +#pragma once #ifndef PATH_MAX #ifndef MAX_PATH @@ -11,5 +10,3 @@ enum { PATH_MAX = MAX_PATH }; #endif - -#endif /* PATH_H */ diff --git a/src/util/performancetimer.h b/src/util/performancetimer.h index d4ac8b39225..2625d5010a6 100644 --- a/src/util/performancetimer.h +++ b/src/util/performancetimer.h @@ -39,8 +39,7 @@ ** ****************************************************************************/ -#ifndef PERFORMANCETIMER_H -#define PERFORMANCETIMER_H +#pragma once // // This is a fork of QPerformanceTimer just without the Q prefix @@ -74,5 +73,3 @@ class PerformanceTimer qint64 t2; #endif }; - -#endif // PERFORMANCETIMER_H diff --git a/src/util/platform.h b/src/util/platform.h index 8f248b26565..d3660a42b94 100644 --- a/src/util/platform.h +++ b/src/util/platform.h @@ -1,5 +1,4 @@ -#ifndef MIXXX_UTIL_PLATFORM_H -#define MIXXX_UTIL_PLATFORM_H +#pragma once #if defined(__GNUC__) && !defined(__INTEL_COMPILER) // Clang and GCC @@ -39,5 +38,3 @@ do { \ } while (0) #endif - -#endif /* MIXXX_UTIL_PLATFORM_H */ diff --git a/src/util/rampingvalue.h b/src/util/rampingvalue.h index 51fa17f3143..367e1cd9c10 100644 --- a/src/util/rampingvalue.h +++ b/src/util/rampingvalue.h @@ -1,6 +1,4 @@ -#ifndef MIXXX_UTIL_RAMPINGVALUE_H -#define MIXXX_UTIL_RAMPINGVALUE_H - +#pragma once template class RampingValue { @@ -18,5 +16,3 @@ class RampingValue { T m_value; T m_increment; }; - -#endif // MIXXX_UTIL_RAMPINGVALUE_H diff --git a/src/util/reference.h b/src/util/reference.h index 85f34b7e604..6d3f181ac96 100644 --- a/src/util/reference.h +++ b/src/util/reference.h @@ -1,5 +1,4 @@ -#ifndef REFERENCE_H -#define REFERENCE_H +#pragma once // General tool for removing concrete dependencies while still incrementing a // reference count. @@ -20,6 +19,3 @@ class ReferenceHolder : public BaseReferenceHolder { private: QSharedPointer m_reference; }; - - -#endif /* REFERENCE_H */ diff --git a/src/util/regex.h b/src/util/regex.h index 5cc58c7b79f..527d0b3ffe3 100644 --- a/src/util/regex.h +++ b/src/util/regex.h @@ -1,5 +1,4 @@ -#ifndef REGEX_H -#define REGEX_H +#pragma once #include #include @@ -19,6 +18,3 @@ class RegexUtils { private: RegexUtils() {} }; - - -#endif /* REGEX_H */ diff --git a/src/util/rescaler.h b/src/util/rescaler.h index 26286a30d4a..c0d6bb9f367 100644 --- a/src/util/rescaler.h +++ b/src/util/rescaler.h @@ -1,7 +1,4 @@ -#ifndef RESCALER_H -#define RESCALER_H - - +#pragma once class RescalerUtils { public: @@ -23,7 +20,3 @@ class RescalerUtils { private: RescalerUtils() {} }; - - - -#endif // RESCALER_H diff --git a/src/util/rlimit.h b/src/util/rlimit.h index d96fc88e4e8..1f8b50ea6ec 100644 --- a/src/util/rlimit.h +++ b/src/util/rlimit.h @@ -1,5 +1,4 @@ -#ifndef RLIMIT_H -#define RLIMIT_H +#pragma once #ifdef __LINUX__ @@ -11,4 +10,3 @@ class RLimit { }; #endif // __LINUX__ -#endif // RLIMIT_H_ diff --git a/src/util/rotary.h b/src/util/rotary.h index 4d78e162767..c886a1a9bc9 100644 --- a/src/util/rotary.h +++ b/src/util/rotary.h @@ -1,5 +1,4 @@ -#ifndef MIXXX_UTIL_ROTARY_H -#define MIXXX_UTIL_ROTARY_H +#pragma once class Rotary { public: @@ -38,5 +37,3 @@ class Rotary { double m_dLastValue; int m_iCalibrationCount; }; - -#endif /* MIXXX_UTIL_ROTARY_H */ diff --git a/src/util/sample.h b/src/util/sample.h index 4ccabe13c08..455543b7711 100644 --- a/src/util/sample.h +++ b/src/util/sample.h @@ -1,5 +1,4 @@ -#ifndef MIXXX_UTIL_SAMPLE_H -#define MIXXX_UTIL_SAMPLE_H +#pragma once #include #include // memset @@ -287,5 +286,3 @@ class SampleUtil { }; Q_DECLARE_OPERATORS_FOR_FLAGS(SampleUtil::CLIP_STATUS); - -#endif /* MIXXX_UTIL_SAMPLE_H */ diff --git a/src/util/sample_autogen.h b/src/util/sample_autogen.h index 0f0d8254e0e..53c34c0a35b 100644 --- a/src/util/sample_autogen.h +++ b/src/util/sample_autogen.h @@ -1,5 +1,4 @@ -#ifndef MIXXX_UTIL_SAMPLEAUTOGEN_H -#define MIXXX_UTIL_SAMPLEAUTOGEN_H +#pragma once //////////////////////////////////////////////////////// // THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY! // // SEE tools/generate_sample_functions.py // @@ -8836,4 +8835,3 @@ static inline void copy32WithRampingGain(CSAMPLE* M_RESTRICT pDest, pSrc31[i * 2 + 1] * gain31; } } -#endif /* MIXXX_UTIL_SAMPLEAUTOGEN_H */ diff --git a/src/util/sandbox.cpp b/src/util/sandbox.cpp index 2dc305cacb4..d9424114b09 100644 --- a/src/util/sandbox.cpp +++ b/src/util/sandbox.cpp @@ -30,14 +30,9 @@ void Sandbox::initialize(const QString& permissionsFile) { s_pSandboxPermissions = QSharedPointer>( new ConfigObject(permissionsFile)); -#ifdef Q_OS_MAC -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 - // If we are running on at least 10.7.0 and have the com.apple.security.app-sandbox - // entitlement, we are in a sandbox - SInt32 version = 0; - Gestalt(gestaltSystemVersion, &version); +#ifdef __APPLE__ SecCodeRef secCodeSelf; - if (version >= 0x1070 && SecCodeCopySelf(kSecCSDefaultFlags, &secCodeSelf) == errSecSuccess) { + if (SecCodeCopySelf(kSecCSDefaultFlags, &secCodeSelf) == errSecSuccess) { SecRequirementRef sandboxReq; CFStringRef entitlement = CFSTR("entitlement [\"com.apple.security.app-sandbox\"]"); if (SecRequirementCreateWithString(entitlement, kSecCSDefaultFlags, @@ -51,7 +46,6 @@ void Sandbox::initialize(const QString& permissionsFile) { CFRelease(secCodeSelf); } #endif -#endif } // static @@ -156,8 +150,7 @@ bool Sandbox::createSecurityToken(const QString& canonicalPath, return false; } -#ifdef Q_OS_MAC -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 +#ifdef __APPLE__ CFURLRef url = CFURLCreateWithFileSystemPath( kCFAllocatorDefault, QStringToCFString(canonicalPath), kCFURLPOSIXPathStyle, isDirectory); @@ -191,7 +184,6 @@ bool Sandbox::createSecurityToken(const QString& canonicalPath, qDebug() << "Failed to create security-scoped bookmark URL for" << canonicalPath; } } -#endif #endif return false; } @@ -322,8 +314,7 @@ SecurityTokenPointer Sandbox::openSecurityToken(const QDir& dir, bool create) { SecurityTokenPointer Sandbox::openTokenFromBookmark(const QString& canonicalPath, const QString& bookmarkBase64) { -#ifdef Q_OS_MAC -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 +#ifdef __APPLE__ QByteArray bookmarkBA = QByteArray::fromBase64(bookmarkBase64.toLatin1()); if (!bookmarkBA.isEmpty()) { CFDataRef bookmarkData = CFDataCreate( @@ -360,7 +351,6 @@ SecurityTokenPointer Sandbox::openTokenFromBookmark(const QString& canonicalPath } } } -#endif #else Q_UNUSED(canonicalPath); Q_UNUSED(bookmarkBase64); @@ -369,7 +359,93 @@ SecurityTokenPointer Sandbox::openTokenFromBookmark(const QString& canonicalPath return SecurityTokenPointer(); } -#ifdef Q_OS_MAC +QString Sandbox::migrateOldSettings() { + // QStandardPaths::DataLocation returns a different location depending on whether the build + // is signed (and therefore sandboxed with the hardened runtime), so use the absolute path + // that the sandbox uses regardless of whether this build is actually sandboxed. + // Otherwise, developers would need to run with --settingsPath every time or symlink + // to use the same settings directory with signed and unsigned builds. + + // QDir::homePath returns a path inside the sandbox. + QString homePath = QLatin1String("/Users/") + qgetenv("USER"); + + QString sandboxedPath = homePath + + QLatin1String( + "/Library/Containers/org.mixxx.mixxx/Data/Library/Application Support/Mixxx"); + QDir sandboxedSettings(sandboxedPath); + + if (sandboxedSettings.exists() && !sandboxedSettings.isEmpty()) { + return sandboxedPath; + } + + // Because Mixxx cannot test if the old path exists before getting permission to access it + // outside the sandbox, unfortunately it is necessary to annoy the user with this popup + // even if they are installing Mixxx >= 2.3.0 without having installed an old version of Mixxx. + QString title = QObject::tr("Upgrading old Mixxx settings"); + QString oldPath = homePath + QLatin1String("/Library/Application Support/Mixxx"); + QMessageBox::information(nullptr, + title, + QObject::tr( + "Due to Mac sandboxing, Mixxx needs your permission to " + "access your music library " + "and settings from Mixxx versions before 2.3.0. After " + "clicking OK, you will see a file picker. " + "To give Mixxx permission, press the Ok button in the file " + "picker." + "\n\n" + "If you do not want to grant Mixxx access click Cancel on " + "the file picker.")); + QString result = QFileDialog::getExistingDirectory( + nullptr, + title, + oldPath); + if (result != oldPath) { + qInfo() << "Sandbox::migrateOldSettings: User declined to migrate " + "old settings from" + << oldPath << "User selected" << result; + return sandboxedPath; + } + + // Sandbox::askForAccess cannot be used here because it depends on settings being + // initialized. There is no need to store the bookmark anyway because this is a + // one time process. +#ifdef __APPLE__ + CFURLRef url = CFURLCreateWithFileSystemPath( + kCFAllocatorDefault, QStringToCFString(oldPath), kCFURLPOSIXPathStyle, true); + if (url) { + CFErrorRef error = NULL; + CFDataRef bookmark = CFURLCreateBookmarkData( + kCFAllocatorDefault, + url, + kCFURLBookmarkCreationWithSecurityScope, + nil, + nil, + &error); + CFRelease(url); + if (bookmark) { + QFile oldSettings(oldPath); + if (oldSettings.rename(sandboxedPath)) { + qInfo() << "Sandbox::migrateOldSettings: Successfully " + "migrated old settings from" + << oldPath << "to new path" << sandboxedPath; + } else { + qWarning() << "Sandbox::migrateOldSettings: Failed to migrate " + "old settings from" + << oldPath << "to new path" << sandboxedPath; + } + } else { + qWarning() << "Sandbox::migrateOldSettings: Failed to access old " + "settings path" + << oldPath << "Cannot migrate to new path" + << sandboxedPath; + } + CFRelease(bookmark); + } +#endif + return sandboxedPath; +} + +#ifdef __APPLE__ SandboxSecurityToken::SandboxSecurityToken(const QString& path, CFURLRef url) : m_path(path), m_url(url) { @@ -382,16 +458,14 @@ SandboxSecurityToken::SandboxSecurityToken(const QString& path, CFURLRef url) #endif SandboxSecurityToken::~SandboxSecurityToken() { -#ifdef Q_OS_MAC +#ifdef __APPLE__ if (sDebug) { qDebug() << "~SandboxSecurityToken" << m_path; } -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 if (m_url) { CFURLStopAccessingSecurityScopedResource(m_url); CFRelease(m_url); m_url = 0; } #endif -#endif } diff --git a/src/util/sandbox.h b/src/util/sandbox.h index 404a093bed9..d25bc5f8cbf 100644 --- a/src/util/sandbox.h +++ b/src/util/sandbox.h @@ -1,5 +1,4 @@ -#ifndef SANDBOX_H -#define SANDBOX_H +#pragma once #include #include @@ -32,6 +31,8 @@ class Sandbox { static void initialize(const QString& permissionsFile); static void shutdown(); + static QString migrateOldSettings(); + // Returns true if we are in a sandbox. static bool enabled() { return s_bInSandbox; @@ -79,6 +80,3 @@ class Sandbox { static QSharedPointer> s_pSandboxPermissions; static QHash s_activeTokens; }; - - -#endif /* SANDBOX_H */ diff --git a/src/util/scopedoverridecursor.h b/src/util/scopedoverridecursor.h index ccce7dc3867..af08eb50d3d 100644 --- a/src/util/scopedoverridecursor.h +++ b/src/util/scopedoverridecursor.h @@ -1,5 +1,4 @@ -#ifndef SCOPEDOVERRIDECURSOR_H -#define SCOPEDOVERRIDECURSOR_H +#pragma once #include @@ -22,5 +21,3 @@ class ScopedWaitCursor : public ScopedOverrideCursor { { } }; - -#endif // SCOPEDOVERRIDECURSOR_H diff --git a/src/util/screensaver.cpp b/src/util/screensaver.cpp index 266abf20b08..022312f2075 100644 --- a/src/util/screensaver.cpp +++ b/src/util/screensaver.cpp @@ -336,4 +336,3 @@ void ScreenSaverHelper::uninhibitInternal() } // namespace mixxx - diff --git a/src/util/screensaver.h b/src/util/screensaver.h index 03c3be778bb..73d91835dbe 100644 --- a/src/util/screensaver.h +++ b/src/util/screensaver.h @@ -1,5 +1,4 @@ -#ifndef MIXXX_SCREENSAVER_H -#define MIXXX_SCREENSAVER_H +#pragma once #ifdef Q_OS_MAC #include @@ -35,5 +34,3 @@ class ScreenSaverHelper { }; } - -#endif // MIXXX_SCREENSAVER_H diff --git a/src/util/singleton.h b/src/util/singleton.h index ce195be3ed2..ae4a0531003 100644 --- a/src/util/singleton.h +++ b/src/util/singleton.h @@ -1,5 +1,4 @@ -#ifndef SINGLETON_H -#define SINGLETON_H +#pragma once #include @@ -48,5 +47,3 @@ class Singleton { template T* Singleton::m_instance = nullptr; - -#endif // SINGLETON_H diff --git a/src/util/sleep.h b/src/util/sleep.h index e20960b2bfc..0eca42c241b 100644 --- a/src/util/sleep.h +++ b/src/util/sleep.h @@ -1,5 +1,4 @@ -#ifndef SLEEP_H -#define SLEEP_H +#pragma once #ifdef __WINDOWS__ #include @@ -8,5 +7,3 @@ #else #include #endif - -#endif /* SLEEP_H */ diff --git a/src/util/sleepableqthread.cpp b/src/util/sleepableqthread.cpp index 1986bd7f47e..9d3ab5b315b 100644 --- a/src/util/sleepableqthread.cpp +++ b/src/util/sleepableqthread.cpp @@ -1,8 +1,6 @@ -// sleepableqthread.cpp -// Created May 21, 2012 by Bill Good -// // This is just a dummy file meant to be shoved in the build list so that moc // runs on the class and linker errors are avoided. #include "util/sleepableqthread.h" +#include "moc_sleepableqthread.cpp" diff --git a/src/util/sleepableqthread.h b/src/util/sleepableqthread.h index 7bd12f4d161..4c3768b558f 100644 --- a/src/util/sleepableqthread.h +++ b/src/util/sleepableqthread.h @@ -1,5 +1,4 @@ -// sleepableqthread.h -// Created May 21, 2012 by Bill Good +#pragma once #include diff --git a/src/util/statmodel.cpp b/src/util/statmodel.cpp index 0b9d7d8de62..598b7e8e4b4 100644 --- a/src/util/statmodel.cpp +++ b/src/util/statmodel.cpp @@ -1,6 +1,8 @@ +#include "util/statmodel.h" + #include -#include "util/statmodel.h" +#include "moc_statmodel.cpp" #include "util/math.h" StatModel::StatModel(QObject* pParent) diff --git a/src/util/statmodel.h b/src/util/statmodel.h index 60b0273550f..f66bbf02adc 100644 --- a/src/util/statmodel.h +++ b/src/util/statmodel.h @@ -1,5 +1,4 @@ -#ifndef STATMODEL_H -#define STATMODEL_H +#pragma once #include #include @@ -50,5 +49,3 @@ class StatModel final : public QAbstractTableModel { QList m_stats; QHash m_statNameToRow; }; - -#endif /* STATMODEL_H */ diff --git a/src/util/statsmanager.cpp b/src/util/statsmanager.cpp index 66ce27420af..b771a2ed8c2 100644 --- a/src/util/statsmanager.cpp +++ b/src/util/statsmanager.cpp @@ -1,10 +1,12 @@ -#include -#include -#include +#include "util/statsmanager.h" + #include #include +#include +#include +#include -#include "util/statsmanager.h" +#include "moc_statsmanager.cpp" #include "util/cmdlineargs.h" #include "util/compatibility.h" diff --git a/src/util/tapfilter.cpp b/src/util/tapfilter.cpp index cbc4de489a1..e5235d239ff 100644 --- a/src/util/tapfilter.cpp +++ b/src/util/tapfilter.cpp @@ -1,5 +1,7 @@ #include "util/tapfilter.h" +#include "moc_tapfilter.cpp" + TapFilter::TapFilter(QObject* pParent, int filterLength, mixxx::Duration maxInterval) : QObject(pParent), m_mean(MovingInterquartileMean(filterLength)), diff --git a/src/util/tapfilter.h b/src/util/tapfilter.h index d6805dcd315..232a27b15a3 100644 --- a/src/util/tapfilter.h +++ b/src/util/tapfilter.h @@ -1,5 +1,4 @@ -#ifndef TAPFILTER_H -#define TAPFILTER_H +#pragma once #include #include @@ -27,5 +26,3 @@ class TapFilter : public QObject { mixxx::Duration m_maxInterval; QMutex m_mutex; }; - -#endif /* TAPFILTER_H */ diff --git a/src/util/task.cpp b/src/util/task.cpp index 9df52830120..92c5df7355e 100644 --- a/src/util/task.cpp +++ b/src/util/task.cpp @@ -1,6 +1,8 @@ +#include "util/task.h" + #include -#include "util/task.h" +#include "moc_task.cpp" #include "util/compatibility.h" TaskWatcher::TaskWatcher(QObject* pParent) : QObject(pParent) { diff --git a/src/util/task.h b/src/util/task.h index 49110fbfdc5..4fae197e74b 100644 --- a/src/util/task.h +++ b/src/util/task.h @@ -1,5 +1,4 @@ -#ifndef TASK_H -#define TASK_H +#pragma once #include #include @@ -29,5 +28,3 @@ class TaskWatcher : public QObject { private: QAtomicInt m_activeTasks; }; - -#endif /* TASK_H */ diff --git a/src/util/taskmonitor.cpp b/src/util/taskmonitor.cpp index 305e5a1c849..633f580fa11 100644 --- a/src/util/taskmonitor.cpp +++ b/src/util/taskmonitor.cpp @@ -3,6 +3,7 @@ #include #include +#include "moc_taskmonitor.cpp" #include "util/assert.h" #include "util/math.h" #include "util/thread_affinity.h" diff --git a/src/util/thread_annotations.h b/src/util/thread_annotations.h index eb6a0ef0809..f7c7a246e16 100644 --- a/src/util/thread_annotations.h +++ b/src/util/thread_annotations.h @@ -1,5 +1,4 @@ -#ifndef UTIL_THREAD_ANNOTATIONS_H -#define UTIL_THREAD_ANNOTATIONS_H +#pragma once // NOTE(rryan): Taken from http://clang.llvm.org/docs/ThreadSafetyAnalysis.html. // Assumed to be in the public domain. @@ -68,5 +67,3 @@ #define NO_THREAD_SAFETY_ANALYSIS \ THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis) - -#endif /* UTIL_THREAD_ANNOTATIONS_H */ diff --git a/src/util/threadcputimer.cpp b/src/util/threadcputimer.cpp index bc2bb9eda50..13f62803160 100644 --- a/src/util/threadcputimer.cpp +++ b/src/util/threadcputimer.cpp @@ -1,4 +1,3 @@ - #include "util/threadcputimer.h" #if defined(Q_OS_MAC) diff --git a/src/util/threadcputimer.h b/src/util/threadcputimer.h index 9e625659c7a..6a5a569fc18 100644 --- a/src/util/threadcputimer.h +++ b/src/util/threadcputimer.h @@ -1,5 +1,4 @@ -#ifndef UTIL_THREADCPUTIMER_H -#define UTIL_THREADCPUTIMER_H +#pragma once #include "util/duration.h" #include "util/performancetimer.h" @@ -13,5 +12,3 @@ class ThreadCpuTimer { qint64 t1; qint64 t2; }; - -#endif // UTIL_THREADCPUTIMER_H diff --git a/src/util/time.h b/src/util/time.h index 8e097d83e16..47fe6e0d495 100644 --- a/src/util/time.h +++ b/src/util/time.h @@ -1,5 +1,4 @@ -#ifndef MIXXX_UTIL_TIME_H -#define MIXXX_UTIL_TIME_H +#pragma once #include "util/performancetimer.h" #include "util/threadcputimer.h" @@ -43,5 +42,3 @@ class Time { }; } // namespace mixxx - -#endif /* MIXXX_UTIL_TIME_H */ diff --git a/src/util/timer.cpp b/src/util/timer.cpp index e95f39dfa84..335c9996764 100644 --- a/src/util/timer.cpp +++ b/src/util/timer.cpp @@ -1,5 +1,6 @@ #include "util/timer.h" +#include "moc_timer.cpp" #include "util/experiment.h" #include "util/time.h" #include "waveform/guitick.h" diff --git a/src/util/timer.h b/src/util/timer.h index 57fd4d58601..8be1adf939f 100644 --- a/src/util/timer.h +++ b/src/util/timer.h @@ -1,5 +1,4 @@ -#ifndef UTIL_TIMER_H -#define UTIL_TIMER_H +#pragma once #include @@ -134,5 +133,3 @@ class GuiTickTimer : public QObject { mixxx::Duration m_lastUpdate; bool m_bActive; }; - -#endif /* UTIL_TIMER_H */ diff --git a/src/util/trace.h b/src/util/trace.h index 18c5cb60b13..4c9615bb867 100644 --- a/src/util/trace.h +++ b/src/util/trace.h @@ -1,5 +1,4 @@ -#ifndef UTIL_TRACE_H -#define UTIL_TRACE_H +#pragma once #include #include @@ -100,5 +99,3 @@ class DebugTrace : public Trace { virtual ~DebugTrace() { } }; - -#endif /* UTIL_TRACE_H */ diff --git a/src/util/types.h b/src/util/types.h index 15b45e604ee..cc1ded5db54 100644 --- a/src/util/types.h +++ b/src/util/types.h @@ -1,5 +1,4 @@ -#ifndef TYPES_H -#define TYPES_H +#pragma once #include #include @@ -62,5 +61,3 @@ inline CSAMPLE_GAIN CSAMPLE_GAIN_clamp(CSAMPLE_GAIN in) { return math_clamp(in, CSAMPLE_GAIN_MIN, CSAMPLE_GAIN_MAX); } - -#endif /* TYPES_H */ diff --git a/src/util/valuetransformer.h b/src/util/valuetransformer.h index 12018c666b9..95a46a5bda6 100644 --- a/src/util/valuetransformer.h +++ b/src/util/valuetransformer.h @@ -1,5 +1,4 @@ -#ifndef VALUETRANSFORMER_H -#define VALUETRANSFORMER_H +#pragma once #include #include @@ -94,5 +93,3 @@ class ValueTransformer { QList m_transformers; }; - -#endif /* VALUETRANSFORMER_H */ diff --git a/src/util/version.h b/src/util/version.h index 61f645314c1..625a86974e2 100644 --- a/src/util/version.h +++ b/src/util/version.h @@ -1,5 +1,4 @@ -#ifndef VERSION_H -#define VERSION_H +#pragma once #include @@ -32,5 +31,3 @@ class Version { // Prints out diagnostic information about this build. static void logBuildDetails(); }; - -#endif /* VERSION_H */ diff --git a/src/util/widgetrendertimer.cpp b/src/util/widgetrendertimer.cpp index 7f8e81f78fb..43b51a40f0a 100644 --- a/src/util/widgetrendertimer.cpp +++ b/src/util/widgetrendertimer.cpp @@ -1,5 +1,6 @@ #include "util/widgetrendertimer.h" +#include "moc_widgetrendertimer.cpp" #include "util/time.h" WidgetRenderTimer::WidgetRenderTimer(mixxx::Duration renderFrequency, diff --git a/src/util/workerthread.cpp b/src/util/workerthread.cpp index 00808adf313..bf376e40e51 100644 --- a/src/util/workerthread.cpp +++ b/src/util/workerthread.cpp @@ -1,5 +1,6 @@ #include "util/workerthread.h" +#include "moc_workerthread.cpp" namespace { diff --git a/src/util/xml.h b/src/util/xml.h index b736edb6fe5..c16431bd9a9 100644 --- a/src/util/xml.h +++ b/src/util/xml.h @@ -1,5 +1,4 @@ -#ifndef XML_H -#define XML_H +#pragma once #include #include @@ -53,5 +52,3 @@ class XmlParse { XmlParse() {} ~XmlParse() {} }; - -#endif diff --git a/src/vinylcontrol/defs_vinylcontrol.h b/src/vinylcontrol/defs_vinylcontrol.h index aa37b7b04bd..69a8b54ec9c 100644 --- a/src/vinylcontrol/defs_vinylcontrol.h +++ b/src/vinylcontrol/defs_vinylcontrol.h @@ -1,5 +1,4 @@ -#ifndef DEFS_VINYLCONTROL_H -#define DEFS_VINYLCONTROL_H +#pragma once #define VINYL_PREF_KEY "[VinylControl]" @@ -46,5 +45,3 @@ const int VINYL_STATUS_ERROR = 3; #define MIXXX_VINYL_SCOPE_SIZE 100 const int kMaximumVinylControlInputs = 4; - -#endif /* DEFS_VINYLCONTROL_H */ diff --git a/src/vinylcontrol/steadypitch.cpp b/src/vinylcontrol/steadypitch.cpp index 39596ac5882..ec431903bf7 100644 --- a/src/vinylcontrol/steadypitch.cpp +++ b/src/vinylcontrol/steadypitch.cpp @@ -1,20 +1,3 @@ -/*************************************************************************** - steadypitch.cpp - ------------------- - begin : Halloween, 2011 - copyright : (C) 2011 Owen Williams - email : owilliams@mixxx.org -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include #include "vinylcontrolxwax.h" diff --git a/src/vinylcontrol/steadypitch.h b/src/vinylcontrol/steadypitch.h index 972e2e0c101..6b37d7efaa7 100644 --- a/src/vinylcontrol/steadypitch.h +++ b/src/vinylcontrol/steadypitch.h @@ -1,5 +1,4 @@ -#ifndef STEADYPITCH_H -#define STEADYPITCH_H +#pragma once #include @@ -23,5 +22,3 @@ class SteadyPitch { double m_dPitchThreshold; int m_iPlayDirection; }; - -#endif diff --git a/src/vinylcontrol/vinylcontrol.h b/src/vinylcontrol/vinylcontrol.h index cdc142fc0a4..c3ffd02a2ba 100644 --- a/src/vinylcontrol/vinylcontrol.h +++ b/src/vinylcontrol/vinylcontrol.h @@ -1,5 +1,4 @@ -#ifndef VINYLCONTROL_H -#define VINYLCONTROL_H +#pragma once #include @@ -79,5 +78,3 @@ class VinylControl : public QObject { // Whether this VinylControl instance is enabled. bool m_bIsEnabled; }; - -#endif diff --git a/src/vinylcontrol/vinylcontrolmanager.cpp b/src/vinylcontrol/vinylcontrolmanager.cpp index 7e3570391a9..f406599047f 100644 --- a/src/vinylcontrol/vinylcontrolmanager.cpp +++ b/src/vinylcontrol/vinylcontrolmanager.cpp @@ -1,14 +1,9 @@ -/** - * @file vinylcontrolmanager.cpp - * @author Bill Good - * @date April 15, 2011 - */ - #include "vinylcontrol/vinylcontrolmanager.h" #include "control/controlobject.h" #include "control/controlproxy.h" #include "mixer/playermanager.h" +#include "moc_vinylcontrolmanager.cpp" #include "soundio/soundmanager.h" #include "util/compatibility.h" #include "util/timer.h" diff --git a/src/vinylcontrol/vinylcontrolmanager.h b/src/vinylcontrol/vinylcontrolmanager.h index bbd26808d4e..5a346d80a20 100644 --- a/src/vinylcontrol/vinylcontrolmanager.h +++ b/src/vinylcontrol/vinylcontrolmanager.h @@ -1,11 +1,4 @@ -/** - * @file vinylcontrolmanager.h - * @author Bill Good - * @date April 15, 2011 - */ - -#ifndef VINYLCONTROLMANAGER_H -#define VINYLCONTROLMANAGER_H +#pragma once #include #include @@ -69,5 +62,3 @@ class VinylControlManager : public QObject { ControlProxy* m_pNumDecks; int m_iNumConfiguredDecks; }; - -#endif // VINYLCONTROLMANAGER_H diff --git a/src/vinylcontrol/vinylcontrolprocessor.cpp b/src/vinylcontrol/vinylcontrolprocessor.cpp index a7b5379d289..037684b7866 100644 --- a/src/vinylcontrol/vinylcontrolprocessor.cpp +++ b/src/vinylcontrol/vinylcontrolprocessor.cpp @@ -1,8 +1,9 @@ -#include - #include "vinylcontrol/vinylcontrolprocessor.h" +#include + #include "control/controlpushbutton.h" +#include "moc_vinylcontrolprocessor.cpp" #include "util/defs.h" #include "util/event.h" #include "util/sample.h" diff --git a/src/vinylcontrol/vinylcontrolprocessor.h b/src/vinylcontrol/vinylcontrolprocessor.h index 0ea9d3fa924..5666db0af76 100644 --- a/src/vinylcontrol/vinylcontrolprocessor.h +++ b/src/vinylcontrol/vinylcontrolprocessor.h @@ -1,5 +1,4 @@ -#ifndef VINYLCONTROLPROCESSOR_H -#define VINYLCONTROLPROCESSOR_H +#pragma once #include #include @@ -80,6 +79,3 @@ class VinylControlProcessor : public QThread, public AudioDestination { volatile bool m_bQuit; volatile bool m_bReloadConfig; }; - - -#endif /* VINYLCONTROLPROCESSOR_H */ diff --git a/src/vinylcontrol/vinylcontrolsignalwidget.cpp b/src/vinylcontrol/vinylcontrolsignalwidget.cpp index 9bf04d870f7..d0aab519a32 100644 --- a/src/vinylcontrol/vinylcontrolsignalwidget.cpp +++ b/src/vinylcontrol/vinylcontrolsignalwidget.cpp @@ -1,22 +1,7 @@ -/*************************************************************************** - vinylcontrolsignalwidget.cpp - ------------------- - begin : July 5, 2008 - copyright : (C) 2008 by Albert Santoni - email : gamegod \a\t users.sf.net -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "vinylcontrol/vinylcontrolsignalwidget.h" +#include "moc_vinylcontrolsignalwidget.cpp" + VinylControlSignalWidget::VinylControlSignalWidget() : QWidget(), m_iVinylInput(-1), diff --git a/src/vinylcontrol/vinylcontrolsignalwidget.h b/src/vinylcontrol/vinylcontrolsignalwidget.h index 702e65d43fb..90bb687c70b 100644 --- a/src/vinylcontrol/vinylcontrolsignalwidget.h +++ b/src/vinylcontrol/vinylcontrolsignalwidget.h @@ -5,8 +5,7 @@ * Author: asantoni */ -#ifndef VINYLCONTROLSIGNALWIDGET_H -#define VINYLCONTROLSIGNALWIDGET_H +#pragma once #include #include @@ -42,5 +41,3 @@ class VinylControlSignalWidget : public QWidget, public VinylSignalQualityListen float m_fSignalQuality; bool m_bVinylActive; }; - -#endif /* VINYLCONTROLSIGNALWIDGET_H */ diff --git a/src/vinylcontrol/vinylcontrolxwax.cpp b/src/vinylcontrol/vinylcontrolxwax.cpp index f4f134eb393..84234060d2c 100644 --- a/src/vinylcontrol/vinylcontrolxwax.cpp +++ b/src/vinylcontrol/vinylcontrolxwax.cpp @@ -1,24 +1,3 @@ -/*************************************************************************** - vinylcontrolxwax.cpp - ------------------- - begin : Sometime in Summer 2007 - copyright : (C) 2007 Albert Santoni - (C) 2007 Mark Hills - (C) 2011 Owen Williams - Portions of xwax used under the terms of the GPL - current maintainer : Owen Williams - email : owilliams@mixxx.org -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include #include @@ -35,7 +14,6 @@ 2) Tons of cleanup 3) Speed up needle dropping 4) Extrapolate small dropouts and keep track of "dynamics" - ********************/ namespace { diff --git a/src/vinylcontrol/vinylcontrolxwax.h b/src/vinylcontrol/vinylcontrolxwax.h index 45567003f16..71a5f72a79f 100644 --- a/src/vinylcontrol/vinylcontrolxwax.h +++ b/src/vinylcontrol/vinylcontrolxwax.h @@ -1,5 +1,4 @@ -#ifndef __VINYLCONTROLXWAX_H__ -#define __VINYLCONTROLXWAX_H__ +#pragma once #include @@ -139,5 +138,3 @@ class VinylControlXwax : public VinylControl { static QMutex s_xwaxLUTMutex; static bool s_bLUTInitialized; }; - -#endif diff --git a/src/vinylcontrol/vinylsignalquality.h b/src/vinylcontrol/vinylsignalquality.h index 670f677656b..ee99e2b56cd 100644 --- a/src/vinylcontrol/vinylsignalquality.h +++ b/src/vinylcontrol/vinylsignalquality.h @@ -1,5 +1,4 @@ -#ifndef VINYLSIGNALQUALITY_H -#define VINYLSIGNALQUALITY_H +#pragma once #include "vinylcontrol/defs_vinylcontrol.h" @@ -14,5 +13,3 @@ class VinylSignalQualityListener { public: virtual void onVinylSignalQualityUpdate(const VinylSignalQualityReport& report) = 0; }; - -#endif /* VINYLSIGNALQUALITY_H */ diff --git a/src/waveform/guitick.h b/src/waveform/guitick.h index fc788e4aa12..29d4bed6e02 100644 --- a/src/waveform/guitick.h +++ b/src/waveform/guitick.h @@ -1,5 +1,4 @@ -#ifndef GUITICK_H -#define GUITICK_H +#pragma once #include @@ -22,5 +21,3 @@ class GuiTick { mixxx::Duration m_lastUpdateTime; mixxx::Duration m_cpuTimeLastTick; }; - -#endif // GUITICK_H diff --git a/src/waveform/renderers/glslwaveformrenderersignal.cpp b/src/waveform/renderers/glslwaveformrenderersignal.cpp index 8777ff0e5ad..0afb83a5426 100644 --- a/src/waveform/renderers/glslwaveformrenderersignal.cpp +++ b/src/waveform/renderers/glslwaveformrenderersignal.cpp @@ -1,4 +1,6 @@ #include "waveform/renderers/glslwaveformrenderersignal.h" + +#include "moc_glslwaveformrenderersignal.cpp" #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) #include diff --git a/src/waveform/renderers/qtvsynctestrenderer.h b/src/waveform/renderers/qtvsynctestrenderer.h index 99386f5ffb9..85e646794fa 100644 --- a/src/waveform/renderers/qtvsynctestrenderer.h +++ b/src/waveform/renderers/qtvsynctestrenderer.h @@ -1,5 +1,4 @@ -#ifndef QTVSYNCTESTRENDERER_H -#define QTVSYNCTESTRENDERER_H +#pragma once #include "waveformrenderersignalbase.h" @@ -15,5 +14,3 @@ class QtVSyncTestRenderer : public WaveformRendererSignalBase { private: int m_drawcount; }; - -#endif // QTVSYNCTESTRENDERER_H diff --git a/src/waveform/renderers/qtwaveformrendererfilteredsignal.h b/src/waveform/renderers/qtwaveformrendererfilteredsignal.h index e3a685445e0..c7fed5db4b4 100644 --- a/src/waveform/renderers/qtwaveformrendererfilteredsignal.h +++ b/src/waveform/renderers/qtwaveformrendererfilteredsignal.h @@ -1,5 +1,4 @@ -#ifndef QTWAVEFROMRENDERERFILTEREDSIGNAL_H -#define QTWAVEFROMRENDERERFILTEREDSIGNAL_H +#pragma once #include "waveformrenderersignalbase.h" @@ -30,5 +29,3 @@ class QtWaveformRendererFilteredSignal : public WaveformRendererSignalBase { QVector m_polygon[3]; }; - -#endif // QTWAVEFROMRENDERERFILTEREDSIGNAL_H diff --git a/src/waveform/renderers/qtwaveformrenderersimplesignal.h b/src/waveform/renderers/qtwaveformrenderersimplesignal.h index a041fc9ca13..c2380249c70 100644 --- a/src/waveform/renderers/qtwaveformrenderersimplesignal.h +++ b/src/waveform/renderers/qtwaveformrenderersimplesignal.h @@ -1,5 +1,4 @@ -#ifndef QTWAVEFORMRENDERERSIMPLESIGNAL_H -#define QTWAVEFORMRENDERERSIMPLESIGNAL_H +#pragma once #include "waveformrenderersignalbase.h" @@ -26,5 +25,3 @@ class QtWaveformRendererSimpleSignal : public WaveformRendererSignalBase { QPen m_borderPen; QVector m_polygon; }; - -#endif // QTWAVEFORMRENDERERSIMPLESIGNAL_H diff --git a/src/waveform/renderers/waveformmark.h b/src/waveform/renderers/waveformmark.h index caa6b3fa814..bef85b1e29c 100644 --- a/src/waveform/renderers/waveformmark.h +++ b/src/waveform/renderers/waveformmark.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMMARK_H -#define WAVEFORMMARK_H +#pragma once #include #include @@ -132,5 +131,3 @@ inline bool operator<(const WaveformMarkPointer& lhs, const WaveformMarkPointer& } return leftPosition < rightPosition; } - -#endif // WAVEFORMMARK_H diff --git a/src/waveform/renderers/waveformmarkset.h b/src/waveform/renderers/waveformmarkset.h index 9997eeffc7e..996fd957dd7 100644 --- a/src/waveform/renderers/waveformmarkset.h +++ b/src/waveform/renderers/waveformmarkset.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMMARKSET_H -#define WAVEFORMMARKSET_H +#pragma once #include @@ -35,5 +34,3 @@ class WaveformMarkSet { DISALLOW_COPY_AND_ASSIGN(WaveformMarkSet); }; - -#endif // WAVEFORMMARKSET_H diff --git a/src/waveform/renderers/waveformrenderbackground.h b/src/waveform/renderers/waveformrenderbackground.h index d2b38e2e126..a877e19ceb4 100644 --- a/src/waveform/renderers/waveformrenderbackground.h +++ b/src/waveform/renderers/waveformrenderbackground.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMRENDERBACKGROUND_H -#define WAVEFORMRENDERBACKGROUND_H +#pragma once #include #include @@ -29,5 +28,3 @@ class WaveformRenderBackground : public WaveformRendererAbstract { DISALLOW_COPY_AND_ASSIGN(WaveformRenderBackground); }; - -#endif /* WAVEFORMRENDERBACKGROUND_H */ diff --git a/src/waveform/renderers/waveformrenderbeat.h b/src/waveform/renderers/waveformrenderbeat.h index 444afba7b25..6d3aff52039 100644 --- a/src/waveform/renderers/waveformrenderbeat.h +++ b/src/waveform/renderers/waveformrenderbeat.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMRENDERBEAT_H -#define WAVEFORMRENDERBEAT_H +#pragma once #include @@ -21,5 +20,3 @@ class WaveformRenderBeat : public WaveformRendererAbstract { DISALLOW_COPY_AND_ASSIGN(WaveformRenderBeat); }; - -#endif //WAVEFORMRENDERBEAT_H diff --git a/src/waveform/renderers/waveformrendererabstract.h b/src/waveform/renderers/waveformrendererabstract.h index efb0a7a5072..a1856e70f2a 100644 --- a/src/waveform/renderers/waveformrendererabstract.h +++ b/src/waveform/renderers/waveformrendererabstract.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMRENDERERABSTRACT_H -#define WAVEFORMRENDERERABSTRACT_H +#pragma once #include #include @@ -46,5 +45,3 @@ class WaveformRendererAbstract { friend class WaveformWidgetRenderer; }; - -#endif // WAVEFORMRENDERERABSTRACT_H diff --git a/src/waveform/renderers/waveformrendererendoftrack.h b/src/waveform/renderers/waveformrendererendoftrack.h index a085d94d83e..fd18f9a0183 100644 --- a/src/waveform/renderers/waveformrendererendoftrack.h +++ b/src/waveform/renderers/waveformrendererendoftrack.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMRENDERERENDOFTRACK_H -#define WAVEFORMRENDERERENDOFTRACK_H +#pragma once #include #include @@ -41,5 +40,3 @@ class WaveformRendererEndOfTrack : public WaveformRendererAbstract { DISALLOW_COPY_AND_ASSIGN(WaveformRendererEndOfTrack); }; - -#endif // WAVEFORMRENDERERENDOFTRACK_H diff --git a/src/waveform/renderers/waveformrendererfilteredsignal.h b/src/waveform/renderers/waveformrendererfilteredsignal.h index 03a04295967..ba8e41a2eba 100644 --- a/src/waveform/renderers/waveformrendererfilteredsignal.h +++ b/src/waveform/renderers/waveformrendererfilteredsignal.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMRENDERERFILTEREDSIGNAL_H -#define WAVEFORMRENDERERFILTEREDSIGNAL_H +#pragma once #include #include @@ -26,5 +25,3 @@ class WaveformRendererFilteredSignal : public WaveformRendererSignalBase { DISALLOW_COPY_AND_ASSIGN(WaveformRendererFilteredSignal); }; - -#endif // WAVEFORMRENDERERFILTEREDSIGNAL_H diff --git a/src/waveform/renderers/waveformrendererhsv.h b/src/waveform/renderers/waveformrendererhsv.h index 75038de4023..4c13b61c9a3 100644 --- a/src/waveform/renderers/waveformrendererhsv.h +++ b/src/waveform/renderers/waveformrendererhsv.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMRENDERERHSV_H -#define WAVEFORMRENDERERHSV_H +#pragma once #include "util/class.h" #include "waveformrenderersignalbase.h" @@ -17,5 +16,3 @@ class WaveformRendererHSV : public WaveformRendererSignalBase { private: DISALLOW_COPY_AND_ASSIGN(WaveformRendererHSV); }; - -#endif // WAVEFORMRENDERERFILTEREDSIGNAL_H diff --git a/src/waveform/renderers/waveformrendererpreroll.h b/src/waveform/renderers/waveformrendererpreroll.h index 3866c092ad7..47236275d14 100644 --- a/src/waveform/renderers/waveformrendererpreroll.h +++ b/src/waveform/renderers/waveformrendererpreroll.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMRENDERPREROLL_H -#define WAVEFORMRENDERPREROLL_H +#pragma once #include @@ -20,5 +19,3 @@ class WaveformRendererPreroll : public WaveformRendererAbstract { DISALLOW_COPY_AND_ASSIGN(WaveformRendererPreroll); }; - -#endif /* WAVEFORMRENDERPREROLL_H */ diff --git a/src/waveform/renderers/waveformrendererrgb.h b/src/waveform/renderers/waveformrendererrgb.h index e52f8a21df4..fa8e8bbc12f 100644 --- a/src/waveform/renderers/waveformrendererrgb.h +++ b/src/waveform/renderers/waveformrendererrgb.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMRENDERERRGB_H -#define WAVEFORMRENDERERRGB_H +#pragma once #include "util/class.h" #include "waveformrenderersignalbase.h" @@ -16,5 +15,3 @@ class WaveformRendererRGB : public WaveformRendererSignalBase { private: DISALLOW_COPY_AND_ASSIGN(WaveformRendererRGB); }; - -#endif // WAVEFORMRENDERERRGB_H diff --git a/src/waveform/renderers/waveformrenderersignalbase.h b/src/waveform/renderers/waveformrenderersignalbase.h index ab47b753d94..ea7ec99781e 100644 --- a/src/waveform/renderers/waveformrenderersignalbase.h +++ b/src/waveform/renderers/waveformrenderersignalbase.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMRENDERERSIGNALBASE_H -#define WAVEFORMRENDERERSIGNALBASE_H +#pragma once #include "waveformrendererabstract.h" #include "waveformsignalcolors.h" @@ -47,5 +46,3 @@ class WaveformRendererSignalBase : public WaveformRendererAbstract { qreal m_rgbMidColor_r, m_rgbMidColor_g, m_rgbMidColor_b; qreal m_rgbHighColor_r, m_rgbHighColor_g, m_rgbHighColor_b; }; - -#endif // WAVEFORMRENDERERSIGNALBASE_H diff --git a/src/waveform/renderers/waveformrendermark.cpp b/src/waveform/renderers/waveformrendermark.cpp index ae9b6366de1..7694421302d 100644 --- a/src/waveform/renderers/waveformrendermark.cpp +++ b/src/waveform/renderers/waveformrendermark.cpp @@ -1,19 +1,20 @@ +#include "waveform/renderers/waveformrendermark.h" + #include #include #include -#include "waveform/renderers/waveformrendermark.h" - #include "control/controlproxy.h" #include "engine/controls/cuecontrol.h" +#include "moc_waveformrendermark.cpp" #include "track/track.h" #include "util/color/color.h" +#include "util/painterscope.h" #include "waveform/renderers/waveformwidgetrenderer.h" #include "waveform/waveform.h" +#include "widget/wimagestore.h" #include "widget/wskincolor.h" #include "widget/wwidget.h" -#include "widget/wimagestore.h" -#include "util/painterscope.h" namespace { const int kMaxCueLabelLength = 23; diff --git a/src/waveform/renderers/waveformrendermark.h b/src/waveform/renderers/waveformrendermark.h index dc0fad17c90..54900ec963a 100644 --- a/src/waveform/renderers/waveformrendermark.h +++ b/src/waveform/renderers/waveformrendermark.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMRENDERMARK_H -#define WAVEFORMRENDERMARK_H +#pragma once #include @@ -38,5 +37,3 @@ class WaveformRenderMark : public QObject, public WaveformRendererAbstract { WaveformMarkSet m_marks; DISALLOW_COPY_AND_ASSIGN(WaveformRenderMark); }; - -#endif diff --git a/src/waveform/renderers/waveformrendermarkrange.h b/src/waveform/renderers/waveformrendermarkrange.h index 7307a339958..63c0b5a234f 100644 --- a/src/waveform/renderers/waveformrendermarkrange.h +++ b/src/waveform/renderers/waveformrendermarkrange.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMRENDERMARKRANGE_H -#define WAVEFORMRENDERMARKRANGE_H +#pragma once #include #include @@ -30,5 +29,3 @@ class WaveformRenderMarkRange : public WaveformRendererAbstract { std::vector m_markRanges; }; - -#endif diff --git a/src/waveform/renderers/waveformsignalcolors.h b/src/waveform/renderers/waveformsignalcolors.h index ae554b0cec3..30bab499755 100644 --- a/src/waveform/renderers/waveformsignalcolors.h +++ b/src/waveform/renderers/waveformsignalcolors.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMSIGNALCOLORS_H -#define WAVEFORMSIGNALCOLORS_H +#pragma once #include #include @@ -74,5 +73,3 @@ class WaveformSignalColors { QColor m_bgColor; int m_dimBrightThreshold; }; - -#endif // WAVEFORMSIGNALCOLORS_H diff --git a/src/waveform/renderers/waveformwidgetrenderer.h b/src/waveform/renderers/waveformwidgetrenderer.h index 26f5582f75a..9ee6db607f2 100644 --- a/src/waveform/renderers/waveformwidgetrenderer.h +++ b/src/waveform/renderers/waveformwidgetrenderer.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMWIDGETRENDERER_H -#define WAVEFORMWIDGETRENDERER_H +#pragma once #include #include @@ -211,5 +210,3 @@ class WaveformWidgetRenderer { QPointF p2, QPointF p3); }; - -#endif // WAVEFORMWIDGETRENDERER_H diff --git a/src/waveform/visualplayposition.cpp b/src/waveform/visualplayposition.cpp index 68a9641cf86..acb7556518f 100644 --- a/src/waveform/visualplayposition.cpp +++ b/src/waveform/visualplayposition.cpp @@ -2,8 +2,9 @@ #include -#include "control/controlproxy.h" #include "control/controlobject.h" +#include "control/controlproxy.h" +#include "moc_visualplayposition.cpp" #include "util/math.h" #include "waveform/vsyncthread.h" diff --git a/src/waveform/visualplayposition.h b/src/waveform/visualplayposition.h index 0ca4e16b666..9975adbef3b 100644 --- a/src/waveform/visualplayposition.h +++ b/src/waveform/visualplayposition.h @@ -1,5 +1,4 @@ -#ifndef VISUALPLAYPOSITION_H -#define VISUALPLAYPOSITION_H +#pragma once #include #include @@ -78,5 +77,3 @@ class VisualPlayPosition : public QObject { // Time stamp for m_timeInfo in main CPU time static PerformanceTimer m_timeInfoTime; }; - -#endif // VISUALPLAYPOSITION_H diff --git a/src/waveform/vsyncthread.cpp b/src/waveform/vsyncthread.cpp index e4be9359d81..2105d9221a2 100644 --- a/src/waveform/vsyncthread.cpp +++ b/src/waveform/vsyncthread.cpp @@ -1,12 +1,13 @@ -#include +#include "vsyncthread.h" + #include +#include #include #include -#include -#include "vsyncthread.h" -#include "util/performancetimer.h" +#include "moc_vsyncthread.cpp" #include "util/math.h" +#include "util/performancetimer.h" #include "waveform/guitick.h" VSyncThread::VSyncThread(QObject* pParent) diff --git a/src/waveform/vsyncthread.h b/src/waveform/vsyncthread.h index 7d110f87154..f7310aee56d 100644 --- a/src/waveform/vsyncthread.h +++ b/src/waveform/vsyncthread.h @@ -1,5 +1,4 @@ -#ifndef VSYNCTHREAD_H -#define VSYNCTHREAD_H +#pragma once #include #include @@ -57,6 +56,3 @@ class VSyncThread : public QThread { double m_displayFrameRate; int m_vSyncPerRendering; }; - - -#endif // VSYNCTHREAD_H diff --git a/src/waveform/waveform.h b/src/waveform/waveform.h index 813d846c0b5..e9df058148f 100644 --- a/src/waveform/waveform.h +++ b/src/waveform/waveform.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORM_H -#define WAVEFORM_H +#pragma once #include @@ -185,5 +184,3 @@ class Waveform { typedef QSharedPointer WaveformPointer; typedef QSharedPointer ConstWaveformPointer; - -#endif // WAVEFORM_H diff --git a/src/waveform/waveformfactory.h b/src/waveform/waveformfactory.h index 114244478dd..e3848adda5f 100644 --- a/src/waveform/waveformfactory.h +++ b/src/waveform/waveformfactory.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMFACTORY_H -#define WAVEFORMFACTORY_H +#pragma once #include "library/dao/analysisdao.h" @@ -51,5 +50,3 @@ class WaveformFactory { static QString currentWaveformSummaryVersion(); static QString currentWaveformSummaryDescription(); }; - -#endif /* WAVEFORMFACTORY_H */ diff --git a/src/waveform/waveformwidgetfactory.cpp b/src/waveform/waveformwidgetfactory.cpp index 4d8a7062f37..355f08ad609 100644 --- a/src/waveform/waveformwidgetfactory.cpp +++ b/src/waveform/waveformwidgetfactory.cpp @@ -11,6 +11,7 @@ #include #include "control/controlpotmeter.h" +#include "moc_waveformwidgetfactory.cpp" #include "util/cmdlineargs.h" #include "util/math.h" #include "util/performancetimer.h" @@ -105,7 +106,7 @@ WaveformWidgetFactory::WaveformWidgetFactory() m_frameRate(30), m_endOfTrackWarningTime(30), m_defaultZoom(WaveformWidgetRenderer::s_waveformDefaultZoom), - m_zoomSync(false), + m_zoomSync(true), m_overviewNormalized(false), m_openGlAvailable(false), m_openGlesAvailable(false), @@ -303,12 +304,8 @@ bool WaveformWidgetFactory::setConfig(UserSettingsPointer config) { m_config->set(ConfigKey("[Waveform]","DefaultZoom"), ConfigValue(m_defaultZoom)); } - int zoomSync = m_config->getValueString(ConfigKey("[Waveform]","ZoomSynchronization")).toInt(&ok); - if (ok) { - setZoomSync(static_cast(zoomSync)); - } else { - m_config->set(ConfigKey("[Waveform]","ZoomSynchronization"), ConfigValue(m_zoomSync)); - } + bool zoomSync = m_config->getValue(ConfigKey("[Waveform]", "ZoomSynchronization"), m_zoomSync); + setZoomSync(zoomSync); int beatGridAlpha = m_config->getValue(ConfigKey("[Waveform]", "beatGridAlpha"), m_beatGridAlpha); setDisplayBeatGridAlpha(beatGridAlpha); diff --git a/src/waveform/widgets/emptywaveformwidget.cpp b/src/waveform/widgets/emptywaveformwidget.cpp index d6ac2f10437..601b822936b 100644 --- a/src/waveform/widgets/emptywaveformwidget.cpp +++ b/src/waveform/widgets/emptywaveformwidget.cpp @@ -1,9 +1,10 @@ -#include - #include "waveform/widgets/emptywaveformwidget.h" -#include "waveform/renderers/waveformwidgetrenderer.h" +#include + +#include "moc_emptywaveformwidget.cpp" #include "waveform/renderers/waveformrenderbackground.h" +#include "waveform/renderers/waveformwidgetrenderer.h" EmptyWaveformWidget::EmptyWaveformWidget(const QString& group, QWidget* parent) : QWidget(parent), diff --git a/src/waveform/widgets/emptywaveformwidget.h b/src/waveform/widgets/emptywaveformwidget.h index c9056554fef..28fd5b401b6 100644 --- a/src/waveform/widgets/emptywaveformwidget.h +++ b/src/waveform/widgets/emptywaveformwidget.h @@ -1,5 +1,4 @@ -#ifndef EMPTYWAVEFORM_H -#define EMPTYWAVEFORM_H +#pragma once #include @@ -30,5 +29,3 @@ class EmptyWaveformWidget : public QWidget, public WaveformWidgetAbstract { EmptyWaveformWidget(const QString& group, QWidget* parent); friend class WaveformWidgetFactory; }; - -#endif // EMPTYWAVEFORM_H diff --git a/src/waveform/widgets/glrgbwaveformwidget.cpp b/src/waveform/widgets/glrgbwaveformwidget.cpp index 271b5cb6f1e..40b54b49034 100644 --- a/src/waveform/widgets/glrgbwaveformwidget.cpp +++ b/src/waveform/widgets/glrgbwaveformwidget.cpp @@ -1,16 +1,16 @@ #include "glrgbwaveformwidget.h" -#include "waveform/sharedglcontext.h" -#include "waveform/renderers/waveformwidgetrenderer.h" -#include "waveform/renderers/waveformrenderbackground.h" +#include "moc_glrgbwaveformwidget.cpp" +#include "util/performancetimer.h" #include "waveform/renderers/glwaveformrendererrgb.h" +#include "waveform/renderers/waveformrenderbackground.h" +#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendererendoftrack.h" #include "waveform/renderers/waveformrendererpreroll.h" #include "waveform/renderers/waveformrendermark.h" #include "waveform/renderers/waveformrendermarkrange.h" -#include "waveform/renderers/waveformrendererendoftrack.h" -#include "waveform/renderers/waveformrenderbeat.h" - -#include "util/performancetimer.h" +#include "waveform/renderers/waveformwidgetrenderer.h" +#include "waveform/sharedglcontext.h" GLRGBWaveformWidget::GLRGBWaveformWidget(const QString& group, QWidget* parent) : QGLWidget(parent, SharedGLContext::getWidget()), diff --git a/src/waveform/widgets/glrgbwaveformwidget.h b/src/waveform/widgets/glrgbwaveformwidget.h index d479c22d95d..8d6391ad791 100644 --- a/src/waveform/widgets/glrgbwaveformwidget.h +++ b/src/waveform/widgets/glrgbwaveformwidget.h @@ -1,5 +1,4 @@ -#ifndef GLRGBWAVEFORMWIDGET_H -#define GLRGBWAVEFORMWIDGET_H +#pragma once #include @@ -27,5 +26,3 @@ class GLRGBWaveformWidget : public QGLWidget, public WaveformWidgetAbstract { private: friend class WaveformWidgetFactory; }; - -#endif // GLRGBWAVEFORMWIDGET_H diff --git a/src/waveform/widgets/glsimplewaveformwidget.cpp b/src/waveform/widgets/glsimplewaveformwidget.cpp index b36dc23ed25..c54482279ef 100644 --- a/src/waveform/widgets/glsimplewaveformwidget.cpp +++ b/src/waveform/widgets/glsimplewaveformwidget.cpp @@ -3,17 +3,17 @@ #include #include -#include "waveform/sharedglcontext.h" -#include "waveform/renderers/waveformwidgetrenderer.h" -#include "waveform/renderers/waveformrenderbackground.h" +#include "moc_glsimplewaveformwidget.cpp" +#include "util/performancetimer.h" #include "waveform/renderers/glwaveformrenderersimplesignal.h" +#include "waveform/renderers/waveformrenderbackground.h" +#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendererendoftrack.h" #include "waveform/renderers/waveformrendererpreroll.h" #include "waveform/renderers/waveformrendermark.h" #include "waveform/renderers/waveformrendermarkrange.h" -#include "waveform/renderers/waveformrendererendoftrack.h" -#include "waveform/renderers/waveformrenderbeat.h" - -#include "util/performancetimer.h" +#include "waveform/renderers/waveformwidgetrenderer.h" +#include "waveform/sharedglcontext.h" GLSimpleWaveformWidget::GLSimpleWaveformWidget(const QString& group, QWidget* parent) : QGLWidget(parent, SharedGLContext::getWidget()), diff --git a/src/waveform/widgets/glsimplewaveformwidget.h b/src/waveform/widgets/glsimplewaveformwidget.h index 7cc3ddfc7c8..1aacfaed80a 100644 --- a/src/waveform/widgets/glsimplewaveformwidget.h +++ b/src/waveform/widgets/glsimplewaveformwidget.h @@ -1,5 +1,4 @@ -#ifndef GLSIMPLEWAVEFORMWIDGET_H -#define GLSIMPLEWAVEFORMWIDGET_H +#pragma once #include @@ -27,4 +26,3 @@ class GLSimpleWaveformWidget : public QGLWidget, public WaveformWidgetAbstract { private: friend class WaveformWidgetFactory; }; -#endif // GLSIMPLEWAVEFORMWIDGET_H diff --git a/src/waveform/widgets/glslwaveformwidget.cpp b/src/waveform/widgets/glslwaveformwidget.cpp index 6c8c22fc7b6..a45e0a715b7 100644 --- a/src/waveform/widgets/glslwaveformwidget.cpp +++ b/src/waveform/widgets/glslwaveformwidget.cpp @@ -3,18 +3,18 @@ #include #include -#include "waveform/renderers/waveformwidgetrenderer.h" -#include "waveform/renderers/waveformrenderbackground.h" +#include "moc_glslwaveformwidget.cpp" +#include "util/performancetimer.h" #include "waveform/renderers/glslwaveformrenderersignal.h" +#include "waveform/renderers/waveformrenderbackground.h" +#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendererendoftrack.h" #include "waveform/renderers/waveformrendererpreroll.h" #include "waveform/renderers/waveformrendermark.h" #include "waveform/renderers/waveformrendermarkrange.h" -#include "waveform/renderers/waveformrendererendoftrack.h" -#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformwidgetrenderer.h" #include "waveform/sharedglcontext.h" -#include "util/performancetimer.h" - GLSLFilteredWaveformWidget::GLSLFilteredWaveformWidget( const QString& group, QWidget* parent) diff --git a/src/waveform/widgets/glvsynctestwidget.cpp b/src/waveform/widgets/glvsynctestwidget.cpp index 7de3fcf3200..d0c67991df1 100644 --- a/src/waveform/widgets/glvsynctestwidget.cpp +++ b/src/waveform/widgets/glvsynctestwidget.cpp @@ -2,18 +2,18 @@ #include -#include "waveform/sharedglcontext.h" -#include "waveform/renderers/waveformwidgetrenderer.h" -#include "waveform/renderers/waveformrenderbackground.h" -#include "waveform/renderers/glwaveformrenderersimplesignal.h" +#include "moc_glvsynctestwidget.cpp" +#include "util/performancetimer.h" #include "waveform/renderers/glvsynctestrenderer.h" +#include "waveform/renderers/glwaveformrenderersimplesignal.h" +#include "waveform/renderers/waveformrenderbackground.h" +#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendererendoftrack.h" #include "waveform/renderers/waveformrendererpreroll.h" #include "waveform/renderers/waveformrendermark.h" #include "waveform/renderers/waveformrendermarkrange.h" -#include "waveform/renderers/waveformrendererendoftrack.h" -#include "waveform/renderers/waveformrenderbeat.h" - -#include "util/performancetimer.h" +#include "waveform/renderers/waveformwidgetrenderer.h" +#include "waveform/sharedglcontext.h" GLVSyncTestWidget::GLVSyncTestWidget(const QString& group, QWidget* parent) : QGLWidget(parent, SharedGLContext::getWidget()), diff --git a/src/waveform/widgets/glvsynctestwidget.h b/src/waveform/widgets/glvsynctestwidget.h index 6a3aaf3a8b1..38b094f9117 100644 --- a/src/waveform/widgets/glvsynctestwidget.h +++ b/src/waveform/widgets/glvsynctestwidget.h @@ -1,5 +1,4 @@ -#ifndef GLVSYNCTESTWIDGET_H -#define GLVSYNCTESTWIDGET_H +#pragma once #include @@ -27,4 +26,3 @@ class GLVSyncTestWidget : public QGLWidget, public WaveformWidgetAbstract { private: friend class WaveformWidgetFactory; }; -#endif // GLVSYNCTESTWIDGET_H diff --git a/src/waveform/widgets/glwaveformwidget.cpp b/src/waveform/widgets/glwaveformwidget.cpp index 071f476dcdb..4b43658fd1e 100644 --- a/src/waveform/widgets/glwaveformwidget.cpp +++ b/src/waveform/widgets/glwaveformwidget.cpp @@ -1,19 +1,21 @@ -#include +#include "waveform/widgets/glwaveformwidget.h" + #include +#include #include -#include "waveform/widgets/glwaveformwidget.h" -#include "waveform/renderers/waveformwidgetrenderer.h" -#include "waveform/renderers/waveformrenderbackground.h" -#include "waveform/renderers/qtwaveformrendererfilteredsignal.h" +#include "moc_glwaveformwidget.cpp" +#include "util/performancetimer.h" #include "waveform/renderers/glwaveformrendererfilteredsignal.h" +#include "waveform/renderers/qtwaveformrendererfilteredsignal.h" +#include "waveform/renderers/waveformrenderbackground.h" +#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendererendoftrack.h" #include "waveform/renderers/waveformrendererpreroll.h" #include "waveform/renderers/waveformrendermark.h" #include "waveform/renderers/waveformrendermarkrange.h" -#include "waveform/renderers/waveformrendererendoftrack.h" -#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformwidgetrenderer.h" #include "waveform/sharedglcontext.h" -#include "util/performancetimer.h" GLWaveformWidget::GLWaveformWidget(const QString& group, QWidget* parent) : QGLWidget(parent, SharedGLContext::getWidget()), diff --git a/src/waveform/widgets/glwaveformwidget.h b/src/waveform/widgets/glwaveformwidget.h index ea81612bcac..fa27180e676 100644 --- a/src/waveform/widgets/glwaveformwidget.h +++ b/src/waveform/widgets/glwaveformwidget.h @@ -1,5 +1,4 @@ -#ifndef GLWAVEFORMWIDGET_H -#define GLWAVEFORMWIDGET_H +#pragma once #include @@ -27,5 +26,3 @@ class GLWaveformWidget : public QGLWidget, public WaveformWidgetAbstract { private: friend class WaveformWidgetFactory; }; - -#endif // GLWAVEFORMWIDGET_H diff --git a/src/waveform/widgets/hsvwaveformwidget.cpp b/src/waveform/widgets/hsvwaveformwidget.cpp index b3f869a6022..d514a8fc74f 100644 --- a/src/waveform/widgets/hsvwaveformwidget.cpp +++ b/src/waveform/widgets/hsvwaveformwidget.cpp @@ -2,14 +2,15 @@ #include -#include "waveform/renderers/waveformwidgetrenderer.h" +#include "moc_hsvwaveformwidget.cpp" #include "waveform/renderers/waveformrenderbackground.h" -#include "waveform/renderers/waveformrendermark.h" -#include "waveform/renderers/waveformrendermarkrange.h" +#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendererendoftrack.h" #include "waveform/renderers/waveformrendererhsv.h" #include "waveform/renderers/waveformrendererpreroll.h" -#include "waveform/renderers/waveformrendererendoftrack.h" -#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendermark.h" +#include "waveform/renderers/waveformrendermarkrange.h" +#include "waveform/renderers/waveformwidgetrenderer.h" HSVWaveformWidget::HSVWaveformWidget(const QString& group, QWidget* parent) : QWidget(parent), diff --git a/src/waveform/widgets/hsvwaveformwidget.h b/src/waveform/widgets/hsvwaveformwidget.h index e035b60d792..399f1260159 100644 --- a/src/waveform/widgets/hsvwaveformwidget.h +++ b/src/waveform/widgets/hsvwaveformwidget.h @@ -1,5 +1,4 @@ -#ifndef HSVWAVEFORMWIDGET_H -#define HSVWAVEFORMWIDGET_H +#pragma once #include @@ -26,5 +25,3 @@ class HSVWaveformWidget : public QWidget, public WaveformWidgetAbstract { HSVWaveformWidget(const QString& group, QWidget* parent); friend class WaveformWidgetFactory; }; - -#endif // HSVWAVEFORMWIDGET_H diff --git a/src/waveform/widgets/qthsvwaveformwidget.cpp b/src/waveform/widgets/qthsvwaveformwidget.cpp index 1523e08d2f7..5ab657850b9 100644 --- a/src/waveform/widgets/qthsvwaveformwidget.cpp +++ b/src/waveform/widgets/qthsvwaveformwidget.cpp @@ -1,17 +1,18 @@ -#include +#include "waveform/widgets/qthsvwaveformwidget.h" + #include +#include #include -#include "waveform/widgets/qthsvwaveformwidget.h" - -#include "waveform/renderers/waveformwidgetrenderer.h" +#include "moc_qthsvwaveformwidget.cpp" #include "waveform/renderers/waveformrenderbackground.h" -#include "waveform/renderers/waveformrendermark.h" -#include "waveform/renderers/waveformrendermarkrange.h" +#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendererendoftrack.h" #include "waveform/renderers/waveformrendererhsv.h" #include "waveform/renderers/waveformrendererpreroll.h" -#include "waveform/renderers/waveformrendererendoftrack.h" -#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendermark.h" +#include "waveform/renderers/waveformrendermarkrange.h" +#include "waveform/renderers/waveformwidgetrenderer.h" QtHSVWaveformWidget::QtHSVWaveformWidget(const QString& group, QWidget* parent) : QGLWidget(parent), diff --git a/src/waveform/widgets/qthsvwaveformwidget.h b/src/waveform/widgets/qthsvwaveformwidget.h index 6a013cb1a02..4bf41262311 100644 --- a/src/waveform/widgets/qthsvwaveformwidget.h +++ b/src/waveform/widgets/qthsvwaveformwidget.h @@ -1,5 +1,4 @@ -#ifndef QTHSVWAVEFORMWIDGET_H -#define QTHSVWAVEFORMWIDGET_H +#pragma once #include @@ -27,5 +26,3 @@ class QtHSVWaveformWidget : public QGLWidget, public WaveformWidgetAbstract { QtHSVWaveformWidget(const QString& group, QWidget* parent); friend class WaveformWidgetFactory; }; - -#endif // QTHSVWAVEFORMWIDGET_H diff --git a/src/waveform/widgets/qtrgbwaveformwidget.cpp b/src/waveform/widgets/qtrgbwaveformwidget.cpp index 6cc72f74c97..7a388ad8136 100644 --- a/src/waveform/widgets/qtrgbwaveformwidget.cpp +++ b/src/waveform/widgets/qtrgbwaveformwidget.cpp @@ -1,17 +1,18 @@ -#include +#include "waveform/widgets/qtrgbwaveformwidget.h" + #include +#include #include -#include "waveform/widgets/qtrgbwaveformwidget.h" - -#include "waveform/renderers/waveformwidgetrenderer.h" +#include "moc_qtrgbwaveformwidget.cpp" #include "waveform/renderers/waveformrenderbackground.h" +#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendererendoftrack.h" +#include "waveform/renderers/waveformrendererpreroll.h" +#include "waveform/renderers/waveformrendererrgb.h" #include "waveform/renderers/waveformrendermark.h" #include "waveform/renderers/waveformrendermarkrange.h" -#include "waveform/renderers/waveformrendererrgb.h" -#include "waveform/renderers/waveformrendererpreroll.h" -#include "waveform/renderers/waveformrendererendoftrack.h" -#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformwidgetrenderer.h" #include "waveform/sharedglcontext.h" QtRGBWaveformWidget::QtRGBWaveformWidget(const QString& group, QWidget* parent) diff --git a/src/waveform/widgets/qtrgbwaveformwidget.h b/src/waveform/widgets/qtrgbwaveformwidget.h index 57d60b40bf6..31477169072 100644 --- a/src/waveform/widgets/qtrgbwaveformwidget.h +++ b/src/waveform/widgets/qtrgbwaveformwidget.h @@ -1,5 +1,4 @@ -#ifndef QTRGBWAVEFORMWIDGET_H -#define QTRGBWAVEFORMWIDGET_H +#pragma once #include @@ -27,5 +26,3 @@ class QtRGBWaveformWidget : public QGLWidget, public WaveformWidgetAbstract { QtRGBWaveformWidget(const QString& group, QWidget* parent); friend class WaveformWidgetFactory; }; - -#endif // QTRGBWAVEFORMWIDGET_H diff --git a/src/waveform/widgets/qtsimplewaveformwidget.cpp b/src/waveform/widgets/qtsimplewaveformwidget.cpp index 1aae5b6a42f..4978a6b848e 100644 --- a/src/waveform/widgets/qtsimplewaveformwidget.cpp +++ b/src/waveform/widgets/qtsimplewaveformwidget.cpp @@ -3,17 +3,17 @@ #include #include -#include "waveform/sharedglcontext.h" -#include "waveform/renderers/waveformwidgetrenderer.h" -#include "waveform/renderers/waveformrenderbackground.h" +#include "moc_qtsimplewaveformwidget.cpp" +#include "util/performancetimer.h" #include "waveform/renderers/qtwaveformrenderersimplesignal.h" +#include "waveform/renderers/waveformrenderbackground.h" +#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendererendoftrack.h" #include "waveform/renderers/waveformrendererpreroll.h" #include "waveform/renderers/waveformrendermark.h" #include "waveform/renderers/waveformrendermarkrange.h" -#include "waveform/renderers/waveformrendererendoftrack.h" -#include "waveform/renderers/waveformrenderbeat.h" - -#include "util/performancetimer.h" +#include "waveform/renderers/waveformwidgetrenderer.h" +#include "waveform/sharedglcontext.h" QtSimpleWaveformWidget::QtSimpleWaveformWidget( const QString& group, diff --git a/src/waveform/widgets/qtsimplewaveformwidget.h b/src/waveform/widgets/qtsimplewaveformwidget.h index a00f7ec36bd..18687901326 100644 --- a/src/waveform/widgets/qtsimplewaveformwidget.h +++ b/src/waveform/widgets/qtsimplewaveformwidget.h @@ -1,5 +1,4 @@ -#ifndef QTSIMPLEWAVEFORMWIDGET_H -#define QTSIMPLEWAVEFORMWIDGET_H +#pragma once #include @@ -28,5 +27,3 @@ class QtSimpleWaveformWidget : public QGLWidget, public WaveformWidgetAbstract { private: friend class WaveformWidgetFactory; }; - -#endif // QTSIMPLEWAVEFORMWIDGET_H diff --git a/src/waveform/widgets/qtvsynctestwidget.cpp b/src/waveform/widgets/qtvsynctestwidget.cpp index d30c6f44cb3..c651d3655d7 100644 --- a/src/waveform/widgets/qtvsynctestwidget.cpp +++ b/src/waveform/widgets/qtvsynctestwidget.cpp @@ -1,20 +1,20 @@ -#include +#include "waveform/widgets/qtvsynctestwidget.h" + #include +#include #include -#include "waveform/widgets/qtvsynctestwidget.h" - -#include "waveform/sharedglcontext.h" -#include "waveform/renderers/waveformwidgetrenderer.h" -#include "waveform/renderers/waveformrenderbackground.h" +#include "moc_qtvsynctestwidget.cpp" +#include "util/performancetimer.h" #include "waveform/renderers/qtvsynctestrenderer.h" +#include "waveform/renderers/waveformrenderbackground.h" +#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendererendoftrack.h" #include "waveform/renderers/waveformrendererpreroll.h" #include "waveform/renderers/waveformrendermark.h" #include "waveform/renderers/waveformrendermarkrange.h" -#include "waveform/renderers/waveformrendererendoftrack.h" -#include "waveform/renderers/waveformrenderbeat.h" - -#include "util/performancetimer.h" +#include "waveform/renderers/waveformwidgetrenderer.h" +#include "waveform/sharedglcontext.h" QtVSyncTestWidget::QtVSyncTestWidget(const QString& group, QWidget* parent) : QGLWidget(parent, SharedGLContext::getWidget()), diff --git a/src/waveform/widgets/qtvsynctestwidget.h b/src/waveform/widgets/qtvsynctestwidget.h index bb575d54b46..e0b98793705 100644 --- a/src/waveform/widgets/qtvsynctestwidget.h +++ b/src/waveform/widgets/qtvsynctestwidget.h @@ -1,5 +1,4 @@ -#ifndef QTVSYNCTESTWIDGET_H -#define QTVSYNCTESTWIDGET_H +#pragma once #include @@ -27,5 +26,3 @@ class QtVSyncTestWidget : public QGLWidget, public WaveformWidgetAbstract { private: friend class WaveformWidgetFactory; }; - -#endif // QTVSYNCTESTWIDGET_H diff --git a/src/waveform/widgets/qtwaveformwidget.cpp b/src/waveform/widgets/qtwaveformwidget.cpp index 9d5c353d588..904e03cc09b 100644 --- a/src/waveform/widgets/qtwaveformwidget.cpp +++ b/src/waveform/widgets/qtwaveformwidget.cpp @@ -1,21 +1,21 @@ -#include +#include "waveform/widgets/qtwaveformwidget.h" + #include +#include #include -#include "waveform/widgets/qtwaveformwidget.h" - -#include "waveform/renderers/waveformwidgetrenderer.h" -#include "waveform/renderers/waveformrenderbackground.h" +#include "moc_qtwaveformwidget.cpp" +#include "util/performancetimer.h" #include "waveform/renderers/qtwaveformrendererfilteredsignal.h" +#include "waveform/renderers/waveformrenderbackground.h" +#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendererendoftrack.h" #include "waveform/renderers/waveformrendererpreroll.h" #include "waveform/renderers/waveformrendermark.h" #include "waveform/renderers/waveformrendermarkrange.h" -#include "waveform/renderers/waveformrendererendoftrack.h" -#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformwidgetrenderer.h" #include "waveform/sharedglcontext.h" -#include "util/performancetimer.h" - QtWaveformWidget::QtWaveformWidget(const QString& group, QWidget* parent) : QGLWidget(parent, SharedGLContext::getWidget()), WaveformWidgetAbstract(group) { diff --git a/src/waveform/widgets/qtwaveformwidget.h b/src/waveform/widgets/qtwaveformwidget.h index bb9b58c2e62..4c4ef085dc6 100644 --- a/src/waveform/widgets/qtwaveformwidget.h +++ b/src/waveform/widgets/qtwaveformwidget.h @@ -1,5 +1,4 @@ -#ifndef QTWAVEFORMWIDGET_H -#define QTWAVEFORMWIDGET_H +#pragma once #include @@ -27,5 +26,3 @@ class QtWaveformWidget : public QGLWidget, public WaveformWidgetAbstract { private: friend class WaveformWidgetFactory; }; - -#endif // QTWAVEFORMWIDGET_H diff --git a/src/waveform/widgets/rgbwaveformwidget.cpp b/src/waveform/widgets/rgbwaveformwidget.cpp index d313a98d805..befc317f28b 100644 --- a/src/waveform/widgets/rgbwaveformwidget.cpp +++ b/src/waveform/widgets/rgbwaveformwidget.cpp @@ -2,14 +2,15 @@ #include -#include "waveform/renderers/waveformwidgetrenderer.h" +#include "moc_rgbwaveformwidget.cpp" #include "waveform/renderers/waveformrenderbackground.h" +#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendererendoftrack.h" +#include "waveform/renderers/waveformrendererpreroll.h" +#include "waveform/renderers/waveformrendererrgb.h" #include "waveform/renderers/waveformrendermark.h" #include "waveform/renderers/waveformrendermarkrange.h" -#include "waveform/renderers/waveformrendererrgb.h" -#include "waveform/renderers/waveformrendererpreroll.h" -#include "waveform/renderers/waveformrendererendoftrack.h" -#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformwidgetrenderer.h" RGBWaveformWidget::RGBWaveformWidget(const QString& group, QWidget* parent) : QWidget(parent), diff --git a/src/waveform/widgets/rgbwaveformwidget.h b/src/waveform/widgets/rgbwaveformwidget.h index dd4202b593b..045c0ab734b 100644 --- a/src/waveform/widgets/rgbwaveformwidget.h +++ b/src/waveform/widgets/rgbwaveformwidget.h @@ -1,5 +1,4 @@ -#ifndef RGBWAVEFORMWIDGET_H -#define RGBWAVEFORMWIDGET_H +#pragma once #include @@ -26,5 +25,3 @@ class RGBWaveformWidget : public QWidget, public WaveformWidgetAbstract { RGBWaveformWidget(const QString& group, QWidget* parent); friend class WaveformWidgetFactory; }; - -#endif // RGBWAVEFORMWIDGET_H diff --git a/src/waveform/widgets/softwarewaveformwidget.cpp b/src/waveform/widgets/softwarewaveformwidget.cpp index 8c3fb3e9148..ccc6a64b122 100644 --- a/src/waveform/widgets/softwarewaveformwidget.cpp +++ b/src/waveform/widgets/softwarewaveformwidget.cpp @@ -2,14 +2,15 @@ #include -#include "waveform/renderers/waveformwidgetrenderer.h" +#include "moc_softwarewaveformwidget.cpp" #include "waveform/renderers/waveformrenderbackground.h" -#include "waveform/renderers/waveformrendermark.h" -#include "waveform/renderers/waveformrendermarkrange.h" +#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendererendoftrack.h" #include "waveform/renderers/waveformrendererfilteredsignal.h" #include "waveform/renderers/waveformrendererpreroll.h" -#include "waveform/renderers/waveformrendererendoftrack.h" -#include "waveform/renderers/waveformrenderbeat.h" +#include "waveform/renderers/waveformrendermark.h" +#include "waveform/renderers/waveformrendermarkrange.h" +#include "waveform/renderers/waveformwidgetrenderer.h" SoftwareWaveformWidget::SoftwareWaveformWidget(const QString& group, QWidget* parent) : QWidget(parent), diff --git a/src/waveform/widgets/softwarewaveformwidget.h b/src/waveform/widgets/softwarewaveformwidget.h index da6319501cd..ff9ac610b58 100644 --- a/src/waveform/widgets/softwarewaveformwidget.h +++ b/src/waveform/widgets/softwarewaveformwidget.h @@ -1,5 +1,4 @@ -#ifndef SOFTWAREWAVEFORMWIDGET_H -#define SOFTWAREWAVEFORMWIDGET_H +#pragma once #include @@ -26,5 +25,3 @@ class SoftwareWaveformWidget : public QWidget, public WaveformWidgetAbstract { SoftwareWaveformWidget(const QString& groupp, QWidget* parent); friend class WaveformWidgetFactory; }; - -#endif // SOFTWAREWAVEFORMWIDGET_H diff --git a/src/waveform/widgets/waveformwidgetabstract.h b/src/waveform/widgets/waveformwidgetabstract.h index 5f79f2f69c0..3b975c71897 100644 --- a/src/waveform/widgets/waveformwidgetabstract.h +++ b/src/waveform/widgets/waveformwidgetabstract.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMWIDGETABSTRACT_H -#define WAVEFORMWIDGETABSTRACT_H +#pragma once #include #include @@ -42,5 +41,3 @@ class WaveformWidgetAbstract : public WaveformWidgetRenderer { friend class WaveformWidgetFactory; }; - -#endif // WAVEFORMWIDGETABSTRACT_H diff --git a/src/waveform/widgets/waveformwidgettype.h b/src/waveform/widgets/waveformwidgettype.h index 5d87a67ece1..a2a889a033b 100644 --- a/src/waveform/widgets/waveformwidgettype.h +++ b/src/waveform/widgets/waveformwidgettype.h @@ -1,5 +1,4 @@ -#ifndef WAVEFORMWIDGETTYPE_H -#define WAVEFORMWIDGETTYPE_H +#pragma once class WaveformWidgetType { public: @@ -25,5 +24,3 @@ class WaveformWidgetType { Count_WaveformwidgetType // Also used as invalid value }; }; - -#endif // WAVEFORMWIDGETTYPE_H diff --git a/src/widget/controlwidgetconnection.cpp b/src/widget/controlwidgetconnection.cpp index c198c45e0b4..2822cb7f3d6 100644 --- a/src/widget/controlwidgetconnection.cpp +++ b/src/widget/controlwidgetconnection.cpp @@ -1,11 +1,13 @@ -#include #include "widget/controlwidgetconnection.h" -#include "widget/wbasewidget.h" +#include + #include "control/controlproxy.h" +#include "moc_controlwidgetconnection.cpp" +#include "util/assert.h" #include "util/debug.h" #include "util/valuetransformer.h" -#include "util/assert.h" +#include "widget/wbasewidget.h" ControlWidgetConnection::ControlWidgetConnection( WBaseWidget* pBaseWidget, diff --git a/src/widget/controlwidgetconnection.h b/src/widget/controlwidgetconnection.h index 36b8ef39d14..0b487dedd96 100644 --- a/src/widget/controlwidgetconnection.h +++ b/src/widget/controlwidgetconnection.h @@ -1,5 +1,4 @@ -#ifndef CONTROLWIDGETCONNECTION_H -#define CONTROLWIDGETCONNECTION_H +#pragma once #include #include @@ -140,5 +139,3 @@ class ControlWidgetPropertyConnection final : public ControlWidgetConnection { private: QByteArray m_propertyName; }; - -#endif /* CONTROLWIDGETCONNECTION_H */ diff --git a/src/widget/effectwidgetutils.h b/src/widget/effectwidgetutils.h index f2fd08c1c75..3d2b2c75a93 100644 --- a/src/widget/effectwidgetutils.h +++ b/src/widget/effectwidgetutils.h @@ -1,5 +1,4 @@ -#ifndef EFFECTWIDGETUTILS_H -#define EFFECTWIDGETUTILS_H +#pragma once #include @@ -121,5 +120,3 @@ class EffectWidgetUtils { private: EffectWidgetUtils() = default; }; - -#endif /* EFFECTWIDGETUTILS_H */ diff --git a/src/widget/hexspinbox.cpp b/src/widget/hexspinbox.cpp index ab0c04d6978..c58ef0fe886 100644 --- a/src/widget/hexspinbox.cpp +++ b/src/widget/hexspinbox.cpp @@ -1,5 +1,7 @@ #include "widget/hexspinbox.h" +#include "moc_hexspinbox.cpp" + HexSpinBox::HexSpinBox(QWidget* pParent) : QSpinBox(pParent) { setRange(0, 255); diff --git a/src/widget/hexspinbox.h b/src/widget/hexspinbox.h index 6942000d3c4..709bd99fa59 100644 --- a/src/widget/hexspinbox.h +++ b/src/widget/hexspinbox.h @@ -1,5 +1,4 @@ -#ifndef HEXSPINBOX_H -#define HEXSPINBOX_H +#pragma once #include #include @@ -14,5 +13,3 @@ class HexSpinBox : public QSpinBox { int valueFromText(const QString& text) const override; QValidator::State validate(QString& input, int& pos) const override; }; - -#endif /* HEXSPINBOX_H */ diff --git a/src/widget/knobeventhandler.h b/src/widget/knobeventhandler.h index e502336763f..f06fbc26cec 100644 --- a/src/widget/knobeventhandler.h +++ b/src/widget/knobeventhandler.h @@ -1,5 +1,4 @@ -#ifndef KNOBEVENTHANDLER_H -#define KNOBEVENTHANDLER_H +#pragma once #include #include @@ -110,5 +109,3 @@ class KnobEventHandler { QPoint m_startPos; QCursor m_blankCursor; }; - -#endif /* KNOBEVENTHANDLER_H */ diff --git a/src/widget/paintable.cpp b/src/widget/paintable.cpp index 2b84241e915..073d7ba841a 100644 --- a/src/widget/paintable.cpp +++ b/src/widget/paintable.cpp @@ -1,4 +1,3 @@ - #include "widget/wpixmapstore.h" #include diff --git a/src/widget/paintable.h b/src/widget/paintable.h index af36b2b3847..9f3aa591f50 100644 --- a/src/widget/paintable.h +++ b/src/widget/paintable.h @@ -1,6 +1,4 @@ - -#ifndef PAINTABLE_H -#define PAINTABLE_H +#pragma once #include #include @@ -61,5 +59,3 @@ class Paintable { DrawMode m_drawMode; PixmapSource m_source; }; - -#endif // PAINTABLE diff --git a/src/widget/slidereventhandler.h b/src/widget/slidereventhandler.h index aa6a22e62e5..a41aef7c6d1 100644 --- a/src/widget/slidereventhandler.h +++ b/src/widget/slidereventhandler.h @@ -1,5 +1,4 @@ -#ifndef SLIDEREVENTHANDLER_H -#define SLIDEREVENTHANDLER_H +#pragma once #include #include @@ -203,5 +202,3 @@ class SliderEventHandler { // Is true if events is emitted while the slider is dragged bool m_bEventWhileDrag; }; - -#endif /* SLIDEREVENTHANDLER_H */ diff --git a/src/widget/trackdroptarget.h b/src/widget/trackdroptarget.h index 01c0b99be51..6933a4d70f1 100644 --- a/src/widget/trackdroptarget.h +++ b/src/widget/trackdroptarget.h @@ -1,6 +1,4 @@ - -#ifndef TRACKDROPTARGET_H -#define TRACKDROPTARGET_H +#pragma once #include @@ -26,5 +24,3 @@ class TrackDropTarget { virtual void trackDropped(const QString& filename, const QString& group) = 0; virtual void cloneDeck(const QString& sourceGroup, const QString& targetGroup) = 0; }; - -#endif // TRACKDROPTARGET diff --git a/src/widget/wanalysislibrarytableview.h b/src/widget/wanalysislibrarytableview.h index f929520d7bc..b732a0f54b2 100644 --- a/src/widget/wanalysislibrarytableview.h +++ b/src/widget/wanalysislibrarytableview.h @@ -1,5 +1,4 @@ -#ifndef WANALYSISLIBRARYTABLEVIEW_H -#define WANALYSISLIBRARYTABLEVIEW_H +#pragma once #include @@ -16,5 +15,3 @@ class WAnalysisLibraryTableView : public WTrackTableView { void onSearch(const QString& text) override; }; - -#endif diff --git a/src/widget/wbasewidget.h b/src/widget/wbasewidget.h index 8b67602903b..78923dea6c0 100644 --- a/src/widget/wbasewidget.h +++ b/src/widget/wbasewidget.h @@ -1,5 +1,4 @@ -#ifndef WBASEWIDGET_H -#define WBASEWIDGET_H +#pragma once #include #include @@ -100,5 +99,3 @@ class WBaseWidget { friend class ControlParameterWidgetConnection; }; - -#endif /* WBASEWIDGET_H */ diff --git a/src/widget/wbattery.cpp b/src/widget/wbattery.cpp index e5b2506dcf4..d6d4fabdc40 100644 --- a/src/widget/wbattery.cpp +++ b/src/widget/wbattery.cpp @@ -1,7 +1,9 @@ +#include "widget/wbattery.h" + #include #include -#include "widget/wbattery.h" +#include "moc_wbattery.cpp" #include "util/battery/battery.h" #include "util/math.h" diff --git a/src/widget/wbattery.h b/src/widget/wbattery.h index 31253a354d6..e645a8184a7 100644 --- a/src/widget/wbattery.h +++ b/src/widget/wbattery.h @@ -1,5 +1,4 @@ -#ifndef WBATTERY_H -#define WBATTERY_H +#pragma once #include #include @@ -41,5 +40,3 @@ class WBattery : public WWidget { QVector m_dischargingPixmaps; QVector m_chargingPixmaps; }; - -#endif /* WBATTERY_H */ diff --git a/src/widget/wbeatspinbox.cpp b/src/widget/wbeatspinbox.cpp index e775182592d..7876b2fd1de 100644 --- a/src/widget/wbeatspinbox.cpp +++ b/src/widget/wbeatspinbox.cpp @@ -1,9 +1,10 @@ -#include - #include "widget/wbeatspinbox.h" +#include + #include "control/controlobject.h" #include "control/controlproxy.h" +#include "moc_wbeatspinbox.cpp" #include "util/math.h" QRegExp WBeatSpinBox::s_regexpBlacklist("[^0-9.,/ ]"); diff --git a/src/widget/wbeatspinbox.h b/src/widget/wbeatspinbox.h index 7f253033d72..6800d15da5f 100644 --- a/src/widget/wbeatspinbox.h +++ b/src/widget/wbeatspinbox.h @@ -1,5 +1,4 @@ -#ifndef WBEATSPINBOX_H -#define WBEATSPINBOX_H +#pragma once #include "control/controlobject.h" #include "control/controlproxy.h" @@ -55,7 +54,3 @@ class WBeatLineEdit : public QLineEdit { bool event(QEvent* pEvent) override; double m_scaleFactor; }; - - - -#endif diff --git a/src/widget/wcolorpicker.cpp b/src/widget/wcolorpicker.cpp index f571bbf7768..567c6076a7c 100644 --- a/src/widget/wcolorpicker.cpp +++ b/src/widget/wcolorpicker.cpp @@ -5,6 +5,7 @@ #include #include +#include "moc_wcolorpicker.cpp" #include "util/color/color.h" #include "util/parented_ptr.h" diff --git a/src/widget/wcolorpickeraction.cpp b/src/widget/wcolorpickeraction.cpp index dbee9c3b871..642a2f20fb0 100644 --- a/src/widget/wcolorpickeraction.cpp +++ b/src/widget/wcolorpickeraction.cpp @@ -1,5 +1,7 @@ #include "widget/wcolorpickeraction.h" +#include "moc_wcolorpickeraction.cpp" + WColorPickerAction::WColorPickerAction(WColorPicker::Options options, const ColorPalette& palette, QWidget* parent) : QWidgetAction(parent), m_pColorPicker(make_parented(options, palette)) { diff --git a/src/widget/wcombobox.cpp b/src/widget/wcombobox.cpp index 9e682c2be78..7fc52220463 100644 --- a/src/widget/wcombobox.cpp +++ b/src/widget/wcombobox.cpp @@ -1,7 +1,9 @@ -#include +#include "widget/wcombobox.h" + #include +#include -#include "widget/wcombobox.h" +#include "moc_wcombobox.cpp" WComboBox::WComboBox(QWidget* pParent) : QComboBox(pParent), diff --git a/src/widget/wcombobox.h b/src/widget/wcombobox.h index 930aacb9429..b871419a5a5 100644 --- a/src/widget/wcombobox.h +++ b/src/widget/wcombobox.h @@ -1,5 +1,4 @@ -#ifndef WCOMBOBOX_H -#define WCOMBOBOX_H +#pragma once #include #include @@ -23,5 +22,3 @@ class WComboBox : public QComboBox, public WBaseWidget { private slots: void slotCurrentIndexChanged(int index); }; - -#endif /* WCOMBOBOX_H */ diff --git a/src/widget/wcoverart.cpp b/src/widget/wcoverart.cpp index a63ca0b6702..7ab0e6b6a1b 100644 --- a/src/widget/wcoverart.cpp +++ b/src/widget/wcoverart.cpp @@ -12,6 +12,7 @@ #include "library/coverartcache.h" #include "library/coverartutils.h" #include "library/dlgcoverartfullsize.h" +#include "moc_wcoverart.cpp" #include "track/track.h" #include "util/compatibility.h" #include "util/dnd.h" diff --git a/src/widget/wcoverart.h b/src/widget/wcoverart.h index 8d43c9659b7..7cc673afc34 100644 --- a/src/widget/wcoverart.h +++ b/src/widget/wcoverart.h @@ -1,5 +1,4 @@ -#ifndef WCOVERART_H -#define WCOVERART_H +#pragma once #include #include @@ -76,5 +75,3 @@ class WCoverArt : public QWidget, public WBaseWidget, public TrackDropTarget { DlgCoverArtFullSize* m_pDlgFullSize; QTimer m_clickTimer; }; - -#endif // WCOVERART_H diff --git a/src/widget/wcoverartlabel.cpp b/src/widget/wcoverartlabel.cpp index 2d76d4be501..88c10e9bc7f 100644 --- a/src/widget/wcoverartlabel.cpp +++ b/src/widget/wcoverartlabel.cpp @@ -4,6 +4,7 @@ #include "library/coverartutils.h" #include "library/dlgcoverartfullsize.h" +#include "moc_wcoverartlabel.cpp" #include "track/track.h" #include "util/compatibility.h" #include "widget/wcoverartmenu.h" diff --git a/src/widget/wcoverartmenu.cpp b/src/widget/wcoverartmenu.cpp index 538a3f023a2..9274561c12d 100644 --- a/src/widget/wcoverartmenu.cpp +++ b/src/widget/wcoverartmenu.cpp @@ -1,8 +1,10 @@ +#include "widget/wcoverartmenu.h" + #include #include -#include "widget/wcoverartmenu.h" #include "library/coverartutils.h" +#include "moc_wcoverartmenu.cpp" #include "util/sandbox.h" WCoverArtMenu::WCoverArtMenu(QWidget *parent) diff --git a/src/widget/wcoverartmenu.h b/src/widget/wcoverartmenu.h index e86c713d4d9..a22e3e03d8c 100644 --- a/src/widget/wcoverartmenu.h +++ b/src/widget/wcoverartmenu.h @@ -1,5 +1,4 @@ -#ifndef WCOVERARTMENU_H -#define WCOVERARTMENU_H +#pragma once #include #include @@ -38,5 +37,3 @@ class WCoverArtMenu : public QMenu { CoverInfo m_coverInfo; }; - -#endif // WCOVERARTMENU_H diff --git a/src/widget/wcuemenupopup.cpp b/src/widget/wcuemenupopup.cpp index ea92cb56c07..631808a67f8 100644 --- a/src/widget/wcuemenupopup.cpp +++ b/src/widget/wcuemenupopup.cpp @@ -5,6 +5,7 @@ #include #include "engine/engine.h" +#include "moc_wcuemenupopup.cpp" #include "track/track.h" #include "util/color/color.h" diff --git a/src/widget/wdisplay.cpp b/src/widget/wdisplay.cpp index f2110bfcdd8..d3a78e12064 100644 --- a/src/widget/wdisplay.cpp +++ b/src/widget/wdisplay.cpp @@ -1,28 +1,12 @@ -/*************************************************************************** - wdisplay.cpp - description - ------------------- - begin : Fri Jun 21 2002 - copyright : (C) 2002 by Tue & Ken Haste Andersen - email : haste@diku.dk -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "widget/wdisplay.h" -#include -#include #include -#include #include +#include +#include +#include +#include "moc_wdisplay.cpp" #include "widget/wpixmapstore.h" WDisplay::WDisplay(QWidget * parent) diff --git a/src/widget/wdisplay.h b/src/widget/wdisplay.h index b5b8acad333..0aca733810c 100644 --- a/src/widget/wdisplay.h +++ b/src/widget/wdisplay.h @@ -1,22 +1,4 @@ -/*************************************************************************** - wdisplay.h - description - ------------------- - begin : Fri Jun 21 2002 - copyright : (C) 2002 by Tue & Ken Haste Andersen - email : haste@diku.dk - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef WDISPLAY_H -#define WDISPLAY_H +#pragma once #include #include @@ -78,5 +60,3 @@ class WDisplay : public WWidget { // List of disabled pixmaps. QVector m_disabledPixmaps; }; - -#endif diff --git a/src/widget/weffect.cpp b/src/widget/weffect.cpp index e62fd529d92..f9141d3a52a 100644 --- a/src/widget/weffect.cpp +++ b/src/widget/weffect.cpp @@ -1,8 +1,9 @@ -#include - #include "widget/weffect.h" +#include + #include "effects/effectsmanager.h" +#include "moc_weffect.cpp" #include "widget/effectwidgetutils.h" WEffect::WEffect(QWidget* pParent, EffectsManager* pEffectsManager) diff --git a/src/widget/weffect.h b/src/widget/weffect.h index 6a0e736cec1..8334a1cd5fc 100644 --- a/src/widget/weffect.h +++ b/src/widget/weffect.h @@ -1,5 +1,4 @@ -#ifndef WEFFECT_H -#define WEFFECT_H +#pragma once #include @@ -26,6 +25,3 @@ class WEffect : public WLabel { EffectsManager* m_pEffectsManager; EffectSlotPointer m_pEffectSlot; }; - - -#endif /* WEFFECT_H */ diff --git a/src/widget/weffectbuttonparameter.cpp b/src/widget/weffectbuttonparameter.cpp index c7847447647..01ba1503cef 100644 --- a/src/widget/weffectbuttonparameter.cpp +++ b/src/widget/weffectbuttonparameter.cpp @@ -1,7 +1,9 @@ +#include "widget/weffectbuttonparameter.h" + #include -#include "widget/weffectbuttonparameter.h" #include "effects/effectsmanager.h" +#include "moc_weffectbuttonparameter.cpp" #include "widget/effectwidgetutils.h" WEffectButtonParameter::WEffectButtonParameter(QWidget* pParent, EffectsManager* pEffectsManager) diff --git a/src/widget/weffectbuttonparameter.h b/src/widget/weffectbuttonparameter.h index 2e6b845a9f1..5b204efc8a3 100644 --- a/src/widget/weffectbuttonparameter.h +++ b/src/widget/weffectbuttonparameter.h @@ -1,5 +1,4 @@ -#ifndef WEFFECTBUTTONPARAMETER_H -#define WEFFECTBUTTONPARAMETER_H +#pragma once #include @@ -16,6 +15,3 @@ class WEffectButtonParameter : public WEffectParameterBase { void setup(const QDomNode& node, const SkinContext& context) override; }; - - -#endif /* WEFFECTBUTTONPARAMETER_H */ diff --git a/src/widget/weffectchain.cpp b/src/widget/weffectchain.cpp index 9d2121ff24e..66211e1368f 100644 --- a/src/widget/weffectchain.cpp +++ b/src/widget/weffectchain.cpp @@ -1,7 +1,9 @@ +#include "widget/weffectchain.h" + #include -#include "widget/weffectchain.h" #include "effects/effectsmanager.h" +#include "moc_weffectchain.cpp" #include "widget/effectwidgetutils.h" WEffectChain::WEffectChain(QWidget* pParent, EffectsManager* pEffectsManager) diff --git a/src/widget/weffectchain.h b/src/widget/weffectchain.h index 45b81c8700a..2bfa9658c6b 100644 --- a/src/widget/weffectchain.h +++ b/src/widget/weffectchain.h @@ -1,5 +1,4 @@ -#ifndef WEFFECTCHAIN_H -#define WEFFECTCHAIN_H +#pragma once #include #include @@ -28,5 +27,3 @@ class WEffectChain : public WLabel { EffectsManager* m_pEffectsManager; EffectChainSlotPointer m_pEffectChainSlot; }; - -#endif /* WEFFECTCHAIN_H */ diff --git a/src/widget/weffectparameter.cpp b/src/widget/weffectparameter.cpp index 4d4a22faf3f..202a68f2f7a 100644 --- a/src/widget/weffectparameter.cpp +++ b/src/widget/weffectparameter.cpp @@ -1,7 +1,9 @@ +#include "widget/weffectparameter.h" + #include -#include "widget/weffectparameter.h" #include "effects/effectsmanager.h" +#include "moc_weffectparameter.cpp" #include "widget/effectwidgetutils.h" WEffectParameter::WEffectParameter(QWidget* pParent, EffectsManager* pEffectsManager) diff --git a/src/widget/weffectparameter.h b/src/widget/weffectparameter.h index d7a37ab5e2e..1dd8265d622 100644 --- a/src/widget/weffectparameter.h +++ b/src/widget/weffectparameter.h @@ -1,5 +1,4 @@ -#ifndef WEFFECTPARAMETER_H -#define WEFFECTPARAMETER_H +#pragma once #include @@ -16,6 +15,3 @@ class WEffectParameter : public WEffectParameterBase { void setup(const QDomNode& node, const SkinContext& context) override; }; - - -#endif /* WEFFECTPARAMETER_H */ diff --git a/src/widget/weffectparameterbase.cpp b/src/widget/weffectparameterbase.cpp index 8fa10e93adc..22191ee58b6 100644 --- a/src/widget/weffectparameterbase.cpp +++ b/src/widget/weffectparameterbase.cpp @@ -1,7 +1,9 @@ +#include "widget/weffectparameterbase.h" + #include -#include "widget/weffectparameterbase.h" #include "effects/effectsmanager.h" +#include "moc_weffectparameterbase.cpp" WEffectParameterBase::WEffectParameterBase(QWidget* pParent, EffectsManager* pEffectsManager) : WLabel(pParent), diff --git a/src/widget/weffectparameterbase.h b/src/widget/weffectparameterbase.h index 2b6c9497e22..18acf5e1c51 100644 --- a/src/widget/weffectparameterbase.h +++ b/src/widget/weffectparameterbase.h @@ -1,5 +1,4 @@ -#ifndef WEFFECTPARAMETERBASE_H -#define WEFFECTPARAMETERBASE_H +#pragma once #include @@ -27,5 +26,3 @@ class WEffectParameterBase : public WLabel { EffectsManager* m_pEffectsManager; EffectParameterSlotBasePointer m_pEffectParameterSlot; }; - -#endif /* WEFFECTPARAMETERBASE_H */ diff --git a/src/widget/weffectparameterknob.cpp b/src/widget/weffectparameterknob.cpp index 6b07483b611..4d68641b646 100644 --- a/src/widget/weffectparameterknob.cpp +++ b/src/widget/weffectparameterknob.cpp @@ -1,6 +1,8 @@ -#include "widget/effectwidgetutils.h" #include "widget/weffectparameterknob.h" +#include "moc_weffectparameterknob.cpp" +#include "widget/effectwidgetutils.h" + void WEffectParameterKnob::setupEffectParameterSlot(const ConfigKey& configKey) { EffectParameterSlotPointer pParameterSlot = m_pEffectsManager->getEffectParameterSlot(configKey); diff --git a/src/widget/weffectparameterknob.h b/src/widget/weffectparameterknob.h index 6fdeaf8afe3..3fa13863d90 100644 --- a/src/widget/weffectparameterknob.h +++ b/src/widget/weffectparameterknob.h @@ -1,5 +1,4 @@ -#ifndef WEFFECTKNOB_H -#define WEFFECTKNOB_H +#pragma once #include "widget/wknob.h" #include "effects/effectparameterslot.h" @@ -30,5 +29,3 @@ class WEffectParameterKnob : public WKnob { EffectsManager* m_pEffectsManager; EffectParameterSlotBasePointer m_pEffectParameterSlot; }; - -#endif // WEFFECTKNOB_H diff --git a/src/widget/weffectparameterknobcomposed.cpp b/src/widget/weffectparameterknobcomposed.cpp index df10fc7544e..6627cd57844 100644 --- a/src/widget/weffectparameterknobcomposed.cpp +++ b/src/widget/weffectparameterknobcomposed.cpp @@ -1,6 +1,9 @@ -#include "widget/effectwidgetutils.h" #include "widget/weffectparameterknobcomposed.h" +#include "moc_effectwidgetutils.cpp" +#include "moc_weffectparameterknobcomposed.cpp" +#include "widget/effectwidgetutils.h" + namespace { const QString effectGroupSeparator = "_"; const QString groupClose = "]"; diff --git a/src/widget/weffectparameterknobcomposed.h b/src/widget/weffectparameterknobcomposed.h index 4449ffccfec..5131f985b09 100644 --- a/src/widget/weffectparameterknobcomposed.h +++ b/src/widget/weffectparameterknobcomposed.h @@ -1,5 +1,4 @@ -#ifndef WEFFECTKNOBCOMPOSED_H -#define WEFFECTKNOBCOMPOSED_H +#pragma once #include "widget/wknobcomposed.h" #include "effects/effectparameterslot.h" @@ -31,5 +30,3 @@ class WEffectParameterKnobComposed : public WKnobComposed { EffectsManager* m_pEffectsManager; EffectParameterSlotBasePointer m_pEffectParameterSlot; }; - -#endif // WEFFECTKNOBCOMPOSED_H diff --git a/src/widget/weffectpushbutton.cpp b/src/widget/weffectpushbutton.cpp index 1e21fd34ce7..3dfc096e2c6 100644 --- a/src/widget/weffectpushbutton.cpp +++ b/src/widget/weffectpushbutton.cpp @@ -2,6 +2,7 @@ #include +#include "moc_weffectpushbutton.cpp" #include "widget/effectwidgetutils.h" WEffectPushButton::WEffectPushButton(QWidget* pParent, EffectsManager* pEffectsManager) diff --git a/src/widget/weffectpushbutton.h b/src/widget/weffectpushbutton.h index 595486f8f01..63f5366a740 100644 --- a/src/widget/weffectpushbutton.h +++ b/src/widget/weffectpushbutton.h @@ -1,5 +1,4 @@ -#ifndef WEFFECTPUSHBUTTON_H -#define WEFFECTPUSHBUTTON_H +#pragma once #include #include @@ -41,5 +40,3 @@ class WEffectPushButton : public WPushButton { EffectParameterSlotBasePointer m_pEffectParameterSlot; QMenu* m_pButtonMenu; }; - -#endif // WEFFECTPUSHBUTTON_H diff --git a/src/widget/weffectselector.cpp b/src/widget/weffectselector.cpp index 467f77531bb..02c9c3f2306 100644 --- a/src/widget/weffectselector.cpp +++ b/src/widget/weffectselector.cpp @@ -1,8 +1,9 @@ -#include - #include "widget/weffectselector.h" +#include + #include "effects/effectsmanager.h" +#include "moc_weffectselector.cpp" #include "widget/effectwidgetutils.h" WEffectSelector::WEffectSelector(QWidget* pParent, EffectsManager* pEffectsManager) diff --git a/src/widget/weffectselector.h b/src/widget/weffectselector.h index a9816f62f2f..dd358af0672 100644 --- a/src/widget/weffectselector.h +++ b/src/widget/weffectselector.h @@ -1,5 +1,4 @@ -#ifndef WEFFECTSELECTOR_H -#define WEFFECTSELECTOR_H +#pragma once #include #include @@ -31,6 +30,3 @@ class WEffectSelector : public QComboBox, public WBaseWidget { EffectRackPointer m_pRack; double m_scaleFactor; }; - - -#endif /* WEFFECTSELECTOR_H */ diff --git a/src/widget/whotcuebutton.cpp b/src/widget/whotcuebutton.cpp index d483cd0a31f..7ea6e8abd2b 100644 --- a/src/widget/whotcuebutton.cpp +++ b/src/widget/whotcuebutton.cpp @@ -5,6 +5,7 @@ #include #include "mixer/playerinfo.h" +#include "moc_whotcuebutton.cpp" #include "track/track.h" namespace { diff --git a/src/widget/wimagestore.h b/src/widget/wimagestore.h index 9d77ae40aaa..249356a3ad9 100644 --- a/src/widget/wimagestore.h +++ b/src/widget/wimagestore.h @@ -1,4 +1,3 @@ - #pragma once #include diff --git a/src/widget/wkey.cpp b/src/widget/wkey.cpp index 59a6fcbdaf8..9955f99e872 100644 --- a/src/widget/wkey.cpp +++ b/src/widget/wkey.cpp @@ -1,4 +1,6 @@ #include "widget/wkey.h" + +#include "moc_wkey.cpp" #include "track/keys.h" #include "track/keyutils.h" diff --git a/src/widget/wkey.h b/src/widget/wkey.h index 6ceba450676..706337ea06e 100644 --- a/src/widget/wkey.h +++ b/src/widget/wkey.h @@ -1,5 +1,4 @@ -#ifndef WKEY_H -#define WKEY_H +#pragma once #include @@ -26,5 +25,3 @@ class WKey : public WLabel { ControlProxy m_keyNotation; ControlProxy m_engineKeyDistance; }; - -#endif /* WKEY_H */ diff --git a/src/widget/wknob.cpp b/src/widget/wknob.cpp index 974c7224964..83fae02dcaf 100644 --- a/src/widget/wknob.cpp +++ b/src/widget/wknob.cpp @@ -1,26 +1,11 @@ -/*************************************************************************** - wknob.cpp - description - ------------------- - begin : Fri Jun 21 2002 - copyright : (C) 2002 by Tue & Ken Haste Andersen - email : haste@diku.dk -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ +#include "widget/wknob.h" -#include #include #include +#include +#include "moc_wknob.cpp" #include "util/duration.h" -#include "widget/wknob.h" WKnob::WKnob(QWidget* pParent) : WDisplay(pParent), diff --git a/src/widget/wknob.h b/src/widget/wknob.h index 3e56b4f979c..62298cab54b 100644 --- a/src/widget/wknob.h +++ b/src/widget/wknob.h @@ -1,5 +1,4 @@ -#ifndef WKNOB_H -#define WKNOB_H +#pragma once #include #include @@ -33,5 +32,3 @@ class WKnob : public WDisplay { KnobEventHandler m_handler; friend class KnobEventHandler; }; - -#endif diff --git a/src/widget/wknobcomposed.cpp b/src/widget/wknobcomposed.cpp index e2fbb98c1f3..e9cba3290c2 100644 --- a/src/widget/wknobcomposed.cpp +++ b/src/widget/wknobcomposed.cpp @@ -1,9 +1,11 @@ -#include +#include "widget/wknobcomposed.h" + #include +#include #include +#include "moc_wknobcomposed.cpp" #include "util/duration.h" -#include "widget/wknobcomposed.h" #include "widget/wskincolor.h" WKnobComposed::WKnobComposed(QWidget* pParent) diff --git a/src/widget/wknobcomposed.h b/src/widget/wknobcomposed.h index 489c5db9a17..789e2d1dbf0 100644 --- a/src/widget/wknobcomposed.h +++ b/src/widget/wknobcomposed.h @@ -1,5 +1,4 @@ -#ifndef WKNOBCOMPOSED_H -#define WKNOBCOMPOSED_H +#pragma once #include #include @@ -67,5 +66,3 @@ class WKnobComposed : public WWidget { friend class KnobEventHandler; }; - -#endif /* WKNOBCOMPOSED_H */ diff --git a/src/widget/wlabel.cpp b/src/widget/wlabel.cpp index 5a07154bc5b..a732eab87b0 100644 --- a/src/widget/wlabel.cpp +++ b/src/widget/wlabel.cpp @@ -1,24 +1,8 @@ -/*************************************************************************** - wlabel.cpp - description - ------------------- - begin : Wed Jan 5 2005 - copyright : (C) 2003 by Tue Haste Andersen - email : haste@diku.dk -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "widget/wlabel.h" #include +#include "moc_wlabel.cpp" #include "widget/wskincolor.h" WLabel::WLabel(QWidget* pParent) diff --git a/src/widget/wlabel.h b/src/widget/wlabel.h index d63ff5b1236..d29bfe8b811 100644 --- a/src/widget/wlabel.h +++ b/src/widget/wlabel.h @@ -1,22 +1,4 @@ -/*************************************************************************** - wlabel.h - description - ------------------- - begin : Wed Jan 5 2005 - copyright : (C) 2003 by Tue Haste Andersen - email : haste@diku.dk - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef WLABEL_H -#define WLABEL_H +#pragma once #include #include @@ -60,5 +42,3 @@ class WLabel : public QLabel, public WBaseWidget { double m_scaleFactor; int m_highlight; }; - -#endif diff --git a/src/widget/wlibrary.cpp b/src/widget/wlibrary.cpp index b293fe61510..1d0b3d9b32e 100644 --- a/src/widget/wlibrary.cpp +++ b/src/widget/wlibrary.cpp @@ -1,14 +1,13 @@ -// wlibrary.cpp -// Created 8/28/2009 by RJ Ryan (rryan@mit.edu) +#include "widget/wlibrary.h" -#include #include +#include -#include "widget/wlibrary.h" -#include "library/libraryview.h" #include "controllers/keyboard/keyboardeventfilter.h" -#include "widget/wtracktableview.h" +#include "library/libraryview.h" +#include "moc_wlibrary.cpp" #include "util/math.h" +#include "widget/wtracktableview.h" WLibrary::WLibrary(QWidget* parent) : QStackedWidget(parent), diff --git a/src/widget/wlibrarysidebar.cpp b/src/widget/wlibrarysidebar.cpp index 93fe776e23f..f6be444e29d 100644 --- a/src/widget/wlibrarysidebar.cpp +++ b/src/widget/wlibrarysidebar.cpp @@ -2,11 +2,12 @@ #include #include +#include #include #include -#include #include "library/sidebarmodel.h" +#include "moc_wlibrarysidebar.cpp" #include "util/dnd.h" const int expand_time = 250; @@ -213,14 +214,42 @@ void WLibrarySidebar::keyPressEvent(QKeyEvent* event) { void WLibrarySidebar::selectIndex(const QModelIndex& index) { auto pModel = new QItemSelectionModel(model()); pModel->select(index, QItemSelectionModel::Select); + if (selectionModel()) { + selectionModel()->deleteLater(); + } setSelectionModel(pModel); - if (index.parent().isValid()) { expand(index.parent()); } scrollTo(index); } +/// Selects a child index from a feature and ensures visibility +void WLibrarySidebar::selectChildIndex(const QModelIndex& index, bool selectItem) { + SidebarModel* sidebarModel = qobject_cast(model()); + VERIFY_OR_DEBUG_ASSERT(sidebarModel) { + qDebug() << "model() is not SidebarModel"; + return; + } + QModelIndex translated = sidebarModel->translateChildIndex(index); + + if (selectItem) { + auto pModel = new QItemSelectionModel(sidebarModel); + pModel->select(translated, QItemSelectionModel::Select); + if (selectionModel()) { + selectionModel()->deleteLater(); + } + setSelectionModel(pModel); + } + + QModelIndex parentIndex = translated.parent(); + while (parentIndex.isValid()) { + expand(parentIndex); + parentIndex = parentIndex.parent(); + } + scrollTo(translated, EnsureVisible); +} + bool WLibrarySidebar::event(QEvent* pEvent) { if (pEvent->type() == QEvent::ToolTip) { updateTooltip(); diff --git a/src/widget/wlibrarysidebar.h b/src/widget/wlibrarysidebar.h index 8539e8a541e..3e97e003e12 100644 --- a/src/widget/wlibrarysidebar.h +++ b/src/widget/wlibrarysidebar.h @@ -1,5 +1,4 @@ -#ifndef WLIBRARYSIDEBAR_H -#define WLIBRARYSIDEBAR_H +#pragma once #include #include @@ -30,6 +29,7 @@ class WLibrarySidebar : public QTreeView, public WBaseWidget { public slots: void selectIndex(const QModelIndex&); + void selectChildIndex(const QModelIndex&, bool selectItem = true); void slotSetFont(const QFont& font); signals: @@ -42,5 +42,3 @@ class WLibrarySidebar : public QTreeView, public WBaseWidget { QBasicTimer m_expandTimer; QModelIndex m_hoverIndex; }; - -#endif /* WLIBRARYSIDEBAR_H */ diff --git a/src/widget/wlibrarytableview.cpp b/src/widget/wlibrarytableview.cpp index ff650d0afe0..6c63faf9930 100644 --- a/src/widget/wlibrarytableview.cpp +++ b/src/widget/wlibrarytableview.cpp @@ -7,6 +7,7 @@ #include #include "library/trackmodel.h" +#include "moc_wlibrarytableview.cpp" #include "util/math.h" #include "widget/wskincolor.h" #include "widget/wwidget.h" diff --git a/src/widget/wlibrarytableview.h b/src/widget/wlibrarytableview.h index 2b65c949c03..89d4f1bc4ac 100644 --- a/src/widget/wlibrarytableview.h +++ b/src/widget/wlibrarytableview.h @@ -1,8 +1,4 @@ -// wlibrarytableview.h -// Created 10/19/2009 by RJ Ryan (rryan@mit.edu) - -#ifndef WLIBRARYTABLEVIEW_H -#define WLIBRARYTABLEVIEW_H +#pragma once #include #include @@ -26,14 +22,13 @@ class WLibraryTableView : public QTableView, public virtual LibraryView { void moveSelection(int delta) override; /** - * @brief saveVScrollBarPos function saves current position of scrollbar - * using string key - can be any value but should invariant for model + * Saves current position of scrollbar using string key + * can be any value but should invariant for model * @param key unique for trackmodel */ void saveVScrollBarPos(TrackModel* key); /** - * @brief restoreVScrollBarPos function finds scrollbar value associated with model - * by given key and restores it + * Finds scrollbar value associated with model by given key and restores it * @param key unique for trackmodel */ void restoreVScrollBarPos(TrackModel* key); @@ -69,6 +64,3 @@ class WLibraryTableView : public QTableView, public virtual LibraryView { // executed int m_noSearchVScrollBarPos; }; - - -#endif /* WLIBRARYTABLEVIEW_H */ diff --git a/src/widget/wlibrarytextbrowser.cpp b/src/widget/wlibrarytextbrowser.cpp index 52b29510389..64b7139ef8a 100644 --- a/src/widget/wlibrarytextbrowser.cpp +++ b/src/widget/wlibrarytextbrowser.cpp @@ -1,8 +1,7 @@ -// wlibrarytextbrowser.cpp -// Created 10/23/2009 by RJ Ryan (rryan@mit.edu) - #include "widget/wlibrarytextbrowser.h" +#include "moc_wlibrarytextbrowser.cpp" + WLibraryTextBrowser::WLibraryTextBrowser(QWidget* parent) : QTextBrowser(parent) { } diff --git a/src/widget/wlibrarytextbrowser.h b/src/widget/wlibrarytextbrowser.h index e61c38efa09..b1e952301f8 100644 --- a/src/widget/wlibrarytextbrowser.h +++ b/src/widget/wlibrarytextbrowser.h @@ -1,8 +1,4 @@ -// wlibrarytextbrowser.h -// Created 10/23/2009 by RJ Ryan (rryan@mit.edu) - -#ifndef WLIBRARYTEXTBROWSER_H -#define WLIBRARYTEXTBROWSER_H +#pragma once #include @@ -15,5 +11,3 @@ class WLibraryTextBrowser : public QTextBrowser, public LibraryView { void onShow() override {} bool hasFocus() const override; }; - -#endif /* WLIBRARYTEXTBROWSER_H */ diff --git a/src/widget/wmainmenubar.cpp b/src/widget/wmainmenubar.cpp index 4b70daa011e..7e409d0a550 100644 --- a/src/widget/wmainmenubar.cpp +++ b/src/widget/wmainmenubar.cpp @@ -6,6 +6,7 @@ #include "control/controlproxy.h" #include "defs_urls.h" #include "mixer/playermanager.h" +#include "moc_wmainmenubar.cpp" #include "util/cmdlineargs.h" #include "util/experiment.h" #include "vinylcontrol/defs_vinylcontrol.h" diff --git a/src/widget/wmainmenubar.h b/src/widget/wmainmenubar.h index a40be8d49b5..afcc3785f65 100644 --- a/src/widget/wmainmenubar.h +++ b/src/widget/wmainmenubar.h @@ -1,5 +1,4 @@ -#ifndef WIDGET_WMAINMENUBAR -#define WIDGET_WMAINMENUBAR +#pragma once #include #include @@ -90,5 +89,3 @@ class WMainMenuBar : public QMenuBar { QList m_loadToDeckActions; QList m_vinylControlEnabledActions; }; - -#endif /* WIDGET_WMAINMENUBAR */ diff --git a/src/widget/wnumber.cpp b/src/widget/wnumber.cpp index 43d902e1d9d..b0f8a9134aa 100644 --- a/src/widget/wnumber.cpp +++ b/src/widget/wnumber.cpp @@ -1,22 +1,7 @@ -/*************************************************************************** - wnumber.cpp - description - ------------------- - begin : Wed Jun 18 2003 - copyright : (C) 2003 by Tue & Ken Haste Andersen - email : haste@diku.dk -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "widget/wnumber.h" +#include "moc_wnumber.cpp" + WNumber::WNumber(QWidget* pParent) : WLabel(pParent), m_iNoDigits(2) { diff --git a/src/widget/wnumber.h b/src/widget/wnumber.h index 7974ffcfd9d..780b8f2ba76 100644 --- a/src/widget/wnumber.h +++ b/src/widget/wnumber.h @@ -1,22 +1,4 @@ -/*************************************************************************** - wnumber.h - description - ------------------- - begin : Wed Jun 18 2003 - copyright : (C) 2003 by Tue & Ken Haste Andersen - email : haste@diku.dk - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef WNUMBER_H -#define WNUMBER_H +#pragma once #include @@ -39,5 +21,3 @@ class WNumber : public WLabel { // Number of digits to round to. int m_iNoDigits; }; - -#endif diff --git a/src/widget/wnumberdb.cpp b/src/widget/wnumberdb.cpp index a517a808a16..8a1371cb677 100644 --- a/src/widget/wnumberdb.cpp +++ b/src/widget/wnumberdb.cpp @@ -1,9 +1,9 @@ - #include "widget/wnumberdb.h" -#include "util/math.h" #include +#include "moc_wnumberdb.cpp" +#include "util/math.h" #include "widget/wskincolor.h" WNumberDb::WNumberDb(QWidget* pParent) diff --git a/src/widget/wnumberdb.h b/src/widget/wnumberdb.h index 9cd5e98d531..e8f7a1b6610 100644 --- a/src/widget/wnumberdb.h +++ b/src/widget/wnumberdb.h @@ -1,6 +1,4 @@ - -#ifndef WNUMBERDB_H -#define WNUMBERDB_H +#pragma once #include @@ -15,5 +13,3 @@ class WNumberDb : public WNumber { public slots: void setValue(double dValue) override; }; - -#endif // WNUMBERDB_H diff --git a/src/widget/wnumberpos.cpp b/src/widget/wnumberpos.cpp index 96df878886b..9a6e65dfef9 100644 --- a/src/widget/wnumberpos.cpp +++ b/src/widget/wnumberpos.cpp @@ -1,10 +1,10 @@ -// Tue Haste Andersen , (C) 2003 - #include "widget/wnumberpos.h" + #include "control/controlobject.h" #include "control/controlproxy.h" -#include "util/math.h" +#include "moc_wnumberpos.cpp" #include "util/duration.h" +#include "util/math.h" WNumberPos::WNumberPos(const QString& group, QWidget* parent) : WNumber(parent), diff --git a/src/widget/wnumberpos.h b/src/widget/wnumberpos.h index 74f43c43c12..0d22cbc7de7 100644 --- a/src/widget/wnumberpos.h +++ b/src/widget/wnumberpos.h @@ -1,7 +1,4 @@ -// Tue Haste Andersen , (C) 2003 - -#ifndef WNUMBERPOS_H -#define WNUMBERPOS_H +#pragma once #include @@ -37,5 +34,3 @@ class WNumberPos : public WNumber { ControlProxy* m_pShowTrackTimeRemaining; ControlProxy* m_pTimeFormat; }; - -#endif diff --git a/src/widget/wnumberrate.cpp b/src/widget/wnumberrate.cpp index 048e840c911..075ad3ba96c 100644 --- a/src/widget/wnumberrate.cpp +++ b/src/widget/wnumberrate.cpp @@ -14,8 +14,23 @@ #include "control/controlobject.h" #include "control/controlproxy.h" +#include "moc_wnumberrate.cpp" #include "util/math.h" +namespace { + +inline QChar sign(double number) { + if (number > 0) { + return '+'; + } + if (number < 0) { + return '-'; + } + return ' '; +} + +} // namespace + WNumberRate::WNumberRate(const QString& group, QWidget* parent) : WNumber(parent) { m_pRateRatio = new ControlProxy(group, "rate_ratio", this, ControlFlag::NoAssertIfMissing); @@ -30,13 +45,8 @@ void WNumberRate::setup(const QDomNode& node, const SkinContext& context) { } void WNumberRate::setValue(double dValue) { - double vsign = dValue - 1; - - char sign = '+'; - if (vsign < -0.00000001) { - sign = '-'; - } - - setText(QString(m_skinText).append(sign) - .append("%1").arg(fabs(vsign) * 100.0, 0, 'f', m_iNoDigits)); + const double digitFactor = pow(10, m_iNoDigits); + // Calculate percentage rounded to the number of digits specified by iNoDigits + const double percentage = round((dValue - 1) * 100.0 * digitFactor) / digitFactor; + setText(m_skinText + sign(percentage) + QString::number(fabs(percentage), 'f', m_iNoDigits)); } diff --git a/src/widget/wnumberrate.h b/src/widget/wnumberrate.h index 5c8aca255e5..1c447f551d7 100644 --- a/src/widget/wnumberrate.h +++ b/src/widget/wnumberrate.h @@ -9,8 +9,7 @@ // Copyright: See COPYING file that comes with this distribution // // -#ifndef WNUMBERRATE_H -#define WNUMBERRATE_H +#pragma once #include "widget/wnumber.h" @@ -29,5 +28,3 @@ class WNumberRate final : public WNumber { private: ControlProxy* m_pRateRatio; }; - -#endif diff --git a/src/widget/woverview.cpp b/src/widget/woverview.cpp index ca9904df095..29cbcab31b3 100644 --- a/src/widget/woverview.cpp +++ b/src/widget/woverview.cpp @@ -25,6 +25,7 @@ #include "control/controlproxy.h" #include "engine/engine.h" #include "mixer/playermanager.h" +#include "moc_woverview.cpp" #include "preferences/colorpalettesettings.h" #include "track/track.h" #include "util/color/color.h" diff --git a/src/widget/woverview.h b/src/widget/woverview.h index 915f7229179..ace7d0a3b74 100644 --- a/src/widget/woverview.h +++ b/src/widget/woverview.h @@ -9,8 +9,7 @@ // Copyright: See COPYING file that comes with this distribution // // -#ifndef WOVERVIEW_H -#define WOVERVIEW_H +#pragma once #include #include @@ -198,5 +197,3 @@ class WOverview : public WWidget, public TrackDropTarget { bool m_trackLoaded; double m_scaleFactor; }; - -#endif diff --git a/src/widget/woverviewhsv.h b/src/widget/woverviewhsv.h index ab8c26d4ce7..9876040adf2 100644 --- a/src/widget/woverviewhsv.h +++ b/src/widget/woverviewhsv.h @@ -1,5 +1,4 @@ -#ifndef WOVERVIEWHSV_H -#define WOVERVIEWHSV_H +#pragma once #include "widget/woverview.h" @@ -14,5 +13,3 @@ class WOverviewHSV : public WOverview { private: bool drawNextPixmapPart() override; }; - -#endif // WOVERVIEWHSV_H diff --git a/src/widget/woverviewlmh.h b/src/widget/woverviewlmh.h index 4fbb2c0c8e9..3b1913c85bc 100644 --- a/src/widget/woverviewlmh.h +++ b/src/widget/woverviewlmh.h @@ -1,5 +1,4 @@ -#ifndef WOVERVIEWLMH_H -#define WOVERVIEWLMH_H +#pragma once #include "widget/woverview.h" @@ -14,5 +13,3 @@ class WOverviewLMH : public WOverview { private: bool drawNextPixmapPart() override; }; - -#endif // WOVERVIEWLMH_H diff --git a/src/widget/woverviewrgb.h b/src/widget/woverviewrgb.h index 8d862a89d5b..d249243998d 100644 --- a/src/widget/woverviewrgb.h +++ b/src/widget/woverviewrgb.h @@ -1,5 +1,4 @@ -#ifndef WOVERVIEWRGB_H -#define WOVERVIEWRGB_H +#pragma once #include "widget/woverview.h" @@ -14,5 +13,3 @@ class WOverviewRGB : public WOverview { private: bool drawNextPixmapPart() override; }; - -#endif // WOVERVIEWRGB_H diff --git a/src/widget/wpixmapstore.h b/src/widget/wpixmapstore.h index 01100a0c57e..bab91657c57 100644 --- a/src/widget/wpixmapstore.h +++ b/src/widget/wpixmapstore.h @@ -1,22 +1,4 @@ -/*************************************************************************** - wpixmapstore.h - description - ------------------- - begin : Mon Jun 28 2003 - copyright : (C) 2003 by Tue & Ken Haste Andersen - email : haste@diku.dk - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef WPIXMAPSTORE_H -#define WPIXMAPSTORE_H +#pragma once #include #include @@ -51,5 +33,3 @@ class WPixmapStore { static QHash m_paintableCache; static QSharedPointer m_loader; }; - -#endif diff --git a/src/widget/wpushbutton.cpp b/src/widget/wpushbutton.cpp index 339c61f7d2f..8c64f545298 100644 --- a/src/widget/wpushbutton.cpp +++ b/src/widget/wpushbutton.cpp @@ -1,34 +1,18 @@ -/*************************************************************************** - wpushbutton.cpp - description - ------------------- - begin : Fri Jun 21 2002 - copyright : (C) 2002 by Tue & Ken Haste Andersen - email : haste@diku.dk -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "widget/wpushbutton.h" -#include -#include -#include -#include +#include #include -#include #include -#include +#include +#include +#include +#include +#include #include "control/controlbehavior.h" #include "control/controlobject.h" #include "control/controlpushbutton.h" +#include "moc_wpushbutton.cpp" #include "util/debug.h" #include "util/math.h" #include "widget/wpixmapstore.h" diff --git a/src/widget/wpushbutton.h b/src/widget/wpushbutton.h index 6393ea57101..efc8d7d7cee 100644 --- a/src/widget/wpushbutton.h +++ b/src/widget/wpushbutton.h @@ -1,22 +1,4 @@ -/*************************************************************************** - wpushbutton.h - description - ------------------- - begin : Fri Jun 21 2002 - copyright : (C) 2002 by Tue & Ken Haste Andersen - email : haste@diku.dk - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef WPUSHBUTTON_H -#define WPUSHBUTTON_H +#pragma once #include #include @@ -129,5 +111,3 @@ class WPushButton : public WWidget { QTimer m_clickTimer; QVector m_align; }; - -#endif diff --git a/src/widget/wrecordingduration.cpp b/src/widget/wrecordingduration.cpp index ee9770bf64a..1fc66601b58 100644 --- a/src/widget/wrecordingduration.cpp +++ b/src/widget/wrecordingduration.cpp @@ -1,5 +1,7 @@ #include "widget/wrecordingduration.h" +#include "moc_wrecordingduration.cpp" + WRecordingDuration::WRecordingDuration(QWidget *parent, RecordingManager* pRecordingManager) : WLabel(parent), diff --git a/src/widget/wrecordingduration.h b/src/widget/wrecordingduration.h index e6adbd5411e..a67821bf84c 100644 --- a/src/widget/wrecordingduration.h +++ b/src/widget/wrecordingduration.h @@ -1,9 +1,7 @@ -// wrecordingduration.h // WRecordingDuration is a widget showing the duration of running recoding -// In skin it is represented by a node. +// In skins it is represented by a node. -#ifndef WRECORDINGDURATION_H -#define WRECORDINGDURATION_H +#pragma once #include "widget/wlabel.h" #include "skin/skincontext.h" @@ -25,5 +23,3 @@ class WRecordingDuration: public WLabel { RecordingManager* m_pRecordingManager; QString m_inactiveText; }; - -#endif /* WRECORDINGDURATION_H */ diff --git a/src/widget/wsearchlineedit.cpp b/src/widget/wsearchlineedit.cpp index d4fa3d97897..184939ec7fa 100644 --- a/src/widget/wsearchlineedit.cpp +++ b/src/widget/wsearchlineedit.cpp @@ -7,6 +7,7 @@ #include #include +#include "moc_wsearchlineedit.cpp" #include "skin/skincontext.h" #include "util/assert.h" #include "util/logger.h" diff --git a/src/widget/wsearchrelatedtracksmenu.cpp b/src/widget/wsearchrelatedtracksmenu.cpp index 0a3a933893b..f3be9502859 100644 --- a/src/widget/wsearchrelatedtracksmenu.cpp +++ b/src/widget/wsearchrelatedtracksmenu.cpp @@ -2,6 +2,7 @@ #include +#include "moc_wsearchrelatedtracksmenu.cpp" #include "track/track.h" #include "util/math.h" #include "util/qt.h" diff --git a/src/widget/wsingletoncontainer.cpp b/src/widget/wsingletoncontainer.cpp index 6deebe709d2..7e390c852f7 100644 --- a/src/widget/wsingletoncontainer.cpp +++ b/src/widget/wsingletoncontainer.cpp @@ -2,11 +2,11 @@ #include -#include "util/assert.h" +#include "moc_wsingletoncontainer.cpp" #include "skin/skincontext.h" +#include "util/assert.h" #include "widget/wlibrary.h" - WSingletonContainer::WSingletonContainer(QWidget* pParent) : WWidgetGroup(pParent), m_pWidget(nullptr), m_pLayout(nullptr) { } diff --git a/src/widget/wsingletoncontainer.h b/src/widget/wsingletoncontainer.h index 168e263ad4a..f5e6c4a3750 100644 --- a/src/widget/wsingletoncontainer.h +++ b/src/widget/wsingletoncontainer.h @@ -44,8 +44,7 @@ // in the skin. Note that if a Singleton is visible twice at the same time, // behavior is undefined and could be crashy. -#ifndef WSINGLETONCONTAINER_H -#define WSINGLETONCONTAINER_H +#pragma once #include @@ -83,6 +82,3 @@ class SingletonMap { private: QMap m_singletons; }; - - -#endif // WSINGLETONCONTAINER_H diff --git a/src/widget/wsizeawarestack.cpp b/src/widget/wsizeawarestack.cpp index 566a71c49f8..3032110624e 100644 --- a/src/widget/wsizeawarestack.cpp +++ b/src/widget/wsizeawarestack.cpp @@ -1,8 +1,10 @@ -#include -#include +#include "widget/wsizeawarestack.h" + #include +#include +#include -#include "widget/wsizeawarestack.h" +#include "moc_wsizeawarestack.cpp" class SizeAwareLayout : public QStackedLayout { diff --git a/src/widget/wsizeawarestack.h b/src/widget/wsizeawarestack.h index 56bbd594be5..97032b89407 100644 --- a/src/widget/wsizeawarestack.h +++ b/src/widget/wsizeawarestack.h @@ -1,5 +1,4 @@ -#ifndef WSIZEAWARESTACK_H -#define WSIZEAWARESTACK_H +#pragma once #include #include @@ -22,5 +21,3 @@ class WSizeAwareStack : public QWidget, public WBaseWidget { private: SizeAwareLayout* m_layout; }; - -#endif /* WSIZEAWARESTACK_H */ diff --git a/src/widget/wskincolor.cpp b/src/widget/wskincolor.cpp index 38270ffc52e..d1c0357431b 100644 --- a/src/widget/wskincolor.cpp +++ b/src/widget/wskincolor.cpp @@ -12,4 +12,3 @@ void WSkinColor::setLoader(QSharedPointer ld) { QColor WSkinColor::getCorrectColor(QColor c) { return loader->getCorrectColor(c); } - diff --git a/src/widget/wskincolor.h b/src/widget/wskincolor.h index 30c21ba263a..687a6597cfd 100644 --- a/src/widget/wskincolor.h +++ b/src/widget/wskincolor.h @@ -1,22 +1,4 @@ -/*************************************************************************** - wskincolor.h - description - ------------------- - begin : 14 April 2007 - copyright : (C) 2007 by Adam Davison - email : adamdavison@gmail.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef WSKINCOLOR_H -#define WSKINCOLOR_H +#pragma once #include #include "skin/imgsource.h" @@ -28,6 +10,3 @@ class WSkinColor { private: static QSharedPointer loader; }; - -#endif - diff --git a/src/widget/wslidercomposed.cpp b/src/widget/wslidercomposed.cpp index 0c28df5b618..20b65726a20 100644 --- a/src/widget/wslidercomposed.cpp +++ b/src/widget/wslidercomposed.cpp @@ -1,36 +1,19 @@ -/*************************************************************************** - wslidercomposed.cpp - description - ------------------- - begin : Tue Jun 25 2002 - copyright : (C) 2002 by Tue & Ken Haste Andersen - email : haste@diku.dk -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "widget/wslidercomposed.h" -#include -#include #include +#include +#include -#include "widget/controlwidgetconnection.h" -#include "widget/wpixmapstore.h" -#include "widget/wskincolor.h" +#include "moc_wslidercomposed.cpp" #include "util/debug.h" #include "util/duration.h" #include "util/math.h" +#include "widget/controlwidgetconnection.h" +#include "widget/wpixmapstore.h" +#include "widget/wskincolor.h" WSliderComposed::WSliderComposed(QWidget * parent) : WWidget(parent), - m_bRightButtonPressed(false), m_dHandleLength(0.0), m_dSliderLength(0.0), m_bHorizontal(false), diff --git a/src/widget/wslidercomposed.h b/src/widget/wslidercomposed.h index df178232632..a79cda8127a 100644 --- a/src/widget/wslidercomposed.h +++ b/src/widget/wslidercomposed.h @@ -1,22 +1,4 @@ -/*************************************************************************** - wslidercomposed.h - description - ------------------- - begin : Tue Jun 25 2002 - copyright : (C) 2002 by Tue & Ken Haste Andersen - email : haste@diku.dk - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef WSLIDERCOMPOSED_H -#define WSLIDERCOMPOSED_H +#pragma once #include #include @@ -32,12 +14,7 @@ #include "widget/wwidget.h" #include "widget/wpixmapstore.h" -/** - * A widget for a slider composed of a background pixmap and a handle. - * - *@author Tue & Ken Haste Andersen - */ - +/** A widget for a slider composed of a background pixmap and a handle. */ class WSliderComposed : public WWidget { Q_OBJECT public: @@ -74,8 +51,6 @@ class WSliderComposed : public WWidget { double calculateHandleLength(); void unsetPixmaps(); - // True if right mouse button is pressed. - bool m_bRightButtonPressed; // Length of handle in pixels double m_dHandleLength; // Length of the slider in pixels. @@ -103,5 +78,3 @@ class WSliderComposed : public WWidget { friend class SliderEventHandler; }; - -#endif diff --git a/src/widget/wspinny.cpp b/src/widget/wspinny.cpp index 90c513dc85a..01a473d8762 100644 --- a/src/widget/wspinny.cpp +++ b/src/widget/wspinny.cpp @@ -11,6 +11,7 @@ #include "control/controlproxy.h" #include "library/coverartcache.h" #include "library/coverartutils.h" +#include "moc_wspinny.cpp" #include "track/track.h" #include "util/compatibility.h" #include "util/dnd.h" @@ -59,7 +60,6 @@ WSpinny::WSpinny( m_iStartMouseY(-1), m_iFullRotations(0), m_dPrevTheta(0.), - m_dTheta(0.), m_dRotationsPerSecond(MIXXX_VINYL_SPEED_33_NUM / 60), m_bClampFailedWarning(false), m_bGhostPlayback(false), diff --git a/src/widget/wspinny.h b/src/widget/wspinny.h index 42b195d6602..a8000d56078 100644 --- a/src/widget/wspinny.h +++ b/src/widget/wspinny.h @@ -1,6 +1,4 @@ - -#ifndef _WSPINNY_H -#define _WSPINNY_H +#pragma once #include #include @@ -127,7 +125,6 @@ class WSpinny : public QGLWidget, public WBaseWidget, public VinylSignalQualityL int m_iStartMouseY; int m_iFullRotations; double m_dPrevTheta; - double m_dTheta; // Speed of the vinyl rotation. double m_dRotationsPerSecond; bool m_bClampFailedWarning; @@ -137,5 +134,3 @@ class WSpinny : public QGLWidget, public WBaseWidget, public VinylSignalQualityL DlgCoverArtFullSize* m_pDlgCoverArt; WCoverArtMenu* m_pCoverMenu; }; - -#endif //_WSPINNY_H diff --git a/src/widget/wsplitter.cpp b/src/widget/wsplitter.cpp index 1afbf4e1196..61dcb8344a8 100644 --- a/src/widget/wsplitter.cpp +++ b/src/widget/wsplitter.cpp @@ -1,6 +1,8 @@ +#include "widget/wsplitter.h" + #include -#include "widget/wsplitter.h" +#include "moc_wsplitter.cpp" WSplitter::WSplitter(QWidget* pParent, UserSettingsPointer pConfig) : QSplitter(pParent), diff --git a/src/widget/wsplitter.h b/src/widget/wsplitter.h index 76b2422e409..bf5f7643550 100644 --- a/src/widget/wsplitter.h +++ b/src/widget/wsplitter.h @@ -1,5 +1,4 @@ -#ifndef WSPLITTER_H -#define WSPLITTER_H +#pragma once #include #include @@ -26,5 +25,3 @@ class WSplitter : public QSplitter, public WBaseWidget { UserSettingsPointer m_pConfig; ConfigKey m_configKey; }; - -#endif /* WSPLITTER_H */ diff --git a/src/widget/wstarrating.cpp b/src/widget/wstarrating.cpp index a9a010bf5b2..58850204f71 100644 --- a/src/widget/wstarrating.cpp +++ b/src/widget/wstarrating.cpp @@ -5,6 +5,7 @@ #include #include +#include "moc_wstarrating.cpp" #include "track/track.h" WStarRating::WStarRating(const QString& group, QWidget* pParent) diff --git a/src/widget/wstarrating.h b/src/widget/wstarrating.h index 426701042b9..805febc598e 100644 --- a/src/widget/wstarrating.h +++ b/src/widget/wstarrating.h @@ -1,5 +1,4 @@ -#ifndef WSTARRATING_H -#define WSTARRATING_H +#pragma once #include #include @@ -50,5 +49,3 @@ class WStarRating : public WWidget { std::unique_ptr m_pStarsUp; std::unique_ptr m_pStarsDown; }; - -#endif /* WSTARRATING_H */ diff --git a/src/widget/wstatuslight.cpp b/src/widget/wstatuslight.cpp index e3ab09736ab..7cf486322eb 100644 --- a/src/widget/wstatuslight.cpp +++ b/src/widget/wstatuslight.cpp @@ -1,28 +1,12 @@ -/*************************************************************************** - wstatuslight.cpp - description - ------------------- - begin : Wed May 30 2007 - copyright : (C) 2003 by Tue & Ken Haste Andersen - (C) 2007 by John Sully (converted from WVumeter) - email : jsully@scs.ryerson.ca -***************************************************************************/ - -/*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - #include "widget/wstatuslight.h" #include -#include +#include #include +#include #include -#include + +#include "moc_wstatuslight.cpp" WStatusLight::WStatusLight(QWidget * parent) : WWidget(parent), diff --git a/src/widget/wstatuslight.h b/src/widget/wstatuslight.h index 9ac71aa0060..41fabdf53e8 100644 --- a/src/widget/wstatuslight.h +++ b/src/widget/wstatuslight.h @@ -1,24 +1,4 @@ -/*************************************************************************** - wstatuslight.h - A general purpose status light - for indicating boolean events - ------------------- - begin : Fri Jul 22 2007 - copyright : (C) 2003 by Tue & Ken Haste Andersen - (C) 2007 by John Sully (derived from WVumeter) - email : jsully@scs.ryerson.ca - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef WSTATUSLIGHT_H -#define WSTATUSLIGHT_H +#pragma once #include #include @@ -31,6 +11,7 @@ #include "widget/wpixmapstore.h" #include "skin/skincontext.h" +/// A general purpose status light for indicating boolean events. class WStatusLight : public WWidget { Q_OBJECT public: @@ -59,5 +40,3 @@ class WStatusLight : public WWidget { // Associated pixmaps QVector m_pixmaps; }; - -#endif diff --git a/src/widget/wtime.cpp b/src/widget/wtime.cpp index 54f3f853b26..91e406185b9 100644 --- a/src/widget/wtime.cpp +++ b/src/widget/wtime.cpp @@ -1,8 +1,10 @@ -#include -#include +#include "widget/wtime.h" + #include +#include +#include -#include "widget/wtime.h" +#include "moc_wtime.cpp" #include "util/cmdlineargs.h" WTime::WTime(QWidget *parent) diff --git a/src/widget/wtime.h b/src/widget/wtime.h index 1db63c164d0..d82cc708e14 100644 --- a/src/widget/wtime.h +++ b/src/widget/wtime.h @@ -1,9 +1,7 @@ -// wtime.h // WTime is a widget showing the current time -// In skin.xml, it is represented by a