-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
AutoDJProcessor refactoring and split into separate files #16050
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
Open
fonsargo
wants to merge
17
commits into
mixxxdj:main
Choose a base branch
from
fonsargo:autodj-refactoring
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
beed3ac
AutoDJProcessor: Add TrackOrDeckAttributes
cr7pt0gr4ph7 90800ad
AutoDJProcessor: Add FadeableTrackOrDeckAttributes
cr7pt0gr4ph7 f886172
AutoDJProcessor: Add calculateTransitionImpl
cr7pt0gr4ph7 b485983
AutoDJProcessor: Readability: Append "Second" suffix to variables
cr7pt0gr4ph7 b79fabc
AutoDJProcessor: Readability: Shorten variable names
cr7pt0gr4ph7 2148b03
AutoDJFeature: Fix spelling of 'findOrCreateAutoDjPlaylistId'
cr7pt0gr4ph7 35b4bae
AutoDJConstants: Extract common constants into AutoDJConstants.
cr7pt0gr4ph7 3c908ff
TrackOrDeckAttributes: Move TrackOrDeckAttributes and subclasses into…
cr7pt0gr4ph7 8908f15
AutoDJProcessor: Fix a few spelling and grammar errors.
cr7pt0gr4ph7 9a53b06
Remove new feature leftovers: fadeDurationSeconds
fonsargo 00e875f
Use PollingControlProxy instead of ControlProxy
fonsargo edfa17c
Use setters & getters in FadeableTrackOrDeckAttributes
fonsargo 5bc8810
Use namespaces for constants
fonsargo 168fccf
Use pointers for FadeableTrackOrDeckAttributes in calculateTransition…
fonsargo 404db53
Use fat pointers for FadeableTrackOrDeckAttributes in useFixedFadeTime()
fonsargo b826310
Use parented_ptr for BaseTrackPlayer
fonsargo ea8eba7
Include parented_ptr.h
fonsargo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #pragma once | ||
|
|
||
| namespace mixxx { | ||
| namespace autodj { | ||
| static constexpr double kKeepPosition = -1.0; | ||
| static constexpr double kSkipToNextTrack = -2.0; | ||
| } // namespace autodj | ||
| } // namespace mixxx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| #include "library/autodj/track/deckattributes.h" | ||
|
|
||
| #include "mixer/basetrackplayer.h" | ||
| #include "moc_deckattributes.cpp" | ||
|
|
||
| DeckAttributes::DeckAttributes(int index, | ||
| BaseTrackPlayer* pPlayer) | ||
| : index(index), | ||
| group(pPlayer->getGroup()), | ||
| loading(false), | ||
| m_orientation(group, "orientation"), | ||
| m_playPos(group, "playposition"), | ||
| m_play(group, "play"), | ||
| m_repeat(group, "repeat"), | ||
| m_introStartPos(group, "intro_start_position"), | ||
| m_introEndPos(group, "intro_end_position"), | ||
| m_outroStartPos(group, "outro_start_position"), | ||
| m_outroEndPos(group, "outro_end_position"), | ||
| m_trackSamples(group, "track_samples"), | ||
| m_sampleRate(group, "track_samplerate"), | ||
| m_rateRatio(group, "rate_ratio"), | ||
| m_pPlayer(pPlayer) { | ||
| connect(m_pPlayer, &BaseTrackPlayer::newTrackLoaded, this, &DeckAttributes::slotTrackLoaded); | ||
| connect(m_pPlayer, &BaseTrackPlayer::loadingTrack, this, &DeckAttributes::slotLoadingTrack); | ||
| connect(m_pPlayer, &BaseTrackPlayer::playerEmpty, this, &DeckAttributes::slotPlayerEmpty); | ||
| m_playPos.connectValueChanged(this, &DeckAttributes::slotPlayPosChanged); | ||
| m_play.connectValueChanged(this, &DeckAttributes::slotPlayChanged); | ||
| m_introStartPos.connectValueChanged(this, &DeckAttributes::slotIntroStartPositionChanged); | ||
| m_introEndPos.connectValueChanged(this, &DeckAttributes::slotIntroEndPositionChanged); | ||
| m_outroStartPos.connectValueChanged(this, &DeckAttributes::slotOutroStartPositionChanged); | ||
| m_outroEndPos.connectValueChanged(this, &DeckAttributes::slotOutroEndPositionChanged); | ||
| m_rateRatio.connectValueChanged(this, &DeckAttributes::slotRateChanged); | ||
| } | ||
|
|
||
| DeckAttributes::~DeckAttributes() { | ||
| } | ||
|
|
||
| void DeckAttributes::slotPlayChanged(double v) { | ||
| emit playChanged(this, v > 0.0); | ||
| } | ||
|
|
||
| void DeckAttributes::slotPlayPosChanged(double v) { | ||
| emit playPositionChanged(this, v); | ||
| } | ||
|
|
||
| void DeckAttributes::slotIntroStartPositionChanged(double v) { | ||
| emit introStartPositionChanged(this, v); | ||
| } | ||
|
|
||
| void DeckAttributes::slotIntroEndPositionChanged(double v) { | ||
| emit introEndPositionChanged(this, v); | ||
| } | ||
|
|
||
| void DeckAttributes::slotOutroStartPositionChanged(double v) { | ||
| emit outroStartPositionChanged(this, v); | ||
| } | ||
|
|
||
| void DeckAttributes::slotOutroEndPositionChanged(double v) { | ||
| emit outroEndPositionChanged(this, v); | ||
| } | ||
|
|
||
| void DeckAttributes::slotTrackLoaded(TrackPointer pTrack) { | ||
| emit trackLoaded(this, pTrack); | ||
| } | ||
|
|
||
| void DeckAttributes::slotLoadingTrack(TrackPointer pNewTrack, TrackPointer pOldTrack) { | ||
| // qDebug() << "DeckAttributes::slotLoadingTrack"; | ||
| emit loadingTrack(this, pNewTrack, pOldTrack); | ||
| } | ||
|
|
||
| void DeckAttributes::slotPlayerEmpty() { | ||
| emit playerEmpty(this); | ||
| } | ||
|
|
||
| void DeckAttributes::slotRateChanged(double) { | ||
| emit rateChanged(this); | ||
| } | ||
|
|
||
| TrackPointer DeckAttributes::getLoadedTrack() const { | ||
| return m_pPlayer != nullptr ? m_pPlayer->getLoadedTrack() : TrackPointer(); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's apply the const-correctness principle here too.
In case you need them to remain mutable, you should keep the fat pointers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it back to fat pointers according to the const-correctness principle.