21 May '13 - 13:34 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Waveform Time stamps vb.net  (Read 371 times)
Rouse
Posts: 3


« on: 12 Jun '12 - 20:03 »
Reply with quoteQuote

How would I go about creating time stamps for my track in VB.net

What im doing is I have a trackbar linked to my waveform and i want to add timestamps to it every 30 secs. 

-----:30---------1:00--------1:30---------2:00----------2:30-----------3:00---------3:30-------
_________________________________IIIIIII_______________________________________________

The IIII represents my Trackbar. 

Im using this to get my maximum for the scroll
        channelTotal = Bass.BASS_StreamCreateFile(_filename, 0L, 0L, BASSFlag.BASS_SAMPLE_FLOAT Or BASSFlag.BASS_STREAM_PRESCAN)
        tbarPosition.Maximum = Convert.ToInt32(Bass.BASS_ChannelGetLength(channelTotal) / 20000)

Then in my timer im using to update the position of the trackbar
Dim pos As Long = Bass.BASS_ChannelGetPosition(_stream)
tbarPosition.Value = Convert.ToInt32(pos / 20000)

Any suggestions ?
« Last Edit: 12 Jun '12 - 20:50 by Rouse » Logged
gnag
Posts: 160


« Reply #1 on: 12 Jun '12 - 21:22 »
Reply with quoteQuote

Hello Rouse,

I didn't try out the following suggestions myself but Bass.NET has already a feature called Markers which makes it possible to Mark Positions on a WaveForm and give them a name, when the Waveform is rendered the can be displayed !

you could to the following:

  • Use yourWaveForm.AddMarker(string Name, double Position) - To add a Marker for Example every 40 Seconds, you can use the BASS_ChannelGetPosition to get the Byte Position of for example 40 Seconds.
  • Set yourWaveForm.DrawMarker to for exampleWaveForm.MARKERDRAWTYPE.Line | WaveForm.MARKERDRAWTYPE.Name | WaveForm.MARKERDRAWTYPE.NamePositionAlternate;
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines