78 lines
No EOL
2.5 KiB
C#
78 lines
No EOL
2.5 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
using JD.Audio.Annotations;
|
|
using TeaBox;
|
|
using TeaBox.ObjectModel;
|
|
|
|
namespace JD.Application.View.Misc
|
|
{
|
|
/// <summary>
|
|
/// Stores values on how the user edits its values.
|
|
/// </summary>
|
|
public static class EditionOptions
|
|
{
|
|
#region Properties
|
|
|
|
public static SnappingUnit CurrentSnappingUnit
|
|
{
|
|
get
|
|
{
|
|
if ((Control.ModifierKeys & Keys.Alt) == Keys.Alt)
|
|
{
|
|
return SnappingUnit.None;
|
|
}
|
|
return PropertyService.PropertyService.Properties.Get("CurrentSnappingUnit", SnappingUnit.None);
|
|
}
|
|
set
|
|
{
|
|
PropertyService.PropertyService.Properties.Set("CurrentSnappingUnit", value);
|
|
if (value != SnappingUnit.None)
|
|
{
|
|
PreferredSnappingUnit = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public static SnappingUnit PreferredSnappingUnit
|
|
{
|
|
get { return PropertyService.PropertyService.Properties.Get("PreferredSnappingUnit", SnappingUnit.QuarterBeat); }
|
|
set { PropertyService.PropertyService.Properties.Set("PreferredSnappingUnit", value); }
|
|
}
|
|
|
|
public static ScrollingMode ScrollingMode
|
|
{
|
|
get { return PropertyService.PropertyService.Properties.Get("ScrollingMode", ScrollingMode.Page); }
|
|
set { PropertyService.PropertyService.Properties.Set("ScrollingMode", value); }
|
|
}
|
|
|
|
public static bool LoopOnSelection
|
|
{
|
|
get { return PropertyService.PropertyService.Properties.Get("LoopOnSelection", false); }
|
|
set
|
|
{
|
|
if (value != LoopOnSelection)
|
|
{
|
|
PropertyService.PropertyService.Properties.Set("LoopOnSelection", value);
|
|
LoopOnSelectionChanged?.Invoke(null, EventArgs.Empty);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static bool RememberSeekTime
|
|
{
|
|
get { return PropertyService.PropertyService.Properties.Get("RememberSeekTime", false); }
|
|
set
|
|
{
|
|
if (value != RememberSeekTime)
|
|
{
|
|
PropertyService.PropertyService.Properties.Set("RememberSeekTime", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public static event EventHandler LoopOnSelectionChanged;
|
|
|
|
#endregion
|
|
}
|
|
} |