Hi, I've wrote a library based on BASS.NET which simplifies the codes for beginners.
The code that it simplifies are divivded into two category : BASS, Playback
Here's what I simplified :
PLAYBACK :
Normal Stream Playback :
strm = Bass.BASS_StreamCreateFile(str, 0, 0, BASSFlag.BASS_DEFAULT)
Bass.BASS_ChannelPlay(strm, False)
Simplified Stream Playback :
shell.PlayStream(txt_b.Text)
Normal Mod Playback :
strm = Bass.BASS_MusicLoad(str, 0, 0, BASSFlag.BASS_MUSIC_RAMP Or BASSFlag.BASS_MUSIC_FT2MOD Or BASSFlag.BASS_MUSIC_PRESCAN, 0)
Bass.BASS_ChannelPlay(strm, False)
Simplified Mod Playback :
shell.PlayMod(txt_b.Text)
Normal Internet Stream Playback :
strm = Bass.BASS_StreamCreateURL(str, 0, BASSFlag.BASS_STREAM_STATUS, Nothing, IntPtr.Zero)
Bass.BASS_ChannelPlay(strm, False)
Simplified Internet Stream Playback :
shell.PlayFromURL(txt_b.Text)
PLAYBACK Controls :
Normal Pause :
Bass.BASS_ChannelPause(strm)
Simplified Pause :
shell.Pause()
Normal Resume :
BASS.BASS_ChannelPlay(strm, False)
Simplified Resume :
shell.ResumePaused()
Normal Stop :
Bass.BASS_ChannelStop(strm)
Simplified Stop :
shell.StopStream()
LENGTH Controls :
Normal Get Length(Bytes) :
Dim pos As Long
Dim leng As Long
leng = Bass.BASS_ChannelGetLength(strm)
pos = Bass.BASS_ChannelGetPosition(strm)
Return leng
Simplififed Get Length(Bytes) :
shell.GetLengthInBytes
Normal Get Length(Seconds) :
Dim pos As Long
Dim leng As Long
Dim tLength As Single
leng = Bass.BASS_ChannelGetLength(strm)
pos = Bass.BASS_ChannelGetPosition(strm)
tLength = Bass.BASS_ChannelBytes2Seconds(strm, leng)
Return tLength
Simplified Get Length(Seconds) :
shell.GetLengthInSeconds
Normal Get Length(Proper) :
Dim pos As Long
Dim leng As Long
Dim tLength As Single
leng = Bass.BASS_ChannelGetLength(strm)
pos = Bass.BASS_ChannelGetPosition(strm)
tLength = Bass.BASS_ChannelBytes2Seconds(strm, leng)
Return Un4seen.Bass.Utils.FixTimespan(tLength, "MMSS")
Simplified Get Length(Proper) :
shell.GetLengthInProper
Position Controls :
Normal Get Position(Bytes) :
Dim pos As Long
Dim leng As Long
leng = Bass.BASS_ChannelGetLength(strm)
pos = Bass.BASS_ChannelGetPosition(strm)
Return pos
Simplified Get Position(Bytes) :
shell.GetPositionInBytes
Normal Get Position(Seconds) :
Dim pos As Long
Dim leng As Long
Dim tLength As Single
Dim tElapsed As Single
leng = Bass.BASS_ChannelGetLength(strm)
pos = Bass.BASS_ChannelGetPosition(strm)
tLength = Bass.BASS_ChannelBytes2Seconds(strm, leng)
tElapsed = Bass.BASS_ChannelBytes2Seconds(strm, pos)
Return tElapsed
Simplified Get Position(Seconds) :
shell.GetPositionInSeconds
Normal Get Position(Proper) :
Dim pos As Long
Dim leng As Long
Dim tLength As Single
Dim tElapsed As Single
leng = Bass.BASS_ChannelGetLength(strm)
pos = Bass.BASS_ChannelGetPosition(strm)
tLength = Bass.BASS_ChannelBytes2Seconds(strm, leng)
tElapsed = Bass.BASS_ChannelBytes2Seconds(strm, pos)
Return Un4seen.Bass.Utils.FixTimespan(tElapsed, "MMSS")
Simplified Get Position(Proper) :
shell.GetPositionInProper
ADJUSTABLE Controls :
Normal Set Position(Seconds) :
Dim lpos As Long
lpos = Bass.BASS_ChannelSeconds2Bytes(strm, str)
Bass.BASS_ChannelSetPosition(strm, lpos)
Simplified Set Position(Seconds) :
shell.SetPosSeconds(sb_p.Value)
Normal Set Position(Bytes) :
Dim lpos As Long
lpos = str
Bass.BASS_ChannelSetPosition(strm, lpos)
Simplified Set Position(Bytes) :
shell.SetPosBytes(sb_p.Value)
VOLUME Controls :
Normal Volume Control :
Bass.BASS_ChannelSetAttribute(strm, Un4seen.Bass.BASSAttribute.BASS_ATTRIB_VOL, CSng(str) / 100.0F)
Simplified Volume Control :
shell.SetVol(nm_v.Value)
BASS :
Normal BASS Initialization :
Bass.BASS_Init(-1, 44100, Un4seen.Bass.BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero)
Simplified BASS Initialization :
shell.init
Normal BASS Registration :
BassNet.Registration(user, serial)
Simplified BASS Registration :
shell.RegBass(user,serial)
I will try to simplify more codes, at the mean time, download the attachment
How To Use :
Download The ZIP File, extract files to your program's debug/bin folder, add "BASSSHELL.DLL" as reference