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

[WIP] Remove beatmap and beatgrid #2861

Closed
wants to merge 162 commits into from

Conversation

hacksdump
Copy link
Contributor

@hacksdump hacksdump commented Jun 13, 2020

This is a continuation of #2512

Goals:

  • Address all review comments from 2512

  • Fix tests

  • Remove UI features (Since they are being developed in [WIP] Bars and downbeats for common time signature. #2844)

  • Add backward compatibility for functions that generate BeatGrid by generating an intermediate BeatMap before passing to Beats class.

  • Migrate user data from old BeatGrid & BeatMap protobufs

  • Break up Beats class into an inner functional class that doesn't inherit from QObject and an outer QObject wrapper.

  • Add protobuf definitions for TimeSignature, Phrase and Sections and write test cases to test their operations.

Added support in BeatGrid and some minor fixes in BeatMap.
- Added Beats.setBar

The skin work is just a placeholder. I'm not so good in design.
- Extended BeatIterator for Bar and Phrase(partial) support.
- Extended BeatMap for Bar and Phrase(partial) management.
- Waveformrendererbeat extended to include the definition of the bar
beat color in the XML skin files.
- Tango Skin modified to include a button for marking bar beats.
- Filename renamed to match class name
- Property names improved
- UItility constants renamed to fit variable coding rules
protobuff, improvement in some tooltips and name changes in some methods
and properties.
- BeatMap functionality moved to Beats class
- BeatGrid class removed
- BeatsFactory only creates Beats
- BeatGridTest removed
- Beats class moved to mixxx namespace
- Beats class uses frame number instead of sample number
  The original methods still exists. They transform sample into frames
  and call a method with the same name with "New" sufix. This is
  temporary until the rest of the code is adapted to use frames
- BeatsTest adapted to new Beats class
@hacksdump hacksdump marked this pull request as draft June 13, 2020 05:09
@hacksdump
Copy link
Contributor Author

The review comments in #2512 need not be repeated here. Those will be taken care of.

@hacksdump
Copy link
Contributor Author

CodeFactor code check fails due to JS files.

@hacksdump hacksdump changed the title Remove beatmap and beatgrid [WIP] Remove beatmap and beatgrid Jun 13, 2020
@uklotzde
Copy link
Contributor

uklotzde commented Jun 13, 2020

@daschuer Unfortunately this branch still contains unrelated and unnecessary changes in TrackDAO that will cause merge conflicts with #2524.

I am currently checking the whole diff to master. In this special case I would propose to squash all commits, remove all unrelated changes, and restart the branch with a clean rebase on master. To prevent more of this and more serious issues that could be caused by inappropriate merge commits.

Update: This applies to all commits until and including 588b495. The following commits are safe.

build/depends.py Outdated Show resolved Hide resolved
@uklotzde
Copy link
Contributor

https://github.com/uklotzde/mixxx/tree/rebuild-remove-beatmap-beatgrid

  • Only the essential changes up to 430598d, rebased on current master
  • One commit (f9b4626) to fix the build
  • Tests are failing with a SIGSEGV

This is what I consider clean restart, though I don't have the time to preserve all the original commits. The actual number of changes is rather moderate.

Still many open issues, especially regarding the class design. The warnings about the copy constructor already indicate what is fundamentally wrong. Also the cyclic dependency on Track is unhandy and probably unnecessary. I left some TODOs on the class definition.

@Be-ing
Copy link
Contributor

Be-ing commented Jun 13, 2020

I propose "BeatVector" as a less ambiguous name for this new class.

src/proto/beats.proto Outdated Show resolved Hide resolved
src/proto/beats.proto Outdated Show resolved Hide resolved
src/track/beats.cpp Outdated Show resolved Hide resolved
src/track/beats.cpp Outdated Show resolved Hide resolved
src/track/beats.cpp Outdated Show resolved Hide resolved
src/track/beats.cpp Outdated Show resolved Hide resolved
src/track/beats.cpp Outdated Show resolved Hide resolved
src/track/beats.cpp Outdated Show resolved Hide resolved
src/track/beats.cpp Outdated Show resolved Hide resolved
src/track/beats.cpp Outdated Show resolved Hide resolved
src/track/beats.cpp Outdated Show resolved Hide resolved
@@ -746,83 +781,85 @@ Bpm BeatsInternal::getBpmAroundPosition(FramePos curFrame, int n) const {
stopBeat.set_frame_position(upper_bound.getValue());
return calculateBpm(startBeat, stopBeat);
}
TimeSignature BeatsInternal::getSignature(FramePos frame) const {

TimeSignature BeatsInternal::getSignature(int beatIndex) const {
if (!isValid()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the meaning of an invalid time signature? A time signature with 0 as one of the numbers?

@daschuer
Copy link
Member

daschuer commented Jul 16, 2020

https://github.com/mixxxdj/mixxx/wiki/Beat-and-Bar-Edit-Workflow
Contains now a truly backward compatible prototype.
This requires to store the integer presentation of the frame position with the double representation.

If we don't want to be backward compatible we are free to switch over to a sparse representation.
Apart form the optimized storage space I think we have some benefits whenever we edit the beats again, because this way we see exactly what moves beats in the spares areas.

The current definition is in between without making use of one of both benefits, that's why is think we should adjust our current model.

@hacksdump
Copy link
Contributor Author

The current definition is in between without making use of one of both benefits, that's why is think we should adjust our current model.

Yes. It is a hybrid between sparse representation and BeatMap.
TimeSignature, Phrase and Section are using the sparse representation model.

But the individual beats are stored like a beatmap.

@hacksdump
Copy link
Contributor Author

hacksdump commented Jul 16, 2020

This requires to store the integer presentation of the frame position with the double representation.

Why do we require int to be backwards compatible? We do have a migration path. So it doesn't matter what the new storage format is.

If we don't want to be backward compatible we are free to switch over to a sparse representation.

As I mentioned above, migration will take care of new data format.

Comment on lines +834 to +836
TimeSignature timeSignatureBefore;
int timeSignatureBeforeMarkerIndex = 0;
for (const auto& timeSignatureMarker : m_timeSignatureMarkers) {
Copy link
Contributor

@Be-ing Be-ing Jul 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Factor this out to a function to get the time signature for any position.

@daschuer
Copy link
Member

Why do we require int to be backwards compatible? We do have a migration path. So it doesn't matter what the new storage format is.

We have discussed to make the beats set by the new editor also a available for the 2.3 branch. I don't think that this is really necessary if we don't change the beat format of tracks where the beats are not touched.

Is this the case in this branch?

This will allow us to design a new pootop format from the scratch like a sparse presentation.
What do you think?

@hacksdump hacksdump mentioned this pull request Jul 23, 2020
8 tasks
@hacksdump
Copy link
Contributor Author

Closing in favour of #2961.

@hacksdump hacksdump closed this Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants