Added base of code to allow sending backend updates to connected clients.
This commit is contained in:
@@ -33,6 +33,7 @@ WebInterface::WebInterface(const Wt::WEnvironment& env) : Wt::WApplication(env)
|
||||
{
|
||||
priv_int = new internal;
|
||||
setTitle("Arbitrateor - Audio Jukebox");
|
||||
enableUpdates(true);
|
||||
priv_int->playerUI = new PlayerInterface(this);
|
||||
priv_int->playerUI->hide();
|
||||
priv_int->loginUI = new LoginInterface(this);
|
||||
@@ -53,5 +54,29 @@ void WebInterface::loginCompleted()
|
||||
//Login completed, now bring up main inteface.
|
||||
priv_int->loginUI->animateHide(Wt::WAnimation(Wt::WAnimation::AnimationEffect::Fade));
|
||||
priv_int->playerUI->animateShow(Wt::WAnimation(Wt::WAnimation::AnimationEffect::Fade, Wt::WAnimation::TimingFunction::EaseIn, 500));
|
||||
//TODO: set up player to dynamically update?
|
||||
//TODO: request current player state.
|
||||
}
|
||||
|
||||
void WebInterface::playPauseActionFromServer(User* userPausing)
|
||||
{
|
||||
priv_int->playerUI->tempText->setText(priv_int->playerUI->tempText->text()+"play");
|
||||
triggerUpdate();
|
||||
}
|
||||
|
||||
void WebInterface::songChangedFromServer(AudioTrack* nextTrack)
|
||||
{
|
||||
priv_int->playerUI->tempText->setText(priv_int->playerUI->tempText->text()+"change");
|
||||
triggerUpdate();
|
||||
}
|
||||
|
||||
void WebInterface::skipVotedFromServer(User* userRequestingToSkipCurrentTrack)
|
||||
{
|
||||
priv_int->playerUI->tempText->setText(priv_int->playerUI->tempText->text()+"skip");
|
||||
triggerUpdate();
|
||||
}
|
||||
|
||||
void WebInterface::voteUpdateFromServer(User* userVoting, bool forSkip)
|
||||
{
|
||||
priv_int->playerUI->tempText->setText(priv_int->playerUI->tempText->text()+"vote");
|
||||
triggerUpdate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user