added support for panning editing of notes (stable backport)

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms/stable-0.4@1948 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-12-17 11:49:28 +00:00
parent 3e0f9d0216
commit f62830c1ee
9 changed files with 247 additions and 48 deletions

View File

@@ -40,6 +40,11 @@
note::note( const midiTime & _length, const midiTime & _pos,
int _key, volume _volume, panning _panning,
detuningHelper * _detuning ) :
m_selected( false ),
m_oldKey( tLimit( _key, 0, NumKeys ) ),
m_oldPos( _pos ),
m_oldLength( _length ),
m_isPlaying( false ),
m_key( tLimit( _key, 0, NumKeys ) ),
m_volume( tLimit( _volume, MinVolume, MaxVolume ) ),
m_panning( tLimit( _panning, PanningLeft, PanningRight ) ),
@@ -48,7 +53,6 @@ note::note( const midiTime & _length, const midiTime & _pos,
{
//saveJournallingState( FALSE );
// setJournalling( FALSE );
if( _detuning )
{
m_detuning = sharedObject::ref( _detuning );
@@ -65,6 +69,11 @@ note::note( const midiTime & _length, const midiTime & _pos,
note::note( const note & _note ) :
serializingObject( _note ),
m_selected( _note.m_selected ),
m_oldKey( _note.m_oldKey ),
m_oldPos( _note.m_oldPos ),
m_oldLength( _note.m_oldLength ),
m_isPlaying( _note.m_isPlaying ),
m_key( _note.m_key),
m_volume( _note.m_volume ),
m_panning( _note.m_panning ),

View File

@@ -506,7 +506,7 @@ void pianoView::mousePressEvent( QMouseEvent * _me )
}
else
{
if( engine::getMainWindow()->isCtrlPressed() )
if( _me->modifiers() & Qt::ControlModifier )
{
new stringPairDrag( "automatable_model",
QString::number( m_piano->

View File

@@ -34,6 +34,8 @@
#include <QtGui/QPainter>
#include <QtGui/QProgressBar>
#include <QtGui/QPushButton>
#include <QtAlgorithms>
#include "pattern.h"
@@ -96,8 +98,6 @@ pattern::pattern( const pattern & _pat_to_copy ) :
}
pattern::~pattern()
{
for( noteVector::iterator it = m_notes.begin();
@@ -183,6 +183,17 @@ midiTime pattern::beatPatternLength( void ) const
void pattern::printNotes( void )
{
for( noteVector::iterator it = m_notes.begin(); it != m_notes.end();
++it )
{
printf("note (pos = %i)\n", (int) ( *it )->pos() );
}
printf("\n");
}
note * pattern::addNote( const note & _new_note, const bool _quant_pos )
{
@@ -270,6 +281,13 @@ note * pattern::rearrangeNote( const note * _note_to_proc,
void pattern::rearrangeAllNotes( void )
{
// sort notes by start time
qSort(m_notes.begin(), m_notes.end(), note::lessThan );
}
void pattern::clearNotes( void )
{
@@ -1034,7 +1052,7 @@ void patternView::mousePressEvent( QMouseEvent * _me )
}
else if( m_pat->m_frozenPattern != NULL &&
_me->button() == Qt::LeftButton &&
engine::getMainWindow()->isShiftPressed() == true )
_me->modifiers() & Qt::ShiftModifier )
{
QString s;
new stringPairDrag( "sampledata",