Exemplo n.º 1
0
 public String Get(StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo,
                   InfoKind KindOfSearch)
 {
     return
         (Marshal.PtrToStringUni(MediaInfo_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter,
                                               (IntPtr)KindOfInfo, (IntPtr)KindOfSearch)));
 }
Exemplo n.º 2
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)));
 }
        public string Get(StreamKind streamKind, int streamNumber, string parameter, InfoKind kindOfInfo = InfoKind.Text, InfoKind kindOfSearch = InfoKind.Name)
        {
            CheckHandle();

            if (_mustUseAnsi)
            {
                using (var parameterPtr = GlobalMemory.StringToGlobalAnsi(parameter))
                {
                    return
                        (Marshal.PtrToStringAnsi(
                             NativeMethods.MediaInfoA_Get(
                                 _handle,
                                 (IntPtr)streamKind,
                                 (IntPtr)streamNumber,
                                 parameterPtr.Handle,
                                 (IntPtr)kindOfInfo,
                                 (IntPtr)kindOfSearch)));
                }
            }

            return
                (Marshal.PtrToStringUni(
                     NativeMethods.MediaInfo_Get(
                         _handle,
                         (IntPtr)streamKind,
                         (IntPtr)streamNumber,
                         parameter,
                         (IntPtr)kindOfInfo,
                         (IntPtr)kindOfSearch)));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets property value by specified stream kind and name.
        /// </summary>
        /// <param name="streamKind">Kind of the stream.</param>
        /// <param name="streamNumber">The stream number.</param>
        /// <param name="parameter">The parameter.</param>
        /// <param name="kindOfInfo">The kind of information.</param>
        /// <param name="kindOfSearch">The kind of search.</param>
        /// <returns>Returns property value</returns>
        public string Get(StreamKind streamKind, int streamNumber, string parameter, InfoKind kindOfInfo, InfoKind kindOfSearch)
        {
            if (Handle == IntPtr.Zero)
            {
                return("Unable to load MediaInfo library");
            }

            return(_mustUseAnsi ?
                   Marshal.PtrToStringAnsi(
                       NativeMethods.MediaInfoA_Get(
                           Handle,
                           (IntPtr)streamKind,
                           (IntPtr)streamNumber,
                           parameter,
                           (IntPtr)kindOfInfo,
                           (IntPtr)kindOfSearch)) :
                   Marshal.PtrToStringUni(
                       NativeMethods.MediaInfo_Get(
                           Handle,
                           (IntPtr)streamKind,
                           (IntPtr)streamNumber,
                           parameter,
                           (IntPtr)kindOfInfo,
                           (IntPtr)kindOfSearch)));
        }
Exemplo n.º 5
0
 public String Get(StreamKind StreamKind, int StreamNumber, int Parameter, InfoKind KindOfInfo)
 {
     if (MustUseAnsi)
         return Marshal.PtrToStringAnsi(MediaInfoA_GetI(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo));
     else
         return Marshal.PtrToStringUni(MediaInfo_GetI(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo));
 }
Exemplo n.º 6
0
 //------------------------------------------------------------
 // コンストラクタ。
 EvaluateInfo(InfoKind aInfoKind, TypeInfo aTypeInfo, ISymbolNode aSymbol)
 {
     this.Kind          = aInfoKind;
     this.TypeInfo      = aTypeInfo;
     this.Symbol        = aSymbol;
     this.mIsReusableSR = true;
 }
        public string Get(StreamKind streamKind, int streamNumber, int parameter, InfoKind kindOfInfo = InfoKind.Text)
        {
            CheckHandle();

            return(_mustUseAnsi ?
                   Marshal.PtrToStringAnsi(NativeMethods.MediaInfoA_GetI(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, (IntPtr)parameter, (IntPtr)kindOfInfo)) :
                   Marshal.PtrToStringUni(NativeMethods.MediaInfo_GetI(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, (IntPtr)parameter, (IntPtr)kindOfInfo)));
        }
Exemplo n.º 8
0
 public string Get(StreamKind StreamKind, int StreamNumber, int Parameter, InfoKind KindOfInfo)
 {
     if (this.MustUseAnsi)
     {
         return(Marshal.PtrToStringAnsi(MediaInfoA_GetI(this.Handle, (IntPtr)((long)StreamKind), (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)((long)KindOfInfo))));
     }
     return(Marshal.PtrToStringUni(MediaInfo_GetI(this.Handle, (IntPtr)((long)StreamKind), (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)((long)KindOfInfo))));
 }
Exemplo n.º 9
0
        /// <summary>
        /// Gets the property <typeparamref name="T">value</typeparamref> by the <paramref name="parameter">property index</paramref>.
        /// </summary>
        /// <param name="parameter">The stream property index.</param>
        /// <param name="infoKind">The kind of property value</param>
        /// <param name="convert"></param>
        /// <param name="extractResult">The manual extract result function.</param>
        /// <returns>Returns property <typeparamref name="T">value</typeparamref> of specified stream <paramref name="parameter">property index</paramref>.</returns>
        protected T Get <T>(int parameter, InfoKind infoKind, ParseDelegate <T> convert, Func <string, string> extractResult = null)
        {
            if (convert == null)
            {
                throw new ArgumentNullException(nameof(convert));
            }

            return(convert(Get(parameter, infoKind, extractResult), out var parsedValue) ? parsedValue : default(T));
        }
Exemplo n.º 10
0
        public string Get(StreamKind streamKind, int streamNumber, int parameter, InfoKind kindOfInfo = InfoKind.Text)
        {
            if (_mustUseAnsi)
            {
                return(Marshal.PtrToStringAnsi(MediaInfoA_GetI(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, (IntPtr)parameter, (IntPtr)kindOfInfo)));
            }

            return(Marshal.PtrToStringUni(MediaInfo_GetI(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, (IntPtr)parameter, (IntPtr)kindOfInfo)));
        }
Exemplo n.º 11
0
        /// <summary>
        /// Get a piece of information about a file (parameter is a string)
        /// </summary>
        public String Get(StreamKind StreamKind, int StreamNumber, int Parameter, InfoKind KindOfInfo)
        {
            if (handleMediaInfo == IntPtr.Zero)
            {
                return("Unable to load MediaInfo library");
            }

            return(Marshal.PtrToStringUni(this.mediaInfo_GetI(handleMediaInfo, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo)));
        }
Exemplo n.º 12
0
 public string Get(StreamKind StreamKind, int StreamNumber, int Parameter, InfoKind KindOfInfo)
 {
     if (Handle == (IntPtr) 0)
         return "Unable to load MediaInfo library";
     if (MustUseAnsi)
         return Marshal.PtrToStringAnsi(MediaInfoA_GetI(Handle, (IntPtr) StreamKind, (IntPtr) StreamNumber,
             (IntPtr) Parameter, (IntPtr) KindOfInfo));
     return Marshal.PtrToStringUni(MediaInfo_GetI(Handle, (IntPtr) StreamKind, (IntPtr) StreamNumber,
         (IntPtr) Parameter, (IntPtr) KindOfInfo));
 }
Exemplo n.º 13
0
 public string Get(StreamKind StreamKind, int StreamNumber, string Parameter, InfoKind KindOfInfo, InfoKind KindOfSearch)
 {
     if (this.MustUseAnsi)
     {
         IntPtr parameter = Marshal.StringToHGlobalAnsi(Parameter);
         string str       = Marshal.PtrToStringAnsi(MediaInfoA_Get(this.Handle, (IntPtr)((long)StreamKind), (IntPtr)StreamNumber, parameter, (IntPtr)((long)KindOfInfo), (IntPtr)((long)KindOfSearch)));
         Marshal.FreeHGlobal(parameter);
         return(str);
     }
     return(Marshal.PtrToStringUni(MediaInfo_Get(this.Handle, (IntPtr)((long)StreamKind), (IntPtr)StreamNumber, Parameter, (IntPtr)((long)KindOfInfo), (IntPtr)((long)KindOfSearch))));
 }
Exemplo n.º 14
0
 public String Get(StreamKind StreamKind, int StreamNumber, int Parameter, InfoKind KindOfInfo)
 {
     if (MustUseAnsi)
     {
         return(Marshal.PtrToStringAnsi((Is32Bit ? MediaInfoA_GetI32(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo) : MediaInfoA_GetI64(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo))));
     }
     else
     {
         return(Marshal.PtrToStringUni((Is32Bit ? MediaInfo_GetI32(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo) : MediaInfo_GetI64(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo))));
     }
 }
Exemplo n.º 15
0
 public string Get(StreamKind streamKind, int streamNumber, int parameter, InfoKind infoKind)
 {
     if (MustUseAnsi)
     {
         return(MakeStringResult(MediaInfoA_GetI(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, (IntPtr)parameter, (IntPtr)infoKind)));
     }
     else
     {
         return(MakeStringResult(MediaInfo_GetI(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, (IntPtr)parameter, (IntPtr)infoKind)));
     }
 }
Exemplo n.º 16
0
        /// <summary>
        /// Gets the specified property value by the <paramref name="parameter">property index</paramref>.
        /// </summary>
        /// <param name="parameter">The property index.</param>
        /// <param name="infoKind">The kind of property value</param>
        /// <param name="extractResult">The extract result.</param>
        /// <returns>Returns property value by name. If property does not defined will return <see cref="string.Empty"/>.</returns>
        protected string Get(int parameter, InfoKind infoKind, Func <string, string> extractResult = null)
        {
            var result = Info.Get(StreamKind, StreamPosition, parameter, infoKind);

            if (extractResult != null)
            {
                result = extractResult(result) ?? result;
            }

            return(result ?? string.Empty);
        }
Exemplo n.º 17
0
 public String Get(StreamKind StreamKind, int streamNumber, int Parameter, InfoKind kindOfInfo = InfoKind.Text)
 {
     if (MustUseAnsi)
     {
         return(Marshal.PtrToStringAnsi(UnsafeNativeMethods.MediaInfoA_GetI(Handle, (IntPtr)StreamKind, (IntPtr)streamNumber, (IntPtr)Parameter, (IntPtr)kindOfInfo)));
     }
     else
     {
         return(Marshal.PtrToStringUni(UnsafeNativeMethods.MediaInfo_GetI(Handle, (IntPtr)StreamKind, (IntPtr)streamNumber, (IntPtr)Parameter, (IntPtr)kindOfInfo)));
     }
 }
Exemplo n.º 18
0
        public string Get(StreamKind streamKind, int streamNumber, string parameter, InfoKind kindOfInfo = InfoKind.Text, InfoKind kindOfSearch = InfoKind.Name)
        {
            if (_mustUseAnsi)
            {
                var parameterPtr = Marshal.StringToHGlobalAnsi(parameter);
                var toReturn     = Marshal.PtrToStringAnsi(MediaInfoA_Get(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, parameterPtr, (IntPtr)kindOfInfo, (IntPtr)kindOfSearch));
                Marshal.FreeHGlobal(parameterPtr);
                return(toReturn);
            }

            return(Marshal.PtrToStringUni(MediaInfo_Get(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, parameter, (IntPtr)kindOfInfo, (IntPtr)kindOfSearch)));
        }
Exemplo n.º 19
0
 public String Get(StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo, InfoKind KindOfSearch)
 {
     if (MustUseAnsi)
     {
         IntPtr Parameter_Ptr = Marshal.StringToHGlobalAnsi(Parameter);
         String ToReturn = Marshal.PtrToStringAnsi(MediaInfoA_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter_Ptr, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch));
         Marshal.FreeHGlobal(Parameter_Ptr);
         return ToReturn;
     }
     else
         return Marshal.PtrToStringUni(MediaInfo_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch));
 }
