From be0cedb475a14c637a15f85fcfbb9c8f9a59e816 Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Sun, 22 Apr 2007 00:14:58 +0000 Subject: [PATCH] Made esc work with attachments, automation and spell checker dialogs, and jfs's suggested changes to dsound code Originally committed to SVN as r1105. --- aegisub/audio_player_dsound.cpp | 2 ++ aegisub/dialog_attachments.cpp | 1 + aegisub/dialog_automation.cpp | 1 + aegisub/dialog_spellchecker.cpp | 1 + 4 files changed, 5 insertions(+) diff --git a/aegisub/audio_player_dsound.cpp b/aegisub/audio_player_dsound.cpp index 81a4616d1..61a8e961d 100644 --- a/aegisub/audio_player_dsound.cpp +++ b/aegisub/audio_player_dsound.cpp @@ -356,6 +356,7 @@ wxThread::ExitCode DirectSoundPlayerThread::Entry() { if (FAILED(res)) break; res = parent->buffer->Lock(parent->offset, (playpos-parent->offset)%parent->bufSize, &buf1, &size1, &buf2, &size2, 0); if (FAILED(res)) break; + parent->offset = (parent->offset + size1 + size2) % parent->bufSize; if (size1) memset(buf1, 0, size1); if (size2) memset(buf2, 0, size2); bytesFilled += size1 + size2; @@ -366,6 +367,7 @@ wxThread::ExitCode DirectSoundPlayerThread::Entry() { wxLogDebug(_T("DS thread dead")); parent->playing = false; + WaitForSingleObject(stopnotify, 1500); parent->buffer->Stop(); return 0; } diff --git a/aegisub/dialog_attachments.cpp b/aegisub/dialog_attachments.cpp index 53adabef2..3ee759ad2 100644 --- a/aegisub/dialog_attachments.cpp +++ b/aegisub/dialog_attachments.cpp @@ -69,6 +69,7 @@ DialogAttachments::DialogAttachments(wxWindow *parent) buttonSizer->Add(extractButton,1,0,0); buttonSizer->Add(deleteButton,1,0,0); buttonSizer->Add(new wxButton(this,BUTTON_CLOSE,_("&Close")),1,wxLEFT,5); + SetEscapeId(BUTTON_CLOSE); // Main sizer wxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); diff --git a/aegisub/dialog_automation.cpp b/aegisub/dialog_automation.cpp index 3ab9e0047..48f4345d2 100644 --- a/aegisub/dialog_automation.cpp +++ b/aegisub/dialog_automation.cpp @@ -75,6 +75,7 @@ DialogAutomation::DialogAutomation(wxWindow *parent, Automation4::ScriptManager button_box->AddSpacer(10); button_box->Add(close_button, 0); button_box->AddStretchSpacer(2); + SetEscapeId(wxID_CLOSE); // main layout wxSizer *main_box = new wxBoxSizer(wxVERTICAL); diff --git a/aegisub/dialog_spellchecker.cpp b/aegisub/dialog_spellchecker.cpp index 60ced470e..91a2df2e8 100644 --- a/aegisub/dialog_spellchecker.cpp +++ b/aegisub/dialog_spellchecker.cpp @@ -126,6 +126,7 @@ DialogSpellChecker::DialogSpellChecker(wxFrame *parent) botSizer->Add(language,1,wxEXPAND); botSizer->Add(new wxButton(this,wxID_CLOSE),0,wxEXPAND); botSizer->AddGrowableCol(0,1); + SetEscapeId(wxID_CLOSE); // Main sizer wxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);