Skip to content
Snippets Groups Projects
Commit ca1356d4 authored by Monroe Linden's avatar Monroe Linden
Browse files

LLViewerMediaImpl now keeps track of which instance is the current parcel media instance.

The active parcel media instance always gets priority over other inworld media.
parent 4be7fa99
No related branches found
No related tags found
No related merge requests found
...@@ -459,12 +459,12 @@ LLViewerMedia::impl_list &LLViewerMedia::getPriorityList() ...@@ -459,12 +459,12 @@ LLViewerMedia::impl_list &LLViewerMedia::getPriorityList()
// This is the predicate function used to sort sViewerMediaImplList by priority. // This is the predicate function used to sort sViewerMediaImplList by priority.
bool LLViewerMedia::priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2) bool LLViewerMedia::priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2)
{ {
if(i1->isForcedUnloaded()) if(i1->isForcedUnloaded() && !i2->isForcedUnloaded())
{ {
// Muted or failed items always go to the end of the list, period. // Muted or failed items always go to the end of the list, period.
return false; return false;
} }
else if(i2->isForcedUnloaded()) else if(i2->isForcedUnloaded() && !i1->isForcedUnloaded())
{ {
// Muted or failed items always go to the end of the list, period. // Muted or failed items always go to the end of the list, period.
return true; return true;
...@@ -489,6 +489,16 @@ bool LLViewerMedia::priorityComparitor(const LLViewerMediaImpl* i1, const LLView ...@@ -489,6 +489,16 @@ bool LLViewerMedia::priorityComparitor(const LLViewerMediaImpl* i1, const LLView
// i2 is a UI element, i1 is not. This makes i2 "less than" i1, so it sorts earlier in our list. // i2 is a UI element, i1 is not. This makes i2 "less than" i1, so it sorts earlier in our list.
return false; return false;
} }
else if(i1->isParcelMedia())
{
// The parcel media impl sorts above all other inworld media, unless one has focus.
return true;
}
else if(i2->isParcelMedia())
{
// The parcel media impl sorts above all other inworld media, unless one has focus.
return false;
}
else else
{ {
// The object with the larger interest value should be earlier in the list, so we reverse the sense of the comparison here. // The object with the larger interest value should be earlier in the list, so we reverse the sense of the comparison here.
...@@ -686,6 +696,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, ...@@ -686,6 +696,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id,
mPreviousMediaState(MEDIA_NONE), mPreviousMediaState(MEDIA_NONE),
mPreviousMediaTime(0.0f), mPreviousMediaTime(0.0f),
mIsDisabled(false), mIsDisabled(false),
mIsParcelMedia(false),
mProximity(-1), mProximity(-1),
mIsUpdated(false) mIsUpdated(false)
{ {
......
...@@ -191,14 +191,17 @@ class LLViewerMediaImpl ...@@ -191,14 +191,17 @@ class LLViewerMediaImpl
bool isMediaPlaying(); bool isMediaPlaying();
bool isMediaPaused(); bool isMediaPaused();
bool hasMedia(); bool hasMedia();
bool isMediaFailed() { return mMediaSourceFailed; }; bool isMediaFailed() const { return mMediaSourceFailed; };
void resetPreviousMediaState(); void resetPreviousMediaState();
void setDisabled(bool disabled) { mIsDisabled = disabled; }; void setDisabled(bool disabled) { mIsDisabled = disabled; };
bool isMediaDisabled() { return mIsDisabled; }; bool isMediaDisabled() const { return mIsDisabled; };
// returns true if this instance should not be loaded (disabled, muted object, crashed, etc.) // returns true if this instance should not be loaded (disabled, muted object, crashed, etc.)
bool isForcedUnloaded() const; bool isForcedUnloaded() const;
void setIsParcelMedia(bool is_parcel_media) { mIsParcelMedia = is_parcel_media; };
bool isParcelMedia() const { return mIsParcelMedia; };
ECursorType getLastSetCursor() { return mLastSetCursor; }; ECursorType getLastSetCursor() { return mLastSetCursor; };
...@@ -326,6 +329,7 @@ class LLViewerMediaImpl ...@@ -326,6 +329,7 @@ class LLViewerMediaImpl
int mPreviousMediaState; int mPreviousMediaState;
F64 mPreviousMediaTime; F64 mPreviousMediaTime;
bool mIsDisabled; bool mIsDisabled;
bool mIsParcelMedia;
S32 mProximity; S32 mProximity;
private: private:
......
...@@ -226,6 +226,7 @@ void LLViewerParcelMedia::play(LLParcel* parcel) ...@@ -226,6 +226,7 @@ void LLViewerParcelMedia::play(LLParcel* parcel)
media_height, media_height,
media_auto_scale, media_auto_scale,
media_loop); media_loop);
sMediaImpl->setIsParcelMedia(true);
sMediaImpl->navigateTo(media_url, mime_type, true); sMediaImpl->navigateTo(media_url, mime_type, true);
} }
} }
...@@ -240,6 +241,7 @@ void LLViewerParcelMedia::play(LLParcel* parcel) ...@@ -240,6 +241,7 @@ void LLViewerParcelMedia::play(LLParcel* parcel)
media_height, media_height,
media_auto_scale, media_auto_scale,
media_loop); media_loop);
sMediaImpl->setIsParcelMedia(true);
sMediaImpl->navigateTo(media_url, mime_type, true); sMediaImpl->navigateTo(media_url, mime_type, true);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment