Something that always bugged me that I never figured out, was if/how it would be possible to get all the songdata fields dynamically at run time, instead of coding for each individual field.
Basically, I want to get a (indexed?) list of fields, perform a search, make a change, or check for certain data types on each field (or only specific ones), then move to the next songdata item.
Getting SongData members at run time
Moderators: Gurus, Addon Administrators
Re: Getting SongData members at run time
You have to create your own function which takes a songdata object and the returns all properties as an array. You can then do stuff with the array.
E.g.
E.g.
Code: Select all
Sub GetAllProperties(SongdataObj)
Dim AllPropArray(?)
AllPropArray(0)=SongdataObj.Artist
AllPropArray(1)=SongdataObj.Title
AllPropArray(2)=SongdataObj.Album
A.s.o. to
AllPropArray(?)=SongdataObj.???
GetAllProperties=AllPropArray
End Function
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!
All My Scripts
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!
All My Scripts
Re: Getting SongData members at run time
but that is the same as coding for each field.
What if you did not know the fields? Yes I know they are documented, but from a programtic point of view?
What if you did not know the fields? Yes I know they are documented, but from a programtic point of view?
New script: Last.FM Node Now with DJ Mode!
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
Re: Getting SongData members at run time
Yes, but you can use it multiple times and also save the code for other scripts as well. There is no automated way to retrieve this.
It would be nice though with some auto functions that returns an Arrays consisting of e.g.
All fields (get/let or get)
Editable fields (get/let)
non-editable fields (get)
But for now you need to create them manually. I believe that both Steegy and Trixmoto has made such functions in a couple of their scripts. I have a similar one which I use in ADFF's Copy/Paste Metadata.
It would be nice though with some auto functions that returns an Arrays consisting of e.g.
All fields (get/let or get)
Editable fields (get/let)
non-editable fields (get)
But for now you need to create them manually. I believe that both Steegy and Trixmoto has made such functions in a couple of their scripts. I have a similar one which I use in ADFF's Copy/Paste Metadata.
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!
All My Scripts
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!
All My Scripts