Do not pass default time to processInEvent()
We introduced default parameters for MidiTime parameters so there's no need to construct them manually.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* MidiWinMM.cpp - WinMM MIDI client
|
||||
*
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -231,28 +231,21 @@ void MidiWinMM::handleInputEvent( HMIDIIN _hm, DWORD _ev )
|
||||
case MidiNoteOn:
|
||||
case MidiNoteOff:
|
||||
case MidiKeyPressure:
|
||||
( *it )->processInEvent(
|
||||
MidiEvent( cmdtype, chan, par1 - KeysPerOctave,
|
||||
par2 & 0xff, &_hm ), MidiTime() );
|
||||
( *it )->processInEvent( MidiEvent( cmdtype, chan, par1 - KeysPerOctave, par2 & 0xff, &_hm ) );
|
||||
break;
|
||||
|
||||
case MidiControlChange:
|
||||
case MidiProgramChange:
|
||||
case MidiChannelPressure:
|
||||
( *it )->processInEvent(
|
||||
MidiEvent( cmdtype, chan, par1, par2 & 0xff, &_hm ),
|
||||
MidiTime() );
|
||||
( *it )->processInEvent( MidiEvent( cmdtype, chan, par1, par2 & 0xff, &_hm ) );
|
||||
break;
|
||||
|
||||
case MidiPitchBend:
|
||||
( *it )->processInEvent(
|
||||
MidiEvent( cmdtype, chan, par1 + par2*128, 0, &_hm ),
|
||||
MidiTime() );
|
||||
( *it )->processInEvent( MidiEvent( cmdtype, chan, par1 + par2*128, 0, &_hm ) );
|
||||
break;
|
||||
|
||||
default:
|
||||
qWarning( "WinMM-MIDI: unhandled input "
|
||||
"event %d\n", cmdtype );
|
||||
qWarning( "WinMM-MIDI: unhandled input event %d\n", cmdtype );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -465,7 +465,7 @@ void PianoView::mousePressEvent( QMouseEvent * _me )
|
||||
velocity = MidiMaxVelocity;
|
||||
}
|
||||
// set note on
|
||||
m_piano->midiEventProcessor()->processInEvent( MidiEvent( MidiNoteOn, 0, key_num, velocity ), MidiTime() );
|
||||
m_piano->midiEventProcessor()->processInEvent( MidiEvent( MidiNoteOn, 0, key_num, velocity ) );
|
||||
m_piano->setKeyState( key_num, true );
|
||||
m_lastKey = key_num;
|
||||
|
||||
@@ -510,7 +510,7 @@ void PianoView::mouseReleaseEvent( QMouseEvent * )
|
||||
{
|
||||
if( m_piano != NULL )
|
||||
{
|
||||
m_piano->midiEventProcessor()->processInEvent( MidiEvent( MidiNoteOff, 0, m_lastKey, 0 ), MidiTime() );
|
||||
m_piano->midiEventProcessor()->processInEvent( MidiEvent( MidiNoteOff, 0, m_lastKey, 0 ) );
|
||||
m_piano->setKeyState( m_lastKey, false );
|
||||
}
|
||||
|
||||
@@ -571,7 +571,7 @@ void PianoView::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( m_lastKey != -1 )
|
||||
{
|
||||
m_piano->midiEventProcessor()->processInEvent( MidiEvent( MidiNoteOff, 0, m_lastKey, 0 ), MidiTime() );
|
||||
m_piano->midiEventProcessor()->processInEvent( MidiEvent( MidiNoteOff, 0, m_lastKey, 0 ) );
|
||||
m_piano->setKeyState( m_lastKey, false );
|
||||
m_lastKey = -1;
|
||||
}
|
||||
@@ -579,7 +579,7 @@ void PianoView::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->pos().y() > PIANO_BASE )
|
||||
{
|
||||
m_piano->midiEventProcessor()->processInEvent( MidiEvent( MidiNoteOn, 0, key_num, velocity ), MidiTime() );
|
||||
m_piano->midiEventProcessor()->processInEvent( MidiEvent( MidiNoteOn, 0, key_num, velocity ) );
|
||||
m_piano->setKeyState( key_num, true );
|
||||
m_lastKey = key_num;
|
||||
}
|
||||
@@ -593,7 +593,7 @@ void PianoView::mouseMoveEvent( QMouseEvent * _me )
|
||||
}
|
||||
else if( m_piano->isKeyPressed( key_num ) )
|
||||
{
|
||||
m_piano->midiEventProcessor()->processInEvent( MidiEvent( MidiKeyPressure, 0, key_num, velocity ), MidiTime() );
|
||||
m_piano->midiEventProcessor()->processInEvent( MidiEvent( MidiKeyPressure, 0, key_num, velocity ) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -690,7 +690,7 @@ void PianoView::focusOutEvent( QFocusEvent * )
|
||||
// hang otherwise
|
||||
for( int i = 0; i < NumKeys; ++i )
|
||||
{
|
||||
m_piano->midiEventProcessor()->processInEvent( MidiEvent( MidiNoteOff, 0, i, 0 ), MidiTime() );
|
||||
m_piano->midiEventProcessor()->processInEvent( MidiEvent( MidiNoteOff, 0, i, 0 ) );
|
||||
m_piano->setKeyState( i, false );
|
||||
}
|
||||
update();
|
||||
|
||||
@@ -2229,15 +2229,14 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
|
||||
if( m_noteEditMode == NoteEditVolume )
|
||||
{
|
||||
n->setVolume( vol );
|
||||
m_pattern->instrumentTrack()->processInEvent(
|
||||
MidiEvent( MidiKeyPressure, 0, n->key(), volumeToMidi( vol ) ), MidiTime() );
|
||||
m_pattern->instrumentTrack()->processInEvent( MidiEvent( MidiKeyPressure, 0, n->key(), volumeToMidi( vol ) ) );
|
||||
}
|
||||
else if( m_noteEditMode == NoteEditPanning )
|
||||
{
|
||||
n->setPanning( pan );
|
||||
MidiEvent evt( MidiMetaEvent, 0, n->key(), panningToMidi( pan ) );
|
||||
evt.setMetaEvent( MidiNotePanning );
|
||||
m_pattern->instrumentTrack()->processInEvent( evt, MidiTime() );
|
||||
m_pattern->instrumentTrack()->processInEvent( evt );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1127,9 +1127,7 @@ void InstrumentTrackView::toggleInstrumentWindow( bool _on )
|
||||
|
||||
void InstrumentTrackView::activityIndicatorPressed()
|
||||
{
|
||||
model()->processInEvent(
|
||||
MidiEvent( MidiNoteOn, 0, DefaultKey, MidiMaxVelocity ),
|
||||
MidiTime() );
|
||||
model()->processInEvent( MidiEvent( MidiNoteOn, 0, DefaultKey, MidiMaxVelocity ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -1137,8 +1135,7 @@ void InstrumentTrackView::activityIndicatorPressed()
|
||||
|
||||
void InstrumentTrackView::activityIndicatorReleased()
|
||||
{
|
||||
model()->processInEvent( MidiEvent( MidiNoteOff, 0, DefaultKey, 0 ),
|
||||
MidiTime() );
|
||||
model()->processInEvent( MidiEvent( MidiNoteOff, 0, DefaultKey, 0 ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -1149,8 +1146,7 @@ void InstrumentTrackView::midiInSelected()
|
||||
{
|
||||
if( model() )
|
||||
{
|
||||
model()->m_midiPort.setReadable(
|
||||
m_midiInputAction->isChecked() );
|
||||
model()->m_midiPort.setReadable( m_midiInputAction->isChecked() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1161,8 +1157,7 @@ void InstrumentTrackView::midiOutSelected()
|
||||
{
|
||||
if( model() )
|
||||
{
|
||||
model()->m_midiPort.setWritable(
|
||||
m_midiOutputAction->isChecked() );
|
||||
model()->m_midiPort.setWritable( m_midiOutputAction->isChecked() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user