Merge branch 'master' into ed_refac

This commit is contained in:
Lukas W
2015-01-08 10:49:09 +01:00
23 changed files with 120 additions and 96 deletions

View File

@@ -441,23 +441,15 @@ void AutomationPattern::flipX( int length )
for( int i = 0; i <= numPoints; i++ )
{
tempValue = valueAt( ( iterate + i ).key() );
cleanObjects();
MidiTime newTime = MidiTime( length - ( iterate + i ).key() );
tempMap[newTime] = tempValue;
}
}
else
{
//for ( int i = 0; ( iterate + i ).key() < length ; i++ )
//{
// tempValue = valueAt( ( iterate + i ).key() );
//}
//putValue( MidiTime( length ) , tempValue, false);
//numPoints++;
for( int i = 0; i <= numPoints; i++ )
{
tempValue = valueAt( ( iterate + i ).key() );
cleanObjects();
MidiTime newTime;
if ( ( iterate + i ).key() <= length )

View File

@@ -248,10 +248,18 @@ bool DataFile::writeFile( const QString& filename )
// make sure the file has been written correctly
if( QFileInfo( outfile.fileName() ).size() > 0 )
{
// remove old backup file
QFile::remove( fullNameBak );
// move current file to backup file
QFile::rename( fullName, fullNameBak );
if( ConfigManager::inst()->value( "app", "disablebackup" ).toInt() )
{
// remove current file
QFile::remove( fullName );
}
else
{
// remove old backup file
QFile::remove( fullNameBak );
// move current file to backup file
QFile::rename( fullName, fullNameBak );
}
// move temporary file to current file
QFile::rename( fullNameTemp, fullName );

View File

@@ -221,7 +221,7 @@ bool EffectChain::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames, b
it = m_effects.end()-1;
printf( "numerical overflow after processing "
"plugin \"%s\"\n", ( *it )->
publicName().toUtf8().constData() );
descriptor()->name);
break;
}
}

View File

@@ -30,7 +30,7 @@
#include "Pattern.h"
#include "SampleBuffer.h"
#include "SampleTrack.h"
#include "debug.h"
SampleRecordHandle::SampleRecordHandle( SampleTCO* tco ) :
@@ -116,9 +116,9 @@ void SampleRecordHandle::createSampleBuffer( SampleBuffer** sampleBuf )
// make sure buffer is cleaned up properly at the end...
sampleFrame * data_ptr = data;
#ifdef LMMS_DEBUG
assert( data != NULL );
#endif
// now copy all buffers into big buffer
for( bufferList::const_iterator it = m_buffers.begin();
it != m_buffers.end(); ++it )

View File

