Skip to content

Commit

Permalink
Merge branch 'main' into syncleader
Browse files Browse the repository at this point in the history
  • Loading branch information
ywwg committed Jul 10, 2021
2 parents e79703d + 3ef395b commit 36781b1
Show file tree
Hide file tree
Showing 32 changed files with 378 additions and 223 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
include:
- name: clazy
- name: clang-tidy
- name: coverage
runs-on: ubuntu-20.04
name: ${{ matrix.name }}
steps:
Expand Down Expand Up @@ -71,6 +72,31 @@ jobs:
-DWAVPACK=ON \
..
working-directory: build
- name: Configure (coverage)
if: matrix.name == 'coverage'
run: |
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DOPTIMIZE=off \
-DCOVERAGE=ON \
-DWARNINGS_FATAL=OFF \
-DDEBUG_ASSERTIONS_FATAL=OFF \
-DBATTERY=ON \
-DBROADCAST=ON \
-DBULK=ON \
-DHID=ON \
-DLILV=ON \
-DOPUS=ON \
-DQTKEYCHAIN=ON \
-DVINYLCONTROL=ON \
-DFFMPEG=ON \
-DKEYFINDER=ON \
-DLOCALECOMPARE=ON \
-DMAD=ON \
-DMODPLUG=ON \
-DWAVPACK=ON \
..
working-directory: build
- name: Set up problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
Expand All @@ -80,3 +106,34 @@ jobs:
env:
CLAZY_CHECKS: level2,no-rule-of-two-soft,no-non-pod-global-static,no-qproperty-without-notify,no-wrong-qevent-cast,no-qstring-allocations,no-function-args-by-value,no-copyable-polymorphic,no-ctor-missing-parent-argument,no-missing-qobject-macro,no-rule-of-three,no-returning-void-expression,no-missing-typeinfo,no-base-class-event
CLAZY_IGNORE_DIRS: lib/.*
- name: "Test"
if: matrix.name == 'coverage'
run: ctest --timeout 45
working-directory: build
env:
# Render analyzer waveform tests to an offscreen buffer
QT_QPA_PLATFORM: ${{ matrix.qt_qpa_platform }}
GTEST_COLOR: 1
# Only use single thread to prevent *.gcna files from overwriting each other
CTEST_PARALLEL_LEVEL: 1
CTEST_OUTPUT_ON_FAILURE: 1
- name: "Generate Coverage Report"
if: matrix.name == 'coverage'
run: >-
lcov
--capture
--directory .
--base-directory ..
--include "${PWD%/*}/src/*"
--exclude "${PWD%/*}/src/test/*"
--exclude "${PWD%/*}/build/*"
--exclude "${PWD%/*}/lib/*"
--output-file lcov.info
working-directory: build
- name: "Upload Coverage Report to coveralls.io"
if: matrix.name == 'coverage'
uses: coverallsapp/github-action@master
with:
flag-name: ubuntu-20.04
path-to-lcov: build/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ if(NOT BUILD_LOW_MEMORY)
add_compile_options(-pipe)
endif()

# Coverage
#
# This is only available with GCC, therefore this option is forcibly set to OFF
# for all other compilers.
cmake_dependent_option(COVERAGE "Coverage (i.e. gcov) support" OFF "GNU_GCC" OFF)
if(COVERAGE)
add_compile_options(--coverage -fprofile-arcs -ftest-coverage)
add_link_options(--coverage -fprofile-arcs -ftest-coverage)
endif()

# Profiling
#
# This is only available on Linux, therefore this option is forcibly set to OFF
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/GitInfo.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Get the current commit ref
if(NOT GIT_DESCRIBE)
execute_process(
COMMAND git describe --tags --always --dirty=-modified
COMMAND git describe --tags --always --first-parent --dirty=-modified
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_DESCRIBE
OUTPUT_STRIP_TRAILING_WHITESPACE
Expand Down
4 changes: 4 additions & 0 deletions res/skins/Deere/icon/ic_library_checkbox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions res/skins/Deere/icon/ic_library_checkbox_checked.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 4 additions & 8 deletions res/skins/Deere/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,11 @@ WLibrary QLineEdit,
}

/* checkbox in library "Played" column */
WTrackTableView::indicator:checked {
image: url(skin:/../Deere/icon/ic_library_checkmark.svg);
border: 1px solid #ff6600;
}
WTrackTableView::indicator:unchecked {
border: 1px solid rgba(151,151,151,128);
image: url(skin:/../Deere/icon/ic_library_checkbox.svg);
}
WTrackTableView::indicator:checked {
image: url(skin:/../Deere/icon/ic_library_checkbox_checked.svg);
}

