|
SageTV Platform V7.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsage.api.MediaFileAPI
public class MediaFileAPI
A MediaFile represents a physical file or a group of files that represent the same content. Every MediaFile has an Airing associated with it that describes the metadata information for the content through the use of a Show object. There are also special MediaFiles that represent streams from capture devices directly or other playback hardware such as CD/DVD drives.
SageTV will automatically convert the following types to MediaFile if used for a parameter that requires the MediaFile type:
Airing - if an Airing has an associated MediaFile then it will be used, otherwise the conversion results in null java.io.File - if the specified physical file has an assoicated MediaFile, then it will be used
| Method Summary | |
|---|---|
sage.MediaFile |
AddMediaFile(java.io.File File,
java.lang.String NamePrefix)
Adds a new MediaFile to the database. |
boolean |
AutorotatePictureFile(sage.MediaFile MediaFile)
Automatically rotates the specified picture file according to the orientation set in the EXIF data. |
boolean |
CanAutorotatePictureFile(sage.MediaFile MediaFile)
Returns true if the specified picture file can be autorotated and is currently not in that autorotated position |
void |
CopyToLocalFile(sage.MediaFile MediaFile,
java.io.File LocalFile)
Downloads the specified MediaFile from the SageTV server and saves it as the specified LocalFile. |
sage.MediaFile |
CreateTempMediaFile(java.lang.String FilePath)
Creates a temporary MediaFile object which can be used for playback later. |
boolean |
DeleteFile(sage.MediaFile MediaFile)
Deletes the files that correspond to this MediaFile from disk and also deletes the MediaFile object from the database. |
boolean |
DeleteFileWithoutPrejudice(sage.MediaFile MediaFile)
Deletes the files that correspond to this MediaFile from disk and also deletes the MediaFile object from the database. |
boolean |
FlipPictureFile(sage.MediaFile MediaFile,
boolean Horizontal)
Performs a lossless flip of the specified JPEG picture file. |
sage.Album |
GetAlbumForFile(sage.MediaFile MediaFile)
Gets the Album object that corresponds to this MediaFile. |
long |
GetDurationForSegment(sage.MediaFile MediaFile,
int SegmentNumber)
Returns the duration in milliseconds for the specified segment number in this MediaFile. |
long |
GetEndForSegment(sage.MediaFile MediaFile,
int SegmentNumber)
Gets the ending time for a specified segment number in this MediaFile. |
long |
GetFileDuration(sage.MediaFile MediaFile)
Returns the total duration of the content in this MediaFile |
long |
GetFileEndTime(sage.MediaFile MediaFile)
Returns the ending time for the content in ths specified MediaFile. |
java.io.File |
GetFileForSegment(sage.MediaFile MediaFile,
int SegmentNumber)
Gets the file that represents the specified segment number in this MediaFile |
long |
GetFileStartTime(sage.MediaFile MediaFile)
Returns the starting time for the content in ths specified MediaFile. |
sage.MetaImage |
GetFullImage(sage.MediaFile MediaFile)
Returns the MetaImage object which represents the picture file for this MediaFile. |
sage.Airing |
GetMediaFileAiring(sage.MediaFile MediaFile)
Gets the Airing object that represents the content metadata for this MediaFile |
java.lang.String |
GetMediaFileEncoding(sage.MediaFile MediaFile)
Gets the encoding that was used to record this file. |
sage.MediaFile |
GetMediaFileForFilePath(java.io.File FilePath)
Returns the MediaFile from the database that corresponds to a specified file on disk |
sage.MediaFile |
GetMediaFileForID(int id)
Returns the MediaFile object that corresponds to the passed in ID. |
java.lang.String |
GetMediaFileFormatDescription(sage.MediaFile MediaFile)
Returns a string that provides a description of this MediaFile's format, i.e. |
int |
GetMediaFileID(sage.MediaFile MediaFile)
Returns the unique ID used to identify this MediaFile. |
java.lang.String |
GetMediaFileMetadata(sage.MediaFile MediaFile,
java.lang.String Name)
Returns a string for the corresponding metadata property in the MediaFile's format. |
java.lang.String |
GetMediaFileRelativePath(sage.MediaFile MediaFile)
Returns the path of this MediaFile object relative to the root of the import directory it is in. |
sage.MediaFile[] |
GetMediaFiles()
Returns all of the MediaFile objects in the database. |
sage.MediaFile[] |
GetMediaFiles(java.lang.String MediaMask)
Returns all of the MediaFile objects in the database The content it references must also match one of the media types specified in the MediaMask. |
java.lang.String |
GetMediaTitle(sage.MediaFile MediaFile)
Returns the title for the specified MediaFile object |
int |
GetNumberOfSegments(sage.MediaFile MediaFile)
Returns the number of segments in ths specified MediaFile. |
java.io.File |
GetParentDirectory(sage.MediaFile MediaFile)
Gets the directory that the files for this MediaFile are in. |
java.io.File[] |
GetSegmentFiles(sage.MediaFile MediaFile)
Returns the list of files that make up the specified MediaFile object. |
long |
GetSize(sage.MediaFile MediaFile)
Gets the total size in bytes of the files on disk that represent this MediaFile |
long |
GetStartForSegment(sage.MediaFile MediaFile,
int SegmentNumber)
Gets the starting time for a specified segment number in this MediaFile. |
long[] |
GetStartTimesForSegments(sage.MediaFile MediaFile)
Returns a list of all of the start times of the segments in the specified MediaFile |
sage.MetaImage |
GetThumbnail(sage.MediaFile MediaFile)
Gets the representative thumbnail image which should be used for iconic display of this MediaFile. |
boolean |
HasAnyThumbnail(sage.MediaFile MediaFile)
Returns true if this MediaFile object has a thumbnail representation of it. |
boolean |
HasSpecificThumbnail(sage.MediaFile MediaFile)
Returns true if this MediaFile object has a thumbnail for it that is unique to the content itself. |
boolean |
IsBluRay(sage.MediaFile MediaFile)
Returns true if this MediaFile represents BluRay content. |
boolean |
IsCompleteRecording(sage.MediaFile MediaFile)
Returns true if SageTV considers this MediaFile a 'complete' recording. |
boolean |
IsDVD(sage.MediaFile MediaFile)
Returns true if this MediaFile represents DVD content. |
boolean |
IsDVDDrive(sage.MediaFile MediaFile)
Returns true if this MediaFile represents the physical DVD drive in the system. |
boolean |
IsFileCurrentlyRecording(sage.MediaFile MediaFile)
Returns true if this MediaFile is currently in the process of recording. |
boolean |
IsLibraryFile(sage.MediaFile MediaFile)
Returns true if the specified MediaFile has been either imported using a library path or if this is a television recording that has had the 'Move to Library' operation performed on it. |
boolean |
IsLocalFile(sage.MediaFile MediaFile)
Returns true if the specified MediaFile is local to this system (i.e. |
boolean |
IsMediaFileObject(java.lang.Object Object)
Returns true if the specified object is a MediaFile object. |
boolean |
IsMusicFile(sage.MediaFile MediaFile)
Returns true if this MediaFile's content is audio only. |
boolean |
IsPictureFile(sage.MediaFile MediaFile)
Returns true if this MediaFile's content represents a picture file |
boolean |
IsThumbnailLoaded(sage.MediaFile MediaFile)
Checks whether the passed thumbnail for the specified MediaFile is loaded into system memory or into the VRAM cache of the corresponding UI making the call. |
boolean |
IsTVFile(sage.MediaFile MediaFile)
Returns true if this MediaFile represents recorded television content |
boolean |
IsVideoFile(sage.MediaFile MediaFile)
Returns true if this MediaFile's content is an audio/video or video file (this will be false for DVD/BluRay content) |
void |
MoveFileToLibrary(sage.MediaFile MediaFile)
Marks a MediaFile object as being 'Moved to Library' which means the IsLibraryFile() call will
now return true. |
void |
MoveTVFileOutOfLibrary(sage.MediaFile MediaFile)
Un-marks a MediaFile object as being 'Moved to Library' which means the IsLibraryFile() call will
no longer return true. |
void |
RegeneratePictureThumbnail(sage.MediaFile MediaFile)
Regenerates the thumbnail associated with the specified picture file. |
boolean |
RotatePictureFile(sage.MediaFile MediaFile,
int Degrees)
Performs a lossless rotation of the specified JPEG picture file (90, 180 or 270 degrees). |
boolean |
SetMediaFileAiring(sage.MediaFile MediaFile,
sage.Airing Airing)
Sets a link between a MediaFile object which represents a file(s) on disk and an Airing object which represents metadata about the content. |
void |
SetMediaFileMetadata(sage.MediaFile MediaFile,
java.lang.String Name,
java.lang.String Value)
Sets the corresponding metadata property in the MediaFile's format. |
boolean |
SetMediaFileShow(sage.MediaFile MediaFile,
sage.Show Show)
Sets a link between a MediaFile object which represents a file(s) on disk and a Show object which represents metadata about the content. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public sage.MediaFile[] GetMediaFiles()
public sage.MediaFile[] GetMediaFiles(java.lang.String MediaMask)
MediaMask - string specifying what content types to search (i.e. "TM" for TV & Music, 'T'=TV, 'M'=Music, 'V'=Video, 'D'=DVD, 'P'=Pictures, 'B'=BluRay)
public sage.MediaFile AddMediaFile(java.io.File File,
java.lang.String NamePrefix)
File - the file path for the new MediaFileNamePrefix - the 'prefix' to prepend to the name of this media file for hierarchical purposes (i.e. the subdirectory that the file is in relative to the import root)
public sage.MediaFile CreateTempMediaFile(java.lang.String FilePath)
FilePath - the file path for the temporary MediaFile (can also be an smb:// URL)
public boolean SetMediaFileAiring(sage.MediaFile MediaFile,
sage.Airing Airing)
MediaFile - the MediaFile object to set the content information forAiring - the Airing object that should be the content metadata pointer for this MediaFile
public boolean SetMediaFileShow(sage.MediaFile MediaFile,
sage.Show Show)
SetMediaFileAiring()
MediaFile - the MediaFile object to set the content information forShow - the Show object that should be the content information for this MediaFile
public sage.MediaFile GetMediaFileForFilePath(java.io.File FilePath)
FilePath - the file path to find the corresponding MediaFile for
public boolean IsLocalFile(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public boolean IsLibraryFile(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public boolean IsCompleteRecording(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public boolean IsDVD(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public boolean IsBluRay(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public boolean IsDVDDrive(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public boolean IsMusicFile(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public boolean IsVideoFile(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public boolean IsPictureFile(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public boolean IsTVFile(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public java.io.File[] GetSegmentFiles(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public java.lang.String GetMediaTitle(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public java.lang.String GetMediaFileRelativePath(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public java.io.File GetParentDirectory(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public long GetSize(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public sage.MetaImage GetFullImage(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public sage.MetaImage GetThumbnail(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public boolean IsThumbnailLoaded(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public boolean HasSpecificThumbnail(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public boolean HasAnyThumbnail(sage.MediaFile MediaFile)
GetThumbnail()
will not return null.
MediaFile - the MediaFile object
public boolean IsFileCurrentlyRecording(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public boolean DeleteFile(sage.MediaFile MediaFile)
DeleteFileWithoutPrejudice()
MediaFile - the MediaFile object to delete
public boolean DeleteFileWithoutPrejudice(sage.MediaFile MediaFile)
DeleteFile(). DeleteFileWithoutPrejudice should
be used when the file was incorrectly recorded or in other cases where this deletion decision should have no effect on intelligent recording.
MediaFile - the MediaFile object to delete
public long GetFileDuration(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public long GetFileStartTime(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public long GetFileEndTime(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public void CopyToLocalFile(sage.MediaFile MediaFile,
java.io.File LocalFile)
MediaFile - the MediaFile object to download a copy ofLocalFile - the destination file to store the MediaFile as on the local filesystem
public long GetDurationForSegment(sage.MediaFile MediaFile,
int SegmentNumber)
MediaFile - the MediaFile objectSegmentNumber - the 0-based segment number to get the duration of
public long GetEndForSegment(sage.MediaFile MediaFile,
int SegmentNumber)
MediaFile - the MediaFile objectSegmentNumber - the 0-based segment number to get the end time of
public long GetStartForSegment(sage.MediaFile MediaFile,
int SegmentNumber)
MediaFile - the MediaFile objectSegmentNumber - the 0-based segment number to get the start time of
public java.io.File GetFileForSegment(sage.MediaFile MediaFile,
int SegmentNumber)
MediaFile - the MediaFile objectSegmentNumber - the 0-based segment number to get the file for
public int GetNumberOfSegments(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public long[] GetStartTimesForSegments(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public void MoveFileToLibrary(sage.MediaFile MediaFile)
IsLibraryFile() call will
now return true. This can be used to help organize the recorded television files.
MediaFile - the MediaFile ojbectpublic void MoveTVFileOutOfLibrary(sage.MediaFile MediaFile)
IsLibraryFile() call will
no longer return true. This can only be used on recorded television files and has the opposite effect of
MoveFileToLibrary()
MediaFile - the MediaFile ojbectpublic boolean IsMediaFileObject(java.lang.Object Object)
Object - the object to test to see if it is a MediaFile object
public sage.Album GetAlbumForFile(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public java.lang.String GetMediaFileEncoding(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public sage.Airing GetMediaFileAiring(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public int GetMediaFileID(sage.MediaFile MediaFile)
GetMediaFileForID()
MediaFile - the MediaFileobject
public sage.MediaFile GetMediaFileForID(int id)
GetMediaFileID()
id - the id of the MediaFile object to get
public java.lang.String GetMediaFileFormatDescription(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public java.lang.String GetMediaFileMetadata(sage.MediaFile MediaFile,
java.lang.String Name)
MediaFile - the MediaFile objectName - the name of the property to get
public void SetMediaFileMetadata(sage.MediaFile MediaFile,
java.lang.String Name,
java.lang.String Value)
MediaFile - the MediaFile objectName - the name of the property to setValue - the value of the property to set
public boolean RotatePictureFile(sage.MediaFile MediaFile,
int Degrees)
MediaFile - the MediaFile objectDegrees - the number of degress to rotate the picture in the clockwise direction, can be a positive or negative value and must be a multiple of 90
public boolean FlipPictureFile(sage.MediaFile MediaFile,
boolean Horizontal)
MediaFile - the MediaFile objectHorizontal - true if it should be flipped horizontally (i.e. around a vertical axis), false if it should be flipped vertically (i.e. around a horizontal axis)
public boolean CanAutorotatePictureFile(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
public boolean AutorotatePictureFile(sage.MediaFile MediaFile)
MediaFile - the MediaFile object that represents the picture
public void RegeneratePictureThumbnail(sage.MediaFile MediaFile)
MediaFile - the MediaFile object
|
SageTV Platform V7.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||