Skip to content

Commit

Permalink
Ignorable filter properties
Browse files Browse the repository at this point in the history
  • Loading branch information
VoidXH committed Jul 11, 2024
1 parent a99a272 commit 1f964fe
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Cavern.QuickEQ/Filters/GraphicEQ.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;

using Cavern.QuickEQ.Equalization;

Expand All @@ -24,6 +25,24 @@ public Equalizer Equalizer {
}
Equalizer equalizer;

/// <summary>
/// Get a clone of the <see cref="filter"/>'s impulse response.
/// </summary>
[IgnoreDataMember]
public new float[] Impulse {
get => base.Impulse;
set => base.Impulse = value;
}

/// <summary>
/// Added filter delay to the impulse, in samples.
/// </summary>
[IgnoreDataMember]
public new int Delay {
get => base.Delay;
set => base.Delay = value;
}

/// <summary>
/// Sample rate at which this EQ is converted to a minimum-phase FIR filter.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions CavernSamples/VoidX.WPF/ObjectToDataGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Windows.Controls;

using FilterStudio;
Expand Down Expand Up @@ -122,6 +123,10 @@ public ObjectToDataGrid(object source, Action successCallback, Action<Exception>
PropertyInfo[] properties = source.GetType().GetProperties();
for (int i = 0; i < properties.Length; i++) {
PropertyInfo property = properties[i];
if (property.GetCustomAttribute<IgnoreDataMemberAttribute>() != null) {
continue;
}

if (property.SetMethod != null && property.SetMethod.IsPublic) {
(Type type, Action<object> editor) = customFields.FirstOrDefault(x => x.type == property.PropertyType);
if (editor == null) {
Expand Down

0 comments on commit 1f964fe

Please sign in to comment.