mirror of
https://github.com/LMMS/lmms.git
synced 2026-01-24 22:38:07 -05:00
made MIDI-port-menu work again
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@781 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
14
ChangeLog
14
ChangeLog
@@ -1,5 +1,19 @@
|
||||
2008-03-08 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* src/core/track.cpp:
|
||||
* include/track.h:
|
||||
fixed crash when removing TCO via context-menu
|
||||
|
||||
* include/instrument_track.h:
|
||||
* src/core/file_browser.cpp:
|
||||
made "Send to active instrument-track" work again
|
||||
|
||||
* include/instrument_midi_io_view.h:
|
||||
* include/instrument_midi_io.h:
|
||||
* src/widgets/instrument_midi_io_view.cpp:
|
||||
* src/core/instrument_midi_io.cpp:
|
||||
made MIDI-port-menu work again
|
||||
|
||||
* plugins/kicker/kicker.cpp:
|
||||
set track for knobs in order to make them automatable
|
||||
|
||||
|
||||
@@ -55,17 +55,22 @@ public:
|
||||
}
|
||||
|
||||
|
||||
signals:
|
||||
void readablePortsChanged( void );
|
||||
void writeablePortsChanged( void );
|
||||
|
||||
|
||||
public slots:
|
||||
void midiPortModeChanged( void );
|
||||
void updateMidiPortMode( void );
|
||||
|
||||
|
||||
protected slots:
|
||||
void inputChannelChanged( void );
|
||||
void outputChannelChanged( void );
|
||||
void defaultVelInChanged( void );
|
||||
void defaultVelOutChanged( void );
|
||||
void readablePortsChanged( void );
|
||||
void writeablePortsChanged( void );
|
||||
void updateInputChannel( void );
|
||||
void updateOutputChannel( void );
|
||||
void updateDefaultVelIn( void );
|
||||
void updateDefaultVelOut( void );
|
||||
void updateReadablePorts( void );
|
||||
void updateWriteablePorts( void );
|
||||
|
||||
void activatedReadablePort( const descriptiveMidiPort & _port );
|
||||
void activatedWriteablePort( const descriptiveMidiPort & _port );
|
||||
|
||||
@@ -52,6 +52,9 @@ protected slots:
|
||||
void activatedReadablePort( QAction * _item );
|
||||
void activatedWriteablePort( QAction * _item );
|
||||
|
||||
void updateReadablePortsMenu( void );
|
||||
void updateWriteablePortsMenu( void );
|
||||
|
||||
|
||||
private:
|
||||
virtual void modelChanged( void );
|
||||
|
||||
@@ -261,6 +261,16 @@ public:
|
||||
return( m_tabWidget );
|
||||
}
|
||||
|
||||
instrumentTrack * model( void )
|
||||
{
|
||||
return( castModel<instrumentTrack>() );
|
||||
}
|
||||
|
||||
const instrumentTrack * model( void ) const
|
||||
{
|
||||
return( castModel<instrumentTrack>() );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void textChanged( const QString & _new_name );
|
||||
|
||||
@@ -61,20 +61,20 @@ instrumentMidiIO::instrumentMidiIO( instrumentTrack * _instrument_track,
|
||||
m_defaultVelocityOutEnabledModel.setTrack( m_instrumentTrack );
|
||||
|
||||
connect( &m_inputChannelModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( inputChannelChanged() ) );
|
||||
this, SLOT( updateInputChannel() ) );
|
||||
connect( &m_outputChannelModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( outputChannelChanged() ) );
|
||||
this, SLOT( updateOutputChannel() ) );
|
||||
connect( &m_receiveEnabledModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( midiPortModeChanged() ) );
|
||||
this, SLOT( updateMidiPortMode() ) );
|
||||
connect( &m_defaultVelocityInEnabledModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( defaultVelInChanged() ) );
|
||||
this, SLOT( updateDefaultVelIn() ) );
|
||||
connect( &m_sendEnabledModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( midiPortModeChanged() ) );
|
||||
this, SLOT( updateMidiPortMode() ) );
|
||||
connect( &m_defaultVelocityOutEnabledModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( defaultVelOutChanged() ) );
|
||||
this, SLOT( updateDefaultVelOut() ) );
|
||||
|
||||
inputChannelChanged();
|
||||
outputChannelChanged();
|
||||
updateInputChannel();
|
||||
updateOutputChannel();
|
||||
|
||||
|
||||
const midiPort::modes m = m_midiPort->mode();
|
||||
@@ -88,12 +88,12 @@ instrumentMidiIO::instrumentMidiIO( instrumentTrack * _instrument_track,
|
||||
midiClient * mc = engine::getMixer()->getMIDIClient();
|
||||
if( mc->isRaw() == FALSE )
|
||||
{
|
||||
readablePortsChanged();
|
||||
writeablePortsChanged();
|
||||
updateReadablePorts();
|
||||
updateWriteablePorts();
|
||||
|
||||
// we want to get informed about port-changes!
|
||||
mc->connectRPChanged( this, SLOT( readablePortsChanged() ) );
|
||||
mc->connectWPChanged( this, SLOT( writeablePortsChanged() ) );
|
||||
mc->connectRPChanged( this, SLOT( updateReadablePorts() ) );
|
||||
mc->connectWPChanged( this, SLOT( updateWriteablePorts() ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ void instrumentMidiIO::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void instrumentMidiIO::inputChannelChanged( void )
|
||||
void instrumentMidiIO::updateInputChannel( void )
|
||||
{
|
||||
m_midiPort->setInputChannel( m_inputChannelModel.value() - 1 );
|
||||
engine::getSong()->setModified();
|
||||
@@ -210,7 +210,7 @@ void instrumentMidiIO::inputChannelChanged( void )
|
||||
|
||||
|
||||
|
||||
void instrumentMidiIO::outputChannelChanged( void )
|
||||
void instrumentMidiIO::updateOutputChannel( void )
|
||||
{
|
||||
m_midiPort->setOutputChannel( m_outputChannelModel.value() - 1 );
|
||||
engine::getSong()->setModified();
|
||||
@@ -219,7 +219,7 @@ void instrumentMidiIO::outputChannelChanged( void )
|
||||
|
||||
|
||||
|
||||
void instrumentMidiIO::defaultVelInChanged( void )
|
||||
void instrumentMidiIO::updateDefaultVelIn( void )
|
||||
{
|
||||
m_midiPort->enableDefaultVelocityForInEvents(
|
||||
m_defaultVelocityInEnabledModel.value() );
|
||||
@@ -228,7 +228,7 @@ void instrumentMidiIO::defaultVelInChanged( void )
|
||||
|
||||
|
||||
|
||||
void instrumentMidiIO::defaultVelOutChanged( void )
|
||||
void instrumentMidiIO::updateDefaultVelOut( void )
|
||||
{
|
||||
m_midiPort->enableDefaultVelocityForOutEvents(
|
||||
m_defaultVelocityOutEnabledModel.value() );
|
||||
@@ -237,7 +237,7 @@ void instrumentMidiIO::defaultVelOutChanged( void )
|
||||
|
||||
|
||||
|
||||
void instrumentMidiIO::midiPortModeChanged( void )
|
||||
void instrumentMidiIO::updateMidiPortMode( void )
|
||||
{
|
||||
// this small lookup-table makes everything easier
|
||||
static const midiPort::modes modeTable[2][2] =
|
||||
@@ -280,7 +280,7 @@ void instrumentMidiIO::midiPortModeChanged( void )
|
||||
|
||||
|
||||
|
||||
void instrumentMidiIO::readablePortsChanged( void )
|
||||
void instrumentMidiIO::updateReadablePorts( void )
|
||||
{
|
||||
// first save all selected ports
|
||||
QStringList selected_ports;
|
||||
@@ -302,13 +302,13 @@ void instrumentMidiIO::readablePortsChanged( void )
|
||||
m_readablePorts.push_back( qMakePair( *it,
|
||||
selected_ports.indexOf( *it ) != -1 ) );
|
||||
}
|
||||
emit dataChanged();
|
||||
emit readablePortsChanged();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void instrumentMidiIO::writeablePortsChanged( void )
|
||||
void instrumentMidiIO::updateWriteablePorts( void )
|
||||
{
|
||||
// first save all selected ports
|
||||
QStringList selected_ports;
|
||||
@@ -330,7 +330,7 @@ void instrumentMidiIO::writeablePortsChanged( void )
|
||||
m_writeablePorts.push_back( qMakePair( *it,
|
||||
selected_ports.indexOf( *it ) != -1 ) );
|
||||
}
|
||||
emit dataChanged();
|
||||
emit writeablePortsChanged();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -119,10 +119,6 @@ instrumentMidiIOView::instrumentMidiIOView( QWidget * _parent ) :
|
||||
connect( m_writeablePorts, SIGNAL( triggered( QAction * ) ),
|
||||
this, SLOT( activatedWriteablePort( QAction * ) ) );
|
||||
|
||||
// fill menus
|
||||
/* readablePortsChanged();
|
||||
writeablePortsChanged();*/
|
||||
|
||||
QToolButton * rp_btn = new QToolButton( m_setupTabWidget );
|
||||
rp_btn->setText( tr( "MIDI-devices to receive "
|
||||
"MIDI-events from" ) );
|
||||
@@ -162,6 +158,12 @@ void instrumentMidiIOView::modelChanged( void )
|
||||
m_sendCheckBox->setModel( &mio->m_sendEnabledModel );
|
||||
m_defaultVelocityOutCheckBox->setModel(
|
||||
&mio->m_defaultVelocityOutEnabledModel );
|
||||
connect( mio, SIGNAL( readablePortsChanged() ),
|
||||
this, SLOT( updateReadablePortsMenu() ) );
|
||||
connect( mio, SIGNAL( writeablePortsChanged() ),
|
||||
this, SLOT( updateWriteablePortsMenu() ) );
|
||||
updateReadablePortsMenu();
|
||||
updateWriteablePortsMenu();
|
||||
}
|
||||
|
||||
|
||||
@@ -200,6 +202,41 @@ void instrumentMidiIOView::activatedWriteablePort( QAction * _item )
|
||||
|
||||
|
||||
|
||||
|
||||
void instrumentMidiIOView::updateReadablePortsMenu( void )
|
||||
{
|
||||
instrumentMidiIO * mio = castModel<instrumentMidiIO>();
|
||||
m_readablePorts->clear();
|
||||
for( instrumentMidiIO::midiPortMap::const_iterator it =
|
||||
mio->m_readablePorts.begin();
|
||||
it != mio->m_readablePorts.end(); ++it )
|
||||
{
|
||||
QAction * a = m_readablePorts->addAction( it->first );
|
||||
a->setCheckable( TRUE );
|
||||
a->setChecked( it->second );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void instrumentMidiIOView::updateWriteablePortsMenu( void )
|
||||
{
|
||||
instrumentMidiIO * mio = castModel<instrumentMidiIO>();
|
||||
m_writeablePorts->clear();
|
||||
for( instrumentMidiIO::midiPortMap::const_iterator it =
|
||||
mio->m_writeablePorts.begin();
|
||||
it != mio->m_writeablePorts.end(); ++it )
|
||||
{
|
||||
QAction * a = m_writeablePorts->addAction( it->first );
|
||||
a->setCheckable( TRUE );
|
||||
a->setChecked( it->second );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#include "instrument_midi_io_view.moc"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user