Skip to content

Commit

Permalink
Merge branch '2.3' of [email protected]:mixxxdj/mixxx.git
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/build.yml
#	.gitignore
#	CMakeLists.txt
  • Loading branch information
uklotzde committed Jun 17, 2021
2 parents 207043d + b49f33b commit ff2b9a0
Show file tree
Hide file tree
Showing 10 changed files with 328 additions and 174 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
-DMODPLUG=ON
-DWAVPACK=ON
-DINSTALL_USER_UDEV_RULES=OFF
cmake_generator: Unix Makefiles
ctest_args:
compiler_cache: ccache
compiler_cache_path: ~/.ccache
Expand All @@ -41,7 +40,6 @@ jobs:
-DMACOS_BUNDLE=ON
-DMODPLUG=OFF
-DWAVPACK=OFF
cmake_generator: Unix Makefiles
# TODO: Fix this broken test on macOS
ctest_args: --exclude-regex DirectoryDAOTest.relocateDirectory
cpack_generator: DragNDrop
Expand Down Expand Up @@ -70,7 +68,6 @@ jobs:
-DWAVPACK=ON
cc: cl
cxx: cl
cmake_generator: Ninja
# TODO: Fix these broken tests on Windows
ctest_args: --exclude-regex '^AutoDJProcessorTest.*$'
cpack_generator: WIX
Expand Down Expand Up @@ -244,12 +241,10 @@ jobs:

- name: "Configure"
run: >-
cmake
-G "${{ matrix.cmake_generator }}"
cmake ${{ matrix.cmake_args }} ${{ env.CMAKE_ARGS_EXTRA }}
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_PREFIX_PATH="${{ env.CMAKE_PREFIX_PATH }}"
-DDEBUG_ASSERTIONS_FATAL=ON
-DQt5_DIR=${{ env.QT_PATH }} ${{ matrix.cmake_args }} ${{ env.CMAKE_ARGS_EXTRA }}
-DDEBUG_ASSERTIONS_FATAL=OFF
-DBATTERY=ON
-DBROADCAST=ON
-DDOWNLOAD_MANUAL=ON
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ compile_commands.json
/buildenv

# CMake build configurations, generated by tools/windows_buildenv.bat
/CMakeSettings.json
/CMakeSettings*.json

# Build and distribution directories for various build configurations
/build
Expand Down
46 changes: 39 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,39 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()

# Check if any relevant env vars were set from the build env scripts
if(DEFINED ENV{X_VCPKG_APPLOCAL_DEPS_INSTALL} AND NOT DEFINED X_VCPKG_APPLOCAL_DEPS_INSTALL)
set(X_VCPKG_APPLOCAL_DEPS_INSTALL "$ENV{X_VCPKG_APPLOCAL_DEPS_INSTALL}" CACHE BOOL "")
endif()

if(DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET)
set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}" CACHE STRING "")
endif()

if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
endif()

# Set a default build type if none was specified
# See https://blog.kitware.com/cmake-and-the-default-build-type/ for details.
set(default_build_type "RelWithDebInfo")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git" AND NOT WIN32)
# Debug builds are broken on Windows due to CMake/vcpkg linking issues.
# As a workaround, we just default to RelWithDebInfo on Windows.
set(default_build_type "Debug")
endif()

if(NOT CMAKE_CONFIGURATION_TYPES)
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "Setting CMAKE_BUILD_TYPE to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo")
elseif(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo)$")
message(FATAL_ERROR "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} is not supported, use one of Debug, Release or RelWithDebInfo.")
endif()
endif()

project(mixxx VERSION 2.4.0)
# Work around missing version suffixes support https://gitlab.kitware.com/cmake/cmake/-/issues/16716
set(MIXXX_VERSION_PRERELEASE "alpha-pre") # set to "alpha-pre" "beta" or ""
Expand Down Expand Up @@ -101,6 +134,7 @@ endif()
#

set(OPTIMIZE "portable" CACHE STRING "Optimization and Tuning (set to off, portable, native, legacy)")
set_property(CACHE OPTIMIZE PROPERTY STRINGS "off" "portable" "native" "legacy")
string(TOLOWER "${OPTIMIZE}" OPTIMIZE)
message(STATUS "Optimization level: ${OPTIMIZE}")