/* focused BPM cell in the library "BPM" column */
Expand Down Expand Up @@ -2122,7 +2121,6 @@ WTrackMenu QMenu QCheckBox::indicator:disabled {
background-color: #333;
}
WLibrarySidebar QMenu::indicator:checked,
WTrackTableView::indicator:checked,
WTrackMenu QMenu QCheckBox::indicator:checked {
image: url(skin:/../Deere/icon/ic_library_checkmark_orange.svg);
}
Expand Down Expand Up @@ -2158,8 +2156,6 @@ WLibrarySidebar QMenu::indicator:unchecked,
WLibrarySidebar QMenu::indicator:unchecked:selected,
WTrackTableViewHeader QMenu::indicator:unchecked,
WTrackTableViewHeader QMenu::indicator:unchecked:selected,
WTrackTableView::indicator:unchecked,
WTrackTableView::indicator:unchecked:selected,
WEffectSelector::indicator:unchecked,
WEffectSelector::indicator:unchecked:selected,
#fadeModeCombobox::indicator:unchecked,
Expand Down
3 changes: 3 additions & 0 deletions res/skins/LateNight/classic/buttons/btn__lib_checkbox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/skins/LateNight/palemoon/buttons/btn__lib_checkbox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion res/skins/LateNight/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ WEffectSelector QAbstractScrollArea {
margin: 2px;
}
WEffectSelector::down-arrow,
#fadeModeCombobox::down-arrow {
#fadeModeCombobox::down-arrow,
WTrackTableView::indicator {
border: 0;
padding: 0;
margin: 0;
Expand Down
15 changes: 3 additions & 12 deletions res/skins/LateNight/style_classic.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2450,8 +2450,6 @@ QLineEdit QMenu::item:disabled {
}

WLibrarySidebar QMenu::indicator:checked,
WTrackTableViewHeader QMenu::indicator:checked,
WTrackTableView::indicator:checked,
WTrackMenu QMenu QCheckBox::indicator:checked,
WEffectSelector::indicator:checked,
#fadeModeCombobox::indicator:checked {
Expand Down Expand Up @@ -2490,18 +2488,13 @@ QLineEdit QMenu::item:disabled {

/* This is the only way to select the 'Played' checkbox.
Note that this also selects the BPM lock. */
WTrackTableView::indicator {
/* border is added to size defined in style.qss */
border: 1px solid transparent;
margin: 0px;
padding: 0px;
}
WTrackTableView::indicator:checked {
border: 1px solid #ff6600;
image: url(skin:/classic/buttons/btn__lib_checkbox_checked.svg);
}
WTrackTableView::indicator:unchecked {
border: 1px solid rgba(151,151,151,128);
image: url(skin:/classic/buttons/btn__lib_checkbox.svg);
}

#MainMenu QMenu::separator,
WLibrarySidebar QMenu::separator,
WTrackTableViewHeader QMenu::separator,
Expand All @@ -2520,8 +2513,6 @@ WLibrarySidebar QMenu::indicator:unchecked,
WLibrarySidebar QMenu::indicator:unchecked:selected,
WTrackTableViewHeader QMenu::indicator:unchecked,
WTrackTableViewHeader QMenu::indicator:unchecked:selected,
WTrackTableView::indicator:unchecked,
WTrackTableView::indicator:unchecked:selected,
WEffectSelector::indicator:unchecked,
WEffectSelector::indicator:unchecked:selected,
#fadeModeCombobox::indicator:unchecked,
Expand Down
23 changes: 6 additions & 17 deletions res/skins/LateNight/style_palemoon.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2568,18 +2568,6 @@ WTrackTableView {
qproperty-focusBorderColor: #fff;
}

/* This is the only way to select the 'Played' checkbox.
Note that this also selects the BPM lock. */
WTrackTableView::indicator {
/* border is added to configured size */
border: 1px solid transparent;
margin: 0px;
padding: 0px;
}
WTrackTableView::indicator:unchecked {
border: 1px solid rgba(151,151,151,128);
}

/* Table cell in edit mode */
WLibrary QLineEdit,
#LibraryBPMSpinBox {
Expand Down Expand Up @@ -2994,12 +2982,15 @@ QLineEdit QMenu::item:disabled {
image: url(skin:/palemoon/buttons/btn__menu_checkbox.svg);
}

/* This is the only way to select the 'Played' checkbox.
Note that this also selects the BPM lock, so style that afterwards. */
WTrackTableView::indicator:unchecked {
image: url(skin:/palemoon/buttons/btn__lib_checkbox.svg);
}
WLibrarySidebar QMenu::indicator:checked,
WTrackTableViewHeader QMenu::indicator:checked,
WTrackTableView::indicator:checked,
WTrackMenu QMenu QCheckBox::indicator:checked,
WEffectSelector::indicator:checked,
#fadeModeCombobox::indicator:checked {
WTrackMenu QMenu QCheckBox::indicator:checked {
image: url(skin:/palemoon/buttons/btn__lib_checkmark_blue.svg);
}
WEffectSelector::indicator:checked,
Expand Down Expand Up @@ -3035,8 +3026,6 @@ WLibrarySidebar QMenu::indicator:unchecked,
WLibrarySidebar QMenu::indicator:unchecked:selected,
WTrackTableViewHeader QMenu::indicator:unchecked,
WTrackTableViewHeader QMenu::indicator:unchecked:selected,
WTrackTableView::indicator:unchecked,
WTrackTableView::indicator:unchecked:selected,
WEffectSelector::indicator:unchecked,
WEffectSelector::indicator:unchecked:selected,
#fadeModeCombobox::indicator:unchecked,
Expand Down
4 changes: 4 additions & 0 deletions res/skins/Shade/btn/btn_lib_checkbox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions res/skins/Shade/btn/btn_lib_checkbox_checked.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 5 additions & 9 deletions res/skins/Shade/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -549,15 +549,13 @@ WTrackTableView {
WTrackTableView::indicator {
margin: 0px;
padding: 0px;
color: #cfcfcf;
border: 1px solid transparent;
border: 0px;
}
WTrackTableView::indicator:checked {
image: url(skin:/btn/btn_lib_checkmark.svg) no-repeat center center;
border: 1px solid #ff6600;
WTrackTableView::indicator:unchecked {
image: url(skin:/btn/btn_lib_checkbox.svg);
}
WTrackTableView::indicator:unchecked {
border: 1px solid rgba(151,151,151,128);
WTrackTableView::indicator:checked {
image: url(skin:/btn/btn_lib_checkbox_checked.svg);
}

/* explicitly remove icons from unchecked items otherwise
Expand All @@ -566,8 +564,6 @@ WLibrarySidebar QMenu::indicator:unchecked,
WLibrarySidebar QMenu::indicator:unchecked:selected,
WTrackTableViewHeader QMenu::indicator:unchecked,
WTrackTableViewHeader QMenu::indicator:unchecked:selected,
WTrackTableView::indicator:unchecked,
WTrackTableView::indicator:unchecked:selected,
WEffectSelector::indicator:unchecked,
WEffectSelector::indicator:unchecked:selected,
#fadeModeCombobox::indicator:unchecked,
Expand Down
4 changes: 4 additions & 0 deletions res/skins/Tango/buttons/btn_lib_checkbox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions res/skins/Tango/buttons/btn_lib_checkbox_checked.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 2 additions & 14 deletions res/skins/Tango/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2902,21 +2902,11 @@ QPushButton#pushButtonRepeatPlaylist:!checked {
}*/

/* checkbox in library "Played" column */
WTrackTableView::indicator {
margin: 0px;
padding: 0px;
color: #cfcfcf;
/* border is added to size defined above */
border: 1px solid rgba(151,151,151,128);
}
WTrackTableView::indicator:hover {
border: 1px solid #888;
}
WTrackTableView::indicator:checked {
image: url(skin:/../Tango/buttons/btn_lib_checkmark.svg);
image: url(skin:/../Tango/buttons/btn_lib_checkbox_checked.svg);
}
WTrackTableView::indicator:unchecked {
background: none;
image: url(skin:/../Tango/buttons/btn_lib_checkbox.svg);
}

WLibrary QSpinBox {
Expand Down Expand Up @@ -2977,8 +2967,6 @@ WLibrarySidebar QMenu::indicator:unchecked,
WLibrarySidebar QMenu::indicator:unchecked:selected,
WTrackTableViewHeader QMenu::indicator:unchecked,
WTrackTableViewHeader QMenu::indicator:unchecked:selected,
WTrackTableView::indicator:unchecked,
WTrackTableView::indicator:unchecked:selected,
WEffectSelector::indicator:unchecked,
WEffectSelector::indicator:unchecked:selected,
#fadeModeCombobox::indicator:unchecked,
Expand Down
7 changes: 3 additions & 4 deletions res/skins/default.qss
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
image: url(:/images/library/ic_library_preview_play.svg);
}

/* These library table indicators are scaled with the library font:
checkbox next to the 'Played' counter */
/* 'Played' checkbox */
WTrackTableView::indicator,
/* BPM lock icon */
#LibraryBPMButton::indicator {
width: 0.5em;
height: 0.5em;
/* The indicator size is dynamically adjusted in c++ to match the size
of the library font: width/height = 0.7em*/
}
/* Style the library BPM Button with a default image */
QPushButton#LibraryBPMButton {
Expand Down
6 changes: 6 additions & 0 deletions src/audio/frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ class FramePos final {
return FramePos(std::floor(value()));
}

/// Return position rounded to the nearest full frame position, without
/// the fractional part.
[[nodiscard]] FramePos toNearestFrameBoundary() const {
return FramePos(std::round(value()));
}

FramePos& operator+=(FrameDiff_t increment) {
DEBUG_ASSERT(isValid());
m_framePosition += increment;
Expand Down
8 changes: 5 additions & 3 deletions src/engine/controls/bpmcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,9 +815,11 @@ double BpmControl::getBeatMatchPosition(
}
if (playing) {
if (!pOtherEngineBuffer || pOtherEngineBuffer->getSpeed() == 0.0) {
// "this" track is playing, or just starting
// only match phase if the sync target is playing as well
// else use the previous phase of "this" track before the seek
// "this" track is playing, or just starting.
// Only match phase if the sync target is playing as well,
// otherwise use the previous phase of "this" track before the seek.
// This occurs when the DJ does a quantized seek -- we preserve
// the exact beat distance.
pOtherEngineBuffer = getEngineBuffer();
}
} else if (!pOtherEngineBuffer) {
Expand Down
Loading

0 comments on commit 36781b1

Please sign in to comment.