Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the TextMediaFormat class with the specified mime type
        ///     and text type.
        /// </summary>
        /// <param name="mimeType">The mime type of the format.</param>
        /// <param name="textType">The text type of the format.</param>
        /// <exception cref="ArgumentException">
        ///     <paramref name="mimeType"/> or <paramref name="textType"/> is invalid (i.e. undefined value).
        /// </exception>
        /// <since_tizen> 3 </since_tizen>
        public TextMediaFormat(MediaFormatTextMimeType mimeType, MediaFormatTextType textType)
            : base(MediaFormatType.Text)
        {
            ValidationUtil.ValidateEnum(typeof(MediaFormatTextMimeType), mimeType, nameof(mimeType));
            ValidationUtil.ValidateEnum(typeof(MediaFormatTextType), textType, nameof(textType));

            MimeType = mimeType;
            TextType = textType;
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the TextMediaFormat class with the specified mime type
 ///     and text type.
 /// </summary>
 /// <param name="mimeType">The mime type of the format.</param>
 /// <param name="textType">The text type of the format.</param>
 /// <exception cref="ArgumentException">
 ///     <paramref name="mimeType"/> or <paramref name="textType"/> is invalid (i.e. undefined value).
 /// </exception>
 /// <since_tizen> 3 </since_tizen>
 public TextMediaFormat(MediaFormatTextMimeType mimeType, MediaFormatTextType textType)
     : base(MediaFormatType.Text)
 {
     if (!Enum.IsDefined(typeof(MediaFormatTextMimeType), mimeType))
     {
         throw new ArgumentException($"Invalid mime type value : { (int)mimeType }");
     }
     if (!Enum.IsDefined(typeof(MediaFormatTextType), textType))
     {
         throw new ArgumentException($"Invalid text type value : { (int)textType }");
     }
     MimeType = mimeType;
     TextType = textType;
 }
Beispiel #3
0
        /// <summary>
        /// Retrieves text properties of the media format from a native handle.
        /// </summary>
        /// <param name="handle">A native handle that the properties are retrieved from.</param>
        /// <param name="mimeType">An out parameter for the mime type.</param>
        /// <param name="textType">An out parameter for the text type.</param>
        private static void GetInfo(IntPtr handle, out MediaFormatTextMimeType mimeType,
                                    out MediaFormatTextType textType)
        {
            int mimeTypeValue = 0;
            int textTypeValue = 0;

            int ret = Interop.MediaFormat.GetTextInfo(handle, out mimeTypeValue, out textTypeValue);

            MultimediaDebug.AssertNoError(ret);

            mimeType = (MediaFormatTextMimeType)mimeTypeValue;
            textType = (MediaFormatTextType)textTypeValue;

            Debug.Assert(Enum.IsDefined(typeof(MediaFormatTextMimeType), mimeType),
                         "Invalid text mime type!");
            Debug.Assert(Enum.IsDefined(typeof(MediaFormatTextType), textType),
                         "Invalid text type!");
        }
Beispiel #4
0
 internal static extern int SetTextMimeType(IntPtr handle, MediaFormatTextMimeType value);
Beispiel #5
0
 internal static extern int GetTextInfo(IntPtr handle,
                                        out MediaFormatTextMimeType mimeType, out MediaFormatTextType textType);