Expand Down Expand Up @@ -181,10 +215,11 @@ if(MSVC)
string(REPLACE "/INCREMENTAL" "/INCREMENTAL:NO" CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}")
endif()
# Note: CMAKE_INTERPROCEDURAL_OPTIMIZATION sets the /GL and /LTCG flags for us
elseif(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
# Settings for MinSizeRel builds
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
# Settings for Release builds
# Reduce the size of the binary in Release builds
# Do not use /OPT:ICF because it has no effect.
# https://github.com/mixxxdj/mixxx/pull/3660#pullrequestreview-600137258
add_link_options(/OPT:REF)
endif()

if(OPTIMIZE STREQUAL "portable")
Expand Down Expand Up @@ -2617,12 +2652,9 @@ if(MODPLUG)
endif()

# QtKeychain
find_package(Qt5Keychain QUIET)
option(QTKEYCHAIN "Secure credentials storage support for Live Broadcasting profiles" ON)
if(QTKEYCHAIN)
if(NOT Qt5Keychain_FOUND)
message(FATAL_ERROR "Secure credential storage support requires the Qt5::Keychain component.")
endif()
find_package(Qt5Keychain REQUIRED)
target_compile_definitions(mixxx-lib PUBLIC __QTKEYCHAIN__)
target_link_libraries(mixxx-lib PRIVATE ${QTKEYCHAIN_LIBRARIES})
target_include_directories(mixxx-lib SYSTEM PUBLIC ${QTKEYCHAIN_INCLUDE_DIRS})
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ bug list][easybugs] and get started!

## Building Mixxx

First, open a terminal (on Windows, use "x64 Native Tools command prompt for
VS2019"), download the mixxx source code and navigate to it:
First, open a terminal (on Windows, use "x64 Native Tools Command Prompt for
VS 2019"), download the mixxx source code and navigate to it:

$ git clone https://github.com/mixxxdj/mixxx.git
$ cd mixxx

Fetch the required dependencies (on Windows, macOS and Debian/Ubuntu, you can
do that by running `tools\windows_buildenv.bat`, `source
tools/macos_buildenv.sh setup` or `source tools/debian_buildenv.sh setup`
respectively), then run:
Fetch the required dependencies and set up the build environment (on Windows,
macOS and Debian/Ubuntu, you can do that by running
`tools\windows_buildenv.bat`, `source tools/macos_buildenv.sh setup` or `source
tools/debian_buildenv.sh setup` respectively), then run:

$ mkdir build
$ cd build
$ cmake .. # Use `cmake -G Ninja ..` on Windows
$ cmake ..
$ cmake --build .

There should now be a `mixxx` executable in the current directory that you can
Expand Down
36 changes: 17 additions & 19 deletions src/engine/controls/ratecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,26 +535,24 @@ void RateControl::processTempRate(const int bufferSamples) {
}
}
} else if (m_eRateRampMode == RampMode::Linear) {
if (rampDirection != RampDirection::None) {
if (!m_bTempStarted) {
m_bTempStarted = true;
double latrate = ((double)bufferSamples / (double)m_pSampleRate->get());
m_dRateTempRampChange = (latrate / ((double)m_iRateRampSensitivity / 100.));
}
if (!m_bTempStarted) {
m_bTempStarted = true;
double latrate = bufferSamples / m_pSampleRate->get();
m_dRateTempRampChange = latrate / (m_iRateRampSensitivity / 100.0);
}

switch (rampDirection) {
case RampDirection::Up:
case RampDirection::UpSmall:
addRateTemp(m_dRateTempRampChange * m_pRateRange->get());
break;
case RampDirection::Down:
case RampDirection::DownSmall:
subRateTemp(m_dRateTempRampChange * m_pRateRange->get());
break;
case RampDirection::None:
default:
DEBUG_ASSERT(false);
}
switch (rampDirection) {
case RampDirection::Up:
case RampDirection::UpSmall:
addRateTemp(m_dRateTempRampChange * m_pRateRange->get());
break;
case RampDirection::Down:
case RampDirection::DownSmall:
subRateTemp(m_dRateTempRampChange * m_pRateRange->get());
break;
case RampDirection::None:
default:
DEBUG_ASSERT(false);
}
}
} else if (m_bTempStarted) {
Expand Down
Loading

0 comments on commit ff2b9a0

Please sign in to comment.