mirror of https://github.com/odrling/Aegisub
Anything that stops audio will also stop video too, now
Originally committed to SVN as r457.
This commit is contained in:
parent
453a594264
commit
2627c77a0b
|
@ -382,6 +382,7 @@ void AudioBox::OnPlaySelection(wxCommandEvent &event) {
|
||||||
int start=0,end=0;
|
int start=0,end=0;
|
||||||
audioDisplay->SetFocus();
|
audioDisplay->SetFocus();
|
||||||
audioDisplay->GetTimesSelection(start,end);
|
audioDisplay->GetTimesSelection(start,end);
|
||||||
|
audioDisplay->Stop();
|
||||||
audioDisplay->Play(start,end);
|
audioDisplay->Play(start,end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,6 +394,7 @@ void AudioBox::OnPlayDialogue(wxCommandEvent &event) {
|
||||||
audioDisplay->SetFocus();
|
audioDisplay->SetFocus();
|
||||||
audioDisplay->GetTimesDialogue(start,end);
|
audioDisplay->GetTimesDialogue(start,end);
|
||||||
audioDisplay->SetSelection(start, end);
|
audioDisplay->SetSelection(start, end);
|
||||||
|
audioDisplay->Stop();
|
||||||
audioDisplay->Play(start,end);
|
audioDisplay->Play(start,end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,6 +411,7 @@ void AudioBox::OnStop(wxCommandEvent &event) {
|
||||||
// Next
|
// Next
|
||||||
void AudioBox::OnNext(wxCommandEvent &event) {
|
void AudioBox::OnNext(wxCommandEvent &event) {
|
||||||
audioDisplay->SetFocus();
|
audioDisplay->SetFocus();
|
||||||
|
audioDisplay->Stop();
|
||||||
audioDisplay->Next();
|
audioDisplay->Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -417,6 +420,7 @@ void AudioBox::OnNext(wxCommandEvent &event) {
|
||||||
// Previous
|
// Previous
|
||||||
void AudioBox::OnPrev(wxCommandEvent &event) {
|
void AudioBox::OnPrev(wxCommandEvent &event) {
|
||||||
audioDisplay->SetFocus();
|
audioDisplay->SetFocus();
|
||||||
|
audioDisplay->Stop();
|
||||||
audioDisplay->Prev();
|
audioDisplay->Prev();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -427,6 +431,7 @@ void AudioBox::OnPlay500Before(wxCommandEvent &event) {
|
||||||
int start=0,end=0;
|
int start=0,end=0;
|
||||||
audioDisplay->SetFocus();
|
audioDisplay->SetFocus();
|
||||||
audioDisplay->GetTimesSelection(start,end);
|
audioDisplay->GetTimesSelection(start,end);
|
||||||
|
audioDisplay->Stop();
|
||||||
audioDisplay->Play(start-500,start);
|
audioDisplay->Play(start-500,start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,6 +442,7 @@ void AudioBox::OnPlay500After(wxCommandEvent &event) {
|
||||||
int start=0,end=0;
|
int start=0,end=0;
|
||||||
audioDisplay->SetFocus();
|
audioDisplay->SetFocus();
|
||||||
audioDisplay->GetTimesSelection(start,end);
|
audioDisplay->GetTimesSelection(start,end);
|
||||||
|
audioDisplay->Stop();
|
||||||
audioDisplay->Play(end,end+500);
|
audioDisplay->Play(end,end+500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,6 +455,7 @@ void AudioBox::OnPlay500First(wxCommandEvent &event) {
|
||||||
audioDisplay->GetTimesSelection(start,end);
|
audioDisplay->GetTimesSelection(start,end);
|
||||||
int endp = start+500;
|
int endp = start+500;
|
||||||
if (endp > end) endp = end;
|
if (endp > end) endp = end;
|
||||||
|
audioDisplay->Stop();
|
||||||
audioDisplay->Play(start,endp);
|
audioDisplay->Play(start,endp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -461,6 +468,7 @@ void AudioBox::OnPlay500Last(wxCommandEvent &event) {
|
||||||
audioDisplay->GetTimesSelection(start,end);
|
audioDisplay->GetTimesSelection(start,end);
|
||||||
int startp = end-500;
|
int startp = end-500;
|
||||||
if (startp < start) startp = start;
|
if (startp < start) startp = start;
|
||||||
|
audioDisplay->Stop();
|
||||||
audioDisplay->Play(startp,end);
|
audioDisplay->Play(startp,end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -471,6 +479,7 @@ void AudioBox::OnPlayToEnd(wxCommandEvent &event) {
|
||||||
int start=0,end=0;
|
int start=0,end=0;
|
||||||
audioDisplay->SetFocus();
|
audioDisplay->SetFocus();
|
||||||
audioDisplay->GetTimesSelection(start,end);
|
audioDisplay->GetTimesSelection(start,end);
|
||||||
|
audioDisplay->Stop();
|
||||||
audioDisplay->Play(start,-1);
|
audioDisplay->Play(start,-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ AudioDisplay::AudioDisplay(wxWindow *parent,VideoDisplay *display)
|
||||||
: wxWindow (parent, -1, wxDefaultPosition, wxSize(200,Options.AsInt(_T("Audio Display Height"))), wxSUNKEN_BORDER | wxWANTS_CHARS , _T("Audio Display"))
|
: wxWindow (parent, -1, wxDefaultPosition, wxSize(200,Options.AsInt(_T("Audio Display Height"))), wxSUNKEN_BORDER | wxWANTS_CHARS , _T("Audio Display"))
|
||||||
{
|
{
|
||||||
// Set variables
|
// Set variables
|
||||||
|
video = NULL;
|
||||||
origImage = NULL;
|
origImage = NULL;
|
||||||
spectrumDisplay = NULL;
|
spectrumDisplay = NULL;
|
||||||
ScrollBar = NULL;
|
ScrollBar = NULL;
|
||||||
|
@ -963,6 +964,7 @@ void AudioDisplay::Stop() {
|
||||||
if (!player) return;
|
if (!player) return;
|
||||||
|
|
||||||
player->Stop();
|
player->Stop();
|
||||||
|
if (video && video->IsPlaying) video->Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -854,9 +854,11 @@ void VideoDisplay::PlayLine() {
|
||||||
////////
|
////////
|
||||||
// Stop
|
// Stop
|
||||||
void VideoDisplay::Stop() {
|
void VideoDisplay::Stop() {
|
||||||
Playback.Stop();
|
if (IsPlaying) {
|
||||||
audio->Stop();
|
Playback.Stop();
|
||||||
IsPlaying = false;
|
IsPlaying = false;
|
||||||
|
audio->Stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue