Merge master into ed_refac
This commit is contained in:
@@ -104,7 +104,6 @@ void FxChannel::incrementDeps()
|
||||
{
|
||||
m_queued = true;
|
||||
MixerWorkerThread::addJob( this );
|
||||
m_dependenciesMet = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +173,7 @@ void FxChannel::doProcessing()
|
||||
// only start fxchain when we have input...
|
||||
m_fxChain.startRunning();
|
||||
}
|
||||
|
||||
|
||||
m_stillRunning = m_fxChain.processAudioBuffer( m_buffer, fpp, m_hasInput );
|
||||
|
||||
m_peakLeft = qMax( m_peakLeft, Engine::mixer()->peakValueLeft( m_buffer, fpp ) * v );
|
||||
@@ -184,8 +183,8 @@ void FxChannel::doProcessing()
|
||||
{
|
||||
m_peakLeft = m_peakRight = 0.0f;
|
||||
}
|
||||
|
||||
// increment dependency counter of all receivers
|
||||
|
||||
// increment dependency counter of all receivers
|
||||
processed();
|
||||
}
|
||||
|
||||
@@ -430,7 +429,7 @@ FxRoute * FxMixer::createRoute( FxChannel * from, FxChannel * to, float amount )
|
||||
// add us to fxmixer's list
|
||||
Engine::fxMixer()->m_fxRoutes.append( route );
|
||||
m_sendsMutex.unlock();
|
||||
|
||||
|
||||
return route;
|
||||
}
|
||||
|
||||
@@ -613,6 +612,7 @@ void FxMixer::masterMix( sampleFrame * _buf )
|
||||
m_fxChannels[i]->m_queued = false;
|
||||
// also reset hasInput
|
||||
m_fxChannels[i]->m_hasInput = false;
|
||||
m_fxChannels[i]->m_dependenciesMet = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -688,7 +688,7 @@ void FxMixer::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
ch->m_sends[si]->amount()->saveSettings( _doc, sendsDom, "amount" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// make sure we have at least num channels
|
||||
void FxMixer::allocateChannelsTo(int num)
|
||||
|
||||
@@ -473,7 +473,7 @@ void Song::playBB()
|
||||
|
||||
|
||||
|
||||
void Song::playPattern( Pattern* patternToPlay, bool _loop )
|
||||
void Song::playPattern( const Pattern* patternToPlay, bool _loop )
|
||||
{
|
||||
if( isStopped() == false )
|
||||
{
|
||||
|
||||
@@ -2139,7 +2139,7 @@ TrackContentObject * Track::getTCO( int _tco_num )
|
||||
* \param _tco The TrackContentObject to search for.
|
||||
* \return its number in our array.
|
||||
*/
|
||||
int Track::getTCONum( TrackContentObject * _tco )
|
||||
int Track::getTCONum( const TrackContentObject * _tco )
|
||||
{
|
||||
// for( int i = 0; i < getTrackContentWidget()->numOfTCOs(); ++i )
|
||||
tcoVector::iterator it = qFind( m_trackContentObjects.begin(),
|
||||
|
||||
@@ -99,24 +99,24 @@ MainWindow::MainWindow() :
|
||||
ConfigManager::inst()->userProjectsDir() + "*" +
|
||||
ConfigManager::inst()->factoryProjectsDir(),
|
||||
"*.mmp *.mmpz *.xml *.mid *.flp",
|
||||
tr( "My projects" ),
|
||||
tr( "My Projects" ),
|
||||
embed::getIconPixmap( "project_file" ).transformed( QTransform().rotate( 90 ) ),
|
||||
splitter ) );
|
||||
sideBar->appendTab( new FileBrowser(
|
||||
ConfigManager::inst()->userSamplesDir() + "*" +
|
||||
ConfigManager::inst()->factorySamplesDir(),
|
||||
"*", tr( "My samples" ),
|
||||
"*", tr( "My Samples" ),
|
||||
embed::getIconPixmap( "sample_file" ).transformed( QTransform().rotate( 90 ) ),
|
||||
splitter ) );
|
||||
sideBar->appendTab( new FileBrowser(
|
||||
ConfigManager::inst()->userPresetsDir() + "*" +
|
||||
ConfigManager::inst()->factoryPresetsDir(),
|
||||
"*.xpf *.cs.xml *.xiz",
|
||||
tr( "My presets" ),
|
||||
tr( "My Presets" ),
|
||||
embed::getIconPixmap( "preset_file" ).transformed( QTransform().rotate( 90 ) ),
|
||||
splitter ) );
|
||||
sideBar->appendTab( new FileBrowser( QDir::homePath(), "*",
|
||||
tr( "My home" ),
|
||||
tr( "My Home" ),
|
||||
embed::getIconPixmap( "home" ).transformed( QTransform().rotate( 90 ) ),
|
||||
splitter ) );
|
||||
|
||||
@@ -132,11 +132,11 @@ MainWindow::MainWindow() :
|
||||
#endif
|
||||
sideBar->appendTab( new FileBrowser( root_paths.join( "*" ), "*",
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
tr( "My computer" ),
|
||||
tr( "My Computer" ),
|
||||
#elif defined(LMMS_BUILD_APPLE)
|
||||
tr( "Volumes" ),
|
||||
#else
|
||||
tr( "Root directory" ),
|
||||
tr( "Root Directory" ),
|
||||
#endif
|
||||
|
||||
embed::getIconPixmap( "computer" ).transformed( QTransform().rotate( 90 ) ),
|
||||
@@ -245,7 +245,7 @@ void MainWindow::finalize()
|
||||
|
||||
m_recentlyOpenedProjectsMenu = project_menu->addMenu(
|
||||
embed::getIconPixmap( "project_open_recent" ),
|
||||
tr( "&Recently opened projects" ) );
|
||||
tr( "&Recently Opened Projects" ) );
|
||||
connect( m_recentlyOpenedProjectsMenu, SIGNAL( aboutToShow() ),
|
||||
this, SLOT( updateRecentlyOpenedProjectsMenu() ) );
|
||||
connect( m_recentlyOpenedProjectsMenu, SIGNAL( triggered( QAction * ) ),
|
||||
@@ -257,7 +257,7 @@ void MainWindow::finalize()
|
||||
Qt::CTRL + Qt::Key_S );
|
||||
|
||||
project_menu->addAction( embed::getIconPixmap( "project_save" ),
|
||||
tr( "Save as new &version" ),
|
||||
tr( "Save as New &Version" ),
|
||||
this, SLOT( saveProjectAsNewVersion() ),
|
||||
Qt::CTRL + Qt::ALT + Qt::Key_S );
|
||||
project_menu->addAction( embed::getIconPixmap( "project_saveas" ),
|
||||
@@ -275,7 +275,7 @@ void MainWindow::finalize()
|
||||
SLOT( exportProject() ),
|
||||
Qt::CTRL + Qt::Key_E );
|
||||
project_menu->addAction( embed::getIconPixmap( "project_export" ),
|
||||
tr( "E&xport tracks..." ),
|
||||
tr( "E&xport Tracks..." ),
|
||||
Engine::getSong(),
|
||||
SLOT( exportProjectTracks() ),
|
||||
Qt::CTRL + Qt::SHIFT + Qt::Key_E );
|
||||
@@ -331,7 +331,7 @@ void MainWindow::finalize()
|
||||
if( true )
|
||||
{
|
||||
help_menu->addAction( embed::getIconPixmap( "help" ),
|
||||
tr( "Online help" ),
|
||||
tr( "Online Help" ),
|
||||
this, SLOT( browseHelp() ) );
|
||||
}
|
||||
else
|
||||
@@ -341,7 +341,7 @@ void MainWindow::finalize()
|
||||
this, SLOT( help() ) );
|
||||
}
|
||||
help_menu->addAction( embed::getIconPixmap( "whatsthis" ),
|
||||
tr( "What's this?" ),
|
||||
tr( "What's This?" ),
|
||||
this, SLOT( enterWhatsThisMode() ) );
|
||||
|
||||
help_menu->addSeparator();
|
||||
@@ -743,7 +743,7 @@ void MainWindow::openProject()
|
||||
{
|
||||
if( mayChangeProject() )
|
||||
{
|
||||
FileDialog ofd( this, tr( "Open project" ), "", tr( "LMMS (*.mmp *.mmpz)" ) );
|
||||
FileDialog ofd( this, tr( "Open Project" ), "", tr( "LMMS (*.mmp *.mmpz)" ) );
|
||||
|
||||
ofd.setDirectory( ConfigManager::inst()->userProjectsDir() );
|
||||
ofd.setFileMode( FileDialog::ExistingFiles );
|
||||
@@ -808,7 +808,7 @@ bool MainWindow::saveProject()
|
||||
|
||||
bool MainWindow::saveProjectAs()
|
||||
{
|
||||
VersionedSaveDialog sfd( this, tr( "Save project" ), "",
|
||||
VersionedSaveDialog sfd( this, tr( "Save Project" ), "",
|
||||
tr( "LMMS Project (*.mmpz *.mmp);;"
|
||||
"LMMS Project Template (*.mpt)" ) );
|
||||
QString f = Engine::getSong()->projectFileName();
|
||||
@@ -901,6 +901,7 @@ void MainWindow::toggleWindow( QWidget *window, bool forceShow )
|
||||
else
|
||||
{
|
||||
parent->hide();
|
||||
refocus();
|
||||
}
|
||||
|
||||
// Workaround for Qt Bug #260116
|
||||
@@ -913,6 +914,38 @@ void MainWindow::toggleWindow( QWidget *window, bool forceShow )
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* When an editor window with focus is toggled off, attempt to set focus
|
||||
* to the next visible editor window, or if none are visible, set focus
|
||||
* to the parent window.
|
||||
*/
|
||||
void MainWindow::refocus()
|
||||
{
|
||||
QList<QWidget*> editors;
|
||||
editors
|
||||
<< Engine::songEditor()->parentWidget()
|
||||
<< Engine::getBBEditor()->parentWidget()
|
||||
<< Engine::pianoRoll()->parentWidget()
|
||||
<< Engine::automationEditor()->parentWidget();
|
||||
|
||||
bool found = false;
|
||||
QList<QWidget*>::Iterator editor;
|
||||
for( editor = editors.begin(); editor != editors.end(); ++editor )
|
||||
{
|
||||
if( ! (*editor)->isHidden() ) {
|
||||
(*editor)->setFocus();
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( ! found )
|
||||
this->setFocus();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void MainWindow::toggleBBEditorWin( bool forceShow )
|
||||
{
|
||||
toggleWindow( Engine::getBBEditor(), forceShow );
|
||||
|
||||
@@ -1529,7 +1529,7 @@ void AutomationEditor::play()
|
||||
if( Engine::getSong()->playMode() != Song::Mode_PlayPattern )
|
||||
{
|
||||
Engine::getSong()->stop();
|
||||
Engine::getSong()->playPattern( (Pattern *) Engine::pianoRoll()->currentPattern() );
|
||||
Engine::getSong()->playPattern( Engine::pianoRoll()->currentPattern() );
|
||||
}
|
||||
else if( Engine::getSong()->isStopped() == false )
|
||||
{
|
||||
@@ -1537,7 +1537,7 @@ void AutomationEditor::play()
|
||||
}
|
||||
else
|
||||
{
|
||||
Engine::getSong()->playPattern( (Pattern *) Engine::pianoRoll()->currentPattern() );
|
||||
Engine::getSong()->playPattern( Engine::pianoRoll()->currentPattern() );
|
||||
}
|
||||
}
|
||||
else if( inBBEditor() )
|
||||
|
||||
Reference in New Issue
Block a user