Commit 2fdb2393 authored by Felix Paul Kühne's avatar Felix Paul Kühne

VLCMedia: add new type property

parent 1f958e20
......@@ -188,6 +188,21 @@ typedef NS_ENUM(NSInteger, VLCMediaState) {
*/
- (instancetype)initAsNodeWithName:(NSString *)aName;
typedef NS_ENUM(NSUInteger, VLCMediaType) {
VLCMediaTypeUnknown,
VLCMediaTypeFile,
VLCMediaTypeDirectory,
VLCMediaTypeDisc,
VLCMediaTypeStream,
VLCMediaTypePlaylist,
};
/**
* media type
* \return returns the type of a media (VLCMediaType)
*/
@property (readonly) VLCMediaType mediaType;
/**
* Returns an NSComparisonResult value that indicates the lexical ordering of
* the receiver and a given meda.
......
......@@ -10,7 +10,9 @@ New APIs:
VLCMetaInformationSeason, VLCMetaInformationEpisode,
VLCMetaInformationShowName, VLCMetaInformationActors,
VLCMetaInformationAlbumArtist, VLCMetaInformationDiscNumber
- new selector: codecNameForFourCC:trackType:
- added selectors: codecNameForFourCC:trackType:
mediaType
- added enum: VLCMediaType
Deprecated APIs:
- VLCMediaPlayer
......
......@@ -257,6 +257,27 @@ static void HandleMediaParsedChanged(const libvlc_event_t * event, void * self)
libvlc_media_release( p_md );
}
- (VLCMediaType)mediaType
{
libvlc_media_type_t libmediatype = libvlc_media_get_type(p_md);
switch (libmediatype) {
case libvlc_media_type_file:
return VLCMediaTypeFile;
case libvlc_media_type_directory:
return VLCMediaTypeDirectory;
case libvlc_media_type_disc:
return VLCMediaTypeDisc;
case libvlc_media_type_stream:
return VLCMediaTypeStream;
case libvlc_media_type_playlist:
return VLCMediaTypePlaylist;
default:
return VLCMediaTypeUnknown;
}
}
- (NSString *)description
{
NSString * result = _metaDictionary[VLCMetaInformationTitle];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment