Implement 1429 -- move to next and previous pattern
This commit is contained in:
@@ -967,6 +967,14 @@ void PianoRoll::keyPressEvent(QKeyEvent* ke )
|
||||
int amt = quantized ? quantization() : 1;
|
||||
shiftPos( -amt );
|
||||
}
|
||||
else if( ke->modifiers() & Qt::AltModifier)
|
||||
{
|
||||
Pattern * p = m_pattern->previousPattern();
|
||||
if(p != NULL)
|
||||
{
|
||||
setCurrentPattern(p);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// scroll
|
||||
@@ -1001,6 +1009,13 @@ void PianoRoll::keyPressEvent(QKeyEvent* ke )
|
||||
int amt = quantized ? quantization() : 1;
|
||||
shiftPos( +amt );
|
||||
}
|
||||
else if( ke->modifiers() & Qt::AltModifier) {
|
||||
Pattern * p = m_pattern->nextPattern();
|
||||
if(p != NULL)
|
||||
{
|
||||
setCurrentPattern(p);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// scroll
|
||||
|
||||
@@ -434,6 +434,32 @@ void Pattern::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
Pattern * Pattern::previousPattern() const
|
||||
{
|
||||
return adjacentPatternByOffset(-1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Pattern * Pattern::nextPattern() const
|
||||
{
|
||||
return adjacentPatternByOffset(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Pattern * Pattern::adjacentPatternByOffset(int offset) const
|
||||
{
|
||||
QVector<TrackContentObject *> tcos = m_instrumentTrack->getTCOs();
|
||||
int tcoNum = m_instrumentTrack->getTCONum(this);
|
||||
return dynamic_cast<Pattern*>(tcos.value(tcoNum + offset, NULL));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Pattern::clear()
|
||||
{
|
||||
addJournalCheckPoint();
|
||||
|
||||
Reference in New Issue
Block a user