예제 #1
0
        /// <summary>
        /// Gets the language object for the given code.
        /// </summary>
        /// <param name="code">The ISO-639-2 code for the language.</param>
        /// <returns>Object that describes the language.</returns>
        public static Language Get(string code)
        {
            iso639_lang_t language = InteropUtilities.ReadStructure <iso639_lang_t>(HBFunctions.lang_for_code2(code));

            return(Converters.NativeToLanguage(language));
        }
예제 #2
0
 /// <summary>
 /// Sanitizes an audio bitrate given the output codec, sample rate and mixdown.
 /// </summary>
 /// <param name="audioBitrate">The desired audio bitrate.</param>
 /// <param name="encoder">The output encoder to be used.</param>
 /// <param name="sampleRate">The output sample rate to be used.</param>
 /// <param name="mixdown">The mixdown to be used.</param>
 /// <returns>A sanitized audio bitrate.</returns>
 public static int SanitizeAudioBitrate(int audioBitrate, AudioEncoder encoder, int sampleRate, Mixdown mixdown)
 {
     return(HBFunctions.hb_get_best_audio_bitrate(Converters.AudioEncoderToNative(encoder), audioBitrate, sampleRate, Converters.MixdownToNative(mixdown)));
 }
예제 #3
0
        /// <summary>
        /// Gets the bitrate limits for the given audio codec, sample rate and mixdown.
        /// </summary>
        /// <param name="encoder">The audio encoder used.</param>
        /// <param name="sampleRate">The sample rate used (Hz).</param>
        /// <param name="mixdown">The mixdown used.</param>
        /// <returns>Limits on the audio bitrate for the given settings.</returns>
        public static Limits GetBitrateLimits(AudioEncoder encoder, int sampleRate, Mixdown mixdown)
        {
            if (mixdown == Mixdown.Auto)
            {
                throw new ArgumentException("Mixdown cannot be Auto.");
            }

            int low  = 0;
            int high = 0;

            HBFunctions.hb_get_audio_bitrate_limits(Converters.AudioEncoderToNative(encoder), sampleRate, Converters.MixdownToNative(mixdown), ref low, ref high);

            return(new Limits {
                Low = low, High = high
            });
        }
예제 #4
0
        /// <summary>
        /// Sanitizes a mixdown given the output codec and input channel layout.
        /// </summary>
        /// <param name="mixdown">The desired mixdown.</param>
        /// <param name="encoder">The output encoder to be used.</param>
        /// <param name="layout">The input channel layout.</param>
        /// <returns>A sanitized mixdown value.</returns>
        public static Mixdown SanitizeMixdown(Mixdown mixdown, AudioEncoder encoder, int layout)
        {
            int sanitizedMixdown = HBFunctions.hb_get_best_mixdown(Converters.AudioEncoderToNative(encoder), layout, Converters.MixdownToNative(mixdown));

            return(Converters.NativeToMixdown(sanitizedMixdown));
        }
예제 #5
0
        /// <summary>
        /// Gets the default mixdown for the given audio encoder and channel layout.
        /// </summary>
        /// <param name="encoder">The output codec to be used.</param>
        /// <param name="layout">The input channel layout.</param>
        /// <returns>The default mixdown for the given codec and channel layout.</returns>
        public static Mixdown GetDefaultMixdown(AudioEncoder encoder, int layout)
        {
            int defaultMixdown = HBFunctions.hb_get_default_mixdown(Converters.AudioEncoderToNative(encoder), layout);

            return(Converters.NativeToMixdown(defaultMixdown));
        }