Exemplo n.º 20
0
 public String Get(StreamKind StreamKind, int streamNumber, String Parameter, InfoKind kindOfInfo = InfoKind.Text, InfoKind kindOfSearch = InfoKind.Name)
 {
     if (MustUseAnsi)
     {
         IntPtr Parameter_Ptr = Marshal.StringToHGlobalAnsi(Parameter);
         String ToReturn      = Marshal.PtrToStringAnsi(UnsafeNativeMethods.MediaInfoA_Get(Handle, (IntPtr)StreamKind, (IntPtr)streamNumber, Parameter_Ptr, (IntPtr)kindOfInfo, (IntPtr)kindOfSearch));
         Marshal.FreeHGlobal(Parameter_Ptr);
         return(ToReturn);
     }
     else
     {
         return(Marshal.PtrToStringUni(UnsafeNativeMethods.MediaInfo_Get(Handle, (IntPtr)StreamKind, (IntPtr)streamNumber, Parameter, (IntPtr)kindOfInfo, (IntPtr)kindOfSearch)));
     }
 }
Exemplo n.º 21
0
 public String Get(StreamKind StreamKind, int StreamNumber, int Parameter, InfoKind KindOfInfo)
 {
     if (this.Handle == (IntPtr)0)
     {
         return("Unable to load MediaInfo library");
     }
     if (this.MustUseAnsi)
     {
         return(Marshal.PtrToStringAnsi(MediaInfoA_GetI(this.Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo)));
     }
     else
     {
         return(Marshal.PtrToStringUni(MediaInfo_GetI(this.Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo)));
     }
 }
