Merge branch 'master' into ed_refac

Conflicts:
	include/AutomationEditor.h
	include/SongEditor.h
	plugins/delay/delaycontrols.cpp
	plugins/delay/delaycontrolsdialog.cpp
	src/gui/editors/AutomationEditor.cpp
	src/gui/editors/BBEditor.cpp
	src/gui/editors/PianoRoll.cpp
This commit is contained in:
Lukas W
2015-01-06 23:05:13 +01:00
124 changed files with 3809 additions and 694 deletions

View File

@@ -373,6 +373,119 @@ float *AutomationPattern::valuesAfter( const MidiTime & _time ) const
void AutomationPattern::flipY( int min, int max )
{
timeMap tempMap = m_timeMap;
timeMap::ConstIterator iterate = m_timeMap.lowerBound(0);
float tempValue = 0;
int numPoints = 0;
for( int i = 0; ( iterate + i + 1 ) != m_timeMap.end() && ( iterate + i ) != m_timeMap.end() ; i++)
{
numPoints++;
}
for( int i = 0; i <= numPoints; i++ )
{
if ( min < 0 )
{
tempValue = valueAt( ( iterate + i ).key() ) * -1;
putValue( MidiTime( (iterate + i).key() ) , tempValue, false);
}
else
{
tempValue = max - valueAt( ( iterate + i ).key() );
putValue( MidiTime( (iterate + i).key() ) , tempValue, false);
}
}
generateTangents();
emit dataChanged();
}
void AutomationPattern::flipX( int length )
{
timeMap tempMap;
timeMap::ConstIterator iterate = m_timeMap.lowerBound(0);
float tempValue = 0;
int numPoints = 0;
for( int i = 0; ( iterate + i + 1 ) != m_timeMap.end() && ( iterate + i ) != m_timeMap.end() ; i++)
{
numPoints++;
}
float realLength = ( iterate + numPoints ).key();
if ( length != -1 && length != realLength)
{
if ( realLength < length )
{
tempValue = valueAt( ( iterate + numPoints ).key() );
putValue( MidiTime( length ) , tempValue, false);
numPoints++;
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 )
{
newTime = MidiTime( length - ( iterate + i ).key() );
}
else
{
newTime = MidiTime( ( iterate + i ).key() );
}
tempMap[newTime] = tempValue;
}
}
}
else
{
for( int i = 0; i <= numPoints; i++ )
{
tempValue = valueAt( ( iterate + i ).key() );
cleanObjects();
MidiTime newTime = MidiTime( realLength - ( iterate + i ).key() );
tempMap[newTime] = tempValue;
}
}
m_timeMap.clear();
m_timeMap = tempMap;
generateTangents();
emit dataChanged();
}
void AutomationPattern::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
_this.setAttribute( "pos", startPosition() );
@@ -724,7 +837,7 @@ void AutomationPattern::generateTangents()
void AutomationPattern::generateTangents( timeMap::const_iterator it,
int numToGenerate )
{
if( m_timeMap.size() < 2 )
if( m_timeMap.size() < 2 && numToGenerate > 0 )
{
m_tangents[it.key()] = 0;
return;

View File

@@ -446,14 +446,14 @@ void EnvelopeAndLfoParameters::updateSampleVars()
{
sample_t * tmp = m_pahdEnv;
m_pahdEnv = new sample_t[m_pahdFrames];
delete tmp;
delete[] tmp;
m_pahdBufSize = m_pahdFrames;
}
if( m_rBufSize < m_rFrames )
{
sample_t * tmp = m_rEnv;
m_rEnv = new sample_t[m_rFrames];
delete tmp;
delete[] tmp;
m_rBufSize = m_rFrames;
}

View File

@@ -131,7 +131,7 @@ bool RemotePlugin::init( const QString &pluginExecutable,
m_failed = false;
}
QString exec = ConfigManager::inst()->pluginDir() +
QDir::separator() + pluginExecutable;
pluginExecutable;
QStringList args;
// swap in and out for bidirectional communication

View File

@@ -84,6 +84,7 @@ Song::Song() :
m_recording( false ),
m_exporting( false ),
m_exportLoop( false ),
m_renderBetweenMarkers( false ),
m_playing( false ),
m_paused( false ),
m_loadingProject( false ),
@@ -386,6 +387,25 @@ void Song::processNextBuffer()
}
}
bool Song::isExportDone() const
{
if ( m_renderBetweenMarkers )
{
return m_exporting == true &&
m_playPos[Mode_PlaySong].getTicks() >= m_playPos[Mode_PlaySong].m_timeLine->loopEnd().getTicks();
}
if( m_exportLoop)
{
return m_exporting == true &&
m_playPos[Mode_PlaySong].getTicks() >= length() * ticksPerTact();
}
else
{
return m_exporting == true &&
m_playPos[Mode_PlaySong].getTicks() >= ( length() + 1 ) * ticksPerTact();
}
}
@@ -619,6 +639,14 @@ void Song::stop()
void Song::startExport()
{
stop();
if(m_renderBetweenMarkers)
{
m_playPos[Mode_PlaySong].setTicks( m_playPos[Mode_PlaySong].m_timeLine->loopBegin().getTicks() );
}
else
{
m_playPos[Mode_PlaySong].setTicks( 0 );
}
playSong();
@@ -883,7 +911,10 @@ void Song::loadProject( const QString & _file_name )
m_loadingProject = true;
Engine::projectJournal()->setJournalling( false );
Engine::mainWindow()->clearErrors();
if( Engine::mainWindow() )
{
Engine::mainWindow()->clearErrors();
}
m_fileName = _file_name;
m_oldFileName = _file_name;
@@ -995,7 +1026,10 @@ void Song::loadProject( const QString & _file_name )
emit projectLoaded();
Engine::mainWindow()->showErrors( tr( "The following errors occured while loading: " ) );
if( Engine::mainWindow() )
{
Engine::mainWindow()->showErrors( tr( "The following errors occured while loading: " ) );
}
m_loadingProject = false;
m_modified = false;

View File

@@ -998,7 +998,9 @@ bool TrackContentObjectView::mouseMovedDistance( QMouseEvent * _me, int distance
*/
TrackContentWidget::TrackContentWidget( TrackView * _parent ) :
QWidget( _parent ),
m_trackView( _parent )
m_trackView( _parent ),
m_darkerColor( Qt::SolidPattern ),
m_lighterColor( Qt::SolidPattern )
{
setAcceptDrops( true );

View File

@@ -523,7 +523,7 @@ AudioAlsa::setupWidget::setupWidget( QWidget * _parent ) :
AudioAlsa::setupWidget::~setupWidget()
{
delete m_channels->model();
}

View File

@@ -464,6 +464,7 @@ AudioJack::setupWidget::setupWidget( QWidget * _parent ) :
AudioJack::setupWidget::~setupWidget()
{
delete m_channels->model();
}

View File

@@ -356,7 +356,7 @@ AudioOss::setupWidget::setupWidget( QWidget * _parent ) :
AudioOss::setupWidget::~setupWidget()
{
delete m_channels->model();
}

View File

@@ -33,8 +33,9 @@
#include "panning.h"
AudioPort::AudioPort( const QString & _name, bool _has_effect_chain,
FloatModel * volumeModel, FloatModel * panningModel ) :
AudioPort::AudioPort( const QString & _name, bool _has_effect_chain,
FloatModel * volumeModel, FloatModel * panningModel,
BoolModel * mutedModel ) :
m_bufferUsage( false ),
m_portBuffer( NULL ),
m_extOutputEnabled( false ),
@@ -42,7 +43,8 @@ AudioPort::AudioPort( const QString & _name, bool _has_effect_chain,
m_name( "unnamed port" ),
m_effects( _has_effect_chain ? new EffectChain( NULL ) : NULL ),
m_volumeModel( volumeModel ),
m_panningModel( panningModel )
m_panningModel( panningModel ),
m_mutedModel( mutedModel )
{
Engine::mixer()->addAudioPort( this );
setExtOutputEnabled( true );
@@ -102,6 +104,11 @@ bool AudioPort::processEffects()
void AudioPort::doProcessing()
{
if( m_mutedModel && m_mutedModel->value() )
{
return;
}
const fpp_t fpp = Engine::mixer()->framesPerPeriod();
m_portBuffer = BufferManager::acquire(); // get buffer for processing
@@ -118,11 +125,11 @@ void AudioPort::doProcessing()
m_bufferUsage = true;
MixHelpers::add( m_portBuffer, ph->buffer(), fpp );
}
ph->releaseBuffer(); // gets rid of playhandle's buffer and sets
ph->releaseBuffer(); // gets rid of playhandle's buffer and sets
// pointer to null, so if it doesn't get re-acquired we know to skip it next time
}
}
if( m_bufferUsage )
{
// handle volume and panning
@@ -131,7 +138,7 @@ void AudioPort::doProcessing()
{
ValueBuffer * volBuf = m_volumeModel->valueBuffer();
ValueBuffer * panBuf = m_panningModel->valueBuffer();
// both vol and pan have s.ex.data:
if( volBuf && panBuf )
{
@@ -143,7 +150,7 @@ void AudioPort::doProcessing()
m_portBuffer[f][1] *= ( p >= 0 ? 1.0f : 1.0f + p ) * v;
}
}
// only vol has s.ex.data:
else if( volBuf )
{
@@ -157,7 +164,7 @@ void AudioPort::doProcessing()
m_portBuffer[f][1] *= v * r;
}
}
// only pan has s.ex.data:
else if( panBuf )
{
@@ -169,7 +176,7 @@ void AudioPort::doProcessing()
m_portBuffer[f][1] *= ( p >= 0 ? 1.0f : 1.0f + p ) * v;
}
}
// neither has s.ex.data:
else
{
@@ -182,12 +189,12 @@ void AudioPort::doProcessing()
}
}
}
// has vol model only
else if( m_volumeModel )
{
ValueBuffer * volBuf = m_volumeModel->valueBuffer();
if( volBuf )
{
for( f_cnt_t f = 0; f < fpp; ++f )
@@ -210,7 +217,7 @@ void AudioPort::doProcessing()
}
// as of now there's no situation where we only have panning model but no volume model
// if we have neither, we don't have to do anything here - just pass the audio as is
// handle effects
const bool me = processEffects();
if( me || m_bufferUsage )
@@ -219,7 +226,7 @@ void AudioPort::doProcessing()
// TODO: improve the flow here - convert to pull model
m_bufferUsage = false;
}
BufferManager::release( m_portBuffer ); // release buffer, we don't need it anymore
}

