diff --git a/ChangeLog b/ChangeLog index 75e0582f3..1946cdcf2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,31 @@ 2008-06-07 Tobias Doerffel + * src/tracks/instrument_track.cpp: + fixed MIDI-IO when using raw MIDI client + + * plugins/midi_import/midi_import.cpp: + * include/song.h: + added support for importing time-signature settings + + * Makefile.am: + * plugins/midi_import/midi_import.cpp: + * plugins/vestige/vestige.cpp: + * plugins/vst_base/lvsl_client.cpp: + * plugins/vst_base/lvsl_server.cpp: + * include/meter_model.h: + * include/midi.h: + * src/core/note_play_handle.cpp: + * src/core/piano.cpp: + * src/core/midi/midi_alsa_seq.cpp: + * src/core/midi/midi_client.cpp: + * src/core/midi/midi_controller.cpp: + * src/core/midi/midi_port.cpp: + * src/tracks/instrument_track.cpp: + * src/gui/controller_connection_dialog.cpp: + * src/gui/piano_roll.cpp: + made MidiEventTypes-enum conform coding-style, i.e. MidiNoteOn instead + of NOTE_ON etc. + * include/controller_connection_dialog.h: * include/instrument_midi_io_view.h: * include/instrument_track.h: diff --git a/Makefile.am b/Makefile.am index e086ddd6d..70cd28d74 100644 --- a/Makefile.am +++ b/Makefile.am @@ -260,7 +260,6 @@ lmms_SOURCES = \ $(srcdir)/src/core/midi/midi_alsa_seq.cpp \ $(srcdir)/src/core/midi/midi_client.cpp \ $(srcdir)/src/core/midi/midi_controller.cpp \ - $(srcdir)/src/core/midi/midi_mapper.cpp \ $(srcdir)/src/core/midi/midi_oss.cpp \ $(srcdir)/src/core/midi/midi_port.cpp \ $(srcdir)/src/gui/about_dialog.cpp \ @@ -435,7 +434,6 @@ lmms_SOURCES = \ $(srcdir)/include/sample_play_handle.h \ $(srcdir)/include/nstate_button.h \ $(srcdir)/include/midi_dummy.h \ - $(srcdir)/include/midi_mapper.h \ $(srcdir)/include/lcd_spinbox.h \ $(srcdir)/include/tooltip.h \ $(srcdir)/include/automatable_button.h \ diff --git a/include/meter_model.h b/include/meter_model.h index 32f66b10c..5c4182a99 100644 --- a/include/meter_model.h +++ b/include/meter_model.h @@ -31,6 +31,8 @@ class meterModel : public model { Q_OBJECT + mapPropertyFromModel(int,getNumerator,setNumerator,m_numeratorModel); + mapPropertyFromModel(int,getDenominator,setDenominator,m_denominatorModel); public: meterModel( ::model * _parent, track * _track ); ~meterModel(); @@ -42,16 +44,6 @@ public: void reset( void ); - inline int getNumerator( void ) const - { - return( m_numeratorModel.value() ); - } - - inline int getDenominator( void ) const - { - return( m_denominatorModel.value() ); - } - private: lcdSpinBoxModel m_numeratorModel; diff --git a/include/midi.h b/include/midi.h index b55216900..940243150 100644 --- a/include/midi.h +++ b/include/midi.h @@ -31,61 +31,61 @@ #include -enum midiEventTypes +enum MidiEventTypes { // messages - NOTE_OFF = 0x80, - NOTE_ON = 0x90, - KEY_PRESSURE = 0xA0, - CONTROL_CHANGE = 0xB0, - PROGRAM_CHANGE = 0xC0, - CHANNEL_PRESSURE = 0xD0, - PITCH_BEND = 0xE0, + MidiNoteOff = 0x80, + MidiNoteOn = 0x90, + MidiKeyPressure = 0xA0, + MidiControlChange = 0xB0, + MidiProgramChange = 0xC0, + MidiChannelPressure = 0xD0, + MidiPitchBend = 0xE0, // system exclusive - MIDI_SYSEX = 0xF0, + MidiSysEx= 0xF0, // system common - never in midi files - MIDI_TIME_CODE = 0xF1, - MIDI_SONG_POSITION = 0xF2, - MIDI_SONG_SELECT = 0xF3, - MIDI_TUNE_REQUEST = 0xF6, - MIDI_EOX = 0xF7, + MidiTimeCode= 0xF1, + MidiSongPosition = 0xF2, + MidiSongSelect = 0xF3, + MidiTuneRequest = 0xF6, + MidiEOX= 0xF7, // system real-time - never in midi files - MIDI_SYNC = 0xF8, - MIDI_TICK = 0xF9, - MIDI_START = 0xFA, - MIDI_CONTINUE = 0xFB, - MIDI_STOP = 0xFC, - MIDI_ACTIVE_SENSING = 0xFE, - MIDI_SYSTEM_RESET = 0xFF, + MidiSync = 0xF8, + MidiTick = 0xF9, + MidiStart = 0xFA, + MidiContinue = 0xFB, + MidiStop = 0xFC, + MidiActiveSensing = 0xFE, + MidiSystemReset = 0xFF, // meta event - for midi files only - MIDI_META_EVENT = 0xFF, + MidiMetaEvent = 0xFF, } ; -enum midiMetaEvents +enum MidiMetaEvents { - MIDI_COPYRIGHT = 0x02, - MIDI_TRACK_NAME = 0x03, - MIDI_INST_NAME = 0x04, - MIDI_LYRIC = 0x05, - MIDI_MARKER = 0x06, - MIDI_CUE_POINT = 0x07, - MIDI_PORT_NUMBER = 0x21, - MIDI_EOT = 0x2f, - MIDI_SET_TEMPO = 0x51, - MIDI_SMPTE_OFFSET = 0x54, - MIDI_TIME_SIGNATURE = 0x58, - MIDI_KEY_SIGNATURE = 0x59, - MIDI_SEQUENCER_EVENT = 0x7f + MidiCopyright = 0x02, + MidiTrackName = 0x03, + MidiInstName = 0x04, + MidiLyric = 0x05, + MidiMarker = 0x06, + MidiCuePoint = 0x07, + MidiPortNumber = 0x21, + MidiEOT = 0x2f, + MidiSetTempo = 0x51, + MidiSMPTEOffset = 0x54, + MidiTimeSignature = 0x58, + MidiKeySignature = 0x59, + MidiSequencerEvent = 0x7f } ; -const Uint8 MIDI_CHANNEL_COUNT = 16; -const Uint8 MIDI_CONTROLLER_COUNT = 128; +const int MidiChannelCount = 16; +const int MidiControllerCount = 128; struct midiEvent { - midiEvent( midiEventTypes _type = MIDI_ACTIVE_SENSING, + midiEvent( MidiEventTypes _type = MidiActiveSensing, Sint8 _channel = 0, Uint16 _param1 = 0, Uint16 _param2 = 0 ) : @@ -96,7 +96,7 @@ struct midiEvent m_data.m_param[0] = _param1; m_data.m_param[1] = _param2; } - midiEvent( midiEventTypes _type, const char * _sysex_data, + midiEvent( MidiEventTypes _type, const char * _sysex_data, int _data_len ) : m_type( _type ), m_channel( 0 ), @@ -125,7 +125,7 @@ struct midiEvent return( m_data.m_param[1] ); } - midiEventTypes m_type; // MIDI event type + MidiEventTypes m_type; // MIDI event type Sint8 m_channel; // MIDI channel union { diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 7995d40c2..5b288688b 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -262,11 +262,11 @@ void vestigeInstrument::playNote( notePlayHandle * _n, bool, sampleFrame * ) const int k = getInstrumentTrack()->masterKey( _n ); if( m_runningNotes[k] > 0 ) { - m_plugin->enqueueMidiEvent( midiEvent( NOTE_OFF, 0, + m_plugin->enqueueMidiEvent( midiEvent( MidiNoteOff, 0, k, 0 ), 0 ); } ++m_runningNotes[k]; - m_plugin->enqueueMidiEvent( midiEvent( NOTE_ON, 0, k, + m_plugin->enqueueMidiEvent( midiEvent( MidiNoteOn, 0, k, _n->getVolume() ), _n->offset() ); // notify when the handle stops, call to deleteNotePluginData _n->m_pluginData = _n; @@ -285,8 +285,8 @@ void vestigeInstrument::deleteNotePluginData( notePlayHandle * _n ) const int k = getInstrumentTrack()->masterKey( _n ); if( --m_runningNotes[k] <= 0 ) { - m_plugin->enqueueMidiEvent( midiEvent( NOTE_OFF, 0, k, - 0 ), 0 ); + m_plugin->enqueueMidiEvent( + midiEvent( MidiNoteOff, 0, k, 0 ), 0 ); } } m_pluginMutex.unlock(); @@ -488,8 +488,8 @@ void vestigeInstrumentView::noteOffAll( void ) { for( int key = 0; key < NumKeys; ++key ) { - m_vi->m_plugin->enqueueMidiEvent( midiEvent( NOTE_OFF, 0, - key, 0 ), 0 ); + m_vi->m_plugin->enqueueMidiEvent( + midiEvent( MidiNoteOff, 0, key, 0 ), 0 ); } } m_vi->m_pluginMutex.unlock(); diff --git a/plugins/vst_base/lvsl_client.cpp b/plugins/vst_base/lvsl_client.cpp index f327d0d9e..f0c911d0c 100644 --- a/plugins/vst_base/lvsl_client.cpp +++ b/plugins/vst_base/lvsl_client.cpp @@ -365,7 +365,7 @@ void remoteVSTPlugin::enqueueMidiEvent( const midiEvent & _event, lock(); writeValueS( VST_ENQUEUE_MIDI_EVENT ); - writeValueS( _event.m_type ); + writeValueS( _event.m_type ); writeValueS( _event.m_channel ); writeValueS( _event.m_data.m_param[0] ); writeValueS( _event.m_data.m_param[1] ); diff --git a/plugins/vst_base/lvsl_server.cpp b/plugins/vst_base/lvsl_server.cpp index ac5374d0f..5ae39fe45 100644 --- a/plugins/vst_base/lvsl_server.cpp +++ b/plugins/vst_base/lvsl_server.cpp @@ -515,7 +515,7 @@ void VSTPlugin::enqueueMidiEvent( const midiEvent & _event, event.midiData[0] = _event.m_type + _event.m_channel; switch( _event.m_type ) { - case PITCH_BEND: + case MidiPitchBend: event.midiData[1] = _event.m_data.m_param[0] & 0x7f; event.midiData[2] = _event.m_data.m_param[0] >> 7; break; @@ -1208,8 +1208,8 @@ int main( void ) case VST_ENQUEUE_MIDI_EVENT: { - midiEventTypes type = - readValue(); + MidiEventTypes type = + readValue(); Sint8 channel = readValue(); Uint16 param1 = readValue(); Uint16 param2 = readValue(); diff --git a/src/core/midi/midi_alsa_seq.cpp b/src/core/midi/midi_alsa_seq.cpp index 72ef86975..aad07faba 100644 --- a/src/core/midi/midi_alsa_seq.cpp +++ b/src/core/midi/midi_alsa_seq.cpp @@ -146,47 +146,47 @@ void midiALSASeq::processOutEvent( const midiEvent & _me, ev.queue = m_queueID; switch( _me.m_type ) { - case NOTE_ON: + case MidiNoteOn: snd_seq_ev_set_noteon( &ev, _port->outputChannel(), _me.key() + KeysPerOctave, _me.velocity() ); break; - case NOTE_OFF: + case MidiNoteOff: snd_seq_ev_set_noteoff( &ev, _port->outputChannel(), _me.key() + KeysPerOctave, _me.velocity() ); break; - case KEY_PRESSURE: + case MidiKeyPressure: snd_seq_ev_set_keypress( &ev, _port->outputChannel(), _me.key() + KeysPerOctave, _me.velocity() ); break; - case CONTROL_CHANGE: + case MidiControlChange: snd_seq_ev_set_controller( &ev, _port->outputChannel(), _me.m_data.m_param[0], _me.m_data.m_param[1] ); break; - case PROGRAM_CHANGE: + case MidiProgramChange: snd_seq_ev_set_pgmchange( &ev, _port->outputChannel(), _me.m_data.m_param[0] ); break; - case CHANNEL_PRESSURE: + case MidiChannelPressure: snd_seq_ev_set_chanpress( &ev, _port->outputChannel(), _me.m_data.m_param[0] ); break; - case PITCH_BEND: + case MidiPitchBend: snd_seq_ev_set_pitchbend( &ev, _port->outputChannel(), _me.m_data.m_param[0] - 8192 ); @@ -453,7 +453,7 @@ void midiALSASeq::run( void ) switch( ev->type ) { case SND_SEQ_EVENT_NOTEON: - dest->processInEvent( midiEvent( NOTE_ON, + dest->processInEvent( midiEvent( MidiNoteOn, ev->data.note.channel, ev->data.note.note - KeysPerOctave, @@ -463,7 +463,7 @@ void midiALSASeq::run( void ) break; case SND_SEQ_EVENT_NOTEOFF: - dest->processInEvent( midiEvent( NOTE_OFF, + dest->processInEvent( midiEvent( MidiNoteOff, ev->data.note.channel, ev->data.note.note - KeysPerOctave, @@ -473,7 +473,8 @@ void midiALSASeq::run( void ) break; case SND_SEQ_EVENT_KEYPRESS: - dest->processInEvent( midiEvent( KEY_PRESSURE, + dest->processInEvent( midiEvent( + MidiKeyPressure, ev->data.note.channel, ev->data.note.note - KeysPerOctave, @@ -482,7 +483,7 @@ void midiALSASeq::run( void ) break; case SND_SEQ_EVENT_CONTROLLER: - dest->processInEvent( midiEvent( CONTROL_CHANGE, + dest->processInEvent( midiEvent( MidiControlChange, ev->data.control.channel, ev->data.control.param, ev->data.control.value ), @@ -490,7 +491,8 @@ void midiALSASeq::run( void ) break; case SND_SEQ_EVENT_PGMCHANGE: - dest->processInEvent( midiEvent( PROGRAM_CHANGE, + dest->processInEvent( midiEvent( + MidiProgramChange, ev->data.control.channel, ev->data.control.param, ev->data.control.value ), @@ -499,7 +501,7 @@ void midiALSASeq::run( void ) case SND_SEQ_EVENT_CHANPRESS: dest->processInEvent( midiEvent( - CHANNEL_PRESSURE, + MidiChannelPressure, ev->data.control.channel, ev->data.control.param, ev->data.control.value ), @@ -507,7 +509,7 @@ void midiALSASeq::run( void ) break; case SND_SEQ_EVENT_PITCHBEND: - dest->processInEvent( midiEvent( PITCH_BEND, + dest->processInEvent( midiEvent( MidiPitchBend, ev->data.control.channel, ev->data.control.value + 8192, 0 ), midiTime() ); diff --git a/src/core/midi/midi_client.cpp b/src/core/midi/midi_client.cpp index 399505d75..0738872c4 100644 --- a/src/core/midi/midi_client.cpp +++ b/src/core/midi/midi_client.cpp @@ -147,9 +147,9 @@ void midiClientRaw::parseData( const Uint8 _c ) */ if( _c >= 0xF8 ) { - if( _c == MIDI_SYSTEM_RESET ) + if( _c == MidiSystemReset ) { - m_midiParseData.m_midiEvent.m_type = MIDI_SYSTEM_RESET; + m_midiParseData.m_midiEvent.m_type = MidiSystemReset; m_midiParseData.m_status = 0; processParsedEvent(); } @@ -232,29 +232,29 @@ void midiClientRaw::parseData( const Uint8 _c ) * We simply keep the status as it is, just reset the parameter counter. * If another status byte comes in, it will overwrite the status. */ - m_midiParseData.m_midiEvent.m_type = static_cast( + m_midiParseData.m_midiEvent.m_type = static_cast( m_midiParseData.m_status ); m_midiParseData.m_midiEvent.m_channel = m_midiParseData.m_channel; m_midiParseData.m_bytes = 0; /* Related to running status! */ switch( m_midiParseData.m_midiEvent.m_type ) { - case NOTE_OFF: - case NOTE_ON: - case KEY_PRESSURE: - case PROGRAM_CHANGE: - case CHANNEL_PRESSURE: + case MidiNoteOff: + case MidiNoteOn: + case MidiKeyPressure: + case MidiProgramChange: + case MidiChannelPressure: m_midiParseData.m_midiEvent.m_data.m_param[0] = m_midiParseData.m_buffer[0] - KeysPerOctave; m_midiParseData.m_midiEvent.m_data.m_param[1] = m_midiParseData.m_buffer[1]; - case CONTROL_CHANGE: + case MidiControlChange: m_midiParseData.m_midiEvent.m_data.m_param[0] = m_midiParseData.m_buffer[0] - KeysPerOctave; m_midiParseData.m_midiEvent.m_data.m_param[1] = m_midiParseData.m_buffer[1]; break; - case PITCH_BEND: + case MidiPitchBend: // Pitch-bend is transmitted with 14-bit precision. // Note: '|' does here the same as '+' (no common bits), // but might be faster @@ -293,9 +293,9 @@ void midiClientRaw::processOutEvent( const midiEvent & _me, // TODO: also evaluate _time and queue event if neccessary switch( _me.m_type ) { - case NOTE_ON: - case NOTE_OFF: - case KEY_PRESSURE: + case MidiNoteOn: + case MidiNoteOff: + case MidiKeyPressure: if( _port->outputChannel() >= 0 ) { sendByte( _me.m_type | _port->outputChannel() ); @@ -306,7 +306,7 @@ void midiClientRaw::processOutEvent( const midiEvent & _me, } else { - for( Sint8 i = 0; i < MIDI_CHANNEL_COUNT; ++i ) + for( Sint8 i = 0; i < MidiChannelCount; ++i ) { sendByte( _me.m_type | i ); sendByte( _me.m_data.m_param[0] + diff --git a/src/core/midi/midi_controller.cpp b/src/core/midi/midi_controller.cpp index 0f0eb58ec..6db715640 100644 --- a/src/core/midi/midi_controller.cpp +++ b/src/core/midi/midi_controller.cpp @@ -84,7 +84,7 @@ void midiController::processInEvent( const midiEvent & _me, const Uint8 * bytes; switch( _me.m_type ) { - case CONTROL_CHANGE: + case MidiControlChange: bytes = _me.m_data.m_bytes; controllerNum = _me.m_data.m_bytes[0] & 0x7F; diff --git a/src/core/midi/midi_port.cpp b/src/core/midi/midi_port.cpp index f75ecd82f..5b507ea71 100644 --- a/src/core/midi/midi_port.cpp +++ b/src/core/midi/midi_port.cpp @@ -42,10 +42,10 @@ midiPort::midiPort( const QString & _name, midiClient * _mc, m_midiEventProcessor( _mep ), m_name( _name ), m_mode( _mode ), - m_inputChannelModel( 0, 0, MIDI_CHANNEL_COUNT, this ), - m_outputChannelModel( 1, 1, MIDI_CHANNEL_COUNT, this ), - m_inputControllerModel( 0, 0, MIDI_CONTROLLER_COUNT, this ), - m_outputControllerModel( 0, 0, MIDI_CONTROLLER_COUNT, this ), + m_inputChannelModel( 0, 0, MidiChannelCount, this ), + m_outputChannelModel( 1, 1, MidiChannelCount, this ), + m_inputControllerModel( 0, 0, MidiControllerCount, this ), + m_outputControllerModel( 0, 0, MidiControllerCount, this ), m_readableModel( FALSE, this ), m_writableModel( FALSE, this ), m_defaultVelocityInEnabledModel( FALSE, this ), diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index d23dec639..c4b6d2118 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -47,11 +47,6 @@ inline notePlayHandle::baseDetuning::baseDetuning( - - - - - notePlayHandle::notePlayHandle( instrumentTrack * _it, const f_cnt_t _offset, const f_cnt_t _frames, @@ -104,7 +99,7 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it, setFrames( _frames ); // send MIDI-note-on-event - m_instrumentTrack->processOutEvent( midiEvent( NOTE_ON, + m_instrumentTrack->processOutEvent( midiEvent( MidiNoteOn, m_instrumentTrack->m_midiPort.outputChannel(), key(), tLimit( @@ -302,7 +297,7 @@ void notePlayHandle::noteOff( const f_cnt_t _s ) m_releaseFramesToDo = tMax( 0, // 10, m_instrumentTrack->m_soundShaping.releaseFrames() ); // send MIDI-note-off-event - m_instrumentTrack->processOutEvent( midiEvent( NOTE_OFF, + m_instrumentTrack->processOutEvent( midiEvent( MidiNoteOff, m_instrumentTrack->m_midiPort.outputChannel(), key(), 0 ), midiTime::fromFrames( m_framesBeforeRelease, diff --git a/src/core/piano.cpp b/src/core/piano.cpp index e883d7ac3..7bf3f26cb 100644 --- a/src/core/piano.cpp +++ b/src/core/piano.cpp @@ -114,7 +114,7 @@ void piano::setKeyState( int _key, bool _on ) void piano::handleKeyPress( int _key ) { - m_instrumentTrack->processInEvent( midiEvent( NOTE_ON, 0, _key, + m_instrumentTrack->processInEvent( midiEvent( MidiNoteOn, 0, _key, DefaultVolume ), midiTime() ); m_pressedKeys[_key] = TRUE; } @@ -125,7 +125,7 @@ void piano::handleKeyPress( int _key ) void piano::handleKeyRelease( int _key ) { - m_instrumentTrack->processInEvent( midiEvent( NOTE_OFF, 0, _key, 0 ), + m_instrumentTrack->processInEvent( midiEvent( MidiNoteOff, 0, _key, 0 ), midiTime() ); m_pressedKeys[_key] = FALSE; } @@ -351,7 +351,7 @@ void pianoView::mousePressEvent( QMouseEvent * _me ) } // set note on m_piano->m_instrumentTrack->processInEvent( - midiEvent( NOTE_ON, 0, key_num, + midiEvent( MidiNoteOn, 0, key_num, vol * 127 / 100 ), midiTime() ); m_piano->m_pressedKeys[key_num] = TRUE; @@ -379,7 +379,7 @@ void pianoView::mouseReleaseEvent( QMouseEvent * _me ) if( m_piano != NULL ) { m_piano->m_instrumentTrack->processInEvent( - midiEvent( NOTE_OFF, 0, m_lastKey, 0 ), + midiEvent( MidiNoteOff, 0, m_lastKey, 0 ), midiTime() ); m_piano->m_pressedKeys[m_lastKey] = FALSE; } @@ -429,7 +429,7 @@ void pianoView::mouseMoveEvent( QMouseEvent * _me ) if( m_lastKey != -1 ) { m_piano->m_instrumentTrack->processInEvent( - midiEvent( NOTE_OFF, 0, m_lastKey, 0 ), + midiEvent( MidiNoteOff, 0, m_lastKey, 0 ), midiTime() ); m_piano->m_pressedKeys[m_lastKey] = FALSE; m_lastKey = -1; @@ -439,7 +439,7 @@ void pianoView::mouseMoveEvent( QMouseEvent * _me ) if( _me->pos().y() > PIANO_BASE ) { m_piano->m_instrumentTrack->processInEvent( - midiEvent( NOTE_ON, 0, key_num, vol ), + midiEvent( MidiNoteOn, 0, key_num, vol ), midiTime() ); m_piano->m_pressedKeys[key_num] = TRUE; m_lastKey = key_num; @@ -456,7 +456,7 @@ void pianoView::mouseMoveEvent( QMouseEvent * _me ) else if( m_piano->m_pressedKeys[key_num] == TRUE ) { m_piano->m_instrumentTrack->processInEvent( - midiEvent( KEY_PRESSURE, 0, key_num, vol ), + midiEvent( MidiKeyPressure, 0, key_num, vol ), midiTime() ); } @@ -522,7 +522,7 @@ void pianoView::focusOutEvent( QFocusEvent * ) if( m_piano->m_pressedKeys[i] == TRUE ) { m_piano->m_instrumentTrack->processInEvent( - midiEvent( NOTE_OFF, 0, i, 0 ), + midiEvent( MidiNoteOff, 0, i, 0 ), midiTime() ); m_piano->m_pressedKeys[i] = FALSE; } diff --git a/src/gui/controller_connection_dialog.cpp b/src/gui/controller_connection_dialog.cpp index e60c37f82..65d1d8fae 100644 --- a/src/gui/controller_connection_dialog.cpp +++ b/src/gui/controller_connection_dialog.cpp @@ -67,7 +67,7 @@ public: virtual void processInEvent( const midiEvent & _me, const midiTime & _time, bool _lock ) { - if( _me.m_type == CONTROL_CHANGE && + if( _me.m_type == MidiControlChange && ( m_midiPort.inputChannel() == _me.m_channel + 1 || m_midiPort.inputChannel() == 0 ) ) { diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index 07e7821a0..7358c721c 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -1118,7 +1118,7 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me ) { m_lastKey = key_num; m_pattern->getInstrumentTrack()->processInEvent( - midiEvent( NOTE_ON, 0, key_num, + midiEvent( MidiNoteOn, 0, key_num, vol * 127 / 100 ), midiTime() ); } @@ -1135,13 +1135,13 @@ void pianoRoll::mouseReleaseEvent( QMouseEvent * _me ) if( m_action == CHANGE_NOTE_VOLUME && m_currentNote != NULL ) { m_pattern->getInstrumentTrack()->processInEvent( - midiEvent( NOTE_OFF, 0, + midiEvent( MidiNoteOff, 0, m_currentNote->key(), 0 ), midiTime() ); } else { m_pattern->getInstrumentTrack()->processInEvent( - midiEvent( NOTE_OFF, 0, m_lastKey, 0 ), + midiEvent( MidiNoteOff, 0, m_lastKey, 0 ), midiTime() ); } } @@ -1185,7 +1185,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) _me->buttons() & Qt::LeftButton ) { m_pattern->getInstrumentTrack()->processInEvent( - midiEvent( NOTE_OFF, 0, m_lastKey, 0 ), + midiEvent( MidiNoteOff, 0, m_lastKey, 0 ), midiTime() ); if( _me->buttons() & Qt::LeftButton && m_action != RESIZE_NOTE && @@ -1196,7 +1196,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) { m_lastKey = key_num; m_pattern->getInstrumentTrack()->processInEvent( - midiEvent( NOTE_ON, 0, key_num, + midiEvent( MidiNoteOn, 0, key_num, DefaultVolume * 127 / 100 ), midiTime() ); } @@ -1281,7 +1281,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) { if( m_currentNote != NULL ) { m_pattern->getInstrumentTrack()->processInEvent( - midiEvent( NOTE_OFF, 0, + midiEvent( MidiNoteOff, 0, m_currentNote->key(), 0 ), midiTime() ); } @@ -1289,7 +1289,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) m_lastKey = shortNote->key(); m_pattern->getInstrumentTrack()->processInEvent( - midiEvent( NOTE_ON, 0, + midiEvent( MidiNoteOn, 0, shortNote->key(), shortNote->getVolume() ), midiTime() ); } } @@ -1299,7 +1299,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) m_currentNote->setVolume( vol ); m_pattern->dataChanged(); m_pattern->getInstrumentTrack()->processInEvent( - midiEvent( KEY_PRESSURE, 0, m_lastKey, + midiEvent( MidiKeyPressure, 0, m_lastKey, vol * 127 / 100 ), midiTime() ); }