Exemplo n.º 22
0
 public string Get(StreamKind StreamKind, int StreamNumber, string Parameter, InfoKind KindOfInfo,
     InfoKind KindOfSearch)
 {
     if (Handle == (IntPtr) 0)
         return "Unable to load MediaInfo library";
     if (MustUseAnsi)
     {
         var Parameter_Ptr = Marshal.StringToHGlobalAnsi(Parameter);
         var ToReturn = Marshal.PtrToStringAnsi(MediaInfoA_Get(Handle, (IntPtr) StreamKind,
             (IntPtr) StreamNumber, Parameter_Ptr, (IntPtr) KindOfInfo, (IntPtr) KindOfSearch));
         Marshal.FreeHGlobal(Parameter_Ptr);
         return ToReturn;
     }
     return Marshal.PtrToStringUni(MediaInfo_Get(Handle, (IntPtr) StreamKind, (IntPtr) StreamNumber, Parameter,
         (IntPtr) KindOfInfo, (IntPtr) KindOfSearch));
 }
Exemplo n.º 23
0
 public String Get(StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo, InfoKind KindOfSearch)
 {
     if (Handle == (IntPtr)0)
     {
         return("Unable to load MediaInfo library");
     }
     if (MustUseAnsi)
     {
         IntPtr Parameter_Ptr = Marshal.StringToHGlobalAnsi(Parameter);
         String ToReturn      = Marshal.PtrToStringAnsi(MediaInfoA_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter_Ptr, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch));
         Marshal.FreeHGlobal(Parameter_Ptr);
         return(ToReturn);
     }
     else
     {
         return(Marshal.PtrToStringUni(MediaInfo_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch)));
     }
 }
