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";
// Set DirectSound parameters
AegisubApp *app = (AegisubApp*) wxTheApp;
directSound->SetCooperativeLevel((HWND)app->frame->GetHandle(),DSSCL_PRIORITY);
directSound->SetCooperativeLevel((HWND)wxGetApp().frame->GetHandle(),DSSCL_PRIORITY);
// Create the wave format structure
WAVEFORMATEX waveFormat;

View file

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