DRTVWR-493 Converted LLViewerParcelMediaAutoPlay to singleton
parent
24a0601a50
commit
82f259b133
|
|
@ -52,7 +52,6 @@ mMediaParcelLocalID(0)
|
|||
LLMessageSystem* msg = gMessageSystem;
|
||||
msg->setHandlerFunc("ParcelMediaCommandMessage", parcelMediaCommandMessageHandler );
|
||||
msg->setHandlerFunc("ParcelMediaUpdate", parcelMediaUpdateHandler );
|
||||
LLViewerParcelMediaAutoPlay::initClass();
|
||||
}
|
||||
|
||||
LLViewerParcelMedia::~LLViewerParcelMedia()
|
||||
|
|
|
|||
|
|
@ -51,29 +51,10 @@ LLViewerParcelMediaAutoPlay::LLViewerParcelMediaAutoPlay() :
|
|||
{
|
||||
}
|
||||
|
||||
static LLViewerParcelMediaAutoPlay *sAutoPlay = NULL;
|
||||
|
||||
// static
|
||||
void LLViewerParcelMediaAutoPlay::initClass()
|
||||
{
|
||||
if (!sAutoPlay)
|
||||
sAutoPlay = new LLViewerParcelMediaAutoPlay;
|
||||
}
|
||||
|
||||
// static
|
||||
void LLViewerParcelMediaAutoPlay::cleanupClass()
|
||||
{
|
||||
if (sAutoPlay)
|
||||
delete sAutoPlay;
|
||||
}
|
||||
|
||||
// static
|
||||
void LLViewerParcelMediaAutoPlay::playStarted()
|
||||
{
|
||||
if (sAutoPlay)
|
||||
{
|
||||
sAutoPlay->mPlayed = TRUE;
|
||||
}
|
||||
LLSingleton<LLViewerParcelMediaAutoPlay>::getInstance()->mPlayed = TRUE;
|
||||
}
|
||||
|
||||
BOOL LLViewerParcelMediaAutoPlay::tick()
|
||||
|
|
|
|||
|
|
@ -31,13 +31,11 @@
|
|||
#include "lluuid.h"
|
||||
|
||||
// timer to automatically play media
|
||||
class LLViewerParcelMediaAutoPlay : LLEventTimer
|
||||
class LLViewerParcelMediaAutoPlay : LLEventTimer, public LLSingleton<LLViewerParcelMediaAutoPlay>
|
||||
{
|
||||
public:
|
||||
LLViewerParcelMediaAutoPlay();
|
||||
LLSINGLETON(LLViewerParcelMediaAutoPlay);
|
||||
public:
|
||||
virtual BOOL tick();
|
||||
static void initClass();
|
||||
static void cleanupClass();
|
||||
static void playStarted();
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Reference in New Issue