Exemplo n.º 24
0
        public string Get(StreamKind streamKind, int streamNumber, string parameter, InfoKind infoKind = InfoKind.Text, InfoKind searchKind = InfoKind.Name)
        {
            var pParameter = MakeStringParameter(parameter);

            try
            {
                if (MustUseAnsi)
                {
                    return(MakeStringResult(MediaInfoA_Get(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, pParameter, (IntPtr)infoKind, (IntPtr)searchKind)));
                }
                else
                {
                    return(MakeStringResult(MediaInfo_Get(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, pParameter, (IntPtr)infoKind, (IntPtr)searchKind)));
                }
            }
            finally
            {
                Marshal.FreeHGlobal(pParameter);
            }
        }
Exemplo n.º 25
0
        public string Get(StreamKind streamKind, int streamNumber, string parameter, InfoKind kindOfInfo, InfoKind kindOfSearch)
        {
            if (_handle == IntPtr.Zero)
            {
                return("Unable to load MediaInfo library");
            }

            if (_mustUseAnsi)
            {
                string result;
                using (var parameterPtr = GlobalMemory.StringToGlobalAnsi(parameter))
                {
                    result =
                        Marshal.PtrToStringAnsi(
                            NativeMethods.MediaInfoA_Get(
                                _handle,
                                (IntPtr)streamKind,
                                (IntPtr)streamNumber,
                                parameterPtr.Handle,
                                (IntPtr)kindOfInfo,
                                (IntPtr)kindOfSearch));
                }

                return(result);
            }

            return
                (Marshal.PtrToStringUni(
                     NativeMethods.MediaInfo_Get(
                         _handle,
                         (IntPtr)streamKind,
                         (IntPtr)streamNumber,
                         parameter,
                         (IntPtr)kindOfInfo,
                         (IntPtr)kindOfSearch)));
        }
