/* CTextureCanvas::clearTexture * Clears the current texture and the patch textures list *******************************************************************/ void CTextureCanvas::clearTexture() { // Stop listening to the current texture (if it exists) if (texture) stopListening(texture); // Clear texture; texture = NULL; // Clear patch textures clearPatchTextures(); // Reset view offset resetOffsets(); // Clear patch selection selected_patches.clear(); hilight_patch = -1; // Clear full preview tex_preview.clear(); // Refresh canvas Refresh(); }
void SingularSampleBuffer::resetCapacity(SINT capacity) { DEBUG_ASSERT_CLASS_INVARIANT_SingularSampleBuffer; if (m_primaryBuffer.size() != capacity) { SampleBuffer(capacity).swap(m_primaryBuffer); } resetOffsets(); DEBUG_ASSERT_CLASS_INVARIANT_SingularSampleBuffer; }
EnvelopeHandleComponent::EnvelopeHandleComponent() : dontUpdateTimeAndValue(false), lastX(-1), lastY(-1), resizeLimits(this), shouldLockTime(false), shouldLockValue(false), ignoreDrag(false) { setMouseCursor(MouseCursor::CrosshairCursor); resetOffsets(); }
SampleBuffer::ReadableChunk SingularSampleBuffer::readFromTail(SINT size) { DEBUG_ASSERT_CLASS_INVARIANT_SingularSampleBuffer; const SINT tailLength = math_min(size, getSize()); m_tailOffset -= tailLength; const SampleBuffer::ReadableChunk tailChunk( m_primaryBuffer, m_tailOffset, tailLength); if (isEmpty()) { // Internal buffer becomes empty and can safely be reset // to extend the tail capacity for future growth resetOffsets(); } DEBUG_ASSERT_CLASS_INVARIANT_SingularSampleBuffer; return tailChunk; }