using System; using System.ComponentModel; using System.Text.Json.Serialization; using System.Windows; using static QuikDawEditor.EDITING.StaticProperties; namespace QuikDawEditor.EditingClasses; public partial class Track : INotifyPropertyChanged { [JsonIgnore(Condition = JsonIgnoreCondition.Always)] public RecordingClipAudio audioRecordingClip { get; set; } = new RecordingClipAudio(); [JsonIgnore(Condition = JsonIgnoreCondition.Always)] public RecordingClipMidi midiRecordingClip { get; set; } = new RecordingClipMidi(); private bool _IsRecordingArmed = false; [JsonIgnore(Condition = JsonIgnoreCondition.Always)] public bool IsRecordingArmed { get { return _IsRecordingArmed; } set { _IsRecordingArmed = value; NotifyPropertyChanged(nameof(IsRecordingArmed)); NotifyPropertyChanged(nameof(AutomationDPEnabled)); NotifyPropertyChanged(nameof(DisplayTrackBackgroundBrush)); projPlayer.NotifyTrackArmed(); } } private Visibility _VolumeTextVisibility = Visibility.Hidden; [JsonIgnore(Condition = JsonIgnoreCondition.Always)] public Visibility VolumeTextVisibility { get { return _VolumeTextVisibility; } set { _VolumeTextVisibility = value; NotifyPropertyChanged(nameof(VolumeTextVisibility)); } } [JsonIgnore(Condition = JsonIgnoreCondition.Always)] public double VolumeDB { get { return this.Volume == 0 ? -36D : 20D * Math.Log10(this.Volume); } set { Volume = value <= -36D ? 0 : (float)Math.Pow(10, value / 20); NotifyPropertyChanged(nameof(VolumeDBString)); } } public string VolumeDBString { get { return Math.Round(VolumeDB, 2).ToString(); } } private double _TrackOutputVolume = 0; [JsonIgnore(Condition = JsonIgnoreCondition.Always)] public double TrackOutputVolume { get { return _TrackOutputVolume; } set { _TrackOutputVolume = value; NotifyPropertyChanged(nameof(TrackOutputDB)); } } public double TrackOutputDB { get { return TrackOutputVolume == 0 ? -36D : 20D * Math.Log10(TrackOutputVolume); } } public bool _IsProjectPlayingEnabled = true; [JsonIgnore(Condition = JsonIgnoreCondition.Always)] public bool IsProjectPlayingEnabled { get { return _IsProjectPlayingEnabled; } set { _IsProjectPlayingEnabled = value; NotifyPropertyChanged(nameof(IsProjectPlayingEnabled)); } } private bool _ContentHidden = false; [JsonIgnore(Condition = JsonIgnoreCondition.Always)] public bool ContentHidden { get { return _ContentHidden; } set { _ContentHidden = value; NotifyPropertyChanged(nameof(TrackChildrenVisibility)); } } }