Exemplo n.º 26
0
 /// <summary>
 /// Gets the property value in specified file position by stream and property index.
 /// </summary>
 /// <param name="filePos">The file position.</param>
 /// <param name="streamKind">Kind of the stream.</param>
 /// <param name="streamNumber">The stream number.</param>
 /// <param name="parameter">The property index.</param>
 /// <param name="kindOfInfo">The kind of information.</param>
 /// <returns></returns>
 public string Get(int filePos, StreamKind streamKind, int streamNumber, int parameter, InfoKind kindOfInfo)
 {
     return(_useAnsiStrings ?
            Marshal.PtrToStringAnsi(NativeMethods.MediaInfoListA_GetI(_handle, (IntPtr)filePos, (IntPtr)streamKind, (IntPtr)streamNumber, (IntPtr)parameter, (IntPtr)kindOfInfo)) :
            Marshal.PtrToStringUni(NativeMethods.MediaInfoList_GetI(_handle, (IntPtr)filePos, (IntPtr)streamKind, (IntPtr)streamNumber, (IntPtr)parameter, (IntPtr)kindOfInfo)));
 }
Exemplo n.º 27
0
 public String Get(int filePosition, StreamKind streamKind, int streamNumber, int parameter, InfoKind kindOfInfo) { return Marshal.PtrToStringUni(UnsafeNativeMethods.MediaInfoList_GetI(Handle, (IntPtr)filePosition, (IntPtr)streamKind, (IntPtr)streamNumber, (IntPtr)parameter, (IntPtr)kindOfInfo)); }
Exemplo n.º 28
0
 //Default values, if you know how to set default values in C#, say me
 public string Get(StreamKind StreamKind, int StreamNumber, string Parameter, InfoKind KindOfInfo)
 {
     return Get(StreamKind, StreamNumber, Parameter, KindOfInfo, InfoKind.Name);
 }
Exemplo n.º 29
0
 public String Get(int filePos, StreamKind streamKind, int streamNumber, int parameter, InfoKind kindOfInfo)
 {
     return Marshal.PtrToStringUni(MediaInfoList_GetI(_handle, (IntPtr)filePos, (IntPtr)streamKind, (IntPtr)streamNumber, (IntPtr)parameter, (IntPtr)kindOfInfo));
 }
Exemplo n.º 30
0
 public String Get(StreamKind StreamKind, int streamNumber, String Parameter, InfoKind kindOfInfo = InfoKind.Text, InfoKind kindOfSearch = InfoKind.Name)
 {
     if (MustUseAnsi)
     {
         IntPtr Parameter_Ptr = Marshal.StringToHGlobalAnsi(Parameter);
         String ToReturn = Marshal.PtrToStringAnsi(UnsafeNativeMethods.MediaInfoA_Get(Handle, (IntPtr)StreamKind, (IntPtr)streamNumber, Parameter_Ptr, (IntPtr)kindOfInfo, (IntPtr)kindOfSearch));
         Marshal.FreeHGlobal(Parameter_Ptr);
         return ToReturn;
     }
     else
         return Marshal.PtrToStringUni(UnsafeNativeMethods.MediaInfo_Get(Handle, (IntPtr)StreamKind, (IntPtr)streamNumber, Parameter, (IntPtr)kindOfInfo, (IntPtr)kindOfSearch));
 }
Exemplo n.º 31
0
 public string Get(StreamKind streamKind, int streamNumber, int parameter, InfoKind infoKind)
 {
     if (MustUseAnsi)
     {
         return MakeStringResult(MediaInfoA_GetI(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, (IntPtr)parameter, (IntPtr)infoKind));
     }
     else
     {
         return MakeStringResult(MediaInfo_GetI(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, (IntPtr)parameter, (IntPtr)infoKind));
     }
 }
