Holding down ctrl lets you retime the original line while in Karaoke mode.

Originally committed to SVN as r725.
This commit is contained in:
Rodrigo Braz Monteiro 2007-01-06 20:11:38 +00:00
parent 7843e2e89c
commit cd4b6c0f93
2 changed files with 17 additions and 6 deletions

View File

@ -184,25 +184,31 @@ void AudioDisplay::UpdateImage(bool weak) {
lineEnd = 0; lineEnd = 0;
selStartCap = 0; selStartCap = 0;
selEndCap = 0; selEndCap = 0;
__int64 drawSelStart = 0;
__int64 drawSelEnd = 0;
if (dialogue) { if (dialogue) {
GetDialoguePos(lineStart,lineEnd,false); GetDialoguePos(lineStart,lineEnd,false);
hasSel = true; hasSel = true;
if (hasKaraoke) { if (hasKaraoke) {
GetKaraokePos(selStartCap,selEndCap,true); GetKaraokePos(selStartCap,selEndCap,true);
GetKaraokePos(selStart,selEnd,false); GetKaraokePos(drawSelStart,drawSelEnd,false);
selStart = lineStart;
selEnd = lineEnd;
} }
else { else {
GetDialoguePos(selStartCap,selEndCap,true); GetDialoguePos(selStartCap,selEndCap,true);
selStart = lineStart; selStart = lineStart;
selEnd = lineEnd; selEnd = lineEnd;
drawSelStart = lineStart;
drawSelEnd = lineEnd;
} }
} }
// Draw selection bg // Draw selection bg
if (hasSel && selStart < selEnd && draw_selection_background) { if (hasSel && drawSelStart < drawSelEnd && draw_selection_background) {
if (NeedCommit && !karaoke->enabled) dc.SetBrush(wxBrush(Options.AsColour(_T("Audio Selection Background Modified")))); if (NeedCommit && !karaoke->enabled) dc.SetBrush(wxBrush(Options.AsColour(_T("Audio Selection Background Modified"))));
else dc.SetBrush(wxBrush(Options.AsColour(_T("Audio Selection Background")))); else dc.SetBrush(wxBrush(Options.AsColour(_T("Audio Selection Background"))));
dc.DrawRectangle(selStart,0,selEnd-selStart,h); dc.DrawRectangle(drawSelStart,0,drawSelEnd-drawSelStart,h);
} }
// Draw spectrum // Draw spectrum
@ -1457,9 +1463,10 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
// Grab start/end // Grab start/end
if (hold == 0) { if (hold == 0) {
bool gotGrab = false; bool gotGrab = false;
bool karTime = karMode && !event.ControlDown();
// Grab start // Grab start
if (!karMode) { if (!karTime) {
if (abs64 (x - selStart) < 6) { if (abs64 (x - selStart) < 6) {
wxCursor cursor(wxCURSOR_SIZEWE); wxCursor cursor(wxCURSOR_SIZEWE);
SetCursor(cursor); SetCursor(cursor);
@ -1483,7 +1490,7 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
} }
// Grabbing a syllable // Grabbing a syllable
if (!gotGrab && karMode) { else {
__int64 pos,len,curpos; __int64 pos,len,curpos;
KaraokeSyllable *curSyl; KaraokeSyllable *curSyl;
size_t karn = karaoke->syllables.size(); size_t karn = karaoke->syllables.size();
@ -1533,7 +1540,7 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
if (leftIsDown && x != lastX) { if (leftIsDown && x != lastX) {
selStart = lastX; selStart = lastX;
selEnd = x; selEnd = x;
curStartMS = GetMSAtX(lastX); curStartMS = GetMSAtX(GetBoundarySnap(lastX,event.ShiftDown()?0:10));
curEndMS = GetMSAtX(x); curEndMS = GetMSAtX(x);
hold = 2; hold = 2;
} }
@ -1656,6 +1663,9 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
//////////////////////// ////////////////////////
// Get snap to boundary // Get snap to boundary
int AudioDisplay::GetBoundarySnap(int x,int range) { int AudioDisplay::GetBoundarySnap(int x,int range) {
// Range?
if (range <= 0) return x;
// Find the snap boundaries // Find the snap boundaries
wxArrayInt boundaries; wxArrayInt boundaries;
if (video->KeyFramesLoaded() && Options.AsBool(_T("Audio Draw Secondary Lines"))) { if (video->KeyFramesLoaded() && Options.AsBool(_T("Audio Draw Secondary Lines"))) {

View File

@ -73,6 +73,7 @@ Please visit http://aegisub.net to download latest version
o When dragging line start/end markers, they will snap to keyframes or nearby subtitle start/end markers, hold down "Shift" to override this behaviour. o When dragging line start/end markers, they will snap to keyframes or nearby subtitle start/end markers, hold down "Shift" to override this behaviour.
o The "Play" shortcut will always play, regardless of whether it was already playing or not. There is a new shortcut for "Stop". o The "Play" shortcut will always play, regardless of whether it was already playing or not. There is a new shortcut for "Stop".
o Styles for line start/end markers have changed. o Styles for line start/end markers have changed.
o Holding down ctrl lets you retime the original line while in Karaoke mode.
- Fixed loading of SRT and TXT files, which were causing an empty line to appear at the start of the file. (AMZ) - Fixed loading of SRT and TXT files, which were causing an empty line to appear at the start of the file. (AMZ)
- Added options to toggle the display of the audio timeline and of the time over the mouse cursor. (AMZ) - Added options to toggle the display of the audio timeline and of the time over the mouse cursor. (AMZ)