Extended Track Attributes (ETA) Script

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

raybeau528
Posts: 401
Joined: Thu Sep 27, 2007 4:19 pm
Location: Connecticut

Extended Track Attributes (ETA) Script

Post by raybeau528 »

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.
'

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


Last edited by raybeau528 on Mon Apr 21, 2008 12:56 pm, edited 2 times in total.
RedX
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post by RedX »

What exactly are these extended track attributes?
How do you infer them?

Regards,
Red
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Looking at the script the attributes appear to be mainly the instruments that feature in the track, types of vocalists, that kind of thing.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
raybeau528
Posts: 401
Joined: Thu Sep 27, 2007 4:19 pm
Location: Connecticut

Post by raybeau528 »

Red,
What I did was define a set of attributes that are much more specific than genre which I can then (future script) search on to create a playlist. For instance I may want to create a playlist of tracks that have, in my opinion, great guitar licks or really good tenor sax solos.

Someone else may find the concept amusing/interesting so I share my primitive code here. It would be easy to edit all the attributes for one's own preferences. Or as is often the case, someone might apply the technique to a completely different application.

Ray
raybeau528
Posts: 401
Joined: Thu Sep 27, 2007 4:19 pm
Location: Connecticut

Post by raybeau528 »

Below is an update to the Extended Properties Attributes form. Renamed to ETA_Properties. It now stores the text of the attributes (.caption) in the Custom2 field. This allows you to use standard MM functions such as AutoPlayLists to search.

The following reply will have contain the ETA_Search script which provides for a search capability. Both files should be copied to the scripts/auto folder. Right click on a track or list to invoke.

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 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
'	Added function to store the 'captions' in Custom2. This allows you to search on Custom2 via standard MM
'	functions such as Auto Playlist.
'

'*******************************************************************'
'* Form produced by MMVBS Form Creator (http://trixmoto.net/mmvbs) *'
'*******************************************************************'


Option Explicit

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 Song  ' Play the selected song

Dim TotalETA : TotalETA=0
Dim ETADataBit : ETADataBit = ""


For c = 0 to list.count-1
    i=0
	''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	'''     Play The selected song to determine attributes to set
	''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	Set Song = List.Item(c) 
	SDB.PLAYER.PlayListClear
	SDB.Player.PlaylistAddTrack(list.item(c))
	SDB.Player.Play

	''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	'''	Create The Form 
	''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	Dim Form2 : Set Form2 = SDB.UI.NewForm
	Form2.BorderStyle = 3
	Form2.Caption = "Extended Track Attributes"
	Form2.FormPosition = 1
	Form2.Common.SetRect 53,12,1000,600
	Dim Label9 : Set Label9 = SDB.UI.NewLabel(Form2)
	Label9.Common.SetRect 20,15,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,15,65,17
	Label7.Caption = "Artist"

	Dim Edit1 : Set Edit1 = SDB.UI.NewEdit(Form2)
	Edit1.Text = "Artist"
	Edit1.Common.SetRect 385,15,300,21

	Dim Label8 : Set Label8 = SDB.UI.NewLabel(Form2)
	Label8.Common.SetRect 750,15,65,17
	Label8.Caption = "Track"

	Dim Edit2 : Set Edit2 = SDB.UI.NewEdit(Form2)
	Edit2.Text = "Track"
	Edit2.Common.SetRect 785,15,300,21

	''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	'''                                                          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 386,500,75,25

	Dim Button3 : Set Button3 = SDB.UI.NewButton(Form2)
	Button3.Caption = "Cancel"
	Button3.Cancel = True
	Button3.ModalResult=3
	Button3.Common.SetRect 487,500,75,25
	'*******************************************************************'
	'* End of form                      
	'*******************************************************************'


	''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	'''     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
		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
End Sub
raybeau528
Posts: 401
Joined: Thu Sep 27, 2007 4:19 pm
Location: Connecticut

Post by raybeau528 »

ETA_Search script per previous post.


Code: Select all

'
' MediaMonkey Script
'
' NAME:  Extended Track Attributes Search
'

