fixed broken MIDI-output (when masking output events it didn't match against correct output MIDI channel)

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1558 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-09-06 22:00:12 +00:00
parent e61ea40120
commit 3972065e06
2 changed files with 10 additions and 8 deletions

View File

@@ -53,7 +53,8 @@ midiALSASeq::midiALSASeq( void ) :
probeDevice().toAscii().constData(),
SND_SEQ_OPEN_DUPLEX, 0 ) ) < 0 )
{
printf( "cannot open sequencer: %s\n", snd_strerror( err ) );
fprintf( stderr, "cannot open sequencer: %s\n",
snd_strerror( err ) );
return;
}
snd_seq_set_client_name( m_seqHandle, "LMMS" );
@@ -194,8 +195,8 @@ void midiALSASeq::processOutEvent( const midiEvent & _me,
break;
default:
printf( "ALSA-sequencer: unhandled output event %d\n",
(int) _me.m_type );
fprintf( stderr, "ALSA-sequencer: unhandled output "
"event %d\n", (int) _me.m_type );
return;
}
@@ -335,7 +336,7 @@ void midiALSASeq::subscribeReadablePort( midiPort * _port,
if( snd_seq_parse_address( m_seqHandle, &sender,
_dest.section( ' ', 0, 0 ).toAscii().constData() ) )
{
printf( "error parsing sender-address!!\n" );
fprintf( stderr, "error parsing sender-address!\n" );
return;
}
snd_seq_port_info_t * port_info;
@@ -373,7 +374,7 @@ void midiALSASeq::subscribeWriteablePort( midiPort * _port,
if( snd_seq_parse_address( m_seqHandle, &dest,
_dest.section( ' ', 0, 0 ).toAscii().constData() ) )
{
printf( "error parsing dest-address!!\n" );
fprintf( stderr, "error parsing dest-address!\n" );
return;
}
snd_seq_port_info_t * port_info;
@@ -520,7 +521,8 @@ void midiALSASeq::run( void )
break;
default:
printf( "ALSA-sequencer: unhandled input "
fprintf( stderr,
"ALSA-sequencer: unhandled input "
"event %d\n", ev->type );
break;
}

View File

@@ -153,10 +153,10 @@ void midiPort::processOutEvent( const midiEvent & _me, const midiTime & _time )
{
// mask event
if( outputEnabled() &&
( outputChannel()-1 == _me.m_channel && outputChannel() != 0 ) )
( outputChannel() == _me.m_channel && outputChannel() != 0 ) )
{
midiEvent ev = _me;
if( m_defaultVelocityOutEnabledModel.value() == TRUE &&
if( m_defaultVelocityOutEnabledModel.value() == true &&
_me.velocity() > 0 )
{
ev.velocity() = DefaultVolume;