forked from mia/Aegisub
Karaoke is now more properly autoscrolled into audio display, per bug #334, it still can use some tweaking though
Originally committed to SVN as r1054.
This commit is contained in:
parent
c42dff5d65
commit
6f6f53f1b2
1 changed files with 13 additions and 2 deletions
|
@ -656,15 +656,26 @@ void AudioDisplay::RecreateImage() {
|
||||||
void AudioDisplay::MakeDialogueVisible(bool force) {
|
void AudioDisplay::MakeDialogueVisible(bool force) {
|
||||||
// Variables
|
// Variables
|
||||||
int temp1=0,temp2=0;
|
int temp1=0,temp2=0;
|
||||||
|
if (karaoke->enabled) {
|
||||||
|
// In karaoke mode the entire dialogue line should be visible instead of just the selected syllable
|
||||||
|
GetTimesDialogue(temp1, temp2);
|
||||||
|
} else {
|
||||||
GetTimesSelection(temp1,temp2);
|
GetTimesSelection(temp1,temp2);
|
||||||
|
}
|
||||||
int startPos = GetSampleAtMS(temp1);
|
int startPos = GetSampleAtMS(temp1);
|
||||||
int endPos = GetSampleAtMS(temp2);
|
int endPos = GetSampleAtMS(temp2);
|
||||||
int startX = GetXAtMS(temp1);
|
int startX = GetXAtMS(temp1);
|
||||||
int endX = GetXAtMS(temp2);
|
int endX = GetXAtMS(temp2);
|
||||||
|
|
||||||
if (force || startX < 50 || endX > w-50) {
|
if (force || startX < 50 || endX > w-50) {
|
||||||
|
if (startX < 50) {
|
||||||
|
// Make sure the left edge of the selection is at least 50 pixels from the edge of the display
|
||||||
|
UpdatePosition(startPos - 50*samples, true);
|
||||||
|
} else {
|
||||||
|
// Otherwise center the selection in display
|
||||||
UpdatePosition((startPos+endPos-w*samples)/2,true);
|
UpdatePosition((startPos+endPos-w*samples)/2,true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update
|
// Update
|
||||||
UpdateImage();
|
UpdateImage();
|
||||||
|
|
Loading…
Reference in a new issue