Commit Graph

28 Commits

Author SHA1 Message Date
Vincent Wong 35cd0322ca Audio/timing: minor style, comment
A bit more clarification of code logic. Follow predominant if/else style
2018-11-21 21:21:38 -08:00
Vincent Wong 44bda6e5d9 Audio/Timing: implement tap-to-time
Tap-to-time provides the user the ability to tap to the lyrics/syllables
of the song in order to time lines or karaoke. It consists of these
extra UI interactions:

- **Indicator**: tap marker: a designated marker that can be moved to
  the current audio position; indicated in:
  - the audio display by a green arrow underneath a marker
  - the karaoke display by a green-colored syllable
- **Control**: tap marker: the tap marker can be changed by selecting
  syllables on audio display in karaoke mode, or clicking the markers on
  audio display in dialogue mode
- **Control**: ctrl-right-click audio display: starts playing the audio
  from that exact position until the end of the file
- **Option**: Timing/Tap To Time: enables the tap marker indicator and
  commands
- **Button**: time_opt_tap_to_time: toggles the Timing/Tap To Time option
- **Button**: time_tap_connect (hotkey I): a command that:
  - moves the tap marker's position to the current playing audio
    position
  - sets the next marker to be the tap marker
  - if the tap marker is already the last marker AND BOTH autocommit AND
    next-line-on-commit is ON, will move onto the next line
  - if moved on to the next line, also sets the start marker to the current
    audio position, so the two lines are connected, and moves to the
    next tap marker (essentially reinvoking time_tap_connect once)
- **Button**: time_tap_no_connect (hotkey O): similar to
  time_tap_connect, except it will not set the next line's start
  position even if moved to the next line

Expected workflow:
1) User loads song lyrics
2) User splits each line into syllables
3) User turns on tap-to-time, autocommit, and next-line-on-commit
4) User plays audio from beginning, tapping time_tap_connect to each
syllable, occasionally tapping time_tap_no_connect when a break between
lines is desired
5) If user messes up a line, they can set the tap marker to where they
want to restart from, and ctrl-right-click to start the audio a few
seconds before it
6) Syllables can be split/merged at will, and adjustments to timing can
be done using normal karaoke timing controls
2018-11-21 21:21:31 -08:00
Thomas Goyne 40ae2cdc35 Fix snapping audio markers when dragging inactive line markers with ctrl
We do need to check if the inactive markers are in the active set when
ctrl-dragging, as otherwise there'll always be a marker 0 pixels away to
snap to. Fortunately when ctrl-dragging all of the the markers involved
are by definition very close together, so it would be very difficult to
have enough markers to check for this to be a performance issue.

Closes #1823.
2015-03-01 11:13:43 -08:00
Thomas Goyne 3b34ed9a77 Move AssTime to libaegisub and add tests 2014-07-06 19:25:49 -07:00
Thomas Goyne 09e325a1c3 Clean up unused includes 2014-05-23 07:28:24 -07:00
Thomas Goyne 9774352a77 Fix compilation with gcc 4.8. Closes #1756. 2014-05-19 06:53:44 -07:00
Thomas Goyne 8a49cf1c34 Shove simple getters in AudioTimingControllerDialogue into the class declaration 2014-05-15 07:44:13 -07:00
Thomas Goyne 6f36c75cfd Fix snapping audio markers to markers from other selected lines 2014-05-15 07:31:33 -07:00
Thomas Goyne e593843da7 Significantly speed up marker snapping with large selections 2014-05-14 12:48:59 -07:00
Thomas Goyne fc662e0278 Use INT_MIN as the invalid click position sentinel rather than -1 2014-05-14 12:13:40 -07:00
Thomas Goyne c13b026598 Snap based on all markers being dragged rather than just the mouse position 2014-05-14 12:04:19 -07:00
Thomas Goyne 9168484fc6 Allow clicking anywhere in the audio display for alt-dragging 2014-05-14 08:37:03 -07:00
Thomas Goyne fff59982f4 Clear the clicked marker on right click 2014-05-13 12:44:28 -07:00
Thomas Goyne 1651446e0f Drag the entire audio selection when Alt is held down
Closes #691.
2014-05-12 12:07:46 -07:00
Thomas Goyne 5da847e1ef Use more NSDMIs 2014-05-12 10:05:36 -07:00
Thomas Goyne 7161ce167c Use lambdas rather than std::bind(std::ref(Signal)) for signal forwarding 2014-04-23 15:48:39 -07:00
Thomas Goyne 6fc4c8da14 Move make_unique to its own header file
Rebuilding the entire project after touching util.h gets old fast.
2014-04-23 15:29:23 -07:00
Thomas Goyne c53e8f6139 Pass around newly created AudioTimingControllers in a unique_ptr 2014-04-22 16:21:53 -07:00
Thomas Goyne 1d5292fdee Kill config.h and just force-include acconf.h in non-pch builds 2014-04-16 08:11:37 -07:00
Thomas Goyne df762b5b99 Add a checked iterator_to() to AssFile
iterator_to requires that the object be in the list, which is sometimes
not the case when processing a commit which removed the active line or a
selected line. To handle this, add a checked version that returns
Events.end() when it is not in the list rather than crashing.
2014-04-04 09:01:02 -07:00
Thomas Goyne caf5ac9cd7 Sort the audio display markers
This was accidentally removed in 5d3bc0d. Closes #1731.
2014-04-01 09:19:30 -07:00
Thomas Goyne 523d858374 Extract SelectionController from BaseGrid 2014-03-25 17:06:47 -07:00
Thomas Goyne 2eb211f5b6 Fix issues with showing the previous inactive line
The "previous" line for the first line was actually the last line of the
file, and the previous line for the second line was ignored entirely.

Closes #1719.
2014-03-21 16:41:22 -07:00
Thomas Goyne 3e9bb94126 Use boost range algorithms in audio_timing_dialogue.cpp 2014-03-21 16:11:56 -07:00
Thomas Goyne 5d3bc0d0d2 Modernize some code in audio_timing_dialogue.cpp 2014-03-21 16:01:24 -07:00
Thomas Goyne ea96c6e2ad Make everything final that can be
Apparently gcc does use final for devirtualization.
2014-03-12 19:07:30 -07:00
Thomas Goyne 92ae789b46 Eliminate a bunch of pointless copies of the selection set 2014-03-12 14:54:46 -07:00
Thomas Goyne 33a4a056a4 Move everything up a level since the root dir no longer has stuff 2014-03-11 12:14:57 -07:00