Esempio n. 1
0
        /// <summary>
        /// Presents the user with a list of available ACM (Audio Compression Manager) codec output formats to choose from.
        /// </summary>
        /// <param name="Handle">The channel handle... a HSTREAM, HMUSIC, or HRECORD.</param>
        /// <param name="Format">Pointer to the format buffer.</param>
        /// <param name="FormatLength">Size of the format buffer. If this is 0, then a suggested format buffer length is returned (which is the maximum length of all installed codecs), without displaying the codec selector.</param>
        /// <param name="Title">Window title for the selector... <see langword="null" /> = "Choose the output format".</param>
        /// <param name="Flags">A combination of <see cref="ACMFormatFlags"/>.</param>
        /// <param name="Encoding">Can be used to restrict the choice to a particular format tag. This is required with <see cref="ACMFormatFlags.Suggest"/>, and is optional otherwise.</param>
        /// <returns>
        /// If successful, the user-selected codec format details are put in the provided buffer and the length of the format details is returned, else 0 is returned.
        /// Use <see cref="Bass.LastError" /> to get the error code.
        /// If <paramref name="FormatLength"/> is 0, then the suggested format buffer size is returned.
        /// </returns>
        /// <remarks>
        /// This function presents the user with a list of available ACM codecs to choose from, given the sample format of the channel.
        /// The details of the chosen codec's output are returned in the Format buffer, which can then be used with <see cref="EncodeStartACM(int,IntPtr,EncodeFlags,EncodeProcedure,IntPtr)" /> or <see cref="EncodeStartACM(int,IntPtr,EncodeFlags,string)" /> to begin encoding.
        /// <para>
        /// The <paramref name="Format" /> buffer contents are actually a WAVEFORMATEX or ACMFORMAT structure.
        /// If writing the encoder output to a WAVE file, the Format buffer contents would be the format chunk ("fmt") of the file.
        /// </para>
        /// </remarks>
        /// <exception cref="Errors.Handle"><paramref name="Handle" /> is not valid.</exception>
        /// <exception cref="Errors.NotAvailable">There are no codecs available that will accept the channel's format.</exception>
        /// <exception cref="Errors.AcmCancel">The user pressed the "cancel" button.</exception>
        /// <exception cref="Errors.Unknown">Some other mystery problem!</exception>
        public static int GetACMFormat(int Handle,
                                       IntPtr Format          = default(IntPtr),
                                       int FormatLength       = 0,
                                       string Title           = null,
                                       ACMFormatFlags Flags   = ACMFormatFlags.Default,
                                       WaveFormatTag Encoding = WaveFormatTag.Unknown)
        {
            var acMflags = BitHelper.MakeLong((short)(Flags | ACMFormatFlags.Unicode), (short)Encoding);

            return(BASS_Encode_GetACMFormat(Handle, Format, FormatLength, Title, acMflags));
        }
Esempio n. 2
0
 public static extern int GetACMFormat(int handle, IntPtr form, int formlen, string title, ACMFormatFlags flags);