| 147 | |
| 148 | |
| 149 | void 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 |
no test coverage detected