Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Beats with UI [GSoC 2020] #2961

Draft
wants to merge 352 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
352 commits
Select commit Hold shift + click to select a range
51fdd42
remove adapter for calculateBpm
hacksdump Jun 13, 2020
0f8009b
remove adapter for setGrid
hacksdump Jun 13, 2020
2a4bffb
add frame class to avoid sample/frame ambiguity
hacksdump Jun 13, 2020
56e9051
use single f in protobuf
hacksdump Jun 13, 2020
8e6625a
remove all adapters from main source
hacksdump Jun 15, 2020
ec62228
adapt tests to frame class
hacksdump Jun 16, 2020
91eb3d8
remove residual beats subclasses and corresponding tests
hacksdump Jun 16, 2020
f9fd333
add channel count to beatstest
hacksdump Jun 16, 2020
9b962d7
frame: add multiply and divide operations
hacksdump Jun 16, 2020
480f7f7
beats: use Frame vector in constructor
hacksdump Jun 16, 2020
65a0d84
beatfactory: write adapter to store beatgrid in beats
hacksdump Jun 16, 2020
a49ebe0
beatfactory: use common serialized data for all beatgrid version
hacksdump Jun 16, 2020
3e4664e
beats: remove unused code | rename proto
hacksdump Jun 16, 2020
a7b6d01
beats: remove unused function getMaxBpm
hacksdump Jun 16, 2020
919e1b9
beats: remove extraneous helper functions
hacksdump Jun 16, 2020
84d689c
beats: remove derivable state variable
hacksdump Jun 16, 2020
fe7fd32
beats: remove capability flags
hacksdump Jun 17, 2020
8957a08
beats:doc: describe source of data in constructor
hacksdump Jun 18, 2020
e6b0383
beats: remove optional sample rate parameter
hacksdump Jun 18, 2020
b156cd5
bpm: remove redundant parantheses
hacksdump Jun 18, 2020
e67686f
Merge branch 'ambigous-sample-rate' into remove-beatmap-beatgrid
hacksdump Jun 18, 2020
eab8bb0
beats: simplify bpm scale function
hacksdump Jun 18, 2020
43acd8f
timesignature: modify getters setters
hacksdump Jun 18, 2020
df01cce
beats: remove test logic from main source
hacksdump Jun 18, 2020
bff9917
fix typo
hacksdump Jun 18, 2020
754ecfe
beatutils: don't use framerate for audio
hacksdump Jun 18, 2020
4b515f2
beats: use double instead of rounding
hacksdump Jun 18, 2020
a1dc778
beats: define iterator
hacksdump Jun 18, 2020
e32a19c
timesignature: move symmetrical operations outside class
hacksdump Jun 18, 2020
454ba2c
remove redundant copying of member variable
hacksdump Jun 18, 2020
7eb655c
timesignature: use protobuf object to store signature
hacksdump Jun 19, 2020
9c981fb
beats: enable setBpm for all Beat detection modes
hacksdump Jun 20, 2020
4329021
frame: replace forward declaration with include
hacksdump Jun 20, 2020
1356ccb
frame.h refactor: use FramePos and FrameDiff_t
hacksdump Jun 21, 2020
9e04891
beats: update outdated constructor documentation
hacksdump Jun 21, 2020
43e16c1
bpmcontrol: use parented pointers
hacksdump Jun 21, 2020
f46860f
bpmcontrol: use unique pointers
hacksdump Jun 21, 2020
ea4447a
beatiterator: pointer comparison and exclude end
hacksdump Jun 21, 2020
33b6a4f
change control name
hacksdump Jun 21, 2020
79ecd2a
bpm: pass trivially copyable types by value
hacksdump Jun 21, 2020
c013576
bpm:use double for multiple and divide operations
hacksdump Jun 21, 2020
0576be8
beatiterator: remove destructor
hacksdump Jun 21, 2020
cbc7977
beats.proto: make fields required
hacksdump Jun 21, 2020
d255364
beatutils: remove unnecessary const
hacksdump Jun 21, 2020
397b338
beatutils: remove rounding for frame sample conversion
hacksdump Jun 21, 2020
a0ff6d9
beats: use correct range while returning iterator
hacksdump Jun 21, 2020
cf75244
beatstest: fix time signature test
hacksdump Jun 21, 2020
074a921
beatstest: remove redundant state variable
hacksdump Jun 21, 2020
136060b
waveformrenderbeat: enable beat pen
hacksdump Jun 21, 2020
86b834a
beatstest: fix NthBeatWhenNotOnBeat
hacksdump Jun 21, 2020
cab96a2
track: remove obsolete comments and debug info
hacksdump Jun 22, 2020
be68912
bpmcontrol_test: fix BeatContext_BeatGrid
hacksdump Jun 22, 2020
a9707f8
beatstest: fix BpmAround
hacksdump Jun 24, 2020
33bf4c9
searchqueryparsertest: fuzzy comparison to fix tests
hacksdump Jun 24, 2020
34c35d7
bpm: pass qstring by reference
hacksdump Jun 24, 2020
fe266d0
beats: cleaner debug output
hacksdump Jun 25, 2020
4d8f2f2
engine: use inline functions for frame conversion
hacksdump Jun 25, 2020
0534db3
remove unnecessary frame quantization
hacksdump Jun 25, 2020
915a671
beats: rename method
hacksdump Jun 25, 2020
ca4425a
beats: remove copy to self
hacksdump Jun 25, 2020
540c749
engine: update function to use FramePos instead of samples
hacksdump Jun 25, 2020
c00da80
engine: refactor to use FramePos instead of sample
hacksdump Jun 26, 2020
5f0ce46
beats: don't delete beats on translate
hacksdump Jun 26, 2020
fa86f2a
frame: use constant for invalid frame instead of -1
hacksdump Jun 26, 2020
38555e0
beatstranslatetest: fix SimpleTranslateMatch
hacksdump Jun 26, 2020
7f89649
frame: use C++ style limits
hacksdump Jun 26, 2020
68a1949
use inline functions for sample frame conversion
hacksdump Jun 28, 2020
c19d2f2
fix wrong assignment to beats
hacksdump Jun 29, 2020
55d7784
loopingcontrol: use inline functions for sample frame conversion
hacksdump Jun 29, 2020
1fff80c
Merge branch 'master' into remove-beatmap-beatgrid
hacksdump Jun 29, 2020
4f28348
loopingcontroltest: beat size within track duration
hacksdump Jun 30, 2020
8506d0b
use correct epsilon for finding nearby beat
hacksdump Jun 30, 2020
71bf183
fix enginesynctest failing due to typo
hacksdump Jun 30, 2020
3933e76
fix searchqueryparser test by reducing double precision
hacksdump Jun 30, 2020
85e75c9
remove unused functions
hacksdump Jul 1, 2020
425c7fd
remove unnecesary debug function
hacksdump Jul 2, 2020
2ca2be4
searchquery: improve comment on precision downgrading
hacksdump Jul 2, 2020
0710437
beats: use namespaced constants
hacksdump Jul 2, 2020
006cd74
factor out frame sample adapter functions
hacksdump Jul 2, 2020
cd80c28
loopingcontol: replace wrong variable
hacksdump Jul 2, 2020
bcd32c1
move frameadapter to util
hacksdump Jul 2, 2020
a7a7edd
use frameadapter in track
hacksdump Jul 2, 2020
6268b30
fix scons build
hacksdump Jul 2, 2020
b2a9bcf
frameadapter: change comment
hacksdump Jul 2, 2020
792c682
beats: temporary dirty workaround for copy constructor
hacksdump Jul 2, 2020
8452657
beatsproto: make all fields optional
hacksdump Jul 2, 2020
8134eae
create new internal beats class independent of QObject
hacksdump Jul 7, 2020
a60beee
simplify copy constructor
hacksdump Jul 7, 2020
9a08d05
beats: move findNthBeat to plain class
hacksdump Jul 7, 2020
13538d3
beats: move more code to plain class
hacksdump Jul 7, 2020
0a5fba3
beats: move scale functions to plain class
hacksdump Jul 8, 2020
274c9fa
beats: move all implementation to plain class
hacksdump Jul 8, 2020
49686eb
beats: use function to calculate beat length
hacksdump Jul 11, 2020
eb3b6c9
beats: add back old protobuf types for backwards compatibility
hacksdump Jul 12, 2020
d3b7a5a
beats: add version to distinguish from earlier versions
hacksdump Jul 13, 2020
79f5b2a
beats: add migration code
hacksdump Jul 14, 2020
6a52cab
merge from master and resolve conflicts
hacksdump Jul 14, 2020
abf9694
update comments
hacksdump Jul 14, 2020
7302922
revert all UI changes
hacksdump Jul 14, 2020
77c8d82
use beat indices as marker basis
hacksdump Jul 16, 2020
1e2565a
change section message
hacksdump Jul 16, 2020
cc0d8ef
remove redundant ctor initializer
hacksdump Jul 16, 2020
de26dd4
remove legacy name from comment
hacksdump Jul 16, 2020
e76bfc3
add debug asserts
hacksdump Jul 16, 2020
1967c0f
add placeholder parameters
hacksdump Jul 16, 2020
8f32635
change comparator name
hacksdump Jul 17, 2020
bbca10d
Merge branch 'master' into remove-beatmap-beatgrid
hacksdump Jul 19, 2020
372152e
merge downbeats with new beats
hacksdump Jul 23, 2020
32e6b6a
fix beatgrid mode load on init
hacksdump Jul 24, 2020
ad0290d
start creating time signature editor widget
hacksdump Jul 24, 2020
933020d
beats.proto: simplify bpm marker
hacksdump Jul 25, 2020
88dcdeb
beats.proto: remove unecessary defaults
hacksdump Jul 25, 2020
090528f
beats.proto: comment phrases and sections
hacksdump Jul 25, 2020
787b007
set beats per bar with time signature menu
hacksdump Jul 25, 2020
811135a
fix time signature menu popup location
hacksdump Jul 25, 2020
e56bf68
allow note lengths other than 4
hacksdump Jul 25, 2020
e9c7e62
add note length combo box to time signature editor
hacksdump Jul 25, 2020
57a8969
remove numeric translation
hacksdump Jul 27, 2020
8bc9a36
set min number of beats in a bar as 1
hacksdump Jul 27, 2020
5b2f5b7
use frameadapter functions
hacksdump Jul 27, 2020
f898748
make local copy to avoid race condition
hacksdump Jul 27, 2020
c3d004e
fix invalid frame value
hacksdump Jul 27, 2020
812d137
bpmcontrol: fix offset
hacksdump Jul 27, 2020
e3f23d4
use the more obvious way to get first beat
hacksdump Jul 27, 2020
191da3a
add graphic markers to indicate change in beatgrid
hacksdump Jul 27, 2020
7b3b28b
add display labe to waveformbeatmarker
hacksdump Jul 28, 2020
1468375
clear redundant markers
hacksdump Jul 28, 2020
bb3c711
add test to check bpm with time signature
hacksdump Jul 29, 2020
a410210
adjust opacity for downbeat triangles with preferences
hacksdump Jul 30, 2020
c38c927
beats: remove unused functions
hacksdump Jul 30, 2020
084fa4a
shift downbeats by an offset
hacksdump Aug 2, 2020
f1851af
resolve merge conflicts
hacksdump Aug 3, 2020
7fa9e95
factor out play marker to its own render
hacksdump Aug 6, 2020
61e802f
draw bar and beat counter alongside playhead
hacksdump Aug 7, 2020
6c2ff50
create bpm editor context menu
hacksdump Aug 10, 2020
5cb40dd
fix segfault
hacksdump Aug 17, 2020
3b7a848
remove unused function
hacksdump Aug 17, 2020
b02c703
remove irrelevant comment
hacksdump Aug 17, 2020
8ab2020
merge from master and resolve conflicts
hacksdump Aug 17, 2020
833d3d6
waveformrenderplaymarker: create function to generate display text
hacksdump Aug 19, 2020
b8a49f7
waveformrenderplaymarker: shift display box to start
hacksdump Aug 19, 2020
ed408f5
reduce downbeat triangle edge length
hacksdump Aug 19, 2020
f16cc57
remove downbeat triangle border
hacksdump Aug 19, 2020
ce4950f
remove debug asserts for default time signature assignment
hacksdump Aug 20, 2020
9ed5c89
reduce beatmarker triangle size and change color
hacksdump Aug 20, 2020
c90de25
reduce downbeat triangle size to 6 pixels
hacksdump Aug 20, 2020
e931e60
fix broken BeatsTest::BpmAround
hacksdump Aug 20, 2020
e6abe9b
fix broken beat marker assignment
hacksdump Aug 21, 2020
3bb0f66
enable bpm editing at all beats
hacksdump Aug 21, 2020
1e560ed
fix parented_ptr debug_assert on wbeatmenu
hacksdump Aug 21, 2020
9e1a150
fix enginesynctest
hacksdump Aug 22, 2020
3add426
remove todo
hacksdump Aug 22, 2020
2a6f038
add downbeat numbers near downbeat triangles
hacksdump Aug 22, 2020
b358168
waveformbeatmarker: font, alignment and color changes
hacksdump Aug 22, 2020
dc3a571
beats: fix debug assert condition
hacksdump Aug 22, 2020
ca92a12
beats: reduce floating point precision requirement for comparison
hacksdump Aug 22, 2020
ff68b5a
hide downbeats on zoomout
hacksdump Aug 22, 2020
eb2923c
use qt float comparison instead of custom threshold
hacksdump Aug 22, 2020
699289a
signature menu: add half double time buttons
hacksdump Aug 23, 2020
c2a1cb0
use constant for starting frame pos
hacksdump Aug 24, 2020
94fa463
define constant for first beat index
hacksdump Aug 24, 2020
77140bb
use 'small' instead of 'slight'
hacksdump Aug 24, 2020
1eab86f
add missing braces with single line if blocks
hacksdump Aug 24, 2020
204b8a5
use implicit constructor to initialize empty BPM
hacksdump Aug 24, 2020
101f4ae
use frameadapter functions
hacksdump Aug 24, 2020
a199842
restore searchquery.cpp functionality without fuzzy compare
hacksdump Aug 24, 2020
42b751b
use camel case for enum values
hacksdump Aug 24, 2020
706a7a3
beats.proto: add comment to explain prospective code
hacksdump Aug 24, 2020
7f01fb6
beat.h: extract enums and remove 'get' from getters
hacksdump Aug 24, 2020
4c7d3d7
fix Track and Beats ownership
hacksdump Aug 24, 2020
ef2cc65
rename getBpm to getGlobalBpm
hacksdump Aug 24, 2020
8924435
beats: remove age old comment
hacksdump Aug 24, 2020
7a59f6a
allow only track to create beats
hacksdump Aug 27, 2020
ce0c966
use StreamInfo to encode sample rate and duration
hacksdump Aug 27, 2020
207747b
remove Track from Beats constructor
hacksdump Aug 27, 2020
1b9148a
store StreamInfo in BeatsInternal
hacksdump Aug 27, 2020
aa2bb84
beats.proto: store start beat in time unit
hacksdump Aug 27, 2020
09442e2
track.cpp: fix beats assignment in setBeats
hacksdump Aug 27, 2020
60eaa03
remove bpm around function
hacksdump Aug 27, 2020
dd8270b
move kFirstBeatIndex out of anon namespace
hacksdump Aug 27, 2020
0c88676
use proposed doxygen comment style
hacksdump Aug 27, 2020
3ec8ab7
disable bpm markers on waveform
hacksdump Aug 27, 2020
af8ff0e
extract BPMScale with CamelCase members
hacksdump Aug 28, 2020
5edbd8d
add test to check beatjump before track
hacksdump Aug 29, 2020
d9d1d89
make beatinbarindex unsigned
hacksdump Aug 29, 2020
b8f5809
generate beats before the first beat
hacksdump Aug 29, 2020
734a2d0
generate beats before start and after end
hacksdump Aug 29, 2020
ac32f50
remove redundant function
hacksdump Aug 29, 2020
cd4c52c
hybridize nthbeat and fix accompanying tests
hacksdump Aug 29, 2020
40e8877
remove beatiterator
hacksdump Aug 30, 2020
f06be24
hybridize findPrevNextBeats and fix accompanying tests
hacksdump Aug 30, 2020
b5f5b05
fix beatjump test
hacksdump Aug 30, 2020
1c82271
merge local branch and resolve conflicts
hacksdump Aug 30, 2020
9e62c78
remove references to smart pointers
hacksdump Aug 31, 2020
a267a44
remove -1 from beats documentation comments
hacksdump Aug 31, 2020
68cb8e1
use nan instead of negative inf
hacksdump Aug 31, 2020
2ced9b0
fix if else nesting
hacksdump Aug 31, 2020
4879d89
merge from master and resolve conflicts
hacksdump Aug 31, 2020
1848b47
use mode bpm as global bpm
hacksdump Sep 7, 2020
3086160
Merge branch 'master' of github.com:mixxxdj/mixxx into new-beats-with-ui
hacksdump Sep 7, 2020
9ec079f
use default destructor
hacksdump Sep 9, 2020
11b2fde
stop early if there are no beats on screen
hacksdump Sep 9, 2020
4d4ca2a
add virtual destructor to interface
hacksdump Sep 9, 2020
4a61532
remove unused comparator
hacksdump Sep 9, 2020
ebfb63d
move geometryutils code to cpp file
hacksdump Sep 9, 2020
2ea3d2f
track: remove redundant debug function
hacksdump Sep 9, 2020
4b36b83
timesignature: remove preamble
hacksdump Sep 9, 2020
83f7c03
add QT declarations for FramePos
hacksdump Sep 9, 2020
0acc63e
framepos: define static start and invalid constants
hacksdump Sep 9, 2020
ec984f9
remove redundant streaminfo parameter
hacksdump Sep 9, 2020
2fe74a0
use absolute header include path
hacksdump Sep 9, 2020
7c5cad2
use the commonly used term sampleRate
hacksdump Sep 9, 2020
03dab11
track: update beats stream info on setBeats
hacksdump Sep 9, 2020
2b7ff8e
move long implementation to cpp file
hacksdump Sep 9, 2020
a5ebf61
use CamelCase constants
hacksdump Sep 9, 2020
9069848
fix include order
hacksdump Sep 9, 2020
904855b
beat.h: add comparison operators
hacksdump Sep 10, 2020
4c035f1
use std::optional instead of kInvalidBeat
hacksdump Sep 10, 2020
106edce
use early return instead of if-else nesting
hacksdump Sep 10, 2020
b496fcb
use SampleRate instead of plain double
hacksdump Sep 10, 2020
52895c3
return value instead of mutating parameters
hacksdump Sep 10, 2020
329e624
add missing locking to qDebug
hacksdump Sep 10, 2020
71a09c6
store beats and sample rate separately
hacksdump Sep 11, 2020
1a1c5f3
Merge branch 'master' into new-beats-with-ui
hacksdump Sep 24, 2020
9e0152f
fix no bpm in dlgtrackinfo
hacksdump Sep 24, 2020
ac82ed1
remove m_sampleRate from bpmcontrol
hacksdump Sep 25, 2020
31d0497
use double instead of Duration for time
hacksdump Sep 26, 2020
98eab8e
Merge branch 'master' into new-beats-with-ui
hacksdump Sep 26, 2020
281445b
use explicit type instead of auto
hacksdump Sep 26, 2020
975b28e
copy m_pBeats locally in functions
hacksdump Sep 26, 2020
0f67b0e
use curly braces
hacksdump Sep 26, 2020
510907f
Merge branch 'master' into new-beats-with-ui
hacksdump Oct 17, 2020
09af57c
Merge branch 'main' of github.com:mixxxdj/mixxx into new-beats-with-ui
Holzhaus Feb 20, 2021
2ff46a2
WaveformBeatMarker: Fix build with Qt < 5.11.0
Holzhaus Feb 22, 2021
9a2d250
Beats: Replace cbegin/cend for compatibility reasons
Holzhaus Feb 22, 2021
6e3da98
track: Pass arguments by reference (fixes clazy warnings)
Holzhaus Feb 22, 2021
10e60ad
waveformbeat: Fix -Wfloat-conversion warning for QFont.setPixelSize
Holzhaus Feb 22, 2021
f8eda94
WaveformRenderBeat: Don't use std::optional<T>::value()
Holzhaus Feb 22, 2021
7cac45b
Beats: Fix more clazy warnings
Holzhaus Feb 22, 2021
9475a4d
WaveformBeat: Fix clazy warnings
Holzhaus Feb 22, 2021
a10b7a4
Fix more clazy warnings
Holzhaus Feb 22, 2021
2b0ecad
track: Fix some clang-tidy warnings
Holzhaus Feb 22, 2021
a759b10
Merge branch 'main' of github.com:mixxxdj/mixxx into new-beats-with-ui
Holzhaus Feb 22, 2021
c5a3903
EngineBuffer: Use sample/frame conversion functions from frameadapter.h
Holzhaus Feb 24, 2021
d1967a7
BeatsTest: Fix expected return value for Beats::findNthBeat
Holzhaus Feb 24, 2021
d51caa7
Merge branch 'main' of github.com:mixxxdj/mixxx into new-beats-with-ui
Holzhaus Feb 25, 2021
66d4be5
track: Fix DEBUG_ASSERT when importing beats from Serato Metadata
Holzhaus Feb 25, 2021
df01aa0
Merge pull request #3 from Holzhaus/new-beats-with-ui
hacksdump Mar 2, 2021
4dbc221
Merge commit '5de725f4a1e8a5acb27bee4960dcd2bbdf127bbf' into new-beat…
daschuer Jul 7, 2021
6d07ab2
Fix looping tests
daschuer Jul 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,7 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/sources/soundsourcesndfile.cpp
src/track/albuminfo.cpp
src/track/beatfactory.cpp
src/track/beatgrid.cpp
src/track/beatmap.cpp
src/track/beat.cpp
src/track/beats.cpp
src/track/beatutils.cpp
src/track/bpm.cpp
Expand Down Expand Up @@ -879,6 +878,7 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/util/workerthreadscheduler.cpp
src/util/xml.cpp
src/waveform/guitick.cpp
src/waveform/renderers/geometryutils.cpp
src/waveform/renderers/glslwaveformrenderersignal.cpp
src/waveform/renderers/glvsynctestrenderer.cpp
src/waveform/renderers/glwaveformrendererfilteredsignal.cpp
Expand All @@ -887,11 +887,14 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/waveform/renderers/qtvsynctestrenderer.cpp
src/waveform/renderers/qtwaveformrendererfilteredsignal.cpp
src/waveform/renderers/qtwaveformrenderersimplesignal.cpp
src/waveform/renderers/waveformbeat.cpp
src/waveform/renderers/waveformbeatmarker.cpp
src/waveform/renderers/waveformmark.cpp
src/waveform/renderers/waveformmarkrange.cpp
src/waveform/renderers/waveformmarkset.cpp
src/waveform/renderers/waveformrenderbackground.cpp
src/waveform/renderers/waveformrenderbeat.cpp
src/waveform/renderers/waveformrenderplaymarker.cpp
src/waveform/renderers/waveformrendererabstract.cpp
src/waveform/renderers/waveformrendererendoftrack.cpp
src/waveform/renderers/waveformrendererfilteredsignal.cpp
Expand Down Expand Up @@ -932,6 +935,7 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/widget/wanalysislibrarytableview.cpp
src/widget/wbasewidget.cpp
src/widget/wbattery.cpp
src/widget/wbeatmenu.cpp
src/widget/wbeatspinbox.cpp
src/widget/wcolorpicker.cpp
src/widget/wcolorpickeraction.cpp
Expand Down Expand Up @@ -983,6 +987,8 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/widget/wstarrating.cpp
src/widget/wstatuslight.cpp
src/widget/wtime.cpp
src/widget/wtimesignaturemenu.cpp
src/widget/wtempomenu.cpp
src/widget/wtrackmenu.cpp
src/widget/wtrackproperty.cpp
src/widget/wtracktableview.cpp
Expand Down Expand Up @@ -1436,8 +1442,7 @@ add_executable(mixxx-test
src/test/audiotaperpot_test.cpp
src/test/autodjprocessor_test.cpp
src/test/baseeffecttest.cpp
src/test/beatgridtest.cpp
src/test/beatmaptest.cpp
src/test/beatstest.cpp
src/test/beatstranslatetest.cpp
src/test/bpmcontrol_test.cpp
src/test/broadcastprofile_test.cpp
Expand Down
7 changes: 6 additions & 1 deletion res/skins/Tango/buttons/btn_beats_curpos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 31 additions & 31 deletions src/analyzer/analyzerbeats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
#include <QHash>
#include <QString>
#include <QVector>
#include <QtDebug>

#include "analyzer/constants.h"
#include "analyzer/plugins/analyzerqueenmarybeats.h"
#include "analyzer/plugins/analyzersoundtouchbeats.h"
#include "library/rekordbox/rekordboxconstants.h"
#include "track/beatfactory.h"
#include "track/beatmap.h"
#include "track/beats.h"
#include "track/beatutils.h"
#include "track/track.h"

Expand Down Expand Up @@ -46,7 +45,7 @@ AnalyzerBeats::AnalyzerBeats(UserSettingsPointer pConfig, bool enforceBpmDetecti
m_iMaxBpm(9999) {
}

bool AnalyzerBeats::initialize(TrackPointer tio, int sampleRate, int totalSamples) {
bool AnalyzerBeats::initialize(TrackPointer pTrack, int sampleRate, int totalSamples) {
if (totalSamples == 0) {
return false;
}
Expand All @@ -58,7 +57,7 @@ bool AnalyzerBeats::initialize(TrackPointer tio, int sampleRate, int totalSample
return false;
}

bool bpmLock = tio->isBpmLocked();
bool bpmLock = pTrack->isBpmLocked();
if (bpmLock) {
qDebug() << "Track is BpmLocked: Beat calculation will not start";
return false;
Expand Down Expand Up @@ -106,8 +105,7 @@ bool AnalyzerBeats::initialize(TrackPointer tio, int sampleRate, int totalSample
m_iCurrentSample = 0;

// if we can load a stored track don't reanalyze it
bool bShouldAnalyze = shouldAnalyze(tio);

bool bShouldAnalyze = shouldAnalyze(pTrack);

DEBUG_ASSERT(!m_pPlugin);
if (bShouldAnalyze) {
Expand Down Expand Up @@ -136,11 +134,11 @@ bool AnalyzerBeats::initialize(TrackPointer tio, int sampleRate, int totalSample
return bShouldAnalyze;
}

bool AnalyzerBeats::shouldAnalyze(TrackPointer tio) const {
bool AnalyzerBeats::shouldAnalyze(TrackPointer pTrack) const {
int iMinBpm = m_bpmSettings.getBpmRangeStart();
int iMaxBpm = m_bpmSettings.getBpmRangeEnd();

bool bpmLock = tio->isBpmLocked();
bool bpmLock = pTrack->isBpmLocked();
if (bpmLock) {
qDebug() << "Track is BpmLocked: Beat calculation will not start";
return false;
Expand All @@ -153,11 +151,11 @@ bool AnalyzerBeats::shouldAnalyze(TrackPointer tio) const {

// If the track already has a Beats object then we need to decide whether to
// analyze this track or not.
mixxx::BeatsPointer pBeats = tio->getBeats();
mixxx::BeatsPointer pBeats = pTrack->getBeats();
if (!pBeats) {
return true;
}
if (!mixxx::Bpm::isValidValue(pBeats->getBpm())) {
if (!mixxx::Bpm::isValidValue(pBeats->getGlobalBpm().getValue())) {
// Tracks with an invalid bpm <= 0 should be re-analyzed,
// independent of the preference settings. We expect that
// all tracks have a bpm > 0 when analyzed. Users that want
Expand All @@ -166,7 +164,7 @@ bool AnalyzerBeats::shouldAnalyze(TrackPointer tio) const {
qDebug() << "Re-analyzing track with invalid BPM despite preference settings.";
return true;
}
if (pBeats->findNextBeat(0) <= 0.0) {
if (pBeats->findNextBeat(mixxx::kStartFramePos)->framePosition() <= mixxx::kStartFramePos) {
qDebug() << "First beat is 0 for grid so analyzing track to find first beat.";
return true;
}
Expand Down Expand Up @@ -196,8 +194,8 @@ bool AnalyzerBeats::shouldAnalyze(TrackPointer tio) const {
// Beat grid exists but version and settings differ
if (!m_bPreferencesReanalyzeOldBpm) {
qDebug() << "Beat calculation skips analyzing because the track has"
<< "a BPM computed by a previous Mixxx version and user"
<< "preferences indicate we should not change it.";
<< "a BPM computed by a previous Mixxx version and user"
<< "preferences indicate we should not change it.";
return false;
}

Expand All @@ -221,7 +219,7 @@ void AnalyzerBeats::cleanup() {
m_pPlugin.reset();
}

void AnalyzerBeats::storeResults(TrackPointer tio) {
void AnalyzerBeats::storeResults(TrackPointer pTrack) {
VERIFY_OR_DEBUG_ASSERT(m_pPlugin) {
return;
}
Expand All @@ -231,63 +229,65 @@ void AnalyzerBeats::storeResults(TrackPointer tio) {
return;
}

mixxx::BeatsPointer pBeats;
mixxx::BeatsInternal newBeats;
if (m_pPlugin->supportsBeatTracking()) {
QVector<double> beats = m_pPlugin->getBeats();
QHash<QString, QString> extraVersionInfo = getExtraVersionInfo(
m_pluginId, m_bPreferencesFastAnalysis);
pBeats = BeatFactory::makePreferredBeats(
*tio,
newBeats = BeatFactory::makePreferredBeats(
pTrack,
beats,
extraVersionInfo,
m_bPreferencesFixedTempo,
m_bPreferencesOffsetCorrection,
m_iSampleRate,
m_iTotalSamples,
m_iMinBpm,
m_iMaxBpm);
qDebug() << "AnalyzerBeats plugin detected" << beats.size()
<< "beats. Average BPM:" << (pBeats ? pBeats->getBpm() : 0.0);
<< "beats. Average BPM:" << newBeats.getGlobalBpm();
} else {
float bpm = m_pPlugin->getBpm();
auto bpm = mixxx::Bpm(m_pPlugin->getBpm());
qDebug() << "AnalyzerBeats plugin detected constant BPM: " << bpm;
pBeats = BeatFactory::makeBeatGrid(*tio, bpm, 0.0f);
pTrack->setBpm(bpm.getValue());
}

mixxx::BeatsPointer pCurrentBeats = tio->getBeats();
mixxx::BeatsPointer pCurrentBeats = pTrack->getBeats();

// If the track has no beats object then set our newly generated one
// regardless of beat lock.
if (!pCurrentBeats) {
tio->setBeats(pBeats);
pTrack->setBeats(newBeats);
return;
}

// If the track received the beat lock while we were analyzing it then we
// abort setting it.
if (tio->isBpmLocked()) {
if (pTrack->isBpmLocked()) {
qDebug() << "Track was BPM-locked as we were analyzing it. Aborting analysis.";
return;
}

// If the user prefers to replace old beatgrids with newly generated ones or
// the old beatgrid has 0-bpm then we replace it.
bool zeroCurrentBpm = pCurrentBeats->getBpm() == 0.0;
bool zeroCurrentBpm = pCurrentBeats->getGlobalBpm().getValue() == 0.0;
if (m_bPreferencesReanalyzeOldBpm || zeroCurrentBpm) {
if (zeroCurrentBpm) {
qDebug() << "Replacing 0-BPM beatgrid with a" << pBeats->getBpm()
qDebug() << "Replacing 0-BPM beatgrid with a" << newBeats.getGlobalBpm()
<< "beatgrid.";
}
tio->setBeats(pBeats);
pTrack->setBeats(newBeats);
return;
}

// If we got here then the user doesn't want to replace the beatgrid but
// since the first beat is zero we'll apply the offset we just detected.
double currentFirstBeat = pCurrentBeats->findNextBeat(0);
double newFirstBeat = pBeats->findNextBeat(0);
if (currentFirstBeat == 0.0 && newFirstBeat > 0) {
pCurrentBeats->translate(newFirstBeat);
mixxx::FramePos currentFirstBeat =
pCurrentBeats->getBeatAtIndex(mixxx::kFirstBeatIndex)->framePosition();
mixxx::FramePos newFirstBeat = newBeats.getBeatAtIndex(mixxx::kFirstBeatIndex)->framePosition();
if (currentFirstBeat == mixxx::kStartFramePos && newFirstBeat > mixxx::kStartFramePos) {
const double translateDuration =
(newFirstBeat - currentFirstBeat) / pTrack->getSampleRate();
pCurrentBeats->translateBySeconds(translateDuration);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/analyzer/analyzerbeats.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ class AnalyzerBeats : public Analyzer {
static QList<mixxx::AnalyzerPluginInfo> availablePlugins();
static mixxx::AnalyzerPluginInfo defaultPlugin();

bool initialize(TrackPointer tio, int sampleRate, int totalSamples) override;
bool initialize(TrackPointer pTrack, int sampleRate, int totalSamples) override;
bool processSamples(const CSAMPLE *pIn, const int iLen) override;
void storeResults(TrackPointer tio) override;
void storeResults(TrackPointer pTrack) override;
void cleanup() override;

private:
bool shouldAnalyze(TrackPointer tio) const;
bool shouldAnalyze(TrackPointer pTrack) const;
static QHash<QString, QString> getExtraVersionInfo(
const QString& pluginId, bool bPreferencesFastAnalysis);

Expand Down
36 changes: 28 additions & 8 deletions src/controllers/controlpickermenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,8 +1282,13 @@ void ControlPickerMenu::addPlayerControl(const QString& control,
if (resetControlMenu) {
QString resetTitle = QString("%1 (%2)").arg(controlTitle, m_resetStr);
QString resetDescription = QString("%1 (%2)").arg(controlDescription, m_resetStr);
addSingleControl(group, resetControl, resetTitle, resetDescription,
resetControlMenu, prefix, prefix);
addSingleControl(group,
resetControl,
resetTitle,
resetDescription,
resetControlMenu,
prefix,
prefix);
}
}

Expand All @@ -1302,8 +1307,13 @@ void ControlPickerMenu::addPlayerControl(const QString& control,
if (resetControlMenu) {
QString resetTitle = QString("%1 (%2)").arg(controlTitle, m_resetStr);
QString resetDescription = QString("%1 (%2)").arg(controlDescription, m_resetStr);
addSingleControl(group, resetControl, resetTitle, resetDescription,
resetControlMenu, prefix, prefix);
addSingleControl(group,
resetControl,
resetTitle,
resetDescription,
resetControlMenu,
prefix,
prefix);
}
}

Expand Down Expand Up @@ -1372,8 +1382,13 @@ void ControlPickerMenu::addMicrophoneAndAuxControl(const QString& control,
if (resetControlMenu) {
QString resetTitle = QString("%1 (%2)").arg(controlTitle, m_resetStr);
QString resetDescription = QString("%1 (%2)").arg(controlDescription, m_resetStr);
addSingleControl(group, resetControl, resetTitle, resetDescription,
resetControlMenu, prefix, prefix);
addSingleControl(group,
resetControl,
resetTitle,
resetDescription,
resetControlMenu,
prefix,
prefix);
}
}
}
Expand All @@ -1390,8 +1405,13 @@ void ControlPickerMenu::addMicrophoneAndAuxControl(const QString& control,
if (resetControlMenu) {
QString resetTitle = QString("%1 (%2)").arg(controlTitle, m_resetStr);
QString resetDescription = QString("%1 (%2)").arg(controlDescription, m_resetStr);
addSingleControl(group, resetControl, resetTitle, resetDescription,
resetControlMenu, prefix, prefix);
addSingleControl(group,
resetControl,
resetTitle,
resetDescription,
resetControlMenu,
prefix,
prefix);
}
}
}
Expand Down
Loading