MCPcopy Create free account
hub / github.com/LMMS/lmms / setSampleFile

Method setSampleFile

src/tracks/SampleTrack.cpp:149–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147
148
149void SampleTCO::setSampleFile( const QString & _sf )
150{
151 int length;
152 if ( _sf.isEmpty() )
153 { //When creating an empty sample pattern make it a bar long
154 float nom = Engine::getSong()->getTimeSigModel().getNumerator();
155 float den = Engine::getSong()->getTimeSigModel().getDenominator();
156 length = DefaultTicksPerTact * ( nom / den );
157 }
158 else
159 { //Otherwise set it to the sample's length
160 m_sampleBuffer->setAudioFile( _sf );
161 length = sampleLength();
162 }
163 changeLength(length);
164
165 emit sampleChanged();
166 emit playbackPositionChanged();
167}
168
169
170

Callers 2

dropEventMethod · 0.80
mouseDoubleClickEventMethod · 0.80

Calls 4

getSongFunction · 0.85
sampleLengthFunction · 0.85
isEmptyMethod · 0.45
setAudioFileMethod · 0.45

Tested by

no test coverage detected