sampleTCOView::sampleTCOView( sampleTCO * _tco, trackView * _tv ) : trackContentObjectView( _tco, _tv ), m_tco( _tco ) { connect( m_tco, SIGNAL( sampleChanged() ), this, SLOT( updateSample() ) ); }
void SampleTCO::setSampleFile( const QString & _sf ) { m_sampleBuffer->setAudioFile( _sf ); updateLength(); emit sampleChanged(); }
void SampleTCO::setSampleBuffer( SampleBuffer* sb ) { sharedObject::unref( m_sampleBuffer ); m_sampleBuffer = sb; updateLength(); emit sampleChanged(); }
void SampleTCO::setSampleFile( const QString & _sf ) { m_sampleBuffer->setAudioFile( _sf ); setStartTimeOffset( 0 ); changeLength( (int) ( m_sampleBuffer->frames() / Engine::framesPerTick() ) ); emit sampleChanged(); emit playbackPositionChanged(); }
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() ); }
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(); }
void SampleTCO::updateLength() { emit sampleChanged(); }