Ejemplo n.º 1
0
        /// <summary>
        /// Starts streaming music from a designated file.
        /// </summary>
        /// <param name="Path">The path to the file.</param>
        /// <param name="ID">The ID of the file.</param>
        /// <param name="Loop">Whether or not to loop the playback.</param>
        /// <returns>The music track's channel.</returns>
        public int LoadMusicTrack(string Path, int ID, bool Loop)
        {
            int Channel = Bass.BASS_StreamCreateFile(Path, 0, 0, BASSFlag.BASS_DEFAULT | BASSFlag.BASS_STREAM_AUTOFREE);

            if (Loop)
                Bass.BASS_ChannelFlags(Channel, BASSFlag.BASS_MUSIC_LOOP, BASSFlag.BASS_MUSIC_LOOP);

            MusicTrack Track = new MusicTrack(ID, Channel);
            m_Tracks.Add(Track);

            Bass.BASS_ChannelPlay(Channel, false);

            return Channel;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Starts streaming music from a designated file.
        /// </summary>
        /// <param name="Path">The path to the file.</param>
        /// <param name="ID">The ID of the file.</param>
        /// <param name="Loop">Whether or not to loop the playback.</param>
        /// <returns>The music track's channel.</returns>
        public int LoadMusicTrack(string Path, int ID, bool Loop)
        {
            int Channel = Bass.BASS_StreamCreateFile(Path, 0, 0, BASSFlag.BASS_DEFAULT | BASSFlag.BASS_STREAM_AUTOFREE);

            if (Loop)
            {
                Bass.BASS_ChannelFlags(Channel, BASSFlag.BASS_MUSIC_LOOP, BASSFlag.BASS_MUSIC_LOOP);
            }

            MusicTrack Track = new MusicTrack(ID, Channel);

            m_Tracks.Add(Track);

            Bass.BASS_ChannelPlay(Channel, false);

            return(Channel);
        }