![]() | InDesign SDK 20.5 |
#include <IMediaUtils.h>

Public Types | |
| enum | { kDefaultIID = IID_IMEDIAUTILS } |
| enum | MediaFormatType { kAudio = 0, kVideo, kUnknown } |
Public Member Functions | |
| virtual ErrorCode | AddAdornments (IDataBase *db, UID itemUID, IMediaAdornmentInfo *info)=0 |
| virtual ErrorCode | AddMediaPIToGraphicFrame (IDataBase *db, UID mediaUID, UID frameUID, bool16 alignComponents=kFalse)=0 |
| virtual ErrorCode | AlignMediaComponents (UIDRef mediaRef)=0 |
| virtual bool16 | CanConvertToMediaFrame (UIDRef candidateRef)=0 |
| virtual ErrorCode | ChangeMediaLocation (UIDRef mediaRef, const MediaLocation &newLocation=MediaLocation(), IMediaReadFormat *readFormat=nil, bool16 customPosterFromMedia=kFalse, bool16 preservePoster=kFalse)=0 |
| virtual ErrorCode | ChangePoster (UIDRef mediaRef, IMediaAttributes::PosterType newPosterType, const IDFile *posterImageFile=nil, IPMStream *posterFromMediaStream=nil, bool16 customPosterFromMedia=kFalse, int32 posterTime=0, bool setUndoable=false)=0 |
| virtual ErrorCode | ChangePoster (UIDRef mediaRef, IMediaAttributes::PosterType newPosterType, IPMStream *imageStream)=0 |
| virtual ErrorCode | CreateMediaPageItem (ClassID classID, IDataBase *db, UID frameUID, UID &outMediaUID)=0 |
| virtual ErrorCode | CreateMediaPageItem (ClassID classID, IDataBase *db, UID frameUID, PMRect bounds, UID &outMediaUID)=0 |
| virtual ErrorCode | CreateMediaWithDefaultPoster (ClassID mediaClassID, IDataBase *db, UID &outMediaUID, const ClassID formatClassID=kInvalidClass, IPMStream *mediaImportStream=nil, IURIData *uriData=nil)=0 |
| virtual IPMStream * | CreatePosterLoResReadStream (UIDRef mediaRef)=0 |
| virtual PMString | ExtractMediaName (const MediaLocation &loc)=0 |
| virtual UID | FindMediaUID (UIDRef &rootUIDRef)=0 |
| virtual UIDRef | GetMediaContentRef (const UIDRef &mediaRef)=0 |
| virtual UID | GetMediaParentUID (IDataBase *db, UID mediaUID)=0 |
| virtual UID | GetParentGraphicFrameUID (const UIDRef &mediaRef)=0 |
| virtual bool16 | HasAdornments (UID itemUID, IDataBase *db, IMediaAdornmentInfo *info)=0 |
| virtual void | InvalidateMediaFrameCaches (IDataBase *db, UID mediaUID)=0 |
| virtual bool16 | IsMediaItem (ClassID classID, UID itemUID, IDataBase *db)=0 |
| virtual bool16 | GetExportableMediaFile (UIDRef mediaRef, IDFile &outFile)=0 |
| virtual bool16 | GetExportableMediaURL (UIDRef const &mediaRef, PMString &url) const =0 |
| virtual bool | GetInstalledVideoSkins (K2Vector< IDFile > &skins) const =0 |
| virtual bool | ResolveSkinNameToFile (PMString const &skin, IDFile &file) const =0 |
| virtual bool | IsLegacyMediaItem (UIDRef mediaRef) const =0 |
| virtual IMediaReadFormat * | FindMediaReadFormatForClassID (ClassID readFormatClassID)=0 |
| virtual IMediaReadFormat * | FindMediaReadFormatForLocation (const MediaLocation &loc)=0 |
| virtual IMediaReadFormat * | FindMediaReadFormatForStream (MediaType mediaType, IPMStream *iPMStream)=0 |
| virtual ErrorCode | CanAccess (const MediaLocation &loc, const MediaType mediaType)=0 |
| virtual ErrorCode | SchedulePlaceMediaFromURL (UIDRef mediaRef, const MediaLocation &loc, bool preserveExistingPoster=false, bool allowDecoding=true)=0 |
| virtual ErrorCode | SchedulePosterFromMedia (UIDRef mediaRef)=0 |
| virtual bool | IsFlashOnlyMedia (ILinkResource *iResource)=0 |
| virtual void | GoToAPERemovalURL ()=0 |
| virtual ErrorCode | ChangeFlashFormatExtension (UID resourceUID, ILinkManager *iLinkMgr)=0 |
| virtual bool | HasUnsupportedExtension (ILinkResource *iResource)=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
This interface defines utility methods for working with media page items.
| pure virtual |
Adds top and bottom adornments to a spline item.
| db | valid pointer to the IDataBase interface of the spline item. |
| itemUID | UID of the spline item. |
| info | valid pointer to an IMediaAdornmentInfo interface which will provide the adornment info. |
| pure virtual |
Attaches a media page item to a graphic frame. Existing children in the graphic frame's IHierarchy are destroyed.
| db | valid pointer to the IDataBase interface of the page item to be added. |
| mediaUID | UID of the page item to be added. |
| frameUID | UID of a graphic frame. |
| alignComponents | if kTrue, aligns the media page item with the frame and the poster with the media page item. The media page item is resized if it has no intrinsic bounds. |
| pure virtual |
Aligns the poster with its parent media page item and the media page item with its parent frame. For media with no intrinsic bounds, resizes the media page item according to the rule: if the poster exists, the media page item is sized to the poster bounds; otherwise, the media page item is sized to the parent frame's bounds.
| mediaRef | a valid reference to the media page item. |
| pure virtual |
Verifies that a media location can be accessed for a MediaType. This method is especially usefulfor checking whether URLs, though well-formed, can nevertheless be supported.
| loc | a MediaLocation to media content. |
| mediaType | is either enMovie or enSound. |
| pure virtual |
Determines if a candidate page item can be converted into a media frame.
| candidateRef | UIDRef of the page item to test for conversion. |
| pure virtual |
Modifies the extension format of flash based formats(e.g. flv, f4v and swf) by appending .unsupported(translated) in the end
of the URI in order to trigger the missing links workflow.
| resourceUID | valid existing UID of the imported file. |
| iLinkMgr | valid existing object of LinkManager class. |
| pure virtual |
Changes the location of media content from a specified filter. Changes the poster if it originated from the media.
| mediaRef | valid UIDRef of existing media page item. |
| newLocation | specifies the new MediaLocation; if empty, clears the current location. |
| readFormat | IMediaReadFormat interface that is accessed to obtain the poster IPMStream and media attributes from the media filter (e.g., intrinsic bounds, whether a poster is available, etc); may be nil. |
| customPosterFromMedia | if True, the poster obtained from IMediaReadFormat is a custom poster from the media source. |
| preservePoster | if True, does not change the poster |
| pure virtual |
Changes the media poster page item to a specified PosterType. If the change is made, the resulting poster page item will have a new UID.
This method has no affect and returns kSuccess if the current poster already meets the call specifications (see also the description of the customPosterFromMedia param, below). To force a poster change, first call this method with the newPosterType set to IMediaAttributes::eNone.
| mediaRef | the UIDRef of the parent media page item. |
| newPosterType | the desired IMediaAttributes::PosterType. |
| posterImageFile | a valid pointer to the poster image IDFile, required when newPosterType is IMediaAttributes::eProxyImage. |
| posterFromMediaStream | specifies the IPMStream to a media poster. This parameter is referenced when newPosterType is IMediaAttributes::eFromMedia. If nil, the poster is taken directly from the media content of the parent media page item specified by mediaRef. |
| customPosterFromMedia | boolean flag that indicates that the poster is a custom poster selected from the media content (e.g., an arbitrary frame in a movie). This flag is referenced only when newPosterType is IMediaAttributes::eFromMedia. The poster is always taken from the specified posterFromMediaStream and always results in a new poster page item. It is an error for this flag to be set to kTrue when posterFromMediaStream is nil. |
| setUndoable | specifies whether the changePoster command is undoable. |
| pure virtual |
Changes the media poster page item to a specified PosterType using the image from the imageStream.
| mediaRef | the UIDRef of the parent media page item. |
| newPosterType | must be set to IMediaAttributes::eFromMedia. |
| imageStream | read stream to the poster image data. |
| pure virtual |
Creates a media page item of a specified classID, under a specified frame item, and the same size as the frame.
| classID | the ClassID of the media page item to create. |
| db | valid pointer to an IDataBase instance. |
| frameUID | the UID of the frame that will contain the new page item. This method will fail if the frameUID is invalid. |
| outMediaUID | upon successful return, this is populated with the UID of the new page item. |
| pure virtual |
Creates a media page item of a specified classID, under a specified frame item with the specified bounds.
| classID | |
| db | valid pointer to an IDataBase instance. |
| frameUID | the UID of the frame that will contain the new page item, or kInvalidUID. |
| bounds | the PMRect of the new page item bounds. |
| outMediaUID | upon successful return, this is populated with the UID of the new page item. |
| pure virtual |
Creates a media page item with a default poster (standard poster or poster from the media if available).
| mediaClassID | valid ClassID of the media page item to create. |
| db | valid IDataBase pointer. |
| outMediaUID | set to the new media page item UID upon successful return. |
| frameUID | if valid, attaches the new media page item to the frame as a child page item. |
| mediaLocation | specifies the location of the media content (optional). |
| formatClassID | specifies the ClassID of the filter boss capable of reading the mediaImportStream. Required if mediaImportStream is non-nil. |
| mediaImportStream | a stream to the media content; if non-nil, formatClassID must specify a valid filter boss. |
| uriData | pass the link URI data if the linked media item is not a file. |
| pure virtual |
Extracts an appropriate media name attribute from a MediaLocation.
| loc | a MediaLocation object. |
| pure virtual |
Finds the IMediaReadFormat instance for a specified ClassID.
| readFormatClassID | the ID of a boss aggregating the IMediaReadFormat interface. |
| pure virtual |
Finds the IMediaReadFormat instance that can read from a specified MediaLocation.
| loc | a MediaLocation to media content. |
| pure virtual |
Finds an IMediaReadFormat capable of reading media content from a stream.
| mediaType | is either enMovie or enSound. |
| iPMStream | is a stream capable of reading the media content. |
Finds the UID of the Media page item under the specified root.
| rootUIDRef | valid UIDRef of IHierarchy root containing a Media page item. |
Retrieves the media file for a specified media page item that can is compatible with the export format (assumed to be SWF for now).
| mediaRef | refers to the UIDRef of an existing media page item. |
| outFile | is set to the media file to use for export. For example, if the original placed media file is an MPEG, outFile will refer to the equivalent FLV file. |
| pure virtual |
Retrieves the URL for a specified media page item that is compatible with the export format (assumed to be SWF for now).
| mediaRef | [IN] The UIDRef of an existing media page item. |
| url | [OUT] The URL of the media page item, if any. |
Retrieves the location of the folder where video skins are stored.
| skins | [OUT] Vector of IDFiles, one per installed skin |
Retrieves the parent of a Media page item.
| db | valid pointer to an IDataBase instance. |
| mediaUID | valid UID of a media page item. |
Retrieves the UID of the graphic frame parent of a Media page item.
| mediaRef | valid UIDRef of a media page item. |
| pure virtual |
Directs to the APE removal GoURL which consists of information regarding the removal of flash
and flash based formats(e.g. flv, f4v and swf) from InDesign.
| pure virtual |
Tests if a specified spline item has media adornments.
| itemUID | valid UID of spline item to test. |
| db | valid pointer to an IDataBase instance. |
| info | valid pointer to an IMediaAdornment instance. |
| pure virtual |
Verifies if the extension contains .unsupported(translated) append in the end of the URI of the imported file.
| iResource | is the resource file to be verified. |
Invalidates media frame page item caches; if mediaUID is not a frame, then invalidates the caches of its parent frame. This utility should be called whenever a change affects the size of media frame adornments.
| db | valid pointer to an IDataBase instance. |
| mediaUID | valid UID of a media page item. |
| pure virtual |
Determines the media resource is in a flash only format that is unsupported(e.g. flv, f4v and swf).
| iResource | the resource whose format to check. |
| pure virtual |
Determines the media page item is legacy media.
| mediaRef | [IN] The UIDRef of an existing media page item. |
Tests if a specified page item is a Media page item of a specified ClassID.
| classID | the ClassID (boss ID) of a media page item boss based on the kMediaPageItemBoss. |
| itemUID | valid UID of the page item to test. |
| db | valid pointer to an IDataBase instance. |
| pure virtual |
Resolves a skin name to its location on disk.
| skin | [IN] The name of the skin to resolve |
| file | [OUT] The location of the skin file on disk |
| pure virtual |
Schedules a command to place a URL-based media item. The command is executed after the media format is decoded and attributes are available.
| mediaRef | valid existing UIDRef. |
| loc | is set to the URL. Currently restricted to FLV and F4V video. |
| bool | if true, the existing poster is preserved; if false, the existing poster may be replaced as necessary. |
| bool | if true, decode attributes from the media file as needed; if false, does not decode. |
| pure virtual |
Schedules a command to replace the media poster with an image from the media. The poster is replaced when the image is decoded and the command completes.
| mediaRef | valid existing UIDRef. |