summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerparcelmediaautoplay.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerparcelmediaautoplay.cpp')
-rw-r--r--indra/newview/llviewerparcelmediaautoplay.cpp27
1 files changed, 4 insertions, 23 deletions
diff --git a/indra/newview/llviewerparcelmediaautoplay.cpp b/indra/newview/llviewerparcelmediaautoplay.cpp
index b4dc6932be..36c7d436f6 100644
--- a/indra/newview/llviewerparcelmediaautoplay.cpp
+++ b/indra/newview/llviewerparcelmediaautoplay.cpp
@@ -54,29 +54,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()
@@ -125,7 +106,7 @@ BOOL LLViewerParcelMediaAutoPlay::tick()
(mTimeInParcel > AUTOPLAY_TIME) && // and if we've been here for so many seconds
(!this_media_url.empty()) && // and if the parcel has media
(stricmp(this_media_type.c_str(), LLMIMETypes::getDefaultMimeType().c_str()) != 0) &&
- (LLViewerParcelMedia::sMediaImpl.isNull())) // and if the media is not already playing
+ (!LLViewerParcelMedia::getInstance()->hasParcelMedia())) // and if the media is not already playing
{
if (this_media_texture_id.notNull()) // and if the media texture is good
{
@@ -153,7 +134,7 @@ BOOL LLViewerParcelMediaAutoPlay::tick()
break;
case 1:
// Play, default value for ParcelMediaAutoPlayEnable
- LLViewerParcelMedia::play(this_parcel);
+ LLViewerParcelMedia::getInstance()->play(this_parcel);
break;
case 2:
default:
@@ -188,7 +169,7 @@ void LLViewerParcelMediaAutoPlay::onStartMusicResponse(const LLUUID &region_id,
// make sure we are still there
if (parcel->getLocalID() == parcel_id && gAgent.getRegion()->getRegionID() == region_id)
{
- LLViewerParcelMedia::play(parcel);
+ LLViewerParcelMedia::getInstance()->play(parcel);
}
}
}