void WaveformPlot::load( const std::vector<float> &samples, const ci::Rectf &bounds, size_t pixelsPerVertex ) { mBounds = bounds; mWaveforms.clear(); ivec2 waveSize = bounds.getSize(); mWaveforms.push_back( Waveform( samples, waveSize, pixelsPerVertex, Waveform::CalcMode::MIN_MAX ) ); mWaveforms.push_back( Waveform( samples, waveSize, pixelsPerVertex, Waveform::CalcMode::AVERAGE ) ); }
void WaveformPlot::load( const audio::BufferRef &buffer, const ci::Rectf &bounds, size_t pixelsPerVertex ) { mBounds = bounds; mWaveforms.clear(); size_t numChannels = buffer->getNumChannels(); ivec2 waveSize = bounds.getSize(); waveSize.y /= numChannels; for( size_t ch = 0; ch < numChannels; ch++ ) { mWaveforms.push_back( Waveform( buffer->getChannel( ch ), buffer->getNumFrames(), waveSize, pixelsPerVertex, Waveform::CalcMode::MIN_MAX ) ); mWaveforms.push_back( Waveform( buffer->getChannel( ch ), buffer->getNumFrames(), waveSize, pixelsPerVertex, Waveform::CalcMode::AVERAGE ) ); } }
void Control::setRect(const ci::Rectf &rect) { setSize(rect.getSize()); setLocation(rect.getUpperLeft()); }
AABB::AABB(ci::Rectf const& Rect) #endif : m_Center(Rect.getCenter()) , m_HalfSize(Rect.getSize() / 2.f) { }