forked from mia/Aegisub
Hack to fix #687, if playing to end of audio, changing the selection end shouldn't affect the playback end: it should still play to end of audio.
Originally committed to SVN as r2939.
This commit is contained in:
parent
a6c7a8a724
commit
f6bd6df490
2 changed files with 4 additions and 3 deletions
|
@ -1068,6 +1068,7 @@ void AudioDisplay::Play(int start,int end) {
|
||||||
|
|
||||||
// Set defaults
|
// Set defaults
|
||||||
wxLogDebug(_T("AudioDisplay::Play: initialising playback"));
|
wxLogDebug(_T("AudioDisplay::Play: initialising playback"));
|
||||||
|
playingToEnd = end < 0;
|
||||||
int64_t num_samples = provider->GetNumSamples();
|
int64_t num_samples = provider->GetNumSamples();
|
||||||
start = GetSampleAtMS(start);
|
start = GetSampleAtMS(start);
|
||||||
if (end != -1) end = GetSampleAtMS(end);
|
if (end != -1) end = GetSampleAtMS(end);
|
||||||
|
@ -1076,7 +1077,6 @@ void AudioDisplay::Play(int start,int end) {
|
||||||
// Sanity checking
|
// Sanity checking
|
||||||
if (start < 0) start = 0;
|
if (start < 0) start = 0;
|
||||||
if (start >= num_samples) start = num_samples-1;
|
if (start >= num_samples) start = num_samples-1;
|
||||||
if (end < 0) end = 0;
|
|
||||||
if (end >= num_samples) end = num_samples-1;
|
if (end >= num_samples) end = num_samples-1;
|
||||||
if (end < start) end = start;
|
if (end < start) end = start;
|
||||||
|
|
||||||
|
@ -1729,10 +1729,10 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
|
||||||
// Update stuff
|
// Update stuff
|
||||||
if (updated) {
|
if (updated) {
|
||||||
if (diagUpdated) NeedCommit = true;
|
if (diagUpdated) NeedCommit = true;
|
||||||
if (karaoke->enabled) {
|
if (karaoke->enabled && !playingToEnd) {
|
||||||
AudioKaraokeSyllable &syl = karaoke->syllables[karaoke->curSyllable];
|
AudioKaraokeSyllable &syl = karaoke->syllables[karaoke->curSyllable];
|
||||||
player->SetEndPosition(GetSampleAtMS(curStartMS + (syl.start_time+syl.duration)*10));
|
player->SetEndPosition(GetSampleAtMS(curStartMS + (syl.start_time+syl.duration)*10));
|
||||||
} else {
|
} else if (!playingToEnd) {
|
||||||
player->SetEndPosition(GetSampleAtX(selEnd));
|
player->SetEndPosition(GetSampleAtX(selEnd));
|
||||||
}
|
}
|
||||||
if (hold != 0) {
|
if (hold != 0) {
|
||||||
|
|
|
@ -83,6 +83,7 @@ private:
|
||||||
bool hasFocus;
|
bool hasFocus;
|
||||||
bool blockUpdate;
|
bool blockUpdate;
|
||||||
bool dontReadTimes;
|
bool dontReadTimes;
|
||||||
|
bool playingToEnd;
|
||||||
|
|
||||||
bool needImageUpdate;
|
bool needImageUpdate;
|
||||||
bool needImageUpdateWeak;
|
bool needImageUpdateWeak;
|
||||||
|
|
Loading…
Reference in a new issue