Exemplo n.º 1
0
sampleTCOView::sampleTCOView( sampleTCO * _tco, trackView * _tv ) :
	trackContentObjectView( _tco, _tv ),
	m_tco( _tco )
{
	connect( m_tco, SIGNAL( sampleChanged() ),
			this, SLOT( updateSample() ) );
}
Exemplo n.º 2
0
void SampleTCO::setSampleFile( const QString & _sf )
{
	m_sampleBuffer->setAudioFile( _sf );
	updateLength();

	emit sampleChanged();
}
Exemplo n.º 3
0
void SampleTCO::setSampleBuffer( SampleBuffer* sb )
{
	sharedObject::unref( m_sampleBuffer );
	m_sampleBuffer = sb;
	updateLength();

	emit sampleChanged();
}
Exemplo n.º 4
0
void SampleTCO::setSampleFile( const QString & _sf )
{
	m_sampleBuffer->setAudioFile( _sf );
	setStartTimeOffset( 0 );
	changeLength( (int) ( m_sampleBuffer->frames() / Engine::framesPerTick() ) );

	emit sampleChanged();
	emit playbackPositionChanged();
}
Exemplo n.º 5
0
SampleTCOView::SampleTCOView( SampleTCO * _tco, trackView * _tv ) :
	trackContentObjectView( _tco, _tv ),
	m_tco( _tco )
{
	// update UI and tooltip
	updateSample();

	// track future changes of SampleTCO
	connect( m_tco, SIGNAL( sampleChanged() ),
			this, SLOT( updateSample() ) );

	setStyle( QApplication::style() );
}
Exemplo n.º 6
0
void SampleTCO::setSampleFile( const QString & _sf )
{
	int length;
	if ( _sf.isEmpty() )
	{	//When creating an empty sample pattern make it a bar long
		float nom = Engine::getSong()->getTimeSigModel().getNumerator();
		float den = Engine::getSong()->getTimeSigModel().getDenominator();
		length = DefaultTicksPerTact * ( nom / den );
	}
	else
	{	//Otherwise set it to the sample's length
		m_sampleBuffer->setAudioFile( _sf );
		length = sampleLength();
	}
	changeLength(length);

	setStartTimeOffset( 0 );

	emit sampleChanged();
	emit playbackPositionChanged();
}
Exemplo n.º 7
0
void SampleTCO::updateLength()
{
	emit sampleChanged();
}