Merge branch 'stable-1.2'

# Conflicts:
#	cmake/nsis/CMakeLists.txt
#	src/core/ProjectRenderer.cpp
#	src/tracks/Pattern.cpp
This commit is contained in:
Hyunjin Song
2018-10-29 16:20:58 +09:00
76 changed files with 989 additions and 3528 deletions

View File

@@ -95,10 +95,13 @@ tact_t BBTrackContainer::lengthOfBB( int _bb ) const
MidiTime max_length = MidiTime::ticksPerTact();
const TrackList & tl = tracks();
for( TrackList::const_iterator it = tl.begin(); it != tl.end(); ++it )
for (Track* t : tl)
{
max_length = qMax( max_length,
( *it )->getTCO( _bb )->length() );
// Don't create TCOs here if not exist
if (_bb < t->numOfTCOs())
{
max_length = qMax(max_length, t->getTCO( _bb )->length());
}
}
return max_length.nextFullTact();

View File

@@ -53,7 +53,7 @@ EffectChain::~EffectChain()
void EffectChain::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
_this.setAttribute( "enabled", m_enabledModel.value() );
m_enabledModel.saveSettings( _doc, _this, "enabled" );
_this.setAttribute( "numofeffects", m_effects.count() );
for( Effect* effect : m_effects)
@@ -80,7 +80,7 @@ void EffectChain::loadSettings( const QDomElement & _this )
// TODO This method should probably also lock the mixer
m_enabledModel.setValue( _this.attribute( "enabled" ).toInt() );
m_enabledModel.loadSettings( _this, "enabled" );
const int plugin_cnt = _this.attribute( "numofeffects" ).toInt();

View File

@@ -577,7 +577,8 @@ void Mixer::changeQuality( const struct qualitySettings & _qs )
void Mixer::setAudioDevice( AudioDevice * _dev )
void Mixer::setAudioDevice( AudioDevice * _dev,
bool startNow )
{
stopProcessing();
@@ -594,7 +595,7 @@ void Mixer::setAudioDevice( AudioDevice * _dev )
emit sampleRateChanged();
startProcessing();
if (startNow) {startProcessing();}
}
@@ -602,7 +603,8 @@ void Mixer::setAudioDevice( AudioDevice * _dev )
void Mixer::setAudioDevice( AudioDevice * _dev,
const struct qualitySettings & _qs,
bool _needs_fifo )
bool _needs_fifo,
bool startNow )
{
// don't delete the audio-device
stopProcessing();
@@ -623,7 +625,7 @@ void Mixer::setAudioDevice( AudioDevice * _dev,
emit qualitySettingsChanged();
emit sampleRateChanged();
startProcessing( _needs_fifo );
if (startNow) {startProcessing( _needs_fifo );}
}

View File

@@ -152,7 +152,7 @@ void ProjectRenderer::startProcessing()
// Have to do mixer stuff with GUI-thread affinity in order to
// make slots connected to sampleRateChanged()-signals being called immediately.
Engine::mixer()->setAudioDevice( m_fileDev,
m_qualitySettings, false );
m_qualitySettings, false, false );
start(
#ifndef LMMS_BUILD_WIN32
@@ -193,6 +193,9 @@ void ProjectRenderer::run()
tick_t endTick = exportEndpoints.second.getTicks();
tick_t lengthTicks = endTick - startTick;
// Now start processing
Engine::mixer()->startProcessing(false);
// Continually track and emit progress percentage to listeners.
while( exportPos.getTicks() < endTick &&
Engine::getSong()->isExporting() == true

View File

@@ -285,7 +285,6 @@ void SampleBuffer::update( bool _keep_settings )
else
{
fprintf( stderr, "%s\n", message.toUtf8().constData() );
exit( EXIT_FAILURE );
}
}
}

View File

@@ -346,9 +346,7 @@ void Song::processNextBuffer()
m_vstSyncController.setAbsolutePosition( ticks );
m_vstSyncController.setPlaybackJumped( true );
}
else if( m_playPos[m_playMode] == tl->loopEnd() - 1 )
{
emit updateSampleTracks();
}
}

View File

