-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Refactor to move positionChanged signal to Timeline #7454
Open
regulus79
wants to merge
25
commits into
LMMS:master
Choose a base branch
from
regulus79:fix-record-play-pianoroll-new
base: master
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.
+102
−146
Open
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
07c47b5
Add positionChanged signal to Timeline and alter PianoRoll connection
regulus79 241eedb
Remove SLOT and SIGNAL macros
regulus79 4efe2b8
Merge branch 'master' into fix-record-play-pianoroll-new
regulus79 4e4b8d8
Initial changes
regulus79 e8f5ddb
Cleaning up
regulus79 840d991
Add getters and setters, do not expose PlayPos for writing without em…
regulus79 3032b04
Cleaning up again
regulus79 e22f925
Update include/Timeline.h
regulus79 f66b9b9
Update include/PlayPos.h
regulus79 83be137
Change timeline() to model() in TimeLineWidget.h
regulus79 6467cf6
Rename timeline() to model() in editors
regulus79 5d2d367
Forgot to change one occurance
regulus79 4adfe5a
Remove bufferProcessed signal and updatePosition slot
regulus79 375a6b0
Add return
regulus79 b80cb42
Specify Qt::DirectConnection
regulus79 a9e4c0c
Remove TODO
regulus79 af1e1e2
Change DirectConnection to QueuedConnection and remove argument from …
regulus79 6ef9b4e
Fix formatting in Song.cpp
regulus79 f29ad42
Fix more formatting in Song.cpp
regulus79 1b3c761
Update src/core/Song.cpp
regulus79 2a50a8c
Pass Timeline to TimeLineWIdget as a pointer
regulus79 010d649
Replace accidentally-removed connects
regulus79 4ce6eba
Update src/gui/editors/PianoRoll.cpp
regulus79 8f7484c
Forgot to add
regulus79 2e7234f
Remove PlayPos and put frame count and jumped in Timeline
regulus79 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 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 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 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,54 @@ | ||
/* | ||
* PlayPos.h - declaration of class PlayPos, a TimePos with additional features useful for Timelines | ||
* | ||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net> | ||
* | ||
* This file is part of LMMS - https://lmms.io | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public | ||
* License along with this program (see COPYING); if not, write to the | ||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
* Boston, MA 02110-1301 USA. | ||
* | ||
*/ | ||
|
||
#ifndef LMMS_PLAYPOS_H | ||
#define LMMS_PLAYPOS_H | ||
|
||
#include "TimePos.h" | ||
|
||
namespace lmms | ||
{ | ||
|
||
class PlayPos : public TimePos | ||
{ | ||
public: | ||
PlayPos(const int absolutePosition = 0) | ||
: TimePos{absolutePosition} | ||
, m_currentFrame{0.f} | ||
{ | ||
} | ||
|
||
auto currentFrame() const -> float { return m_currentFrame; } | ||
void setCurrentFrame( const float f ) { m_currentFrame = f; } | ||
auto jumped() const -> bool { return m_jumped; } | ||
void setJumped(const bool jumped) { m_jumped = jumped; } | ||
|
||
private: | ||
float m_currentFrame; | ||
bool m_jumped; | ||
}; | ||
|
||
} // namespace lmms | ||
|
||
#endif // LMMS_PLAYPOS_H |
This file contains 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 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 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 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 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
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.
I would suggest removing
PlayPos
and usingTimePos
directly inTimeline
. This class mostly is just a container for data and does not do anything special really.TimePos
can be refactored to store frames as its smallest unit of time (or just store the frame position maybe? do we even need a class just to store the frame position within the tick?). The member functions should then be changed accordingly to account for that as necessary. This might be okay in a separate PR if you feel its out of scope, but I think its minor enough that it shouldn't matter too much to do it in here. Up to you.Then for the jumped variable, from what I can tell, this just lets us know if the timeline didn't change through time progressively but instead jumped in time. What would it mean for the jumped variable to be
true
even when the timeline is not jumping? This should be a parameter for thepositionChanged
signal. You might have to refactor the VST sync controller code for its invocation to be event-based and not executed withinSong::processNextBuffer
though.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.
I'm not sure
TimePos
can easily be refactored to store frames as its smallest unit of time, unless we allow for fractional frames. If the number of frames in a bar is not a whole number, then it will have to be rounded. That's fine, but if the bpm is changed, then every single TimePos will have to be updated at once so that the number of frames matches the correct tick amount. I feel like a better long-term solution would be to allow float tick values, but that's just me.But I agree, the jumped variable can probably be combined with the
positionChanged
signal.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.
What about just storing the frame position directly and still removing
PlayPos
?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.
I have removed
PlayPos
. Now eachTimeline
stores it's current frame offset and jumped state. I will see if I can getjumped
to be passed in thepositionChanged
signal instead.