View File

@@ -307,7 +307,7 @@ AudioPulseAudio::setupWidget::setupWidget( QWidget * _parent ) :
AudioPulseAudio::setupWidget::~setupWidget()
{
delete m_channels->model();
}

View File

@@ -145,6 +145,27 @@ void AutomationPatternView::toggleRecording()
}
void AutomationPatternView::flipY()
{
m_pat->flipY( m_pat->getMin(), m_pat->getMax() );
update();
}
void AutomationPatternView::flipX()
{
//m_pat->flipX( m_pat->length() );
m_pat->flipX( m_pat->TrackContentObject::length() );
update();
}
void AutomationPatternView::constructContextMenu( QMenu * _cm )
{
QAction * a = new QAction( embed::getIconPixmap( "automation" ),
@@ -168,6 +189,12 @@ void AutomationPatternView::constructContextMenu( QMenu * _cm )
_cm->addAction( embed::getIconPixmap( "record" ),
tr( "Set/clear record" ),
this, SLOT( toggleRecording() ) );
_cm->addAction( embed::getIconPixmap( "flip_y" ),
tr( "Flip Vertically (Visible)" ),
this, SLOT( flipY() ) );
_cm->addAction( embed::getIconPixmap( "flip_x" ),
tr( "Flip Horizontally (Visible)" ),
this, SLOT( flipX() ) );
if( !m_pat->m_objects.isEmpty() )
{
_cm->addSeparator();

View File

@@ -253,13 +253,17 @@ ProjectRenderer* ExportProjectDialog::prepRender()
static_cast<Mixer::qualitySettings::Interpolation>(interpolationCB->currentIndex()),
static_cast<Mixer::qualitySettings::Oversampling>(oversamplingCB->currentIndex()) );
const int samplerates[5] = { 44100, 48000, 88200, 96000, 192000 };
const int bitrates[6] = { 64, 128, 160, 192, 256, 320 };
ProjectRenderer::OutputSettings os = ProjectRenderer::OutputSettings(
samplerateCB->currentText().section(" ", 0, 0).toUInt(),
samplerates[ samplerateCB->currentIndex() ],
false,
bitrateCB->currentText().section(" ", 0, 0).toUInt(),
bitrates[ bitrateCB->currentIndex() ],
static_cast<ProjectRenderer::Depths>( depthCB->currentIndex() ) );
Engine::getSong()->setExportLoop( exportLoopCB->isChecked() );
Engine::getSong()->setRenderBetweenMarkers( renderMarkersCB->isChecked() );
ProjectRenderer* renderer = new ProjectRenderer( qs, os, m_ft, m_fileName );

View File

@@ -395,6 +395,40 @@ void FxMixerView::deleteChannel(int index)
void FxMixerView::deleteUnusedChannels()
{
TrackContainer::TrackList tracks;
tracks += Engine::getSong()->tracks();
tracks += Engine::getBBTrackContainer()->tracks();
// go through all FX Channels
for(int i = m_fxChannelViews.size()-1; i > 0; --i)
{
// check if an instrument references to the current channel
bool empty=true;
foreach( Track* t, tracks )
{
if( t->type() == Track::InstrumentTrack )
{
InstrumentTrack* inst = dynamic_cast<InstrumentTrack *>( t );
if( i == inst->effectChannelModel()->value(0) )
{
empty=false;
break;
}
}
}
FxChannel * ch = Engine::fxMixer()->effectChannel( i );
// delete channel if no references found
if( empty && ch->m_receives.isEmpty() )
{
deleteChannel( i );
}
}
}
void FxMixerView::moveChannelLeft(int index)
{
// can't move master or first channel left or last channel right
@@ -480,6 +514,21 @@ void FxMixerView::keyPressEvent(QKeyEvent * e)
void FxMixerView::closeEvent( QCloseEvent * _ce )
{
if( parentWidget() )
{
parentWidget()->hide();
}
else
{
hide();
}
_ce->ignore();
}
void FxMixerView::setCurrentFxLine( int _line )
{
if( _line >= 0 && _line < m_fxChannelViews.size() )

View File

@@ -664,14 +664,20 @@ void MainWindow::saveWidgetState( QWidget * _w, QDomElement & _de )
_w = _w->parentWidget();
}
_de.setAttribute( "x", _w->x() );
_de.setAttribute( "y", _w->y() );
_de.setAttribute( "visible", _w->isVisible() );
_de.setAttribute( "minimized", _w->isMinimized() );
_de.setAttribute( "maximized", _w->isMaximized() );
bool maxed = _w->isMaximized();
bool mined = _w->isMinimized();
if( mined || maxed ) { _w->showNormal(); }
_de.setAttribute( "x", _w->x() );
_de.setAttribute( "y", _w->y() );
_de.setAttribute( "width", _w->width() );
_de.setAttribute( "height", _w->height() );
if( maxed ) { _w->showMaximized(); }
if( mined ) { _w->showMinimized(); }
}
@@ -679,8 +685,8 @@ void MainWindow::saveWidgetState( QWidget * _w, QDomElement & _de )
void MainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de )
{
QRect r( qMax( 0, _de.attribute( "x" ).toInt() ),
qMax( 0, _de.attribute( "y" ).toInt() ),
QRect r( qMax( 1, _de.attribute( "x" ).toInt() ),
qMax( 1, _de.attribute( "y" ).toInt() ),
qMax( 100, _de.attribute( "width" ).toInt() ),
qMax( 100, _de.attribute( "height" ).toInt() ) );
if( _de.hasAttribute( "visible" ) && !r.isNull() )

View File

@@ -1,7 +1,8 @@
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ExportProjectDialog</class>
<widget class="QDialog" name="ExportProjectDialog" >
<property name="geometry" >
<widget class="QDialog" name="ExportProjectDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,118 +10,127 @@
<height>412</height>
</rect>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string>Export project</string>
</property>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout">
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<widget class="QGroupBox" name="outputGroupBox" >
<property name="title" >
<widget class="QGroupBox" name="outputGroupBox">
<property name="title">
<string>Output</string>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>-1</number>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin" >
<property name="leftMargin">
<number>9</number>
</property>
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<widget class="QLabel" name="label">
<property name="text">
<string>File format:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="fileFormatCB" />
<widget class="QComboBox" name="fileFormatCB"/>
</item>
<item>
<widget class="QLabel" name="label_3" >
<property name="text" >
<widget class="QLabel" name="label_3">
<property name="text">
<string>Samplerate:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="samplerateCB" >
<widget class="QComboBox" name="samplerateCB">
<item>
<property name="text" >
<property name="text">
<string>44100 Hz</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>48000 Hz</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>88200 Hz</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>96000 Hz</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>192000 Hz</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QWidget" native="1" name="bitrateWidget" >
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>-1</number>
<widget class="QWidget" name="bitrateWidget" native="true">
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin" >
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_5" >
<property name="text" >
<widget class="QLabel" name="label_5">
<property name="text">
<string>Bitrate:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="bitrateCB" >
<property name="currentIndex" >
<widget class="QComboBox" name="bitrateCB">
<property name="currentIndex">
<number>2</number>
</property>
<item>
<property name="text" >
<property name="text">
<string>64 KBit/s</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>128 KBit/s</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>160 KBit/s</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>192 KBit/s</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>256 KBit/s</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>320 KBit/s</string>
</property>
</item>
@@ -130,27 +140,36 @@
</widget>
</item>
<item>
<widget class="QWidget" native="1" name="depthWidget" >
<layout class="QVBoxLayout" >
<property name="margin" >
<widget class="QWidget" name="depthWidget" native="true">
<layout class="QVBoxLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_6" >
<property name="text" >
<widget class="QLabel" name="label_6">
<property name="text">
<string>Depth:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="depthCB" >
<widget class="QComboBox" name="depthCB">
<item>
<property name="text" >
<property name="text">
<string>16 Bit Integer</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>32 Bit Float</string>
</property>
</item>
@@ -161,13 +180,13 @@
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>10</height>
@@ -176,21 +195,21 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="label_7" >
<property name="text" >
<widget class="QLabel" name="label_7">
<property name="text">
<string>Please note that not all of the parameters above apply for all file formats.</string>
</property>
<property name="wordWrap" >
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>163</width>
<height>20</height>
@@ -202,71 +221,71 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="qualityGroupBox" >
<property name="title" >
<widget class="QGroupBox" name="qualityGroupBox">
<property name="title">
<string>Quality settings</string>
</property>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="label_2" >
<property name="text" >
<widget class="QLabel" name="label_2">
<property name="text">
<string>Interpolation:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="interpolationCB" >
<property name="currentIndex" >
<widget class="QComboBox" name="interpolationCB">
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text" >
<property name="text">
<string>Zero Order Hold</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>Sinc Fastest</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>Sinc Medium (recommended)</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>Sinc Best (very slow!)</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4" >
<property name="text" >
<widget class="QLabel" name="label_4">
<property name="text">
<string>Oversampling (use with care!):</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="oversamplingCB" >
<widget class="QComboBox" name="oversamplingCB">
<item>
<property name="text" >
<property name="text">
<string>1x (None)</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>2x</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>4x</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>8x</string>
</property>
</item>
@@ -279,12 +298,19 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="renderMarkersCB">
<property name="text">
<string>Export between loop markers</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
@@ -298,13 +324,13 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
@@ -313,15 +339,15 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="startButton" >
<property name="text" >
<widget class="QPushButton" name="startButton">
<property name="text">
<string>Start</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton" >
<property name="text" >
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
@@ -329,11 +355,11 @@
</layout>
</item>
<item>
<widget class="QProgressBar" name="progressBar" >
<property name="enabled" >
<widget class="QProgressBar" name="progressBar">
<property name="enabled">
<bool>false</bool>
</property>
<property name="value" >
<property name="value">
<number>0</number>
</property>
</widget>
@@ -348,11 +374,11 @@
<receiver>ExportProjectDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>357</x>
<y>293</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>202</x>
<y>175</y>
</hint>

View File

@@ -69,6 +69,8 @@ QPixmap * AutomationEditor::s_toolDraw = NULL;
QPixmap * AutomationEditor::s_toolErase = NULL;
QPixmap * AutomationEditor::s_toolSelect = NULL;
QPixmap * AutomationEditor::s_toolMove = NULL;
QPixmap * AutomationEditor::s_toolYFlip = NULL;
QPixmap * AutomationEditor::s_toolXFlip = NULL;
@@ -98,9 +100,9 @@ AutomationEditor::AutomationEditor() :
m_editMode( DRAW ),
m_scrollBack( false ),
m_gridColor( 0,0,0 ),
m_graphColor(),
m_graphColor( Qt::SolidPattern ),
m_vertexColor( 0,0,0 ),
m_scaleColor()
m_scaleColor( Qt::SolidPattern )
{
connect( this, SIGNAL( currentPatternChanged() ),
this, SLOT( updateAfterPatternChange() ),
@@ -118,6 +120,16 @@ AutomationEditor::AutomationEditor() :
{
m_quantizeModel.addItem( "1/" + QString::number( 1 << i ) );
}
if( s_toolYFlip == NULL )
{
s_toolYFlip = new QPixmap( embed::getIconPixmap(
"flip_y" ) );
}
if( s_toolXFlip == NULL )
{
s_toolXFlip = new QPixmap( embed::getIconPixmap(
"flip_x" ) );
}
connect(&m_quantizeModel, SIGNAL(dataChanged()), this, SLOT(setQuantization()));
m_quantizeModel.setValue( m_quantizeModel.findText( "1/16" ) );
@@ -191,10 +203,20 @@ AutomationEditor::~AutomationEditor()
void AutomationEditor::setCurrentPattern(AutomationPattern * new_pattern )
{
if (m_pattern)
{
m_pattern->disconnect(this);
}
m_patternMutex.lock();
m_pattern = new_pattern;
m_patternMutex.unlock();
if (m_pattern != nullptr)
{
connect(m_pattern, SIGNAL(dataChanged()), this, SLOT(update()));
}
emit currentPatternChanged();
}
@@ -1622,6 +1644,22 @@ void AutomationEditor::setEditMode(AutomationEditor::EditModes mode)
void AutomationEditor::flipYButtonPressed()
{
m_pattern->flipY( m_minLevel, m_maxLevel );
}
void AutomationEditor::flipXButtonPressed()
{
m_pattern->flipX();
}
void AutomationEditor::setEditMode(int mode)
{
setEditMode((AutomationEditor::EditModes) mode);
@@ -1998,6 +2036,23 @@ AutomationEditorWindow::AutomationEditorWindow() :
QAction* eraseAction = editModeGroup->addAction(embed::getIconPixmap("edit_erase"), tr("Erase mode (Shift+E)"));
eraseAction->setShortcut(Qt::SHIFT | Qt::Key_E);
m_flipYButton = new ToolButton( embed::getIconPixmap( "flip_y" ),
tr( "Flip Vertically" ),
m_editor, SLOT( flipYButtonPressed() ),
m_toolBar );
m_flipXButton = new ToolButton( embed::getIconPixmap( "flip_x" ),
tr( "Flip Horizontally" ),
m_editor, SLOT( flipXButtonPressed() ),
m_toolBar );
m_flipYButton->setWhatsThis(
tr( "Click here and the pattern will be inverted."
"The points are flipped in the y direction. " ) );
m_flipXButton->setWhatsThis(
tr( "Click here and the pattern will be reversed. "
"The points are flipped in the x direction." ) );
// TODO: m_selectButton and m_moveButton are broken.
// m_selectButton = new QAction(embed::getIconPixmap("edit_select"), tr("Select mode (Shift+S)"), editModeGroup);
// m_moveButton = new QAction(embed::getIconPixmap("edit_move"), tr("Move selection mode (Shift+M)"), editModeGroup);
@@ -2153,6 +2208,8 @@ AutomationEditorWindow::AutomationEditorWindow() :
m_toolBar->addAction(eraseAction);
// m_toolBar->addAction(m_selectButton);
// m_toolBar->addAction(m_moveButton);
m_toolBar->addWidget(m_flipXButton);
m_toolBar->addWidget(m_flipYButton);
m_toolBar->addSeparator();
m_toolBar->addAction(m_discreteAction);
m_toolBar->addAction(m_linearAction);

View File

@@ -249,3 +249,17 @@ void BBTrackContainerView::updatePosition()
//realignTracks();
emit positionChanged( m_currentPosition );
}
void BBEditor::closeEvent( QCloseEvent * _ce )
{
if( parentWidget() )
{
parentWidget()->hide();
}
else
{
hide();
}
_ce->ignore();
}

View File

@@ -288,7 +288,7 @@ PianoRoll::PianoRoll() :
s_toolOpen = new QPixmap( embed::getIconPixmap(
"automation" ) );
}
// init text-float
if( s_textFloat == NULL )
{
@@ -658,47 +658,29 @@ inline void PianoRoll::drawNoteRect(QPainter & p, int x, int y,
{
//step note
col.setRgb( 0, 255, 0 );
p.fillRect( x, y, width, KEY_LINE_HEIGHT - 2, col );
}
else if( n->selected() )
{
col.setRgb( 0x00, 0x40, 0xC0 );
p.fillRect( x, y, width, KEY_LINE_HEIGHT - 2, col );
}
else
{
// adjust note to make it a bit faded if it has a lower volume
// in stereo using gradients
QColor lcol = QColor::fromHsv( col.hue(), col.saturation(),
volVal * leftPercent );
QColor rcol = QColor::fromHsv( col.hue(), col.saturation(),
volVal * rightPercent );
col = QColor::fromHsv( col.hue(), col.saturation(), volVal );
QLinearGradient gradient( x, y, x+width,
y+KEY_LINE_HEIGHT );
gradient.setColorAt( 0, lcol );
gradient.setColorAt( 1, rcol );
p.setBrush( gradient );
p.setPen( Qt::NoPen );
p.drawRect( x, y, width, KEY_LINE_HEIGHT-1 );
}
// hilighting lines around the note
p.setPen( Qt::SolidLine );
p.setBrush( Qt::NoBrush );
// adjust note to make it a bit faded if it has a lower volume
// in stereo using gradients
QColor lcol = QColor::fromHsv( col.hue(), col.saturation(),
volVal * leftPercent );
QColor rcol = QColor::fromHsv( col.hue(), col.saturation(),
volVal * rightPercent );
col = QColor::fromHsv( col.hue(), col.saturation(), volVal );
col = QColor( noteCol );
QLinearGradient gradient( x, y, x+width,
y+KEY_LINE_HEIGHT );
gradient.setColorAt( 0, lcol );
gradient.setColorAt( 1, rcol );
p.setBrush( gradient );
p.setPen( QColor::fromHsv( col.hue(), col.saturation(),
qMin<float>( 255, volVal*1.7f ) ) );
p.drawLine( x, y, x + width, y );
p.drawLine( x, y, x, y + KEY_LINE_HEIGHT - 2 );
col = QColor( noteCol );
p.setPen( QColor::fromHsv( col.hue(), col.saturation(), volVal/1.7 ) );
p.drawLine( x + width, y, x + width, y + KEY_LINE_HEIGHT - 2 );
p.drawLine( x, y + KEY_LINE_HEIGHT - 2, x + width,
y + KEY_LINE_HEIGHT - 2 );
p.setRenderHint(QPainter::Antialiasing);
p.drawRoundedRect( x, y, width, KEY_LINE_HEIGHT-1, 5, 2 );
// that little tab thing on the end hinting at the user
// to resize the note
@@ -1090,10 +1072,13 @@ void PianoRoll::keyPressEvent(QKeyEvent* ke )
}
case Qt::Key_Control:
m_ctrlMode = m_editMode;
m_editMode = ModeSelect;
QApplication::changeOverrideCursor( Qt::ArrowCursor );
ke->accept();
if ( isActiveWindow() )
{
m_ctrlMode = m_editMode;
m_editMode = ModeSelect;
QApplication::changeOverrideCursor( Qt::ArrowCursor );
ke->accept();
}
break;
default:
break;
@@ -1208,7 +1193,7 @@ inline int PianoRoll::keyAreaBottom() const
void PianoRoll::mousePressEvent(QMouseEvent * me )
{
m_startedWithShift = me->modifiers() & Qt::ShiftModifier;
if( hasValidPattern() == false )
{
return;
@@ -1610,11 +1595,11 @@ void PianoRoll::mouseDoubleClickEvent(QMouseEvent * me )
const int ticks_end = ( x+pixel_range/2 ) *
MidiTime::ticksPerTact() / m_ppt + m_currentPosition;
const int ticks_middle = x * MidiTime::ticksPerTact() / m_ppt + m_currentPosition;
// get note-vector of current pattern
NoteVector notes;
NoteVector notes;
notes += m_pattern->notes();
// go through notes to figure out which one we want to change
NoteVector nv;
foreach( Note * i, notes )
@@ -1646,7 +1631,7 @@ void PianoRoll::mouseDoubleClickEvent(QMouseEvent * me )
{
if( ( *it )->pos().getTicks() != closest->pos().getTicks() )
{
it = nv.erase( it );
it = nv.erase( it );
}
else
{
@@ -1996,7 +1981,7 @@ void PianoRoll::mouseMoveEvent( QMouseEvent * me )
// if middle-click, set to defaults
volume_t vol;
panning_t pan;
if( me->buttons() & Qt::LeftButton )
{
vol = tLimit<int>( MinVolume +
@@ -2015,7 +2000,7 @@ void PianoRoll::mouseMoveEvent( QMouseEvent * me )
vol = DefaultVolume;
pan = DefaultPanning;
}
if( m_noteEditMode == NoteEditVolume )
{
m_lastNoteVolume = vol;
@@ -2103,7 +2088,7 @@ void PianoRoll::mouseMoveEvent( QMouseEvent * me )
}
}
else if( me->buttons() == Qt::NoButton && m_editMode == ModeDraw )
{
// set move- or resize-cursor
@@ -2568,14 +2553,14 @@ void PianoRoll::paintEvent(QPaintEvent * pe )
{
QColor horizCol = QColor( gridColor() );
QColor vertCol = QColor( gridColor() );
QStyleOption opt;
opt.initFrom( this );
QPainter p( this );
style()->drawPrimitive( QStyle::PE_Widget, &opt, &p, this );
QBrush bgColor = p.background();
// fill with bg color
p.fillRect( 0,0, width(), height(), bgColor );
@@ -3009,6 +2994,7 @@ void PianoRoll::paintEvent(QPaintEvent * pe )
int y = (int) y_base - sel_key_start * KEY_LINE_HEIGHT;
int h = (int) y_base - sel_key_end * KEY_LINE_HEIGHT - y;
p.setPen( QColor( 0, 64, 192 ) );
p.setBrush( Qt::NoBrush );
p.drawRect( x + WHITE_KEY_WIDTH, y, w, h );
// TODO: Get this out of paint event
@@ -3122,11 +3108,11 @@ void PianoRoll::wheelEvent(QWheelEvent * we )
MidiTime::ticksPerTact() / m_ppt + m_currentPosition;
int ticks_end = ( x+pixel_range/2 ) *
MidiTime::ticksPerTact() / m_ppt + m_currentPosition;
// get note-vector of current pattern
NoteVector notes;
NoteVector notes;
notes += m_pattern->notes();
// go through notes to figure out which one we want to change
NoteVector nv;
foreach( Note * i, notes )
@@ -3139,7 +3125,7 @@ void PianoRoll::wheelEvent(QWheelEvent * we )
nv += i;
}
}
if( nv.size() > 0 )
if( nv.size() > 0 )
{
const int step = we->delta() > 0 ? 1.0 : -1.0;
if( m_noteEditMode == NoteEditVolume )
@@ -3180,7 +3166,7 @@ void PianoRoll::wheelEvent(QWheelEvent * we )
update();
}
}
// not in note edit area, so handle scrolling/zooming and quantization change
else
if( we->modifiers() & Qt::ControlModifier && we->modifiers() & Qt::AltModifier )
@@ -3557,7 +3543,7 @@ void PianoRoll::enterValue( NoteVector* nv )
}
m_lastNotePanning = new_val;
}
}
}
@@ -3692,7 +3678,7 @@ void PianoRoll::deleteSelectedNotes()
bool update_after_delete = false;
m_pattern->addJournalCheckPoint();
// get note-vector of current pattern
const NoteVector & notes = m_pattern->notes();

View File

@@ -386,6 +386,21 @@ void SongEditor::wheelEvent( QWheelEvent * _we )
void SongEditor::closeEvent( QCloseEvent * _ce )
{
if( parentWidget() )
{
parentWidget()->hide();
}
else
{
hide();
}
_ce->ignore();
}
void SongEditor::setMasterVolume( int _new_val )
{
@@ -531,7 +546,7 @@ void SongEditor::updatePosition( const MidiTime & _t )
{
const int w = width() - widgetWidth
- trackOpWidth
- 32; // rough estimation for width of right scrollbar
- contentWidget()->verticalScrollBar()->width(); // width of right scrollbar
if( _t > m_currentPosition + w * MidiTime::ticksPerTact() /
pixelsPerTact() )
{

View File

@@ -195,4 +195,16 @@ void ControllerRackView::addController()
void ControllerRackView::closeEvent( QCloseEvent * _ce )
{
if( parentWidget() )
{
parentWidget()->hide();
}
else
{
hide();
}
_ce->ignore();
}

View File

@@ -46,7 +46,8 @@ QPixmap * FxLine::s_receiveBgArrow = NULL;
FxLine::FxLine( QWidget * _parent, FxMixerView * _mv, int _channelIndex) :
QWidget( _parent ),
m_mv( _mv ),
m_channelIndex( _channelIndex )
m_channelIndex( _channelIndex ),
m_backgroundActive( Qt::SolidPattern )
{
if( ! s_sendBgArrow )
{
@@ -191,14 +192,18 @@ void FxLine::contextMenuEvent( QContextMenuEvent * )
}
contextMenu->addAction( tr( "Rename &channel" ), this, SLOT( renameChannel() ) );
contextMenu->addSeparator();
if( m_channelIndex != 0 ) // no remove-option in master
{
contextMenu->addAction( embed::getIconPixmap( "cancel" ), tr( "R&emove channel" ),
this, SLOT( removeChannel() ) );
contextMenu->addSeparator();
}
contextMenu->addAction( embed::getIconPixmap( "cancel" ), tr( "Remove &unused channels" ),
this, SLOT( removeUnusedChannels() ) );
contextMenu->addSeparator();
contextMenu->addHelpAction();
contextMenu->exec( QCursor::pos() );
delete contextMenu;
@@ -229,6 +234,13 @@ void FxLine::removeChannel()
}
void FxLine::removeUnusedChannels()
{
FxMixerView * mix = Engine::fxMixerView();
mix->deleteUnusedChannels();
}
void FxLine::moveChannelLeft()
{
FxMixerView * mix = Engine::fxMixerView();

View File

@@ -396,4 +396,17 @@ void ProjectNotes::loadSettings( const QDomElement & _this )
void ProjectNotes::closeEvent( QCloseEvent * _ce )
{
if( parentWidget() )
{
parentWidget()->hide();
}
else
{
hide();
}
_ce->ignore();
}

View File

@@ -49,6 +49,7 @@
#include "EffectRackView.h"
#include "embed.h"
#include "Engine.h"
#include "FadeButton.h"
#include "FileBrowser.h"
#include "FxMixer.h"
#include "FxMixerView.h"
@@ -104,7 +105,7 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) :
tr( "Base note" ) ),
m_volumeModel( DefaultVolume, MinVolume, MaxVolume, 0.1f, this, tr( "Volume" ) ),
m_panningModel( DefaultPanning, PanningLeft, PanningRight, 0.1f, this, tr( "Panning" ) ),
m_audioPort( tr( "unnamed_track" ), true, &m_volumeModel, &m_panningModel ),
m_audioPort( tr( "unnamed_track" ), true, &m_volumeModel, &m_panningModel, &m_mutedModel ),
m_pitchModel( 0, MinPitchDefault, MaxPitchDefault, 1, this, tr( "Pitch" ) ),
m_pitchRangeModel( 1, 1, 24, this, tr( "Pitch range" ) ),
m_effectChannelModel( 0, 0, 0, this, tr( "FX channel" ) ),
@@ -338,7 +339,7 @@ void InstrumentTrack::processInEvent( const MidiEvent& event, const MidiTime& ti
break;
}
break;
default:
break;
}
@@ -378,9 +379,10 @@ void InstrumentTrack::processOutEvent( const MidiEvent& event, const MidiTime& t
}
++m_runningMidiNotes[key];
m_instrument->handleMidiEvent( MidiEvent( MidiNoteOn, midiPort()->realOutputChannel(), key, event.velocity() ), time, offset );
emit newNote();
}
m_midiNotesMutex.unlock();
if( m_fb ) { m_fb->activate(); }
break;
case MidiNoteOff:
@@ -561,6 +563,12 @@ void InstrumentTrack::removeMidiPortNode( DataFile & _dataFile )
n.item( 0 ).parentNode().removeChild( n.item( 0 ) );
}
void InstrumentTrack::setIndicator(FadeButton *fb)
{
m_fb = fb;
}
@@ -840,7 +848,7 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerV
{
widgetWidth = DEFAULT_SETTINGS_WIDGET_WIDTH_COMPACT;
}
else
else
{
widgetWidth = DEFAULT_SETTINGS_WIDGET_WIDTH;
}
@@ -910,9 +918,7 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerV
this, SLOT( activityIndicatorPressed() ) );
connect( m_activityIndicator, SIGNAL( released() ),
this, SLOT( activityIndicatorReleased() ) );
connect( _it, SIGNAL( newNote() ),
m_activityIndicator, SLOT( activate() ) );
_it->setIndicator( m_activityIndicator );
setModel( _it );
}
@@ -949,8 +955,8 @@ InstrumentTrackWindow * InstrumentTrackView::topLevelInstrumentTrackWindow()
// TODO: Add windows to free list on freeInstrumentTrackWindow.
// But, don't NULL m_window or disconnect signals. This will allow windows
// TODO: Add windows to free list on freeInstrumentTrackWindow.
// But, don't NULL m_window or disconnect signals. This will allow windows
// that are being show/hidden frequently to stay connected.
void InstrumentTrackView::freeInstrumentTrackWindow()
{
@@ -975,7 +981,7 @@ void InstrumentTrackView::freeInstrumentTrackWindow()
{
delete m_window;
}
m_window = NULL;
}
}
@@ -1002,7 +1008,7 @@ InstrumentTrackWindow * InstrumentTrackView::getInstrumentTrackWindow()
else if( !s_windowCache.isEmpty() )
{
m_window = s_windowCache.dequeue();
m_window->setInstrumentTrackView( this );
m_window->setModel( model() );
m_window->updateInstrumentView();
@@ -1028,7 +1034,7 @@ InstrumentTrackWindow * InstrumentTrackView::getInstrumentTrackWindow()
s_windowCache << m_window;
}
}
return m_window;
}
@@ -1059,7 +1065,7 @@ void InstrumentTrackView::dropEvent( QDropEvent * _de )
void InstrumentTrackView::toggleInstrumentWindow( bool _on )
{
getInstrumentTrackWindow()->toggleVisibility( _on );
if( !_on )
{
freeInstrumentTrackWindow();
@@ -1119,10 +1125,10 @@ void InstrumentTrackView::midiConfigChanged()
class fxLineLcdSpinBox : public LcdSpinBox
class fxLineLcdSpinBox : public LcdSpinBox
{
public:
fxLineLcdSpinBox( int _num_digits, QWidget * _parent,
fxLineLcdSpinBox( int _num_digits, QWidget * _parent,
const QString & _name ) :
LcdSpinBox( _num_digits, _parent, _name ) {}
@@ -1336,7 +1342,7 @@ void InstrumentTrackWindow::modelChanged()
this, SLOT( updateName() ) );
connect( m_track, SIGNAL( instrumentChanged() ),
this, SLOT( updateInstrumentView() ) );
m_volumeKnob->setModel( &m_track->m_volumeModel );
m_panningKnob->setModel( &m_track->m_panningModel );
m_effectChannelNumber->setModel( &m_track->m_effectChannelModel );

View File

@@ -944,7 +944,9 @@ void PatternView::paintEvent( QPaintEvent * )
const float ppt = fixedTCOs() ?
( parentWidget()->width() - 2 * TCO_BORDER_WIDTH )
/ (float) m_pat->length().getTact() :
pixelsPerTact();
( width() - 2 * TCO_BORDER_WIDTH )
/ (float) m_pat->length().getTact();
const int x_base = TCO_BORDER_WIDTH;
p.setPen( c.darker( 300 ) );
@@ -997,7 +999,7 @@ void PatternView::paintEvent( QPaintEvent * )
// qDebug( "keyrange: %d", keyrange );
// determine height of the pattern view, sans borders
const int ht = height() - 1 - TCO_BORDER_WIDTH * 2;
const int ht = (height() - 1 - TCO_BORDER_WIDTH * 2) -1;
// determine maximum height value for drawing bounds checking
const int max_ht = height() - 1 - TCO_BORDER_WIDTH;
@@ -1022,7 +1024,7 @@ void PatternView::paintEvent( QPaintEvent * )
const float y_key =
( 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 );
const int y_pos = static_cast<int>( TCO_BORDER_WIDTH + y_key * ht ) + 1;
// 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 );

View File

@@ -47,6 +47,7 @@
#include "EffectRackView.h"
#include "TrackLabelButton.h"
#include "ConfigManager.h"
#include "panning_constants.h"
SampleTCO::SampleTCO( Track * _track ) :
@@ -386,11 +387,11 @@ void SampleTCOView::paintEvent( QPaintEvent * _pe )
{
p.setFont( pointSize<7>( p.font() ) );
p.setPen( QColor( 0, 0, 0 ) );
p.setPen( QColor( 0, 0, 0 ) );
p.drawText( 10, p.fontMetrics().height()+1, "Rec" );
p.setPen( textColor() );
p.setPen( textColor() );
p.drawText( 9, p.fontMetrics().height(), "Rec" );
p.setBrush( QBrush( textColor() ) );
p.drawEllipse( 4, 5, 4, 4 );
}
@@ -405,9 +406,12 @@ SampleTrack::SampleTrack( TrackContainer* tc ) :
Track( Track::SampleTrack, tc ),
m_volumeModel( DefaultVolume, MinVolume, MaxVolume, 1.0, this,
tr( "Volume" ) ),
m_audioPort( tr( "Sample track" ), true, &m_volumeModel, NULL )
m_panningModel( DefaultPanning, PanningLeft, PanningRight, 0.1f,
this, tr( "Panning" ) ),
m_audioPort( tr( "Sample track" ), true, &m_volumeModel, &m_panningModel, &m_mutedModel )
{
setName( tr( "Sample track" ) );
m_panningModel.setCenterValue( DefaultPanning );
}
@@ -492,6 +496,7 @@ void SampleTrack::saveTrackSpecificSettings( QDomDocument & _doc,
_this.setAttribute( "icon", tlb->pixmapFile() );
#endif
m_volumeModel.saveSettings( _doc, _this, "vol" );
m_panningModel.saveSettings( _doc, _this, "pan" );
}
@@ -513,6 +518,7 @@ void SampleTrack::loadTrackSpecificSettings( const QDomElement & _this )
node = node.nextSibling();
}
m_volumeModel.loadSettings( _this, "vol" );
m_panningModel.loadSettings( _this, "pan" );
}
@@ -550,6 +556,14 @@ SampleTrackView::SampleTrackView( SampleTrack * _t, TrackContainerView* tcv ) :
m_volumeKnob->setLabel( tr( "VOL" ) );
m_volumeKnob->show();
m_panningKnob = new Knob( knobSmall_17, getTrackSettingsWidget(),
tr( "Panning" ) );
m_panningKnob->setModel( &_t->m_panningModel );
m_panningKnob->setHintText( tr( "Panning:" ), "%" );
m_panningKnob->move( DEFAULT_SETTINGS_WIDGET_WIDTH-24, 2 );
m_panningKnob->setLabel( tr( "PAN" ) );
m_panningKnob->show();
m_effectRack = new EffectRackView( _t->audioPort()->effects() );
m_effectRack->setFixedSize( 240, 242 );
@@ -596,8 +610,3 @@ void SampleTrackView::modelChanged()
TrackView::modelChanged();
}