@@ -2125,8 +2125,9 @@ void Track::saveSettings( QDomDocument & doc, QDomElement & element )
}
element.setAttribute( "type", type() );
element.setAttribute( "name", name() );
element.setAttribute( "muted", isMuted() );
element.setAttribute( "solo", isSolo() );
m_mutedModel.saveSettings( doc, element, "muted" );
m_soloModel.saveSettings( doc, element, "solo" );
if( m_height >= MINIMAL_TRACK_HEIGHT )
{
element.setAttribute( "trackheight", m_height );
@@ -2178,8 +2179,8 @@ void Track::loadSettings( const QDomElement & element )
setName( element.hasAttribute( "name" ) ? element.attribute( "name" ) :
element.firstChild().toElement().attribute( "name" ) );
setMuted( element.attribute( "muted" ).toInt() );
setSolo( element.attribute( "solo" ).toInt() );
m_mutedModel.loadSettings( element, "muted" );
m_soloModel.loadSettings( element, "solo" );
if( m_simpleSerializingMode )
{
@@ -2212,8 +2213,9 @@ void Track::loadSettings( const QDomElement & element )
{
loadTrackSpecificSettings( node.toElement() );
}
else if(
!node.toElement().attribute( "metadata" ).toInt() )
else if( node.nodeName() != "muted"
&& node.nodeName() != "solo"
&& !node.toElement().attribute( "metadata" ).toInt() )
{
TrackContentObject * tco = createTCO(
MidiTime( 0 ) );

View File

@@ -804,7 +804,7 @@ int main( int argc, char * * argv )
) );
mb.setIcon( QMessageBox::Warning );
mb.setWindowIcon( embed::getIconPixmap( "icon" ) );
mb.setWindowIcon( embed::getIconPixmap( "icon_small" ) );
mb.setWindowFlags( Qt::WindowCloseButtonHint );
QPushButton * recover;

View File

@@ -266,7 +266,7 @@ MainWindow::~MainWindow()
void MainWindow::finalize()
{
resetWindowTitle();
setWindowIcon( embed::getIconPixmap( "icon" ) );
setWindowIcon( embed::getIconPixmap( "icon_small" ) );
// project-popup-menu
@@ -414,7 +414,7 @@ void MainWindow::finalize()
#if !(defined(LMMS_BUILD_APPLE) && (QT_VERSION < 0x050600))
help_menu->addSeparator();
#endif
help_menu->addAction( embed::getIconPixmap( "icon" ), tr( "About" ),
help_menu->addAction( embed::getIconPixmap( "icon_small" ), tr( "About" ),
this, SLOT( aboutLMMS() ) );
// create tool-buttons

View File

@@ -250,7 +250,25 @@ void BBTrackContainerView::dropEvent(QDropEvent* de)
DataFile dataFile( value.toUtf8() );
Track * t = Track::create( dataFile.content().firstChild().toElement(), model() );
t->deleteTCOs();
// Ensure BB TCOs exist
bool hasValidBBTCOs = false;
if (t->getTCOs().size() == m_bbtc->numOfBBs())
{
hasValidBBTCOs = true;
for (int i = 0; i < t->getTCOs().size(); ++i)
{
if (t->getTCOs()[i]->startPosition() != MidiTime(i, 0))
{
hasValidBBTCOs = false;
break;
}
}
}
if (!hasValidBBTCOs)
{
t->deleteTCOs();
t->createTCOsForBB(m_bbtc->numOfBBs() - 1);
}
m_bbtc->updateAfterTrackAdd();
de->accept();

View File

@@ -697,8 +697,7 @@ void PatternView::mousePressEvent( QMouseEvent * _me )
{
if( _me->button() == Qt::LeftButton &&
m_pat->m_patternType == Pattern::BeatPattern &&
( fixedTCOs() || pixelsPerTact() >= 96 ||
m_pat->m_steps != MidiTime::stepsPerTact() ) &&
( fixedTCOs() || pixelsPerTact() >= 96 ) &&
_me->y() > height() - s_stepBtnOff->height() )
// when mouse button is pressed in beat/bassline -mode
@@ -768,8 +767,7 @@ void PatternView::mouseDoubleClickEvent(QMouseEvent *_me)
void PatternView::wheelEvent( QWheelEvent * _we )
{
if( m_pat->m_patternType == Pattern::BeatPattern &&
( fixedTCOs() || pixelsPerTact() >= 96 ||
m_pat->m_steps != MidiTime::stepsPerTact() ) &&
( fixedTCOs() || pixelsPerTact() >= 96 ) &&
_we->y() > height() - s_stepBtnOff->height() )
{
// get the step number that was wheeled on and
@@ -1013,8 +1011,7 @@ void PatternView::paintEvent( QPaintEvent * )
}
// beat pattern paint event
else if( beatPattern && ( fixedTCOs() || pixelsPerTact >= 96
|| m_pat->m_steps != MidiTime::stepsPerTact() ) )
else if( beatPattern && ( fixedTCOs() || pixelsPerTact >= 96 ) )
{
QPixmap stepon0;
QPixmap stepon200;

View File

@@ -73,13 +73,16 @@ SampleTCO::SampleTCO( Track * _track ) :
connect( timeLine, SIGNAL( positionMarkerMoved() ), this, SLOT( playbackPositionChanged() ) );
}
//playbutton clicked or space key / on Export Song set isPlaying to false
connect( Engine::getSong(), SIGNAL( playbackStateChanged() ), this, SLOT( playbackPositionChanged() ) );
connect( Engine::getSong(), SIGNAL( playbackStateChanged() ),
this, SLOT( playbackPositionChanged() ), Qt::DirectConnection );
//care about loops
connect( Engine::getSong(), SIGNAL( updateSampleTracks() ), this, SLOT( playbackPositionChanged() ) );
connect( Engine::getSong(), SIGNAL( updateSampleTracks() ),
this, SLOT( playbackPositionChanged() ), Qt::DirectConnection );
//care about mute TCOs
connect( this, SIGNAL( dataChanged() ), this, SLOT( playbackPositionChanged() ) );
//care about mute track
connect( getTrack()->getMutedModel(), SIGNAL( dataChanged() ),this, SLOT( playbackPositionChanged() ) );
connect( getTrack()->getMutedModel(), SIGNAL( dataChanged() ),
this, SLOT( playbackPositionChanged() ), Qt::DirectConnection );
//care about TCO position
connect( this, SIGNAL( positionChanged() ), this, SLOT( updateTrackTcos() ) );