@@ -237,9 +237,9 @@ int AudioDevice::convertToS16( const surroundSampleFrame * _ab,
void AudioDevice::clearS16Buffer( int_sample_t * _outbuf, const fpp_t _frames )
{
#ifdef LMMS_DEBUG
assert( _outbuf != NULL );
#endif
memset( _outbuf, 0, _frames * channels() * BYTES_PER_INT_SAMPLE );
}

View File

@@ -76,9 +76,9 @@ void AudioSampleRecorder::createSampleBuffer( SampleBuffer** sampleBuf )
// make sure buffer is cleaned up properly at the end...
sampleFrame * data_ptr = data;
#ifdef LMMS_DEBUG
assert( data != NULL );
#endif
// now copy all buffers into big buffer
for( BufferList::ConstIterator it = m_buffers.begin();
it != m_buffers.end(); ++it )

View File

@@ -259,11 +259,16 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
QLinearGradient lingrad( 0, 0, 0, height() );
QColor c;
if( !( m_pat->getTrack()->isMuted() || m_pat->isMuted() ) )
c = isSelected() ? QColor( 0, 0, 224 )
: styleColor;
c = styleColor;
else
c = QColor( 80,80,80 );
c = QColor( 80, 80, 80 );
if( isSelected() == true )
{
c = QColor( qMax( c.red() - 128, 0 ), qMax( c.green() - 128, 0 ), 255 );
}
lingrad.setColorAt( 1, c.darker( 300 ) );
lingrad.setColorAt( 0, c );

View File

@@ -73,9 +73,9 @@ inline void labelWidget( QWidget * _w, const QString & _txt )
f.setBold( true );
title->setFont( pointSize<12>( f ) );
#ifdef LMMS_DEBUG
assert( dynamic_cast<QBoxLayout *>( _w->layout() ) != NULL );
#endif
dynamic_cast<QBoxLayout *>( _w->layout() )->addSpacing( 5 );
dynamic_cast<QBoxLayout *>( _w->layout() )->addWidget( title );
dynamic_cast<QBoxLayout *>( _w->layout() )->addSpacing( 10 );
@@ -94,6 +94,8 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
m_displaydBV( ConfigManager::inst()->value( "app",
"displaydbv" ).toInt() ),
m_MMPZ( !ConfigManager::inst()->value( "app", "nommpz" ).toInt() ),
m_disableBackup( !ConfigManager::inst()->value( "app",
"disablebackup" ).toInt() ),
m_hqAudioDev( ConfigManager::inst()->value( "mixer",
"hqaudio" ).toInt() ),
m_workingDir( ConfigManager::inst()->workingDir() ),
@@ -300,6 +302,15 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
connect( disableAutoquit, SIGNAL( toggled( bool ) ),
this, SLOT( toggleDisableAutoquit( bool ) ) );
LedCheckBox * disableBackup = new LedCheckBox(
tr( "Create backup file when saving a project" ),
misc_tw );
labelNumber++;
disableBackup->move( XDelta, YDelta*labelNumber );
disableBackup->setChecked( m_disableBackup );
connect( disableBackup, SIGNAL( toggled( bool ) ),
this, SLOT( toggleDisableBackup( bool ) ) );
misc_tw->setFixedHeight( YDelta*labelNumber + HeaderSize );
@@ -806,6 +817,8 @@ void SetupDialog::accept()
QString::number( m_displaydBV ) );
ConfigManager::inst()->setValue( "app", "nommpz",
QString::number( !m_MMPZ ) );
ConfigManager::inst()->setValue( "app", "disablebackup",
QString::number( !m_disableBackup ) );
ConfigManager::inst()->setValue( "mixer", "hqaudio",
QString::number( m_hqAudioDev ) );
ConfigManager::inst()->setValue( "ui", "smoothscroll",
@@ -958,6 +971,14 @@ void SetupDialog::toggleMMPZ( bool _enabled )
void SetupDialog::toggleDisableBackup( bool _enabled )
{
m_disableBackup = _enabled;
}
void SetupDialog::toggleHQAudioDev( bool _enabled )
{
m_hqAudioDev = _enabled;

View File

@@ -1905,9 +1905,9 @@ void AutomationEditor::zoomingXChanged()
{
const QString & zfac = m_zoomingXModel.currentText();
m_ppt = zfac.left( zfac.length() - 1 ).toInt() * DEFAULT_PPT / 100;
#ifdef LMMS_DEBUG
assert( m_ppt > 0 );
#endif
m_timeLine->setPixelsPerTact( m_ppt );
update();
}

View File

@@ -3777,9 +3777,9 @@ void PianoRoll::zoomingChanged()
{
const QString & zfac = m_zoomingModel.currentText();
m_ppt = zfac.left( zfac.length() - 1 ).toInt() * DEFAULT_PR_PPT / 100;
#ifdef LMMS_DEBUG
assert( m_ppt > 0 );
#endif
m_timeLine->setPixelsPerTact( m_ppt );
update();

View File

@@ -216,7 +216,7 @@ void BBTCOView::paintEvent( QPaintEvent * )
{
QPainter p( this );
QColor col = m_bbTCO->m_useStyleColor
QColor col = m_bbTCO->m_useStyleColor
? p.pen().brush().color()
: m_bbTCO->colorObj();
@@ -224,10 +224,10 @@ void BBTCOView::paintEvent( QPaintEvent * )
{
col = QColor( 160, 160, 160 );
}
if( isSelected() == true )
{
col = QColor( qMax( col.red() - 128, 0 ),
qMax( col.green() - 128, 0 ), 255 );
col = QColor( qMax( col.red() - 128, 0 ), qMax( col.green() - 128, 0 ), 255 );
}
QLinearGradient lingrad( 0, 0, 0, height() );

View File

@@ -908,11 +908,15 @@ void PatternView::paintEvent( QPaintEvent * )
if(( m_pat->m_patternType != Pattern::BeatPattern ) &&
!( m_pat->getTrack()->isMuted() || m_pat->isMuted() ))
c = isSelected() ? QColor( 0, 0, 224 )
: styleColor;
c = styleColor;
else
c = QColor( 80, 80, 80 );
if( isSelected() == true )
{
c = QColor( qMax( c.red() - 128, 0 ), qMax( c.green() - 128, 0 ), 255 );
}
if( m_pat->m_patternType != Pattern::BeatPattern )
{
lingrad.setColorAt( 1, c.darker( 300 ) );

View File

@@ -341,9 +341,14 @@ void SampleTCOView::paintEvent( QPaintEvent * _pe )
QColor c;
if( !( m_tco->getTrack()->isMuted() || m_tco->isMuted() ) )
c = isSelected() ? QColor( 0, 0, 224 )
: styleColor;
else c = QColor( 80, 80, 80 );
c = styleColor;
else
c = QColor( 80, 80, 80 );
if( isSelected() == true )
{
c = QColor( qMax( c.red() - 128, 0 ), qMax( c.green() - 128, 0 ), 255 );
}
QLinearGradient grad( 0, 0, 0, height() );