Merge branch 'master' of github.com:LMMS/lmms

This commit is contained in:
Vesa
2014-11-25 21:24:21 +02:00
10 changed files with 65 additions and 24 deletions

View File

@@ -95,6 +95,11 @@ public:
static void saveWidgetState( QWidget * _w, QDomElement & _de );
static void restoreWidgetState( QWidget * _w, const QDomElement & _de );
void collectErrors( const QList<QString>* errors );
void collectError( const QString error );
void clearErrors();
void showErrors( const QString reason );
public slots:
void resetWindowTitle();
@@ -170,6 +175,7 @@ private:
QBasicTimer m_updateTimer;
QTimer m_autoSaveTimer;
QList<QString>* m_errors;
friend class engine;

View File

@@ -185,6 +185,7 @@ public:
protected:
// create a view for the model
virtual PluginView* instantiateView( QWidget* ) = 0;
void collectErrorForUI( QString err_msg );
private:

View File

@@ -135,10 +135,7 @@ void VstEffect::openPlugin( const QString & _plugin )
m_pluginMutex.unlock();
closePlugin();
delete tf;
QMessageBox::information( NULL,
VstPlugin::tr( "Failed loading VST plugin" ),
VstPlugin::tr( "The VST plugin %1 could not be loaded for some reason." ).arg( _plugin ),
QMessageBox::Ok );
collectErrorForUI( VstPlugin::tr( "The VST plugin %1 could not be loaded." ).arg( _plugin ) );
return;
}

View File

@@ -335,7 +335,8 @@ void sf2Instrument::openFile( const QString & _sf2File, bool updateTrackName )
}
else
{
// TODO: Couldn't load file!
collectErrorForUI( sf2Instrument::tr( "A soundfont %1 could not be loaded." ).arg( QFileInfo( _sf2File ).baseName() ) );
// TODO: Why is the filename missing when the file does not exist?
}
}
@@ -357,7 +358,7 @@ void sf2Instrument::openFile( const QString & _sf2File, bool updateTrackName )
if( updateTrackName || instrumentTrack()->displayName() == displayName() )
{
instrumentTrack()->setName( QFileInfo( _sf2File ).baseName() );
instrumentTrack()->setName( QFileInfo( _sf2File ).baseName() );
}
}

View File

@@ -262,15 +262,7 @@ void vestigeInstrument::loadFile( const QString & _file )
m_pluginMutex.unlock();
closePlugin();
delete tf;
QMessageBox::information( 0,
tr( "Failed loading VST-plugin" ),
tr( "The VST-plugin %1 could not "
"be loaded for some reason.\n"
"If it runs with other VST-"
"software under Linux, please "
"contact an LMMS-developer!"
).arg( m_pluginDLL ),
QMessageBox::Ok );
collectErrorForUI( VstPlugin::tr( "The VST plugin %1 could not be loaded." ).arg( m_pluginDLL ) );
return;
}

View File

@@ -34,6 +34,7 @@
#include "ConfigManager.h"
#include "DummyPlugin.h"
#include "AutomatableModel.h"
#include "MainWindow.h"
static PixmapLoader __dummy_loader;
@@ -124,6 +125,10 @@ Plugin * Plugin::instantiate( const QString & pluginName, Model * parent,
return inst;
}
void Plugin::collectErrorForUI( QString err_msg )
{
engine::mainWindow()->collectError( err_msg );
}

View File

@@ -883,6 +883,7 @@ void song::loadProject( const QString & _file_name )
m_loadingProject = true;
engine::projectJournal()->setJournalling( false );
engine::mainWindow()->clearErrors();
m_fileName = _file_name;
m_oldFileName = _file_name;
@@ -994,6 +995,8 @@ void song::loadProject( const QString & _file_name )
emit projectLoaded();
engine::mainWindow()->showErrors( tr( "The following errors occured while loading: " ) );
m_loadingProject = false;
m_modified = false;

View File

@@ -189,6 +189,7 @@ MainWindow::MainWindow() :
vbox->addWidget( w );
setCentralWidget( main_widget );
m_errors = new QList<QString>();
m_updateTimer.start( 1000 / 20, this ); // 20 fps
@@ -345,7 +346,7 @@ void MainWindow::finalize()
help_menu->addSeparator();
help_menu->addAction( embed::getIconPixmap( "icon" ), tr( "About" ),
this, SLOT( aboutLMMS() ) );
this, SLOT( aboutLMMS() ) );
// create tool-buttons
toolButton * project_new = new toolButton(
@@ -1159,4 +1160,40 @@ void MainWindow::autoSave()
void MainWindow::collectErrors(const QList<QString>* errors )
{
m_errors->append( *errors );
}
void MainWindow::collectError( const QString error )
{
m_errors->append( error );
}
void MainWindow::clearErrors()
{
m_errors->clear();
}
void MainWindow::showErrors( const QString message )
{
if ( m_errors->length() != 0 )
{ QString* errors = new QString();
for ( int i = 0 ; i < m_errors->length() ; i++ )
{
errors->append( m_errors->value( i ) + "\n" );
}
errors->prepend( "\n\n" );
errors->prepend( message );
QMessageBox::warning( NULL,
"LMMS Error report",
*errors,
QMessageBox::Ok );
}
}

View File

@@ -1385,7 +1385,6 @@ void PianoRoll::keyPressEvent( QKeyEvent* event )
if( event->modifiers() & Qt::ControlModifier )
{
event->accept();
m_selectButton->setChecked( true );
selectAll();
update();
}

View File

@@ -122,7 +122,7 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) :
connect( &m_pitchModel, SIGNAL( dataChanged() ), this, SLOT( updatePitch() ) );
connect( &m_pitchRangeModel, SIGNAL( dataChanged() ), this, SLOT( updatePitchRange() ) );
m_effectChannelModel.setRange( 0, engine::fxMixer()->numChannels()-1, 1);
m_effectChannelModel.setRange( 0, engine::fxMixer()->numChannels()-1, 1);
for( int i = 0; i < NumKeys; ++i )
{
@@ -312,11 +312,11 @@ void InstrumentTrack::processInEvent( const MidiEvent& event, const MidiTime& ti
}
}
if( event.controllerNumber() == MidiControllerAllSoundOff ||
event.controllerNumber() == MidiControllerAllNotesOff ||
event.controllerNumber() == MidiControllerOmniOn ||
event.controllerNumber() == MidiControllerOmniOff ||
event.controllerNumber() == MidiControllerMonoOn ||
event.controllerNumber() == MidiControllerPolyOn )
event.controllerNumber() == MidiControllerAllNotesOff ||
event.controllerNumber() == MidiControllerOmniOn ||
event.controllerNumber() == MidiControllerOmniOff ||
event.controllerNumber() == MidiControllerMonoOn ||
event.controllerNumber() == MidiControllerPolyOn )
{
silenceAllNotes();
}
@@ -795,8 +795,8 @@ Instrument * InstrumentTrack::loadInstrument( const QString & _plugin_name )
delete m_instrument;
m_instrument = Instrument::instantiate( _plugin_name, this );
unlock();
setName( m_instrument->displayName() );
emit instrumentChanged();
return m_instrument;