Exemplo n.º 1
0
 /// <summary>
 /// Gets description string for specified parameters.
 /// </summary>
 public String Get(StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo, InfoKind KindOfSearch)
 {
     VerifyObjectIsNotDisposed();
     //
     return(Marshal.PtrToStringUni(MediaInfoInterop.MediaInfo_Get(handle, (IntPtr)StreamKind,
                                                                  (IntPtr)StreamNumber, Parameter, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch)));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Clean up resources according <see cref="DisposingRequiredObjectBase"/> model.
 /// </summary>
 /// <param name="isDisposing"></param>
 protected override void Dispose(bool isDisposing)
 {
     try {
         MediaInfoInterop.MediaInfo_Delete(handle);
     } finally {
         base.Dispose(isDisposing);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Closes a file.
 /// </summary>
 public void CloseFile()
 {
     VerifyObjectIsNotDisposed();
     //
     if (!isAnyFileOpened)
     {
         throw new ApplicationException("No media is opened now.");
     }
     //
     MediaInfoInterop.MediaInfo_Close(handle);
     isAnyFileOpened = false;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Gets option string for specified parameters.
 /// </summary>
 public String Option(String Option, String Value)
 {
     VerifyObjectIsNotDisposed();
     //
     if (Option == null)
     {
         throw new ArgumentNullException("Option");
     }
     if (Value == null)
     {
         throw new ArgumentNullException("Value");
     }
     //
     return(Marshal.PtrToStringUni(MediaInfoInterop.MediaInfo_Option(handle, Option, Value)));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Opens a file.
        /// </summary>
        /// <param name="FileName">Name of file.</param>
        public int OpenFile(String FileName)
        {
            VerifyObjectIsNotDisposed();
            //
            if (FileName == null)
            {
                throw new ArgumentNullException("FileName");
            }
            if (!File.Exists(FileName))
            {
                throw new FileNotFoundException("File not found", FileName);
            }
            //
            if (isAnyFileOpened)
            {
                CloseFile();
                isAnyFileOpened = false;
            }
            int res = (int)MediaInfoInterop.MediaInfo_Open(handle, FileName);

            isAnyFileOpened = true;
            return(res);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 public MediaInfoLibrary()
 {
     handle = MediaInfoInterop.MediaInfo_New();
 }
Exemplo n.º 7
0
 /// <summary>
 /// Gets count of streams.
 /// </summary>
 public int Count_Get(StreamKind StreamKind, int StreamNumber)
 {
     VerifyObjectIsNotDisposed();
     //
     return((int)MediaInfoInterop.MediaInfo_Count_Get(handle, (IntPtr)StreamKind, (IntPtr)StreamNumber));
 }
Exemplo n.º 8
0
 /// <summary>
 /// Gets state string.
 /// </summary>
 public int State_Get()
 {
     VerifyObjectIsNotDisposed();
     //
     return((int)MediaInfoInterop.MediaInfo_State_Get(handle));
 }
Exemplo n.º 9
0
 /// <summary>
 /// Get inform string.
 /// </summary>
 public String Inform()
 {
     VerifyObjectIsNotDisposed();
     //
     return(Marshal.PtrToStringUni(MediaInfoInterop.MediaInfo_Inform(handle, (IntPtr)0)));
 }