'
' AUTHOR:  Ray Beausoleil
' DATE : 04/06/2008
'
' INSTALL: Copy to Scripts\Auto directory
'
'Description
'	This script is the complement to ETA_Properties. It provides a search function
' 	for the Estended Attributes as well as Genre. This is a 'AND" search and all selected attributes
'	and Genre must match for a selection. Selections are placed in the Now Playing panel 
	


' FIXES: 
'
Option Explicit

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 Search"
  itm.OnClickFunc = "ETA_Search"
  itm.UseScript = Script.ScriptPath
  itm.IconIndex = 30
  itm.Visible = True

End Sub 'OnStartup

Sub ETA_Search(arg)

Dim CheckBox(72)	' Max 72 Attributes with this form
Dim i : i=0
Dim ETADataString : ETADataString = ""
Dim song : Set Song = SDB.SelectedSongList.Item(SDB.SelectedSongList.Count-1) ' One (Last) song only 
Dim TotalETA : TotalETA=0
Dim ETADataBit : ETADataBit = ""


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''	Create The Form 
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Form2 : Set Form2 = SDB.UI.NewForm
Form2.BorderStyle = 3
Form2.Caption = "Extended Track Attributes"
Form2.FormPosition = 1
Form2.Common.SetRect 53,12,1000,600

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''                                                          Stringed Instruments
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Panel2 : Set Panel2 = SDB.UI.NewPanel(Form2) 'Stringed Instruments Panel
Panel2.Common.SetRect 20,60,140,400

Dim Label9 : Set Label9 = SDB.UI.NewLabel(Form2)
Label9.Common.SetRect 20,15,65,17
Label9.Caption = "Genre"

Dim Edit3 : Set Edit3 = SDB.UI.NewEdit(Form2)
Edit3.Text = ""
Edit3.Common.SetRect 55,15,250,21

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/Instrumental"

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 386,500,75,25

Dim Button3 : Set Button3 = SDB.UI.NewButton(Form2)
Button3.Caption = "Cancel"
  Button3.Cancel = True
  Button3.ModalResult=3
Button3.Common.SetRect 487,500,75,25

 
    If Form2.ShowModal = 3 Then
    Exit Sub
  End If
  TotalETA=i
 ETADataString = ""
 For i = 1 to TotalETA
   If checkbox(i).checked Then
     ETADataBit = "1"
	 ELSE
	 ETADataBit = "0"
   End If  
   ETADataString = ETADataString + ETADataBit
 Next

 Dim List
 Dim Itm

 Set list = SDB.CurrentSongList
SDB.PLAYER.PlayListClear
  If list.count=0 Then
    res = SDB.MessageBox( SDB.Localize("Select tracks to be searched, please."), mtError, Array(mbOk))
    Exit Sub
  End If
  
For i=0 to list.count-1
     Set itm = list.Item(i)
  if (Edit3.text = "") or (Len(Edit3.text) > 0 and itm.genre = Edit3.Text) Then
    if Attributes_match( ETADataString, itm.Custom1) Then
       SDB.Player.PlaylistAddTrack(itm)
    End If
  End If
Next	 

End Sub

Function Attributes_Match( str1, str2 )
	Dim i
	Attributes_Match=True
	For i=1 to len(str1)
		if mid(str1,i,1) = "1" and mid(str2,i,1) <> "1" then
			Attributes_match=false
		End If
	Next
End Function
RedX
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post by RedX »

raybeau you can edit your own posts so no need to post the code twice ;-)
raybeau528
Posts: 401
Joined: Thu Sep 27, 2007 4:19 pm
Location: Connecticut

Post by raybeau528 »

Red,

I didn't know that. Thanks!

Ray
onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous »

Check out Additional Track Information Demo for an alternate way to store lots of custom data.
Last edited by onenonymous on Sun Apr 20, 2008 1:54 pm, edited 1 time in total.
raybeau528
Posts: 401
Joined: Thu Sep 27, 2007 4:19 pm
Location: Connecticut

Post by raybeau528 »

I'll check it out, Thanks!

Ray
Post Reply