Use wxGetApp() rather than wxTheApp plus a cast

Originally committed to SVN as r6052.
This commit is contained in:
Thomas Goyne 2011-12-22 21:17:40 +00:00
parent 92949bc965
commit 28e8f0b640
2 changed files with 3 additions and 5 deletions

View file

@ -78,8 +78,7 @@ void DirectSoundPlayer::OpenStream() {
if (FAILED(res)) throw "Failed initializing DirectSound"; if (FAILED(res)) throw "Failed initializing DirectSound";
// Set DirectSound parameters // Set DirectSound parameters
AegisubApp *app = (AegisubApp*) wxTheApp; directSound->SetCooperativeLevel((HWND)wxGetApp().frame->GetHandle(),DSSCL_PRIORITY);
directSound->SetCooperativeLevel((HWND)app->frame->GetHandle(),DSSCL_PRIORITY);
// Create the wave format structure // Create the wave format structure
WAVEFORMATEX waveFormat; WAVEFORMATEX waveFormat;

View file

@ -165,9 +165,8 @@ struct app_language : public Command {
void operator()(agi::Context *c) { void operator()(agi::Context *c) {
// Get language // Get language
AegisubApp *app = (AegisubApp*) wxTheApp; int old = wxGetApp().locale.curCode;
int old = app->locale.curCode; int newCode = wxGetApp().locale.PickLanguage();
int newCode = app->locale.PickLanguage();
// Is OK? // Is OK?
if (newCode != -1 && newCode != old) { if (newCode != -1 && newCode != old) {
// Set code // Set code