void TrackComponent::resized() { // update the bounds of the regions to the values in the _posX container for(size_t current = 0; current < _regions.size(); ++current) { auto r(getLocalBounds().reduced(4)); r.setX((int)_posX.at(current)); int64 lengthSeconds = samplesToSeconds(_sizeSamps.at(current), _sampleRate); r.setWidth((int)lengthSeconds * (int)_pixelsPerClip); r.removeFromBottom(6); _regionComponents.at(current)->setBounds(r.removeFromBottom(90)); } // set the track mixer bounds _trackMixer->setBounds(0, 0, (int)_mixerOffset, getParentHeight()); repaint(); }
double TSoundTrack::getDuration() const { return samplesToSeconds(m_sampleCount); }