Exemplo n.º 32
0
 public String Get(int filePos, StreamKind streamKind, int streamNumber, String parameter, InfoKind kindOfInfo)
 {
     return Get(filePos, streamKind, streamNumber, parameter, kindOfInfo, InfoKind.Name);
 }
Exemplo n.º 33
0
 private String Get(StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo)
 {
     return this.Get(StreamKind, StreamNumber, Parameter, KindOfInfo, InfoKind.Name);
 }
Exemplo n.º 34
0
 public String Get(int FilePos, StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo)
 {
     return(Get(FilePos, StreamKind, StreamNumber, Parameter, KindOfInfo, InfoKind.Name));
 }
Exemplo n.º 35
0
 String Get(StreamKind StreamKind, uint StreamNumber, String Parameter, InfoKind KindOfInfo, InfoKind KindOfSearch)
 {
     return Marshal.PtrToStringUni(MediaInfo_Get(Handle, StreamKind, StreamNumber, Parameter, KindOfInfo, KindOfSearch));
 }
Exemplo n.º 36
0
 public string Get(StreamKind streamKind, int streamNumber, string parameter, InfoKind infoKind = InfoKind.Text, InfoKind searchKind = InfoKind.Name)
 {
     var pParameter = MakeStringParameter(parameter);
     try
     {
         if (MustUseAnsi)
         {
             return MakeStringResult(MediaInfoA_Get(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, pParameter, (IntPtr)infoKind, (IntPtr)searchKind));
         }
         else
         {
             return MakeStringResult(MediaInfo_Get(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, pParameter, (IntPtr)infoKind, (IntPtr)searchKind));
         }
     }
     finally
     {
         Marshal.FreeHGlobal(pParameter);
     }
 }
Exemplo n.º 37
0
 public String Get(int FilePos, StreamKind StreamKind, int StreamNumber, int Parameter, InfoKind KindOfInfo)
 {
     return Marshal.PtrToStringUni(MediaInfoList_GetI(Handle, (IntPtr)FilePos, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo));
 }
Exemplo n.º 38
0
 private String Get(StreamKind StreamKind, int StreamNumber, int Parameter, InfoKind KindOfInfo)
 {
     return Marshal.PtrToStringUni(MediaInfo_GetI(this.Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo));
 }
Exemplo n.º 39
0
 public String Get(StreamKind StreamKind, int StreamNumber, int Parameter, InfoKind KindOfInfo)
 {
     if (MustUseAnsi)
         return Marshal.PtrToStringAnsi((Is32Bit ? MediaInfoA_GetI32(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo) : MediaInfoA_GetI64(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo)));
     else
         return Marshal.PtrToStringUni((Is32Bit ? MediaInfo_GetI32(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo) : MediaInfo_GetI64(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo)));
 }
Exemplo n.º 40
0
 public String Get(StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo,
     InfoKind KindOfSearch)
 {
     return
     Marshal.PtrToStringUni(MediaInfo_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter,
                                      (IntPtr)KindOfInfo, (IntPtr)KindOfSearch));
 }
Exemplo n.º 41
0
 public String Get(StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo, InfoKind KindOfSearch)
 {
     if (Handle == (IntPtr)0)
         return "Unable to load MediaInfo library";
     if (MustUseAnsi)
     {
         IntPtr Parameter_Ptr=Marshal.StringToHGlobalAnsi(Parameter);
         String ToReturn=Marshal.PtrToStringAnsi(MediaInfoA_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter_Ptr, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch));
         Marshal.FreeHGlobal(Parameter_Ptr);
         return ToReturn;
     }
     else
         return Marshal.PtrToStringUni(MediaInfo_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch));
 }
Exemplo n.º 42
0
 public String Get(int FilePos, StreamKind StreamKind, int StreamNumber, int Parameter, InfoKind KindOfInfo)
 {
     return(Marshal.PtrToStringUni(MediaInfoList_GetI(Handle, (IntPtr)FilePos, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo)));
 }
