//
// ICodec.cs: Provides ICodec, IAudioCodec, and IVideoCodec interfaces.
//
// Author:
// Brian Nickel (brian.nickel@gmail.com)
//
// Copyright (C) 2007 Brian Nickel
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace TagLib
{
///
/// Indicates the types of media represented by a or object.
///
///
/// These values can be bitwise combined to represent multiple media
/// types.
///
[Flags]
public enum MediaTypes
{
///
/// No media is present.
///
None = 0,
///
/// Audio is present.
///
Audio = 1,
///
/// Video is present.
///
Video = 2,
///
/// A Photo is present.
///
Photo = 4,
///
/// Text is present.
///
Text = 8
}
///
/// This interface provides basic information, common to all media
/// codecs.
///
public interface ICodec
{
///
/// Gets the duration of the media represented by the current
/// instance.
///
///
/// A containing the duration of the
/// media represented by the current instance.
///
TimeSpan Duration { get; }
///
/// Gets the types of media represented by the current
/// instance.
///
///
/// A bitwise combined containing
/// the types of media represented by the current instance.
///
MediaTypes MediaTypes { get; }
///
/// Gets a text description of the media represented by the
/// current instance.
///
///
/// A object containing a description
/// of the media represented by the current instance.
///
string Description { get; }
}
///
/// This interface inherits to provide
/// information about an audio codec.
///
///
/// When dealing with a , if contains , it is safe to assume that the object also inherits and can be recast without issue.
///
public interface IAudioCodec : ICodec
{
///
/// Gets the bitrate of the audio represented by the current
/// instance.
///
///
/// A value containing a bitrate of the
/// audio represented by the current instance.
///
int AudioBitrate { get; }
///
/// Gets the sample rate of the audio represented by the
/// current instance.
///
///
/// A value containing the sample rate of
/// the audio represented by the current instance.
///
int AudioSampleRate { get; }
///
/// Gets the number of channels in the audio represented by
/// the current instance.
///
///
/// A value containing the number of
/// channels in the audio represented by the current
/// instance.
///
int AudioChannels { get; }
}
///
/// This interface provides information specific
/// to lossless audio codecs.
///
public interface ILosslessAudioCodec
{
///
/// Gets the number of bits per sample in the audio
/// represented by the current instance.
///
///
/// A value containing the number of bits
/// per sample in the audio represented by the current
/// instance.
///
int BitsPerSample { get; }
}
///
/// This interface inherits to provide
/// information about a video codec.
///
///
/// When dealing with a , if contains , it is safe to assume that the object also inherits and can be recast without issue.
///
public interface IVideoCodec : ICodec
{
///
/// Gets the width of the video represented by the current
/// instance.
///
///
/// A value containing the width of the
/// video represented by the current instance.
///
int VideoWidth { get; }
///
/// Gets the height of the video represented by the current
/// instance.
///
///
/// A value containing the height of the
/// video represented by the current instance.
///
int VideoHeight { get; }
}
///
/// This interface inherits to provide
/// information about a photo.
///
///
/// When dealing with a , if contains , it is safe to assume that the object also inherits and can be recast without issue.
///
public interface IPhotoCodec : ICodec
{
///
/// Gets the width of the photo represented by the current
/// instance.
///
///
/// A value containing the width of the
/// photo represented by the current instance.
///
int PhotoWidth { get; }
///
/// Gets the height of the photo represented by the current
/// instance.
///
///
/// A value containing the height of the
/// photo represented by the current instance.
///
int PhotoHeight { get; }
///
/// Gets the (format specific) quality indicator of the photo
/// represented by the current instance.
///
///
/// A value indicating the quality. A value
/// 0 means that there was no quality indicator for the format
/// or the file.
///
int PhotoQuality { get; }
}
}