📄 smlelem.h
字号:
/* ***** BEGIN LICENSE BLOCK *****
* Version: RCSL 1.0/RPSL 1.0
*
* Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved.
*
* The contents of this file, and the files included with this file, are
* subject to the current version of the RealNetworks Public Source License
* Version 1.0 (the "RPSL") available at
* http://www.helixcommunity.org/content/rpsl unless you have licensed
* the file under the RealNetworks Community Source License Version 1.0
* (the "RCSL") available at http://www.helixcommunity.org/content/rcsl,
* in which case the RCSL will apply. You may also obtain the license terms
* directly from RealNetworks. You may not use this file except in
* compliance with the RPSL or, if you have a valid RCSL with RealNetworks
* applicable to this file, the RCSL. Please see the applicable RPSL or
* RCSL for the rights, obligations and limitations governing use of the
* contents of the file.
*
* This file is part of the Helix DNA Technology. RealNetworks is the
* developer of the Original Code and owns the copyrights in the portions
* it created.
*
* This file, and the files included with this file, is distributed and made
* available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
*
* Technology Compatibility Kit Test Suite(s) Location:
* http://www.helixcommunity.org/content/tck
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** */
#ifndef _SMLELEM_H_
#define _SMLELEM_H_
#define WAY_IN_THE_FUTURE 1981342000 /*1981342000 is 22d+22h+22m+22s */
#if !defined(MAX_LONG32)
#define MAX_LONG32 0x7FFFFFFF
#endif
// /This is used for passing invalid coord value for firing a link when an
// accesskey event occurs (and no mouse coords are involved):
#define ANCHOR_POS_DONTCARE ((UINT16)-1)
// /This is used to simplify event processing since accesskey events have no
// element that raises them, they have no element ID. The following is used
// for all accesskey events that have no ID, and it starts with a number to
// make sure it's an illegal XML id and thus won't be used in a SMIL file:
#define ACCESSKEY_EVENT_FAKE_ID_STRING "21yrsOld__accesskey_fake_id"
// Forward declarations
typedef _INTERFACE IHXValues IHXValues;
typedef _INTERFACE IHXBuffer IHXBuffer;
class CSmilElement;
class CSmilAddGroup;
class CSmilRootLayout;
class CSmilRegion;
class CSmilRegPoint;
#if defined(HELIX_FEATURE_SMIL2_MULTIWINDOWLAYOUT)
class CSmilViewport;
#endif /* #if defined(HELIX_FEATURE_SMIL2_MULTIWINDOWLAYOUT) */
class CSmilSource;
class CSmilMeta;
class CSmilMetadata;
class CSmilEndLayout;
class CSmilRendererPreFetch;
class CSmilSourceUpdate;
#if defined(HELIX_FEATURE_SMIL2_TRANSITIONS)
class CSmilTransition;
#endif /* #if defined(HELIX_FEATURE_SMIL2_TRANSITIONS) */
class CSmilAnimateElement;
class CSmilCustomTest;
class SMILNode;
class CSmilParser;
class SmilTimeValue;
class CHXString;
class CSmilTimelineElement;
class CHXSimpleList;
class CAttr;
class CHXStack;
class CSmilElement;
class CSmilElementHandler
{
public:
virtual HX_RESULT handleAddGroup(CSmilAddGroup* pAddGroup) = 0;
virtual HX_RESULT handleRootLayout(CSmilRootLayout* pRootLayout) = 0;
virtual HX_RESULT handleRegion(CSmilRegion* pRegion) = 0;
virtual HX_RESULT handleRegPoint(CSmilRegPoint* pRegPoint) = 0;
#if defined(HELIX_FEATURE_SMIL2_MULTIWINDOWLAYOUT)
virtual HX_RESULT handleViewport(CSmilViewport* pView) = 0;
#endif /* #if defined(HELIX_FEATURE_SMIL2_MULTIWINDOWLAYOUT) */
virtual HX_RESULT handleSource(CSmilSource* pSource) = 0;
virtual HX_RESULT handleMeta(CSmilMeta* pMeta) = 0;
virtual HX_RESULT handleMetadata(CSmilMetadata* pMetadata) = 0;
virtual HX_RESULT handleEndLayout(CSmilEndLayout* pEndLayout) = 0;
virtual HX_RESULT handleRendererPreFetch(CSmilRendererPreFetch* pRend) = 0;
virtual HX_RESULT handleSourceUpdate(CSmilSourceUpdate* pUpdate) = 0;
#if defined(HELIX_FEATURE_SMIL2_TRANSITIONS)
virtual HX_RESULT handleTransition(CSmilTransition* pTrans) = 0;
#endif /* #if defined(HELIX_FEATURE_SMIL2_TRANSITIONS) */
virtual HX_RESULT handleTrackRemoval(const char* pID, INT32 nGroup) = 0;
virtual HX_RESULT handleTrackPausing(SMILNode* pNode,
LONG32 lTimeOfPause,
SMILPriorityClassPauseDisplay pauseDisplay,
const char* pIdOfPauser) = 0;
virtual HX_RESULT handleTrackResuming(const char* pID, INT32 nGroup) = 0;
#if defined(HELIX_FEATURE_SMIL2_ANIMATION)
virtual HX_RESULT handleAnimate(CSmilAnimateElement* pAnimate) = 0;
#endif /* #if defined(HELIX_FEATURE_SMIL2_ANIMATION) */
virtual HX_RESULT handleRemoveTimeUpdate(CSmilElement* pElement, UINT32 ulRemoveTime) = 0;
virtual HX_RESULT handleExternalMediaMarkerFile(CSmilElement* pElement,
const char* pszID,
const char* pszExternalFileName,
const char* pszRelativeSource) = 0;
virtual HX_RESULT resolveGroupDurToOuterTimeContainerDur(UINT32 ulGroupIndex,
UINT32 ulGroupTimeContainerDuration) = 0;
virtual HX_RESULT GetCurGroupDuration(REF(UINT32) ulCurGrpDur) = 0;
};
class CSmilElement
{
public:
CSmilElement(SMILNode* pNode);
virtual ~CSmilElement();
virtual void addDuration(UINT32 ulDuration);
virtual void addElement(CSmilElement* pElement,
UINT32& ulStartTime,
UINT32& ulDuration);
virtual HX_RESULT handleElement() { return HXR_OK; }
virtual HX_RESULT setBeginTime(CSmilParser* pParser);
virtual HX_RESULT setEndTime(CSmilParser* pParser);
virtual void prepForRestart(BOOL bParentIsRestarting, LONG32 lWhen);
virtual void prepForPauseInExcl(LONG32 lCurTime);
virtual void prepForResumeInExcl();
virtual void prepForStopInExcl(LONG32 lCurTime);
virtual void prepForDeferralInExcl(UINT32 lCurTime);
virtual BOOL isPausedInExcl() { return m_bIsPausedInExcl; }
virtual BOOL isDeferredInExcl() { return m_bIsDeferredInExcl; }
virtual BOOL isStoppedInExcl() { return m_bIsStoppedInExcl; }
virtual HX_RESULT getBeginTimeValue(REF(SmilTimeValue*) pValue);
virtual HX_RESULT getEndTimeValue(REF(SmilTimeValue*) pValue);
// /These were added in order to easily calculate when an already-
// inserted-into-the-timeline element *actually* begins and ends so
// that doing such things as freezing and holding can be done:
virtual HX_RESULT getCurrentScheduledStartTime(
REF(ULONG32) ulActualStartTime);
virtual HX_RESULT getCurrentScheduledStopTime(
REF(ULONG32) ulActualStopTime);
// /Note: pValue, as well as the two lists, is|are filled with either
// begin or end time|times, depending on the listType value:
virtual HX_RESULT getNextResolvedTimeValue(REF(SmilTimeValue*) pValue,
INT32 lCurTimeInGroupTime,
INT32 lCurTimeInSyncBaseTime,
SmilTimingListType listType,
CHXSimpleList*
pListOfAllResolvedTimes);
virtual HX_RESULT resolveEventTimeValues(INT32 lCurTime,
const char* pEventName,
const char* pEventElementId,
SmilTimingListType listType,
REF(BOOL) bATimeWasResolved);
virtual HX_RESULT resolveSyncArcTimeValues(INT32 lResolvedToTime,
const char* pSyncBaseElementId,
SmilTimingListType listType,
REF(BOOL) bATimeWasResolved,
BOOL bMoveNewlyResolvedsToPendingTimesList,
CSmilParser* pParser);
virtual HX_RESULT getParentRestartDefault();
virtual void updateRemoveTime(UINT32 ulRemoveTime);
virtual void handleXMMF(const char* pszID, const char* pszXMMFile, const char* pszSrc);
virtual BOOL hasEventBasedBeginTime();
virtual BOOL hasEventBasedEndTime();
virtual CSmilElement* getSyncAncestorElement();
// /Use of the new method fixes PR 79699 and PR 8XXYZ (PR 63622 part 3,
// revisited) by making sure that the duration passed to
// resetTimelineElementDuration() is in local time coords, not syncbase
// time coord (i.e., m_ulDuration may or may not include the delay beyond
// the syncbase. This method returns the duration from the element's
// begin to its end, w/o any delay:
ULONG32 getPureDuration();
// /This method goes through the m_pEndTimeList to see if there's an
// event-arc end time or other unresolved end time; this is important
// for use in the algorithm for determining whether or not something
// should restart (see SMIL 2.0 Spec Timing Module's getNextInterval()
// pseudocode):
BOOL hasUnresolvedEndTime();
// /This method helps fix PR 50660 (par version) and PR 62408: to make
// sure restarted track doesn't get treated as a repeat track in
// handleSource(), it calls this and uses the return val to decide; the
// m_bIsRestarting is reset to FALSE in case this element does have
// a repeat so the repeats will also restart:
BOOL IsRestartingAndNotRepeating() { BOOL bIs=m_bIsRestarting;
m_bIsRestarting=FALSE; return bIs;}
HX_RESULT GetElementProperties(REF(IHXValues*) pProperties);
void checkElementFillBehavior();
// /NOTE: all values below are for the currently-active (or, if this
// element is not active on the timeline currently, the next-to-be
// active) "interval" (see SMIL 2.0 Timing module for details on
// how a "current interval" is defined and computed). Multiple begin
// and end times are stored in the m_pBeginTimeList and m_pEndTimeList,
// respectively. When a new one from that list becomes the active one,
// the following vars may change (which happens *during* playback):
SMILNode* m_pNode;
UINT32 m_ulClipBegin; // start of clip
UINT32 m_ulAuthoredClipBegin; // explicitly-authored clipBegin value
UINT32 m_ulClipEnd; // clip end time
INT32 m_lBeginOffset; // clip delay
ULONG32 m_ulBeginOffsetFromSyncBase;
UINT32 m_ulDelay; // presentation delay
// /NOTE: this may include delay beyond syncbase. getPureDuration()
// returns the duration from the element's begin to its end, w/o delay:
UINT32 m_ulDuration; // clip duration
UINT32 m_ulOriginalDuration; // value dur attribute if dur is specified.
UINT32 m_ulDurationInAddTrack;
UINT32 m_ulMaxDuration;
UINT32 m_ulMaxActiveDur; // as set by the "min" attribute. deflt=indef
UINT32 m_ulMinActiveDur; // as set by the "min" attribute. default=0.
UINT32 m_ulAuthoredDur; // as set by the "dur" attribute.
INT32 m_lEndOffset;
UINT32 m_ulAnticipatedPauseDur;
UINT32 m_ulEndSync;
ULONG32 m_ulStopTimeInExcl;
ULONG32 m_ulLongSyncArcBeginInGroupTime;
double m_fRepeatValue;
UINT32 m_ulTimestamp; // timestamp to send packet
SmilElementRestart m_restartBehavior;
SmilElementRestart m_restartDefaultBehavior;
ULONG32 m_ulSyncTolerance;
ULONG32 m_ulSyncToleranceDefault;
SMILSyncBehaviorType m_syncBehavior;
SMILSyncBehaviorType m_syncBehaviorDefault;
CHXString m_sensitivityToMouseEvents;
CHXString m_title;
CHXString m_author;
CHXString m_copyright;
CHXString m_abstract;
CHXString m_alt;
CHXString m_longdesc;
ULONG32 m_ulReadIndex;
SMILEventSourceTag m_nBeginEventSourceTag;
CHXString m_BeginEventSourceID;
INT32 m_lBeginEventClockValue;
SMILEventSourceTag m_nEndEventSourceTag;
CHXString m_EndEventSourceID;
INT32 m_lEndEventClockValue;
SMILEventSourceTag m_nEndsyncEventSourceTag;
CHXString m_EndsyncEventSourceID;
CSmilTimelineElement* m_pTimelineElement;
CSmilElementHandler* m_pHandler;
CHXSimpleList* m_pHyperlinks;
CHXSimpleList* m_pBeginTimeList;
CHXSimpleList* m_pEndTimeList;
CHXString m_beginTransition;
CHXString m_endTransition;
FillType m_eFill;
FillDefaultType m_eFillDefault;
FillType m_eActualFill;
EraseType m_eErase;
UINT32 m_ulRemoveTime;
CHXString m_customTestKey;
char* m_pszClipBeginMarkerName;
char* m_pszClipBeginExternalMarkerFileName;
char* m_pszClipEndMarkerName;
char* m_pszClipEndExternalMarkerFileName;
AccessErrorBehavior m_eAccessErrorBehavior;
UINT32 m_ulTimeDeferralOccurred;
// ONLY HX_BITFIELD MEMBERS SHOULD GO BELOW THIS LINE!
// ALL OTHER MEMBER TYPES SHOULD GO ABOVE THIS LINE!
HX_BITFIELD m_bBeginOffsetSet : 1;
HX_BITFIELD m_bNegBeginOffsetAlreadyUsed : 1;
HX_BITFIELD m_bCurBeginIsOffsetFromSyncBase : 1;
HX_BITFIELD m_bCurEndClippedByParent : 1; // end clipped by parent end
HX_BITFIELD m_bUseMediaDurForMinDur : 1; // flag for min="media"
HX_BITFIELD m_bUseMediaDurForMaxDur : 1; // flag for max="media"
HX_BITFIELD m_bHasExplicitEnd : 1;
HX_BITFIELD m_bHasExplicitDur : 1;
HX_BITFIELD m_bDurationIncludesDelayBeyondSyncbase : 1;
HX_BITFIELD m_bAddDurationAlreadyDone : 1;
HX_BITFIELD m_bEndOffsetSet : 1;
HX_BITFIELD m_bInsertedIntoTimeline : 1; // TRUE when inserted
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -