Esempio n. 1
0
        /// <summary>
        /// Set the Broadcast Extension chuck on the given <paramref name="sndfile"/> file.
        /// </summary>
        /// <param name="sndfile">Audio file to set broadcast info chunk for.</param>
        /// <param name="broadcastInfo">Broadcast info chunk.</param>
        /// <returns>True if broadcast info was successfully set.</returns>
        public bool SetBroadcastInfo(IntPtr sndfile, LibsndfileBroadcastInfo broadcastInfo)
        {
            if (sndfile == IntPtr.Zero)
            {
                throw new ArgumentException("File handle is invalid/closed.");
            }

            return(m_Api.SetBroadcastInfo(sndfile, broadcastInfo));
        }
        /// <summary>
        /// Set the Broadcast Extension chuck on the given <paramref name="sndfile"/> file.
        /// </summary>
        /// <param name="sndfile">Audio file to set broadcast info chunk for.</param>
        /// <param name="broadcastInfo">Broadcast info chunk.</param>
        /// <returns>True if broadcast info was successfully set.</returns>
        public bool SetBroadcastInfo(IntPtr sndfile, LibsndfileBroadcastInfo broadcastInfo)
        {
            using (var memory = m_Marshaller.Allocate(broadcastInfo))
            {
                var retval = m_Api.Command(sndfile, LibsndfileCommand.SetBroadcastInfo, memory, memory.Size);
                if (!LibsndfileCommandUtilities.IsValidResult(sndfile, LibsndfileCommand.SetBroadcastInfo, retval))
                {
                    throw new LibsndfileException("Unable to set broadcast info for the given file.");
                }

                return(Convert.ToBoolean(retval));
            }
        }
        /// <summary>
        /// Set the Broadcast Extension chuck on the given <paramref name="sndfile"/> file.
        /// </summary>
        /// <param name="sndfile">Audio file to set broadcast info chunk for.</param>
        /// <param name="broadcastInfo">Broadcast info chunk.</param>
        /// <returns>True if broadcast info was successfully set.</returns>
        public bool SetBroadcastInfo(IntPtr sndfile, LibsndfileBroadcastInfo broadcastInfo)
        {
            if (sndfile == IntPtr.Zero)
                throw new ArgumentException("File handle is invalid/closed.");

            return m_Api.SetBroadcastInfo(sndfile, broadcastInfo);
        }
        /// <summary>
        /// Set the Broadcast Extension chuck on the given <paramref name="sndfile"/> file.
        /// </summary>
        /// <param name="sndfile">Audio file to set broadcast info chunk for.</param>
        /// <param name="broadcastInfo">Broadcast info chunk.</param>
        /// <returns>True if broadcast info was successfully set.</returns>
        public bool SetBroadcastInfo(IntPtr sndfile, LibsndfileBroadcastInfo broadcastInfo)
        {
            using (var memory = m_Marshaller.Allocate(broadcastInfo))
            {
                var retval = m_Api.Command(sndfile, LibsndfileCommand.SetBroadcastInfo, memory, memory.Size);
                if (!LibsndfileCommandUtilities.IsValidResult(sndfile, LibsndfileCommand.SetBroadcastInfo, retval))
                    throw new LibsndfileException("Unable to set broadcast info for the given file.");

                return Convert.ToBoolean(retval);
            }
        }