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

Offbeatnotes #3361

Merged
merged 1 commit into from
Feb 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions include/Pattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class EXPORT Pattern : public TrackContentObject
{
return m_patternType;
}

void checkType();

Copy link
Member Author

Choose a reason for hiding this comment

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

I made this public to be able to call it from PianoRoll.cpp .

// next/previous track based on position in the containing track
Pattern * previousPattern() const;
Expand Down Expand Up @@ -132,7 +132,6 @@ protected slots:
MidiTime beatPatternLength() const;

void setType( PatternTypes _new_pattern_type );
void checkType();

void resizeToFirstTrack();

Expand Down
5 changes: 5 additions & 0 deletions src/gui/editors/PianoRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2451,6 +2451,11 @@ void PianoRoll::dragNotes( int x, int y, bool alt, bool shift, bool ctrl )

note->setPos( MidiTime( pos_ticks ) );
note->setKey( key_num );
// If dragging beat notes check if pattern should be MelodyPattern
if( note->length() < 0 )
{
m_pattern->checkType();
}
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/tracks/Pattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ void Pattern::checkType()
NoteVector::Iterator it = m_notes.begin();
while( it != m_notes.end() )
{
if( ( *it )->length() > 0 )
if( ( *it )->length() > 0 ||
( *it )->pos() % ( MidiTime::ticksPerTact() /
MidiTime::stepsPerTact() ) )
{
setType( MelodyPattern );
return;
Expand Down