Merge https://github.com/LMMS/lmms into bugs_283_303
This commit is contained in:
@@ -859,13 +859,13 @@ QString SampleBuffer::openAudioFile() const
|
||||
// set filters
|
||||
QStringList types;
|
||||
types << tr( "All Audio-Files (*.wav *.ogg *.ds *.flac *.spx *.voc "
|
||||
"*.aif *.aiff *.au *.raw *.mp3)" )
|
||||
"*.aif *.aiff *.au *.raw)" )
|
||||
<< tr( "Wave-Files (*.wav)" )
|
||||
<< tr( "OGG-Files (*.ogg)" )
|
||||
<< tr( "DrumSynth-Files (*.ds)" )
|
||||
<< tr( "FLAC-Files (*.flac)" )
|
||||
<< tr( "SPEEX-Files (*.spx)" )
|
||||
<< tr( "MP3-Files (*.mp3)" )
|
||||
//<< tr( "MP3-Files (*.mp3)" )
|
||||
//<< tr( "MIDI-Files (*.mid)" )
|
||||
<< tr( "VOC-Files (*.voc)" )
|
||||
<< tr( "AIFF-Files (*.aif *.aiff)" )
|
||||
|
||||
@@ -309,6 +309,9 @@ void song::processNextBuffer()
|
||||
// offset
|
||||
ticks = ticks % ( max_tact * MidiTime::ticksPerTact() );
|
||||
|
||||
// wrap milli second counter
|
||||
m_elapsedMilliSeconds = ( ticks * 60 * 1000 / 48 ) / getTempo();
|
||||
|
||||
m_vstSyncController.setAbsolutePosition( ticks );
|
||||
}
|
||||
}
|
||||
@@ -551,6 +554,12 @@ void song::togglePause()
|
||||
|
||||
void song::stop()
|
||||
{
|
||||
// do not stop/reset things again if we're stopped already
|
||||
if( m_playMode == Mode_None )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
timeLine * tl = m_playPos[m_playMode].m_timeLine;
|
||||
m_playing = false;
|
||||
m_paused = false;
|
||||
|
||||
@@ -1911,6 +1911,8 @@ void AutomationEditor::play()
|
||||
engine::getSong()->togglePause();
|
||||
}
|
||||
}
|
||||
|
||||
setPauseIcon( engine::getSong()->isPlaying() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,6 +48,8 @@ AutomationPatternView::AutomationPatternView( AutomationPattern * _pattern,
|
||||
{
|
||||
connect( m_pat, SIGNAL( dataChanged() ),
|
||||
this, SLOT( update() ) );
|
||||
connect( engine::automationEditor(), SIGNAL( currentPatternChanged() ),
|
||||
this, SLOT( update() ) );
|
||||
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
setFixedHeight( parentWidget()->height() - 2 );
|
||||
@@ -228,11 +230,17 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
|
||||
lingrad.setColorAt( 0, c );
|
||||
|
||||
p.setBrush( lingrad );
|
||||
p.setPen( c.lighter( 160 ) );
|
||||
if( engine::automationEditor()->currentPattern() == m_pat )
|
||||
p.setPen( c.lighter( 160 ) );
|
||||
else
|
||||
p.setPen( c.lighter( 130 ) );
|
||||
p.drawRect( 1, 1, width()-3, height()-3 );
|
||||
|
||||
p.setBrush( QBrush() );
|
||||
p.setPen( c.darker( 300 ) );
|
||||
if( engine::automationEditor()->currentPattern() == m_pat )
|
||||
p.setPen( c.lighter( 130 ) );
|
||||
else
|
||||
p.setPen( c.darker( 300 ) );
|
||||
p.drawRect( 0, 0, width()-1, height()-1 );
|
||||
|
||||
const float ppt = fixedTCOs() ?
|
||||
@@ -302,16 +310,15 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
|
||||
|
||||
p.resetMatrix();
|
||||
p.setFont( pointSize<8>( p.font() ) );
|
||||
if( m_pat->isMuted() || m_pat->getTrack()->isMuted() )
|
||||
{
|
||||
p.setPen( QColor( 50, 50, 50 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
}
|
||||
|
||||
p.drawText( 2, p.fontMetrics().height() - 1, m_pat->name() );
|
||||
QColor text_color = ( m_pat->isMuted() || m_pat->getTrack()->isMuted() )
|
||||
? QColor( 30, 30, 30 )
|
||||
: QColor( 255, 255, 255 );
|
||||
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
p.drawText( 4, p.fontMetrics().height()+1, m_pat->name() );
|
||||
p.setPen( text_color );
|
||||
p.drawText( 3, p.fontMetrics().height(), m_pat->name() );
|
||||
|
||||
if( m_pat->isMuted() )
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -380,9 +380,13 @@ void SampleTCOView::paintEvent( QPaintEvent * _pe )
|
||||
if( m_tco->isRecord() )
|
||||
{
|
||||
p.setFont( pointSize<7>( p.font() ) );
|
||||
p.setPen( QColor( 224, 0, 0 ) );
|
||||
p.drawText( 9, p.fontMetrics().height() - 1, "Rec" );
|
||||
p.setBrush( QBrush( QColor( 224, 0, 0 ) ) );
|
||||
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
p.drawText( 10, p.fontMetrics().height()+1, "Rec" );
|
||||
p.setPen( QColor( 255, 60, 60 ) );
|
||||
p.drawText( 9, p.fontMetrics().height(), "Rec" );
|
||||
|
||||
p.setBrush( QBrush( QColor( 255, 60, 60 ) ) );
|
||||
p.drawEllipse( 4, 5, 4, 4 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,9 +212,12 @@ void bbTCOView::paintEvent( QPaintEvent * )
|
||||
p.drawRect( 0, 0, rect().right(), rect().bottom() );
|
||||
|
||||
p.setFont( pointSize<8>( p.font() ) );
|
||||
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
p.drawText( 4, p.fontMetrics().height()+1, m_bbTCO->name() );
|
||||
p.setPen( QColor( 255, 255, 255 ) );
|
||||
p.drawText( 3, p.fontMetrics().height(), m_bbTCO->name() );
|
||||
|
||||
|
||||
if( m_bbTCO->isMuted() )
|
||||
{
|
||||
p.drawPixmap( 3, p.fontMetrics().height() + 1,
|
||||
|
||||
@@ -605,6 +605,9 @@ patternView::patternView( pattern * _pattern, trackView * _parent ) :
|
||||
m_paintPixmap(),
|
||||
m_needsUpdate( true )
|
||||
{
|
||||
connect( engine::pianoRoll(), SIGNAL( currentPatternChanged() ),
|
||||
this, SLOT( update() ) );
|
||||
|
||||
if( s_stepBtnOn == NULL )
|
||||
{
|
||||
s_stepBtnOn = new QPixmap( embed::getIconPixmap(
|
||||
@@ -931,13 +934,19 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
}
|
||||
|
||||
p.setBrush( lingrad );
|
||||
p.setPen( c.darker( 300 ) );
|
||||
if( engine::pianoRoll()->currentPattern() == m_pat && m_pat->m_patternType != pattern::BeatPattern )
|
||||
p.setPen( c.lighter( 130 ) );
|
||||
else
|
||||
p.setPen( c.darker( 300 ) );
|
||||
p.drawRect( QRect( 0, 0, width() - 1, height() - 1 ) );
|
||||
|
||||
p.setBrush( QBrush() );
|
||||
if( m_pat->m_patternType != pattern::BeatPattern )
|
||||
{
|
||||
p.setPen( c.lighter( 130 ) );
|
||||
if( engine::pianoRoll()->currentPattern() == m_pat )
|
||||
p.setPen( c.lighter( 160 ) );
|
||||
else
|
||||
p.setPen( c.lighter( 130 ) );
|
||||
p.drawRect( QRect( 1, 1, width() - 3, height() - 3 ) );
|
||||
}
|
||||
|
||||
@@ -961,7 +970,7 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
}
|
||||
|
||||
// melody pattern paint event
|
||||
|
||||
|
||||
if( m_pat->m_patternType == pattern::MelodyPattern )
|
||||
{
|
||||
if( m_pat->m_notes.size() > 0 )
|
||||
@@ -970,12 +979,12 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
// display the area where most of the m_notes are
|
||||
// also calculate min/max tones so the tonal range can be
|
||||
// properly stretched accross the pattern vertically
|
||||
|
||||
|
||||
int central_key = 0;
|
||||
int max_key = 0;
|
||||
int min_key = 9999999;
|
||||
int total_notes = 0;
|
||||
|
||||
|
||||
for( NoteVector::Iterator it = m_pat->m_notes.begin();
|
||||
it != m_pat->m_notes.end(); ++it )
|
||||
{
|
||||
@@ -992,13 +1001,13 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
{
|
||||
central_key = central_key / total_notes;
|
||||
const int keyrange = qMax( qMax( max_key - central_key, central_key - min_key ), 1 );
|
||||
|
||||
|
||||
// debug code
|
||||
// qDebug( "keyrange: %d", keyrange );
|
||||
|
||||
// determine height of the pattern view, sans borders
|
||||
const int ht = height() - 1 - TCO_BORDER_WIDTH * 2;
|
||||
|
||||
|
||||
// determine maximum height value for drawing bounds checking
|
||||
const int max_ht = height() - 1 - TCO_BORDER_WIDTH;
|
||||
|
||||
@@ -1023,7 +1032,7 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
( float( central_key - ( *it )->key() ) / keyrange + 1.0f ) / 2;
|
||||
// multiply that by pattern height
|
||||
const int y_pos = static_cast<int>( TCO_BORDER_WIDTH + y_key * ht );
|
||||
|
||||
|
||||
// debug code
|
||||
// if( ( *it )->length() > 0 ) qDebug( "key %d, central_key %d, y_key %f, y_pos %d", ( *it )->key(), central_key, y_key, y_pos );
|
||||
|
||||
@@ -1039,7 +1048,7 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
const int x2 = x_base +
|
||||
static_cast<int>
|
||||
( ( ( *it )->pos() + ( *it )->length() ) * ( ppt / MidiTime::ticksPerTact() ) );
|
||||
|
||||
|
||||
// check bounds, draw line
|
||||
if( x1 < width() - TCO_BORDER_WIDTH )
|
||||
p.drawLine( x1, y_pos,
|
||||
@@ -1121,17 +1130,16 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
}
|
||||
|
||||
p.setFont( pointSize<8>( p.font() ) );
|
||||
if( m_pat->isMuted() || m_pat->getTrack()->isMuted() )
|
||||
{
|
||||
p.setPen( QColor( 30, 30, 30 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
}
|
||||
|
||||
QColor text_color = ( m_pat->isMuted() || m_pat->getTrack()->isMuted() )
|
||||
? QColor( 30, 30, 30 )
|
||||
: QColor( 255, 255, 255 );
|
||||
|
||||
if( m_pat->name() != m_pat->instrumentTrack()->name() )
|
||||
{
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
p.drawText( 4, p.fontMetrics().height()+1, m_pat->name() );
|
||||
p.setPen( text_color );
|
||||
p.drawText( 3, p.fontMetrics().height(), m_pat->name() );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user