private void OnEnable() { BackgroundStack = new Texture2DStack(); WaveformIconStack = new Texture2DStack(); WaveformIconStack.AddToStack(WaveformIconStackFunc); WaveformIconStack.RecalculateTextureStack(); AudioPreviewStack = new Texture2DStack(); AudioPreviewStack.AddToStack(WaveformStackFunc); AudioPreviewStack.AddToStack(TimeMarkerStackFunc); AudioPreviewStack.AddToStack(CursorLineStackFunc); AudioPreviewStack.AddToStack(TrimLineStackFunc); AudioPreviewStack.RecalculateTextureStack(); OnWindowSizeUpdate(); }
private void onSourceClipUpdate() { if (sourceClip == null) { return; } PlayBar.maxLimit = (float)sourceClip.samples * (float)sourceClip.channels / (float)sourceClip.frequency; PlayBar.minLimit = 0; PlayBar.value = 0; ZoomSlider.maxLimit = (float)sourceClip.samples * (float)sourceClip.channels / (float)sourceClip.frequency; ZoomSlider.minLimit = 0; ZoomSlider.ReAlignValues(); TrimSlider.minLimit = ZoomSlider.minValue; TrimSlider.maxLimit = ZoomSlider.maxValue; TrimSlider.ReAlignValues(); AudioPreviewStack.RecalculateTextureStack(); WaveformIconStack.RecalculateTextureStack(); }