Exemplo n.º 43
0
 public String Get(int filePosition, StreamKind streamKind, int streamNumber, String parameter, InfoKind kindOfInfo = InfoKind.Text, InfoKind kindOfSearch = InfoKind.Name) { return Marshal.PtrToStringUni(UnsafeNativeMethods.MediaInfoList_Get(Handle, (IntPtr)filePosition, (IntPtr)streamKind, (IntPtr)streamNumber, parameter, (IntPtr)kindOfInfo, (IntPtr)kindOfSearch)); }
Exemplo n.º 44
0
 public String Get(int FilePos, StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo, InfoKind KindOfSearch) 
 { 
     return Marshal.PtrToStringUni((Is32Bit ? MediaInfoList_Get32(Handle, (IntPtr)FilePos, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch) : MediaInfoList_Get64(Handle, (IntPtr)FilePos, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch))); 
 }
Exemplo n.º 45
0
 public String Get(StreamKind StreamKind, uint StreamNumber, uint Parameter, InfoKind KindOfInfo)
 {
     return Marshal.PtrToStringUni(MediaInfo_GetI(Handle, StreamKind, StreamNumber, Parameter, KindOfInfo));
 }
Exemplo n.º 46
0
 /// <summary>
 /// Gets the specified file position.
 /// </summary>
 /// <param name="filePos">The file position.</param>
 /// <param name="streamKind">Kind of the stream.</param>
 /// <param name="streamNumber">The stream number.</param>
 /// <param name="parameter">The parameter.</param>
 /// <param name="kindOfInfo">The kind of information.</param>
 /// <returns></returns>
 public string Get(int filePos, StreamKind streamKind, int streamNumber, string parameter, InfoKind kindOfInfo)
 {
     return(Get(filePos, streamKind, streamNumber, parameter, kindOfInfo, InfoKind.Name));
 }
 private String Get(IntPtr Handle, StreamKind StreamKind, int StreamNumber, string Parameter, InfoKind KindOfInfo, InfoKind KindOfSearch)
 {
     return "MediaInfo";
     //return Marshal.PtrToStringUni(MediaInfo_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch));
 }
Exemplo n.º 48
0
 public String Get(StreamKind StreamKind, int StreamNumber, int Parameter, InfoKind KindOfInfo)
 {
     if (Handle == (IntPtr)0)
         return "Unable to load MediaInfo library";
     if (MustUseAnsi)
         return Marshal.PtrToStringAnsi(MediaInfoA_GetI(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo));
     else
         return Marshal.PtrToStringUni(MediaInfo_GetI(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo));
 }
Exemplo n.º 49
0
 public String Get(StreamKind StreamKind, int streamNumber, int Parameter, InfoKind kindOfInfo = InfoKind.Text)
 {
     if (MustUseAnsi)
         return Marshal.PtrToStringAnsi(UnsafeNativeMethods.MediaInfoA_GetI(Handle, (IntPtr)StreamKind, (IntPtr)streamNumber, (IntPtr)Parameter, (IntPtr)kindOfInfo));
     else
         return Marshal.PtrToStringUni(UnsafeNativeMethods.MediaInfo_GetI(Handle, (IntPtr)StreamKind, (IntPtr)streamNumber, (IntPtr)Parameter, (IntPtr)kindOfInfo));
 }
Exemplo n.º 50
0
 public String Get(int FilePos, StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo)
 {
     return Get(FilePos, StreamKind, StreamNumber, Parameter, KindOfInfo, InfoKind.Name);
 }
Exemplo n.º 51
0
 public String Get(StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo, InfoKind KindOfSearch)
 {
     if (MustUseAnsi)
     {
         IntPtr Parameter_Ptr = Marshal.StringToHGlobalAnsi(Parameter);
         String ToReturn = Marshal.PtrToStringAnsi((Is32Bit ? MediaInfoA_Get32(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter_Ptr, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch) : MediaInfoA_Get64(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter_Ptr, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch)));
         Marshal.FreeHGlobal(Parameter_Ptr);
         return ToReturn;
     }
     else
         return Marshal.PtrToStringUni((Is32Bit ? MediaInfo_Get32(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch) : MediaInfo_Get64(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch)));
 }