Page 1 of 1

Is There a Way to Clear Main Track Window?

Posted: Fri Mar 04, 2016 4:14 pm
by lvstephanie
I'm trying to make an addon / program that will select songs based on a "nested" value that I have in my custom fields ("nested" meaning that I might have a value like Hot100(17) which means that the song ranked #17 in Billboard's Hot100 chart). I've been able to add the songs using the MainTracksWindow.AddTracksFromQuery method, but noticed that it does indeed just add the songs to the list, keeping all of the previous songs in the list intact. What I am wanting, however, is to first clear the list of songs before displaying the results from that method call. Currently, I am looping through the AllVisibleSongList selecting each song one at a time, and then using the MainTracksWindow.RemoveSelectedTracks method to clear that window. However since my collection has upwards of 50K songs, this process is taking quite a while to perform (a few minutes at least). So I was wondering if there is a faster way to clear this list, like some MainTracksWindow.RemoveAllTracks method? Or if not a simple method to clear the list, if there is a better way to select all of the tracks in the list at once instead of selecting them one at a time.

Re: Is There a Way to Clear Main Track Window?

Posted: Fri Mar 04, 2016 7:51 pm
by MMFrLife
I'm not sure if this is what you are talking about, but you can filter out songs in the main window (file list) by creating a collection (Gold) using specified criteria like
Property = specify custom field or any field you want; Condition = equals; Value = Hot100(17).

The "clearing" business isn't necessary with collections, as it will show only what you specify in criteria.

You could also try just searching a term like "Hot100(17)". Or, to specify in search field: |field name:Hot100(17)|, without vertical bars.

Re: Is There a Way to Clear Main Track Window?

Posted: Sat Mar 05, 2016 1:37 am
by Guest
lvstephanie wrote:addon / program that will select songs based on a "nested" value that I have in my custom fields
That is already possible with Magic Nodes and RegExp Find & Replace.

Re: Is There a Way to Clear Main Track Window?

Posted: Mon Mar 07, 2016 9:51 am
by lvstephanie
Ultimately, I'd like to be able to use the search field to search for a range in the nested criteria. For example, putting into the search field "ChartRank: Hot100(1..40)" will search for songs that have Hot100(n) in the ChartRank (ie Custom1 renamed in my DB) where n is between 1 and 40; in other words, that search will yield songs that ranked in the top 40. But as this my first time working "under the scenes" with MM, I decided to first start using VB.Net (I'm much more proficient with the full fledged language than with the scripting version), hence why I wanted to start with a external program hoping to merge this program with the search field later on. So although searching "Hot100(17)" will indeed give me what I want with my original example, it won't be as useful once I start parsing how it handles ranges.

How do the magic nodes and RegEx solution work? Does this also provide a way to search for ranges within the nested field values? I'll try playing around with these to see if this will work for what I ultimately hope to do...

Re: Is There a Way to Clear Main Track Window?

Posted: Tue Mar 08, 2016 4:34 am
by Guest

Code: Select all

String enclosed with parentheses\<Custom 1|Exclusive right of:(|Right until:)|Top:40|Unknown:No>
Ultimately, the Filter qualifier could be added to specify a range. You cannot use the Search toolbar with the add-ons / external programs since it is not exposed in MM API.

Re: Is There a Way to Clear Main Track Window?

Posted: Mon Mar 14, 2016 3:09 pm
by lvstephanie
I'm starting to use Magic Nodes in order to do my search (as previous replies had mentioned)... The mask "String enclosed with parentheses" seemed to work well except that sorting seems to go by order of a string and not by a number. Thus the mask shown will pull up all songs ranked 1-39 plus any songs ranked 100; when sorting the rank by string, it will place Hot100(100) ahead of Hot100(20) since the string "100" comes before "20" alphabetically even though the opposite would be true when sorting by number. To get around this issue, I also had to add the filter to exclude the string "Hot(100)" before taking the Top 40. Even though that is a good work-around for the one mask, I was wondering if there is a better way to construct the mask so that I don't need to use that filter. Right now if I wanted to change the mask to find the top 5 songs, I'd not only have to change Top:40 to Top:5, but I'd also have to change the filter to also exclude "Hot100(10)" as this too would get sorted incorrectly; were I able to convert that string part in the parentheses to a number, then I could ignore the filter, and just change the Top:n to whatever rank I want to look for.

Another question I had related to the suggestion to use the Filter to specify a range... Although Top:40 will show the songs up to rank 40, it does not allow me to specify the lower limit -- I couldn't, for example, look for songs ranked 11-40 (eg popular songs that didn't make the Top 10). I'm assuming that this is what that suggestion was attempting to answer...

Re: Is There a Way to Clear Main Track Window?

Posted: Tue Mar 15, 2016 2:58 am
by ZvezdanD
Filter:

Code: Select all

Cast(SubStr(<Custom 1>, InStr(<Custom 1>, '(') + 1) As Integer) Between 11 And 40