21-Apr-2008 Added a Trackbar to adjust the Volume
' 20-Apr-2008 Added a TrackBar to display and set song position in the Player
' Added function to store the 'captions' in Custom2. This allows you to search on Custom2 via standard MM
' functions such as Auto Playlist.
'
This script uses the Custom1 field to add 72 individual attributes to the selected track
'The selected track is set to Play with the idea that you would listen to the track to determine and set its attributes. The TrackBar allows you to set the song position in the Player.
The data stored in the Custom1 field is a string of 1's and 0's indicating if the attribute is set or not
The ETA Properties Form (this script) decodes the string from Custom1 and sets the appropriate attributes on the field
Any changes to the attributes are updated
A future script will be able to search the database for songs with matching attributes
One could easily create their own set of attributes by editing the Labels and the CheckBox(i).Captions for each attribute
Credits
Learned from reading through many scripts and discussions in this form. Triximoto's form creator helped tremendously to layout the form !
Any comments and feedback are welcome.
Code: Select all
'
' MediaMonkey Script
'
' NAME: ETA - Extended Track Attributes
'
' AUTHOR: Ray Beausoleil
' DATE : 04/05/2008
'
' INSTALL: Copy to Scripts\Auto directory
'
'Description
' This script uses the Custom1 AND Custom2 fields to add 72 individual attributes or your choice to the selected track
' The selected track is set to Play with the idea that you would listen to the track to set its attributes
' The data stored in the Custom1 field is a string of 1's and 0's indicating if the attribute is set or not.
' The data stored in the Custom2 field are the 'Captions' from the form for the selected attributes (checkboxes).
' The ETA Properties Form (this script) decodes the string from Custom1 and sets the appropriate attributes on the field
' Any changes to the attributes are updated
' ETA_Search script is the complement of this script and provides search capabilities.
'
' One could easily create their own set of attributes by editing the Labels and the CheckBox(i).Captions
' for each attribute
'
'
' Credits
' Learned from reading through many scripts
' Triximoto's form creator helped tremendously to layout the form !
'
' FIXES:
'
' Changes
' 21-Apr-2008 Added a Trackbar to adjust the volume
' 20-Apr-2008 Added a TrackBar to display and set song position in the Player
' Added function to store the 'captions' in Custom2. This allows you to search on Custom2 via standard MM
' functions such as Auto Playlist.
'
Option Explicit
' Global Variables
Dim Song ' Play the selected song
Dim SliderTimer
Dim TrackBar1
Dim TrackBar2
Dim TimedOut : TimedOut=False
Dim Edit4
Dim VolumeSet : VolumeSet=False
Sub OnStartup 'Create Extended Track Attributes Menu Item
Dim itm : Set itm = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_Tracklist,0,0)
itm.Caption = "ETA Properties"
itm.OnClickFunc = "ETA_Properties"
itm.UseScript = Script.ScriptPath
itm.IconIndex = 30
itm.Visible = True
End Sub 'OnStartup
Sub ETA_Properties(arg)
Dim CheckBox(72) ' Max 72 Attributes with this form
Dim i : i=0
Dim c : c=0
Dim j : j=0
Dim ETADataString : ETADataString = ""
Dim ETAString : ETAString = ""
Dim list : Set List = SDB.CurrentSongList
Dim TotalETA : TotalETA=0
Dim ETADataBit : ETADataBit = ""
Set SliderTimer = SDB.CreateTimer(100)
Script.RegisterEvent SliderTimer, "OnTimer", "UpdateSlider"
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Create The Form
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Form2 : Set Form2 = SDB.UI.NewForm
Form2.BorderStyle = 3
Form2.Caption = "Extended Track Attributes"
Form2.FormPosition = 1
Form2.Common.SetRect 0,0,1000,600
Dim Label9 : Set Label9 = SDB.UI.NewLabel(Form2)
Label9.Common.SetRect 20,20,65,17
Label9.Caption = "Genre"
Dim Edit3 : Set Edit3 = SDB.UI.NewEdit(Form2)
Edit3.Text = ""
Edit3.Common.SetRect 55,15,250,21
Dim Label7 : Set Label7 = SDB.UI.NewLabel(Form2)
Label7.Common.SetRect 350,20,65,17
Label7.Caption = "Artist"
Dim Edit1 : Set Edit1 = SDB.UI.NewEdit(Form2)
Edit1.Text = "Artist"
Edit1.Common.SetRect 385,15,250,21
Dim Label8 : Set Label8 = SDB.UI.NewLabel(Form2)
Label8.Common.SetRect 675,20,65,17
Label8.Caption = "Track"
Dim Edit2 : Set Edit2 = SDB.UI.NewEdit(Form2)
Edit2.Text = "Track"
Edit2.Common.SetRect 710,15,250,21
Set Edit4 = SDB.UI.NewEdit(Form2)
Edit4.Text = ""
Edit4.Common.SetRect 145,530,50,40
Dim Label10 : Set Label10 = SDB.UI.NewLabel(Form2)
Label10.Common.SetRect 480,530,100,40
Label10.Caption="Volume"
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Stringed Instruments
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Panel2 : Set Panel2 = SDB.UI.NewPanel(Form2) 'Stringed Instruments Panel
Panel2.Common.SetRect 20,60,140,400
Dim Label1 : Set Label1 = SDB.UI.NewLabel(Panel2)
Label1.Common.SetRect 15,10,65,17
Label1.Caption = "Stringed Instruments"
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel2)
CheckBox(i).Caption = "Acoustic Guitar"
CheckBox(i).Common.SetRect 10,40,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel2)
CheckBox(i).Caption = "Electric Blues Guitar"
CheckBox(i).Common.SetRect 10,70,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel2)
CheckBox(i).Caption = "Jazz Guitar"
CheckBox(i).Common.SetRect 10,100,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel2)
CheckBox(i).Caption = "Slide Guitar"
CheckBox(i).Common.SetRect 10,130,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel2)
CheckBox(i).Caption = "Banjo"
CheckBox(i).Common.SetRect 10,160,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel2)
CheckBox(i).Caption = "Mandolin"
CheckBox(i).Common.SetRect 10,190,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel2)
CheckBox(i).Caption = "Acoustic Bass"
CheckBox(i).Common.SetRect 10,220,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel2)
CheckBox(i).Caption = "Electric Bass"
CheckBox(i).Common.SetRect 10,250,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel2)
CheckBox(i).Caption = "Fiddle"
CheckBox(i).Common.SetRect 10,280,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel2)
CheckBox(i).Caption = "Steel Guitar"
CheckBox(i).Common.SetRect 10,310,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel2)
CheckBox(i).Caption = "Distortion Guitar"
CheckBox(i).Common.SetRect 10,340,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel2)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,370,140,20
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Wind Instruments
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Panel5 : Set Panel5 = SDB.UI.NewPanel(Form2) ' Wind Instruments Panel
Panel5.Common.SetRect 170,60,150,400
Dim Label3 : Set Label3 = SDB.UI.NewLabel(Panel5)
Label3.Common.SetRect 20,10,65,17
Label3.Caption = "Wind Instruments"
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel5)
CheckBox(i).Caption = "Tenor Sax"
CheckBox(i).Common.SetRect 10,40,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel5)
CheckBox(i).Caption = "Alto Sax"
CheckBox(i).Common.SetRect 10,70,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel5)
CheckBox(i).Caption = "Trumpet"
CheckBox(i).Common.SetRect 10,100,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel5)
CheckBox(i).Caption = "Flute"
CheckBox(i).Common.SetRect 10,130,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel5)
CheckBox(i).Caption = "Trombone"
CheckBox(i).Common.SetRect 10,160,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel5)
Checkbox(i).Caption = "Blues Harp"
Checkbox(i).Common.SetRect 10,190,100,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel5)
Checkbox(i).Caption = "Jazz Harp"
Checkbox(i).Common.SetRect 10,220,100,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel5)
Checkbox(i).Caption = "Clarinet"
Checkbox(i).Common.SetRect 10,250,100,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel5)
Checkbox(i).Caption = "TBD"
Checkbox(i).Common.SetRect 10,280,100,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel5)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,310,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel5)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,340,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel5)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,370,140,20
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Keyboards
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Panel4 : Set Panel4 = SDB.UI.NewPanel(Form2) ' Keyboards Panel
Panel4.Common.SetRect 330,60,150,400
Dim Label2 : Set Label2 = SDB.UI.NewLabel(Panel4)
Label2.Common.SetRect 20,10,65,17
Label2.Caption = "Keyboards"
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel4)
CheckBox(i).Caption = "Acoustic Piano"
CheckBox(i).Common.SetRect 10,40,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel4)
CheckBox(i).Caption = "Synthesizer"
CheckBox(i).Common.SetRect 10,70,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel4)
CheckBox(i).Caption = "Hammond Organ"
CheckBox(i).Common.SetRect 10,100,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel4)
CheckBox(i).Caption = "B3"
CheckBox(i).Common.SetRect 10,130,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel4)
CheckBox(i).Caption = "Accordian"
CheckBox(i).Common.SetRect 10,160,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel4)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,190,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel4)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,220,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel4)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,250,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel4)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,280,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel4)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,310,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel4)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,340,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel4)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,370,140,20
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Vocals
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Panel3 : Set Panel3 = SDB.UI.NewPanel(Form2) 'Vocals Panel
Panel3.Common.SetRect 490,60,150,400
Dim Label4 : Set Label4 = SDB.UI.NewLabel(Panel3)
Label4.Common.SetRect 20,10,65,17
Label4.Caption = "Vocals"
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel3)
CheckBox(i).Caption = "Instrumental"
CheckBox(i).Common.SetRect 10,40,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel3)
CheckBox(i).Caption = "Male"
CheckBox(i).Common.SetRect 10,70,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel3)
CheckBox(i).Caption = "Female"
CheckBox(i).Common.SetRect 10,100,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel3)
CheckBox(i).Caption = "2 Part Harmony"
CheckBox(i).Common.SetRect 10,130,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel3)
CheckBox(i).Caption = "3 Part Harmony"
CheckBox(i).Common.SetRect 10,160,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel3)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,190,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel3)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,220,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel3)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,250,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel3)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,280,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel3)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,310,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel3)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,340,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel3)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,370,140,20
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Rhythm
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Panel6 : Set Panel6 = SDB.UI.NewPanel(Form2) ' Rhythm Panel
Panel6.Common.SetRect 650,60,150,400
Dim Label5 : Set Label5 = SDB.UI.NewLabel(Panel6)
Label5.Common.SetRect 27,10,65,17
Label5.Caption = "Rhythm"
i=i+1
Set Checkbox(i) = SDB.UI.NewRadioButton(Panel6)
Checkbox(i).Caption = "Swing"
Checkbox(i).Common.SetRect 10,40,140,20
i=i+1
Set Checkbox(i) = SDB.UI.NewRadioButton(Panel6)
Checkbox(i).Caption = "Shuffle"
Checkbox(i).Common.SetRect 10,70,140,20
i=i+1
Set checkbox(i) = SDB.UI.NewRadioButton(Panel6)
Checkbox(i).Caption = "Waltz"
Checkbox(i).Common.SetRect 10,100,140,20
i=i+1
Set Checkbox(i) = SDB.UI.NewRadioButton(Panel6)
Checkbox(i).Caption = "3/4"
Checkbox(i).Common.SetRect 10,130,140,20
i=i+1
Set Checkbox(i) = SDB.UI.NewRadioButton(Panel6)
Checkbox(i).Caption = "4/4"
Checkbox(i).Common.SetRect 10,160,140,20
i=i+1
Set Checkbox(i) = SDB.UI.NewRadioButton(Panel6)
Checkbox(i).Caption = "Cut"
Checkbox(i).Common.SetRect 10,190,140,20
i=i+1
Set Checkbox(i) = SDB.UI.NewRadioButton(Panel6)
Checkbox(i).Caption = "Bossa"
Checkbox(i).Common.SetRect 10,220,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewRadioButton(Panel6)
CheckBox(i).Caption = "Rumba"
CheckBox(i).Common.SetRect 10,250,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewRadioButton(Panel6)
CheckBox(i).Caption = "Tango"
CheckBox(i).Common.SetRect 10,280,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewRadioButton(Panel6)
CheckBox(i).Caption = "Latin"
CheckBox(i).Common.SetRect 10,310,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewRadioButton(Panel6)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,340,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewRadioButton(Panel6)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,370,140,20
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Misc.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Panel7 : Set Panel7 = SDB.UI.NewPanel(Form2) ' Misc
Panel7.Common.SetRect 810,60,150,400
Dim Label6 : Set Label6 = SDB.UI.NewLabel(Panel7)
Label6.Common.SetRect 27,10,65,17
Label6.Caption = "Miscellaneous"
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel7)
CheckBox(i).Caption = "Guitar Solo"
CheckBox(i).Common.SetRect 10,40,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel7)
CheckBox(i).Caption = "Harp Solo"
CheckBox(i).Common.SetRect 10,70,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel7)
CheckBox(i).Caption = "Keyboard Solo"
CheckBox(i).Common.SetRect 10,100,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel7)
CheckBox(i).Caption = "Rhythm Guitar"
CheckBox(i).Common.SetRect 10,130,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel7)
CheckBox(i).Caption = "Rhythm Harp"
CheckBox(i).Common.SetRect 10,160,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel7)
CheckBox(i).Caption = "Percussion"
CheckBox(i).Common.SetRect 10,190,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel7)
CheckBox(i).Caption = "Sax Solo"
CheckBox(i).Common.SetRect 10,220,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel7)
CheckBox(i).Caption = "Trumpet Solo"
CheckBox(i).Common.SetRect 10,250,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel7)
CheckBox(i).Caption = "Licks"
CheckBox(i).Common.SetRect 10,280,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel7)
CheckBox(i).Caption = "Finger Picking"
CheckBox(i).Common.SetRect 10,310,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel7)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,340,140,20
i=i+1
Set CheckBox(i) = SDB.UI.NewCheckBox(Panel7)
CheckBox(i).Caption = "TBD"
CheckBox(i).Common.SetRect 10,370,140,20
Dim Button2 : Set Button2 = SDB.UI.NewButton(Form2)
Button2.Caption = "OK"
Button2.Default = True
Button2.ModalResult = 2
Button2.OnClickFunc = "OK"
Button2.Common.SetRect 800,505,75,25
Dim Button3 : Set Button3 = SDB.UI.NewButton(Form2)
Button3.Caption = "Cancel"
Button3.Cancel = True
Button3.ModalResult=3
Button3.Common.SetRect 700,505,75,25
' Script.RegisterEvent Button3, "OnClick", "CancelButtonClick"
Set Trackbar1 = SDB.UI.NewTrackBar(Form2)
TrackBar1.MaxValue=100
TrackBar1.MinValue=0
TrackBar1.Value=0
TrackBar1.Common.SetRect 20,500,300,28
Script.RegisterEvent trackbar1, "OnChange", "PlayerSlider"
Set Trackbar2 = SDB.UI.NewTrackBar(Form2)
TrackBar2.MaxValue=100
TrackBar2.MinValue=0
TrackBar2.Common.SetRect 350,500,300,28
Script.RegisterEvent trackbar2, "OnChange", "VolumeSlider"
If not VolumeSet then
TrackBar2.Value=SDB.Player.Volume*100
VolumeSet=True
End If
'*******************************************************************'
'* End of form
'*******************************************************************'
For c = 0 to list.count-1
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Play The selected song to determine attributes to set
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
SDB.Player.Stop
Set Song = List.Item(c)
SDB.PLAYER.PlayListClear
SDB.Player.PlaylistAddTrack(list.item(c))
SDB.Player.Play
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Set the Extended Track Attributes from Custom1
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
TotalETA=i 'Number of Attributes
ETADataString = Song.custom1
For j=1 to TotalETA
checkbox(j).checked = Mid(ETADataString,j,1) = "1"
Next
edit1.text = Song.artistname
edit2.text = Song.title
edit3.text = Song.genre
If Form2.ShowModal = 3 Then
sdb.player.stop
Script.UnregisterEvents SliderTimer
Script.UnregisterEvents TrackBar1
Exit Sub
End If
ETADataString = ""
For j = 1 to TotalETA
If checkbox(j).checked Then
ETADataBit = "1"
ETAString = ETAString + CheckBox(j).Caption + ","
ELSE
ETADataBit = "0"
End If
ETADataString = ETADataString + ETADataBit
Next
If Len(ETAString) > 0 Then
ETAString = Left(ETAString,len(ETAString)-1) ' Remove last delimiter
End If
' Update Custom1, Custom2, Genre
song.custom1 = ETADataString
song.custom2 = ETAString
song.genre = edit3.text
song.updatedb
Next ' J
sdb.player.stop
Script.UnregisterEvents SliderTimer
Script.UnregisterEvents TrackBar1
End Sub
Sub PlayerSlider(Control)
If TimedOut Then
TimedOut=False
Else
If control.value <= .98*(control.MaxValue-control.MinValue) Then
SDB.Player.PlayBackTime = control.value*song.songlength/(control.MaxValue-control.MinValue)
If Not SDB.Player.isPlaying then
SDB.Player.Play
End If
End If
End If
End Sub
Sub UpdateSlider(Control)
TimedOut=True
trackbar1.value=(TrackBar1.MaxValue-TrackBar1.MinValue)*sdb.player.playbacktime/song.songlength
Edit4.Text = TimeString(Song.SongLength-SDB.Player.PlayBackTime)
End Sub
Sub VolumeSlider(Control)
sdb.player.volume=control.value/(control.maxvalue-control.minvalue)
End Sub
Function TimeString (TimeMilliseconds)
Dim tm : tm=TimeMilliseconds
TimeString = Cstr(int(tm/60000)) + ":" + right("0"+Cstr(int(tm/1000) mod 60),2)
End Function