using System; using System.Collections.ObjectModel; using System.ComponentModel; using System.Runtime.CompilerServices; using System.Windows; using static QuikDawEditor.EDITING.MiscMethods; using static QuikDawEditor.EDITING.StaticProperties; namespace QuikDawEditor.EditingClasses; public partial class RecordingClipAudio : INotifyPropertyChanged { public string RelRes() { ReleaseResources(); return "Resources released"; } public event PropertyChangedEventHandler PropertyChanged; private void NotifyPropertyChanged([CallerMemberName] String propertyName = "") { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } public RecordingClipAudio() { ReverseTransformFactorX = 1 / editingProject.ViewXZoomFac; } private ObservableCollection _recordingWavePoints = new ObservableCollection(); public ObservableCollection recordingWavePoints { get { return _recordingWavePoints; } set { _recordingWavePoints = value; NotifyPropertyChanged(nameof(recordingWavePoints)); } } public void UpdateRecordingWavePoints() { NotifyPropertyChanged(nameof(recordingWavePoints)); } private double _ClipVirtualStartMs; public double ClipVirtualStartMs { get { return Math.Truncate(_ClipVirtualStartMs); } set { _ClipVirtualStartMs = Math.Truncate(value); NotifyPropertyChanged(nameof(ClipMarginPix)); } } public Thickness ClipMarginPix { get { return new Thickness(MsecToPixels(ClipVirtualStartMs), 0, 0, 0); } } private double _ClipWidthMs = 0; public double ClipWidthMs { get { return Math.Truncate(_ClipWidthMs); } set { _ClipWidthMs = Math.Truncate(value); NotifyPropertyChanged(nameof(PixelWidth)); } } public double PixelWidth { get { return MsecToPixels(this.ClipWidthMs); } } private bool _IsVisible = false; public bool IsVisible { get { return _IsVisible; } set { _IsVisible = value; NotifyPropertyChanged(nameof(ClipVisibility)); } } public Visibility ClipVisibility { get { return IsVisible ? Visibility.Visible : Visibility.Hidden; } } public double ReverseTransformFactorX = 1; public void UpdateRecordingClipTransform() { ReverseTransformFactorX = 1 / editingProject.ViewXZoomFac; NotifyPropertyChanged(nameof(RecClipBorderWidth)); NotifyPropertyChanged(nameof(PathBorderThickness)); } private double myTrackYScale = 1; public double RecClipBorderWidth { get { return ReverseTransformFactorX; } } public double PathBorderThickness { get { return 0.4 * ReverseTransformFactorX; } } }