Make audio marker snap distance and whether or not it defaults to snapping customizable

Originally committed to SVN as r6176.
This commit is contained in:
Thomas Goyne 2011-12-28 01:22:59 +00:00
parent c06d72d5be
commit 4b2e5d1b93
3 changed files with 14 additions and 22 deletions

View file

@ -477,8 +477,6 @@ public:
}
};
class AudioMarkerInteractionObject : public AudioDisplayInteractionObject {
// Object-pair being interacted with
AudioMarker *marker;
@ -496,18 +494,17 @@ class AudioMarkerInteractionObject : public AudioDisplayInteractionObject {
public:
AudioMarkerInteractionObject(AudioMarker *marker, AudioTimingController *timing_controller, AudioDisplay *display, AudioController *controller, wxMouseButton button_used)
: marker(marker)
, timing_controller(timing_controller)
, display(display)
, controller(controller)
, button_used(button_used)
: marker(marker)
, timing_controller(timing_controller)
, display(display)
, controller(controller)
, button_used(button_used)
, default_snap(OPT_GET("Audio/Snap/Enable")->GetBool())
, snap_range(OPT_GET("Audio/Snap/Distance")->GetInt())
{
/// @todo Make these configurable
snap_range = 5;
default_snap = false;
}
virtual bool OnMouseEvent(wxMouseEvent &event)
bool OnMouseEvent(wxMouseEvent &event)
{
if (event.Dragging())
{

View file

@ -40,15 +40,9 @@
"Cursor Time" : true,
"Keyframes in Dialogue Mode" : true,
"Keyframes in Karaoke Mode" : true,
"Secondary Lines" : true,
"Selection Background" : true,
"Timeline" : true,
"Video Position" : false
},
"Snap" : {
"Keyframes" : false,
"Other Lines" : false
},
"Waveform Style" : 1
},
"Downmixer" : "ConvertToMono",
@ -80,6 +74,10 @@
"Quality" : 1
}
},
"Snap" : {
"Distance" : 5,
"Enable" : false
},
"Spectrum" : true,
"Start Drag Sensitivity" : 2,
"Wheel Default to Zoom" : false

View file

@ -144,11 +144,9 @@ Audio::Audio(wxTreebook *book, Preferences *parent): OptionPage(book, parent, _(
OptionAdd(general, _("Grab times from line upon selection"), "Audio/Grab Times on Select");
OptionAdd(general, _("Default mouse wheel to zoom"), "Audio/Wheel Default to Zoom");
OptionAdd(general, _("Lock scroll on cursor"), "Audio/Lock Scroll on Cursor");
OptionAdd(general, _("Snap to keyframes"), "Audio/Display/Snap/Keyframes");
OptionAdd(general, _("Snap to adjacent lines"), "Audio/Display/Snap/Other Lines");
OptionAdd(general, _("Snap markers by default"), "Audio/Snap/Enable");
OptionAdd(general, _("Auto-focus on mouse over"), "Audio/Auto/Focus");
OptionAdd(general, _("Play audio when stepping in video"), "Audio/Plays When Stepping Video");
CellSkip(general);
OptionAdd(general, _("Default timing length"), "Timing/Default Duration", 0, 36000);
OptionAdd(general, _("Default lead-in length"), "Audio/Lead/IN", 0, 36000);
OptionAdd(general, _("Default lead-out length"), "Audio/Lead/OUT", 0, 36000);
@ -158,11 +156,10 @@ Audio::Audio(wxTreebook *book, Preferences *parent): OptionPage(book, parent, _(
OptionChoice(general, _("Show inactive lines"), choice_dtl, "Audio/Inactive Lines Display Mode");
OptionAdd(general, _("Start-marker drag sensitivity"), "Audio/Start Drag Sensitivity", 1, 15);
OptionAdd(general, _("Line boundry thickness"), "Audio/Line Boundaries Thickness", 1, 5);
OptionAdd(general, _("Maximum snap distance"), "Audio/Snap/Distance", 0, 25);
wxFlexGridSizer *display = PageSizer(_("Display Visual Options"));
OptionAdd(display, _("Secondary lines"), "Audio/Display/Draw/Secondary Lines");
OptionAdd(display, _("Selection background"), "Audio/Display/Draw/Selection Background");
OptionAdd(display, _("Timeline"), "Audio/Display/Draw/Timeline");
OptionAdd(display, _("Cursor time"), "Audio/Display/Draw/Cursor Time");
OptionAdd(display, _("Keyframes"), "Audio/Display/Draw/Keyframes in Dialogue Mode");
OptionAdd(display, _("Karaoke keyframes"), "Audio/Display/Draw/Keyframes in Karaoke Mode");