Example #1
0
        /// <summary>
        /// Sets the playback position of a sample, MOD music, or stream
        /// </summary>
        /// <param name="handle">The channel handle... a HCHANNEL, HSTREAM or HMUSIC</param>
        /// <param name="pos">The position, in units determined by the mode</param>
        /// <param name="mode">How to set the position. One of the following, with optional flags</param>
        public static void ChannelSetPosition(int handle, long pos, BASSMode mode)
        {
            bool result = NativeMethods.BASS_ChannelSetPosition(handle, pos, mode);

            if (!result)
            {
                throw new WavException(BassErrorCode.GetErrorInfo());
            }
        }
Example #2
0
        /// <summary>
        /// Retrieves the playback length of a channel.
        /// </summary>
        /// <param name="handle">The channel handle... a HCHANNEL, HMUSIC, HSTREAM. HSAMPLE handles may also be used</param>
        /// <param name="mode">
        /// How to retrieve the length. One of the following.
        /// BASS_POS_BYTE Get the length in bytes.
        /// BASS_POS_MUSIC_ORDER Get the length in orders. (HMUSIC only)
        /// BASS_POS_OGG Get the number of bitstreams in an OGG file.
        /// other modes may be supported by add-ons, see the documentation
        /// </param>
        /// <returns>If successful, then the channel's length is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code. </returns>
        public static long ChannelGetLength(int handle, BASSMode mode)
        {
            long result = NativeMethods.BASS_ChannelGetLength(handle, mode);

            if (result == -1)
            {
                throw new WavException(BassErrorCode.GetErrorInfo());
            }

            return(result);
        }
Example #3
0
 /// <summary>
 /// 获取当前音乐持续时间,单位/秒
 /// </summary>
 /// <param name="handle">The channel handle... a HCHANNEL, HMUSIC, HSTREAM. HSAMPLE handles may also be used</param>
 /// <param name="mode">
 /// How to retrieve the length. One of the following.
 /// BASS_POS_BYTE Get the length in bytes.
 /// BASS_POS_MUSIC_ORDER Get the length in orders. (HMUSIC only)
 /// BASS_POS_OGG Get the number of bitstreams in an OGG file.
 /// other modes may be supported by add-ons, see the documentation
 /// </param>
 /// <returns>If successful, then the channel's length is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code. </returns>
 public static long BASS_ChannelGetLength(int handle, BASSMode mode)
 {
     if (Environment.Is64BitProcess)
     {
         return(BassX64.BASS_ChannelGetLength(handle, mode));
     }
     else
     {
         return(BassX86.BASS_ChannelGetLength(handle, mode));
     }
 }
Example #4
0
 /// <summary>
 /// Sets the playback position of a sample, MOD music, or stream
 /// </summary>
 /// <param name="handle">The channel handle... a HCHANNEL, HSTREAM or HMUSIC</param>
 /// <param name="pos">The position, in units determined by the mode</param>
 /// <param name="mode">How to set the position. One of the following, with optional flags</param>
 /// <returns>If successful, then TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code. </returns>
 public static bool BASS_ChannelSetPosition(int handle, long pos, BASSMode mode)
 {
     if (Environment.Is64BitProcess)
     {
         return(BassX64.BASS_ChannelSetPosition(handle, pos, mode));
     }
     else
     {
         return(BassX86.BASS_ChannelSetPosition(handle, pos, mode));
     }
 }
Example #5
0
 public static extern bool BASS_ChannelSetPosition(int handle, long pos, BASSMode mode);
Example #6
0
 public static extern long BASS_ChannelGetPosition(int handle, BASSMode mode);
Example #7
0
 public static extern long BASS_ChannelGetLength(int handle, BASSMode mode);
Example #8
0
 /// <summary>
 /// Retrieves the playback position of a sample, stream, or MOD music. Can also be used with a recording channel
 /// </summary>
 /// <param name="handle">The channel handle... a HCHANNEL, HMUSIC, HSTREAM, or HRECORD</param>
 /// <param name="mode">How to retrieve the position. One of the following, with optional flags.
 /// BASS_POS_BYTE Get the position in bytes.
 /// BASS_POS_MUSIC_ORDER Get the position in orders and rows... LOWORD = order, HIWORD = row* scaler(BASS_ATTRIB_MUSIC_PSCALER). (HMUSIC only)
 /// BASS_POS_DECODE Flag: Get the decoding/rendering position, which may be ahead of the playback position due to buffering.This flag is unnecessary with decoding channels because the decoding position will always be given for them anyway, as they do not have playback buffers.
 /// other modes & flags may be supported by add-ons, see the documentation</param>
 /// <returns></returns>
 public static long ChannelGetPosition(int handle, BASSMode mode)
 {
     return(NativeMethods.BASS_ChannelGetPosition(handle, mode));
 }
Example #9
0
 public static extern long BASS_ChannelGetLength(int handle, BASSMode mode);
Example #10
0
 public static extern bool BASS_ChannelSetPosition(int handle, long pos, BASSMode mode);
Example #11
0
 public static extern long BASS_ChannelGetPosition(int handle, BASSMode mode);
Example #12
0
 public static extern long BASS_Mixer_ChannelGetPositionEx(int handle, BASSMode mode, int delay);