Use Bind rather than Connect in AudioController

Originally committed to SVN as r5085.
This commit is contained in:
Thomas Goyne 2010-12-31 23:53:36 +00:00
parent cf89403a5b
commit 7347c09ac0
1 changed files with 5 additions and 5 deletions

View File

@ -142,11 +142,11 @@ AudioController::AudioController()
, playback_mode(PM_NotPlaying) , playback_mode(PM_NotPlaying)
, playback_timer(this) , playback_timer(this)
{ {
Connect(playback_timer.GetId(), wxEVT_TIMER, (wxObjectEventFunction)&AudioController::OnPlaybackTimer); Bind(wxEVT_TIMER, &AudioController::OnPlaybackTimer, this, playback_timer.GetId());
#ifdef wxHAS_POWER_EVENTS #ifdef wxHAS_POWER_EVENTS
Connect(wxEVT_POWER_SUSPENDED, (wxObjectEventFunction)&AudioController::OnComputerSuspending); Bind(wxEVT_POWER_SUSPENDED, &AudioController::OnComputerSuspending, this);
Connect(wxEVT_POWER_RESUME, (wxObjectEventFunction)&AudioController::OnComputerResuming); Bind(wxEVT_POWER_RESUME, &AudioController::OnComputerResuming, this);
#endif #endif
} }
@ -164,8 +164,8 @@ void AudioController::OnPlaybackTimer(wxTimerEvent &event)
if (!player->IsPlaying() || if (!player->IsPlaying() ||
(playback_mode != PM_ToEnd && pos >= player->GetEndPosition()+200)) (playback_mode != PM_ToEnd && pos >= player->GetEndPosition()+200))
{ {
// The +200 is to allow the player to end the sound output cleanly, otherwise a popping // The +200 is to allow the player to end the sound output cleanly,
// artifact can sometimes be heard. // otherwise a popping artifact can sometimes be heard.
Stop(); Stop();
} }
else else