-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IWaveformDrawingOption add Reset()/Reload()/Save()
- Loading branch information
1 parent
ee0d2f1
commit 4c59735
Showing
17 changed files
with
484 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 64 additions & 25 deletions
89
...ules/AudioPlayerToolViewer/Graphics/WaveformDrawing/DefaultImpls/DefaultWaveformOption.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,77 @@ | ||
using OngekiFumenEditor.Base.Attributes; | ||
using OngekiFumenEditor.Properties; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace OngekiFumenEditor.Modules.AudioPlayerToolViewer.Graphics.WaveformDrawing.DefaultImpls | ||
{ | ||
public class DefaultWaveformOption : WaveformDrawingOptionBase | ||
{ | ||
private bool showTimingLine = true; | ||
[ObjectPropertyBrowserShow] | ||
[JsonInclude] | ||
[ObjectPropertyBrowserAlias(nameof(ShowTimingLine))] | ||
public bool ShowTimingLine | ||
{ | ||
get => showTimingLine; | ||
set => Set(ref showTimingLine, value); | ||
} | ||
|
||
private bool showObjectPlaceLine = true; | ||
[ObjectPropertyBrowserShow] | ||
[JsonInclude] | ||
[ObjectPropertyBrowserAlias(nameof(ShowObjectPlaceLine))] | ||
public bool ShowObjectPlaceLine | ||
{ | ||
get => showObjectPlaceLine; | ||
set => Set(ref showObjectPlaceLine, value); | ||
} | ||
|
||
private bool showWaveform = true; | ||
public class DefaultWaveformOption : WaveformDrawingOptionBase | ||
{ | ||
private bool showTimingLine; | ||
[ObjectPropertyBrowserShow] | ||
[ObjectPropertyBrowserAlias(nameof(ShowTimingLine))] | ||
public bool ShowTimingLine | ||
{ | ||
get => showTimingLine; | ||
set | ||
{ | ||
Set(ref showTimingLine, value); | ||
DefaultWaveformSettings.Default.ShowTimingLine = value; | ||
} | ||
} | ||
|
||
private bool showObjectPlaceLine; | ||
[ObjectPropertyBrowserShow] | ||
[ObjectPropertyBrowserAlias(nameof(ShowObjectPlaceLine))] | ||
public bool ShowObjectPlaceLine | ||
{ | ||
get => showObjectPlaceLine; | ||
set | ||
{ | ||
Set(ref showObjectPlaceLine, value); | ||
DefaultWaveformSettings.Default.ShowObjectPlaceLine = value; | ||
} | ||
} | ||
|
||
private bool showWaveform; | ||
[ObjectPropertyBrowserShow] | ||
[JsonInclude] | ||
[ObjectPropertyBrowserAlias(nameof(ShowWaveform))] | ||
public bool ShowWaveform | ||
{ | ||
get => showWaveform; | ||
set => Set(ref showWaveform, value); | ||
set | ||
{ | ||
Set(ref showWaveform, value); | ||
DefaultWaveformSettings.Default.ShowWaveform = value; | ||
} | ||
} | ||
|
||
public DefaultWaveformOption() | ||
{ | ||
SyncFromSettings(); | ||
} | ||
|
||
private void SyncFromSettings() | ||
{ | ||
ShowWaveform = DefaultWaveformSettings.Default.ShowWaveform; | ||
ShowObjectPlaceLine = DefaultWaveformSettings.Default.ShowObjectPlaceLine; | ||
ShowTimingLine = DefaultWaveformSettings.Default.ShowTimingLine; | ||
} | ||
|
||
public override void Reload() | ||
{ | ||
DefaultWaveformSettings.Default.Reload(); | ||
SyncFromSettings(); | ||
} | ||
|
||
public override void Reset() | ||
{ | ||
DefaultWaveformSettings.Default.Reset(); | ||
SyncFromSettings(); | ||
} | ||
|
||
public override void Save() | ||
{ | ||
DefaultWaveformSettings.Default.Save(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.