| 148 | } |
| 149 | |
| 150 | inline te::WaveAudioClip::Ptr loadAudioFileAsClip (te::Edit& edit, const File& file) |
| 151 | { |
| 152 | // Find the first track and delete all clips from it |
| 153 | if (auto track = getOrInsertAudioTrackAt (edit, 0)) |
| 154 | { |
| 155 | removeAllClips (*track); |
| 156 | |
| 157 | // Add a new clip to this track |
| 158 | te::AudioFile audioFile (edit.engine, file); |
| 159 | |
| 160 | if (audioFile.isValid()) |
| 161 | if (auto newClip = track->insertWaveClip (file.getFileNameWithoutExtension(), file, |
| 162 | { { {}, te::TimeDuration::fromSeconds (audioFile.getLength()) }, {} }, false)) |
| 163 | return newClip; |
| 164 | } |
| 165 | |
| 166 | return {}; |
| 167 | } |
| 168 | |
| 169 | template<typename ClipType> |
| 170 | typename ClipType::Ptr loopAroundClip (ClipType& clip) |
no test coverage detected