-
-
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
Sampletrack - resize from left #3487
Conversation
src/core/Track.cpp
Outdated
@@ -67,7 +67,7 @@ | |||
#include "SongEditor.h" | |||
#include "StringPairDrag.h" | |||
#include "TextFloat.h" | |||
|
|||
#include <QDebug> |
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.
remove
src/tracks/SampleTrack.cpp
Outdated
@@ -48,7 +48,7 @@ | |||
#include "Mixer.h" | |||
#include "EffectRackView.h" | |||
#include "TrackLabelButton.h" | |||
|
|||
#include <QDebug> |
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.
remove
Omg I love you so much for doing this <3 |
I guess, this is ready for review. |
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.
Suggested improvements.
src/core/Track.cpp
Outdated
#else | ||
"Ctrl"), | ||
#endif | ||
embed::getIconPixmap( "hint" ), 0 ); |
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.
Could you reuse the Resize
case code?
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 don't see how could this happen economical. Maybe you can give me a tip? All three cases are very similar. I don't know how to consolidate.
include/SampleTrack.h
Outdated
@@ -58,6 +58,7 @@ class SampleTCO : public TrackContentObject | |||
return m_sampleBuffer; | |||
} | |||
|
|||
void setStartTimeOffset( MidiTime startTime ); |
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.
Are you sure this feature will not be useful for other TCOs? You do not have to implement those cases now.
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.
@jasp00 excellent point, yes this will be useful for other track types. Piano Roll, BBEdtior and Automation patterns can eventually benefit from this as well. 👍
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 moved it into Track.h/.cpp in the TrackContentObject. 👍
src/core/Track.cpp
Outdated
arg( m_tco->endPosition().getTicks() % | ||
MidiTime::ticksPerTact() ) ); | ||
s_textFloat->moveGlobal( this, QPoint( width() + 2, | ||
height() + 2) ); |
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.
Could you reuse the text float code?
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 don't see how could this happen economical. Maybe you can give me a tip?
src/core/Track.cpp
Outdated
@@ -925,6 +982,24 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * me ) | |||
QCursor c( Qt::SizeHorCursor ); | |||
QApplication::setOverrideCursor( c ); | |||
} | |||
else if( me->x() < RESIZE_GRIP_WIDTH && !me->buttons() ) |
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.
You should merge this block with the previous one.
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.
done
src/core/Track.cpp
Outdated
@@ -954,7 +1029,7 @@ void TrackContentObjectView::mouseReleaseEvent( QMouseEvent * me ) | |||
setSelected( !isSelected() ); | |||
} | |||
|
|||
if( m_action == Move || m_action == Resize ) | |||
if( m_action == Move || m_action == Resize || m_action == ResizeLeft ) | |||
{ | |||
m_tco->setJournalling( true ); |
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.
Could you add this?
// TODO: Fix m_tco->setJournalling() consistency
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.
done
@@ -603,10 +629,10 @@ bool SampleTrack::play( const MidiTime & _start, const fpp_t _frames, | |||
float framesPerTick = Engine::framesPerTick(); | |||
if( _start >= sTco->startPosition() && _start < sTco->endPosition() ) | |||
{ | |||
if( sTco->isPlaying() == false ) | |||
if( sTco->isPlaying() == false && _start > sTco->startPosition() + sTco->startTimeOffset() ) |
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.
You should refactor the offset information because playing is more important than GUI events.
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.
Can you please explain, what is in your mind? @jasp00
@Umcaruje Ah! Cool! I'll look into it. Thanks! |
Just an FYI, this bug had existed prior to this feature. |
@tresf Okay, that's another bug. I think, we should split this issue. The bug should be fixed for 1.2. I'll make a new pull request for this. |
@BaraMGB if I'm reading this correctly, we're fixing this in this PR, correct? Is the PR ready for testing? |
@tresf actually I thought this one is a feature and so it doesn't goes into 1.2. The issue by resizing from the end and changing tempo is a bug though. So my plan is to handle it in a further pull request. But this one here is complicated. It works almost but is not perfect, yet. |
Good point. We can always use some testing though, regardless of the branch. Please feel free to ping @UnityParadox when ready if you need a tester, he's been volunteering himself for testing. |
Okay. This seems to work. I want to clean up and optimize the code before we merge. Perhaps people wants to test this. @UnityParadox |
Actually, this feature would be great for any type of track. |
Can someone please review this and merge if it's okay? |
@BaraMGB It'll be first on my list tommorow. |
Can someone please review this and merge if it's okay? |
This should be available for any type of track, not just sample tracks. |
Step by step. |
1 2 3 ... testing!
Save works fine as does the rest. I can't really assess the code but others have done this already. After testing it for an hour I'm happy to include it in master but someone else should really chip in. Edit: It's been tested with the fpe debug option. |
Actually I merged the latest master into my branch, got the merge conflict and solved it with meld. I did this twice for this branch. But I'm a little bit tired of this. Therefore it would be nice if this could be merged. |
Alrighty then. 👍 |
new StringPairDrag( QString( "tco_%1" ).arg( | ||
m_tco->getTrack()->type() ), | ||
dataFile.toString(), thumbnail, this ); | ||
m_action = ToggleSelected; |
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.
@BaraMGB I guess something went wrong when you sync with master
branch.
See https://github.com/LMMS/lmms/pull/3649/files#diff-cb2a453c979a4777b9330e2b96644f0eR701.
I also found some serious GUI bugs introduced here(ex. can't copy TCOs with drag & drop). I'm going to fix that if @BaraMGB is not going to do that. |
@PhysSong I'm appreciate for your help in this matter. |
@PhysSong it's a long time ago when I wrote this. For fixing I need a little more help. Can you tell me which bugs you noticed? I don't get the problems. Copy TCOs by pressing ctrl and dragging don't work anymore is what I can reproduce. This should be easy to fix. But you pointed out that there are more GUI bugs. I need to know them. Thanks for the help. |
Okay, I guess I see whats's going on. I'll fix that. |
Fix bugs introduced in LMMS#3487
Sampletrack - resize from left
https://www.youtube.com/watch?v=BQfWqTMjxUE&feature=youtu.be
Things to do:
- save to project doesn't work, yet
This one is the halve way to split (knife tool) a sample track in two.