Magic Nodes
Version 5.1
- MediaMonkey Add-on -

by Zvezdan Dimitrijević

This is information about the new enhanced version of Magic Nodes add-on for MediaMonkey v2.x-4.x. The old version of Magic Nodes was already the largest and most complex MediaMonkey add-on with 600 KB of code (not to mention 100 KB+ in masks that are full of SQL queries), but the new version is 1.000 KB in size which is more than 50% increase. However, not matter how complex it is, its usage is now even more simpler.

Donation

The previous vesion of the add-on has a free access to download, but the new enhanced version is available only to those who donate to me using PayPal because I have spent too much of my time developing it. Just leave me a note about your e-mail address, if it is different than the one that you have registered at PayPal, since I am sending this version of the add-on using e-mail attachment.

If you didn't get my e-mail for a day or two after your donation, you could check your Spam folder first and, if you cannot find it in there, please send me an e-mail with the information about donation to: . Actually, if you are a GMail user, I recommend that you put my e-mail address to your Contact list before you make donation, so that GMail will not treat my e-mail sent to you as a spam. Thanks in advance!

Euro (EUR) US Dollar (USD)

Compatibility

This add-on doesn't work with MediaMonkey v5! Actually, none add-on made for some previous version of program could work with MM5, either by me or by another authors, since MM5 has completely different programming interface than before. If you really like my add-on and think that it is essential for your work with the program, you have several possibilities:
- you could stay with MM4;
- you could ask MM developers to implement support for old add-ons in MM5;
- you could wait for me to port the add-on to MM5, but don't hold your breath.

If you decide to stay with MM4, rest assured that I will still improve and support the add-on as long as there is an interest for it.

What is new

v5.1 - 2017-03-07

v5.0.8 - 2016-04-21

v5.0.7 - 2015-10-15

v5.0.6 - 2015-07-22

v5.0.5 - 2015-06-18

v5.0.3 - 2014-10-26

v5.0 - 2014-04-19

Installation

Note: The MagicNodes.ini file is used only after the installation. During its work, the Magic Nodes add-on stores masks into the MediaMonkey.ini file.

Usage

Introduction
Nodes are the elements of the navigation tree structure of the MediaMonkey interface. Magic Nodes add-on allows a simple way of creating new ones to help you manage your music library. The Magic nodes are defined using masks which are loosely based on the way MediaMonkey auto-organize works. The masks that represent the Magic nodes could be typed from scratch or they could be created using controls in the Settings dialog box.

If you want to type masks from scratch or just to understand their structure, it is recommended that you read the PDF manual written by Rick Parsons. It is outdated since it covers only 1.7 version of the add-on which was one of the latest versions without the proper GUI, but it explains many things needed for understanding of this add-on. The things covered by that manual will not be mentioned in this section, but you could rather find here the explanation how to use the commands and options of this add-on that you could find in its GUI.

Magic Nodes add-on could be used by the beginners as well as by very advanced users, there are at least 3 levels of difficulty:
1. The beginners could use add-on just by navigating through the Magic Nodes branch of the Media Tree panel. You could find there over 400+ different nodes that could be useful for you without any additional adjustment, e.g. you could get displayed "Files with the Artist name on the begin of the Filename", or "Files rated X stars or more from Album Artists that haven't played last Y days", or "X random files from each Genre which has Y or more files and played more than Z times".

2. With many nodes and their corresponding masks there is a possibility for their adjustment using the new Adjust Magic Node command from the menu - just select the wanted node, choose the mentioned command and you will get one dialog box where you could tune some parameters of that node. For example, with the node "Artists with at least X (complete) Albums having at least Y files where all files are rated Z stars or more" there are 3 parameters: X (number of albums), Y (number of files per album) and Z (minimal rating of files). Actually, that node has one parameter more which could be toggled using one check box - "Complete Albums", but more about that you could find in the section dedicated to the Adjust Magic Node command and its related tags.

3. Somewhat more experienced users could create their own masks to get nodes that are different than those that are included with the add-on. Mask could be very simple as it is Test\<Genre>, but also very complex like the mask "Artists with at least <ID:1> (complete) Albums having at least <ID:3> files, all files rated <ID:4> stars or more" that is located in the "Artist Ratings" branch of the Magic Nodes.

There are three different ways to edit some existing mask and its corresponding node:
1. choose Edit / Magic Nodes / Mask Settings, then choose the wanted mask from the Caption combo box, edit it and click on the Update/Rename button.
2. choose Edit / Magic Nodes / Manage Masks, then click on the number of the needed mask from the "#" column, edit it and click on the OK button.
3. right-click on the corresponding node in the Media Tree panel, choose Edit Magic Node command, then edit the mask and click on the OK button.

If you want to create a new mask, you should use Magic Nodes Settings dialog - just click on the New button, type some text in the Caption combo box and set some fields and its qualifiers, then click on the Add button.

There are also three different ways to delete some existing mask:
1. choose Edit / Magic Nodes / Mask Settings, then choose the mask from the Caption combo box and click on the Delete button.
2. choose Edit / Magic Nodes / Manage Masks, then select the mask(s) in the table and click on the Delete button.
3. right-click on the corresponding node in the Media Tree panel and choose Delete Magic Node command.

The Magic Nodes commands could be found in the Edit menu of the main menu or in the context menu of the Media Tree. Some of the commands are enabled only if you have selected some Magic node, e.g. Edit Magic Node, or Delete Magic Node, while others could be executed even when none Magic node is selected, e.g. Mask Settings. However, with the first group of commands from the menu to get some of them enabled it is not enough to select any Magic node, but in most cases it should be global Magic node (unless it is stated otherwise).

Mask's syntax
The description about that what is the "global" Magic node could be found in the mentioned PDF manual. Here is just a quick reference about the syntax of the masks where "[]" indicates optional and "*" indicates repeat 0-n times:

[<Group|Name:string[|Group qualifier]*>\]*Caption[|Global qualifier]*[\<Field[|Local qualifier]*>]*

Each additional "\" indicates the start of a new hierarchical level in the tree. The every level of nodes begins with "<" and ends with ">" except the global level.

As you could see, there are 3 different types of sub-nodes in the Magic nodes: group, global and local nodes. Every Magic node contains just one global node which is mandatory, while group and local nodes are optional and there is no limit on their number of hierarchical levels.

The global node is represented by its Caption that you want displayed on the node. The local nodes represents a hierarchical levels under the global node that could display predefined set of fields and their values. The group nodes could help in better organization of the related Magic nodes in a similar way to the MediaMonkey's Files to Edit group. One or more Magic nodes could be placed inside of one group, and groups could contain additional levels of sub-groups.

For example, If I have mask <Group|Name:Tests>\Artists\<Artist>, the node with the caption "Tests" is the group node, the node with the caption "Artists" is the global node, while its sub-nodes with the names of the artists are local nodes.

Every node in the mask could contain additional optional qualifiers separated with "|", while the group nodes have also one mandatory "Name" qualifier. With the qualifiers you could specify behaviour of some node, e.g. which part of the field should be displayed or how sub-nodes should be sorted.

MagicNodes-5.0 - Menu

Menu
The Magic Nodes menu contains the next commands:
  • Edit Magic Node - it is enabled for the global and local nodes, but not for group nodes. If you choose this command you will get opened dialog box that is very similar to the Magic Nodes Settings dialog box, but it contains just OK and Cancel buttons on its bottom and it doesn't have a possibility to choose the mask for editing, i.e. this dialog box allows arbitrary modifications of the mask only for the selected node.

  • Adjust Magic Node - it is enabled for the global and local nodes, but not for group nodes. If you choose this command you will get opened dialog box which could contain one or more different controls depending of the tags used in the corresponding mask of the selected node. This dialog allows fine adjustment of some parameters of the mask which is described more in the Additional Information section.

  • Delete Magic Node - it is enabled for the group and global nodes, but not for local nodes. This command allows deleting of the selected node(s) and its corresponding mask(s). If the selected node is group node, all contained Magic nodes and corresponding masks will be removed permanently. Be careful when using this command because there is no Undo command for it.

  • Refresh Magic Playlist - it is enabled for any type of nodes: group, global and local, but such Magic node should be inside of the Playlists branch. The playlists created using Position:Child qualifier of Magic Nodes have static filelists, so if you want to update their content you could use this command.

  • Mask Settings - if you choose this command you will get opened the Magic Nodes Settings dialog box that is very similar to the Edit Magic Node dialog box, but it has a possibility to choose mask for editing and it contains several controls on its bottom that allows different manipulations of the selected mask, e.g. Move spin control, as well as New, Update, Add and Delete buttons beside of the Close button. This dialog box allows arbitrary modifications of any mask.

  • Manage Masks - this command opens the Manage Magic Nodes dialog box that contains a table with all available masks and it allows batch operations on several masks at the same time, e.g. Delete, Export or Import. It also has some another commands that are better used when the masks are displayed in the tabular form, e.g. Find for searching of some specific mask.

  • Options - when you choose this command you will get opened the Magic Nodes Options dialog box that contains some less important options that affect behavior of the add-on and/or all Magic nodes in general.

    MagicNodes-5.0 - Settings

    Magic Nodes Settings
    The Magic Nodes Settings dialog box allows arbitrary modifications of any mask, either typing them from scratch in the Mask text box or by using other controls from this dialog box which would construct the appropriate mask for you automatically. This dialog box is resizable, so you could enlarge it, e.g. if you cannot see the content of some control.

    Caption
    The topmost group of controls contains the controls that affect the whole mask. The first control is the Caption combo box which contains the list of all available MN masks and with it you could choose which mask you want to see or modify. The same combo box could be used to rename the caption of the global node of the selected mask, or to enter the new caption when creating the new mask. You could paste the whole mask in this combo box, e.g. after copying it from the Forum, but you cannot type masks from scratch in it - you should use the Mask text box on the bottom if you want to do that. The caption cannot contains "|" and "\" characters.

    Toolbar
    The next two Toolbar controls allow displaying of the toolbar button for the currently displayed mask which could bring the focus to the corresponding node in the Media Tree (the corresponding qualifier is Toolbar). With the Icon and Text check boxes you could choose what you wan to get displayed on the toolbar button: the icon or the caption of the selected mask. The particular icon could be chosen using the Icon combo box when the global node is selected in the Nodes list, which will be explained latter.

    Position
    The Position group of controls consists of two combo boxes - with the first one you could choose the relative position of the selected mask and its corresponding node to the node that is selected in the second combo box (the corresponding qualifiers are Position and Child of respectively). The first list box is dynamically filled depending of the node that is selected in the second combo box. For example, if you choose "Magic Nodes" in the second combo box then the first combo box will contain the "First chid of" and "Last child of" items, but if you choose "Collection" then the first combo box will contain additionally "Before" and "After" items ("Before" and "After" means that the Magic node will be on the same level as the node selected in the second combo box).

    Creating playlists
    If you choose "Playlists" from the second Position combo box, beside of the "Before" and "After" items in the first combo box you will get also the "Child of" and "Auto-child of" items. All nodes in the Playlists branch are always sorted alphabetically and because of that there are not different the "First child of" and "Last child of" options for positioning of the nodes within that node. Unlike other Magic nodes positioned elsewhere, the ones that are placed inside of the Playlists branch are so called Magic playlists that are created when you add or modify their corresponding masks.

    The Magic playlists created by using the "Child of" item from the first Position combo box are static: if you select some playlist created using this option, then select some another node and finally select the same playlist again, it will contain the same files in the filelist even if the corresponding mask has some filter which should change the contained files, e.g. if it allows displaying of the random files. To be able to update such playlist you could modify somehow the corresponding mask or you could just choose the Refresh Magic Playlist command from the menu.

    However, if you choose the "Auto-child of" item from the first combo box, the playlists created using this option will be updated whenever you select such playlist, similarly to the regular Magic nodes or auto-playlists which are updated every time when you select them. Such behavior could be preferable sometimes because you will get the playlists that are always up-to-date without worrying if you need to refresh them, but you should also keep in mind that some masks contain filters that take to much time whenever you select the corresponding node which is not always desirable and in that case the static playlists would be a better choice.

    Unlike other regular Magic nodes where their whole sub-branches are updated whenever you expand them, the sub-nodes placed in the Playlists branch cannot be automatically updated when you expand their parent node even if you choose "Auto-child of" because of the limited MM API. If you want to update the whole structure of folders for some Magic playlist, you should choose Refresh Magic Playlist command even for nodes/masks with "Auto-child of".

    The Magic playlists have the hierarchical structure as the regular Magic nodes having the same nodes. For example, if I have the mask Test|Child of:Playlists|Position:Child\<Arstist>\<Album> I will get not only "Test" playlist, but also its sub-playlists with names of the artists and sub-sub-playlists with the names of their albums. Be careful with the number of generated sub-playlists because too much playlists could slow down the program.

    If you want to move some existing node from the Magic Nodes to the Playlists branch, but you don't want to get its sub-playlists, you have two possibilities: you could remove the corresponding sub-nodes from the mask or you could turn off the Show nodes option, but that option could be used only for the latest (bottommost) level of nodes, so that possibility is mostly applicable for masks with only one sub-level of nodes.

    There are some limitations with the masks that create Magic playlists: you cannot set the Show node if empty option to the global node and you cannot set the Icon qualifier at all since the program has the fixed icon for all playlists. You could specify Sort by qualifier for some level of sub-nodes in the Magic playlists, but there is a chance that you would not get what you want, because the playlists are always sorted alphabetically (in such case consider a possibility to turn on the Show ordinal numbers option for that level).

    Collection
    If you choose the "Collection" item from the second Position combo box or any following item from its list which starts with "_", you will be able to choose a collection where you want to place the Magic node of the selected mask using the Collection combo box (the corresponding qualifier is MM filter). One Magic node cannot be placed in several collections at the same time. If you want something like that, you need to create copies of its mask with the specified different collection for each copy of that mask.

    Hotkey
    The Hotkey control allows the same thing as the Toolbar controls: you could bring the focus to the corresponding node in the Media Tree if you press the specified hotkey on the keyboard, e.g. Shift+Ctrl+A (the corresponding qualifier is Shortcut).

    Node controls
    The several next controls in the Settings dialog box allow creating of nested nodes for each level of some Magic node: group, global and local. When you select some existing mask/node from the Caption combo box, the Nodes list box will be automatically filled with all nested nodes with the proper indentation for each new level. If you want to create a new mask by the click on the New button, the global node would be automatically added to the Nodes list box when you type its new caption in the Caption combo box.

    Field
    The local nodes could be added to the selected mask if you choose the Field radio button and select some item from the related list box. That list contains all fields available to the Magic Nodes: simple fields that directly correspond to some existing database fields like "Title" or "Rating", and complex ones like "Artist - Title" or "Weeks since added".

    Group
    If you want to assign the Magic node to some existing group you should choose the Group radio button and select the wanted item from the related combo box, but if you want to create the new group which is not listed in that combo box then just type its name in it (the corresponding qualifier is Name). The name of the group cannot contains "|", "\", "<" and ">" characters.

    Nodes
    The new group and local nodes could be added to the Nodes list box using the Add button located between the Filter and Nodes list boxes, after you have selected the appropriate item from the Field or Group lists. If you want to remove some existing group or local node from the mask, you should select that node in the Nodes list box and click the Del button that is under the mentioned Add button. The spin control with the up/down buttons located bellow the Del button allows moving of the selected node in the Nodes list box in the wanted direction, i.e. up or down. Higher nodes in the Nodes list are closer to the root in the node hierarchy.

    The remaining controls from the Settings dialog box, excluding the Mask text box, affect only particular node in the hierarchy of some Magic node that is selected in the Nodes list box. For example, if I have the mask Test\<Artist>\<Album> and if I want to add Statistics qualifier to the "Artist" node, I need to select the "Artist" item in the Nodes list box and then to set the Statistics controls appropriately.

    Show ... controls
    The first group of the remaining controls determines the display of nodes and files, but only the first check box is enabled for all nodes (group, global or local), while the other check boxes could be set only for the local nodes (unless it is stated otherwise); also many Show commands are disabled with some Split modes which will be mentioned latter in the Split by part of this section:
  • Show files in filelist - turn it on if you want to get displayed files in the filelist when you select the corresponding sub-node in the Media Tree (the corresponding qualifier is Show tracks).

  • Show [All] node - turn it on if you want to get displayed "All" node for the corresponding sub-node, similarly to the "All" nodes in the Location and My Computer folders (the corresponding qualifier is All).

  • Show [Unknown] node - turn it on if you want to get displayed "Unknown" node for the corresponding sub-node, similarly to the "Unknown" nodes in the "Title", "Artist" and many other built-in nodes (the corresponding qualifier is Unknown); turning off this option for the selected sub-nodes could speed up expanding of their parent nodes sometimes; this option is disabled if the Top items has some value greater than zero.

  • The next check box has two meanings depending of the selected sub-node:
  • Show node if empty is displayed if you select the global node or local node that is not the latest one in the hierarchy (the corresponding qualifier is Show if empty); you should turn on this option if you want to get displayed the selected node even if it doesn't have any child nodes, e.g. for the mask Test\<Album>\<Disc number|Unknown:No> you could turn this option on for the "Album" node to get displayed albums even if they contain files without disc numbers; this option is disabled if you have selected "Child of" or "Auto-child of" - "Playlist" in the Position combo boxes.

  • Show nodes is displayed only if you select the latest (bottommost) local node in the hierarchy; you should turn this option off if you don't want to get displayed nodes on the selected level for some reason, e.g. if the Magic node is positioned inside of the Playlists branch, while you still want that node added to the mask because it could contain some important qualifiers that affect its parent nodes even if it is not displayed like Min. files or Top items (the corresponding qualifier is Show nodes).

  • Show ordinal numbers - you should turn on this option if you want to get ordinal numbers of nodes in the front of their captions (the corresponding qualifier is Show rank).

    Filter controls
    The next group of controls allows setting of the filter for the selected mask (the corresponding qualifier is Filter). With the old versions of the add-on it was possible to set only one filter per mask to the global node, while the new version allows setting of different filters to the each level of nodes in the mask. The Filter string for the group and global levels of nodes represents the WHERE part of the SQL query applied to the whole Magic node, while for the local nodes it represents the HAVING part of the SQL query which is applied to the corresponding group level of the query. The Filter qualifier specified to the group node will be applied to all Magic nodes belonging to that group (the group filters are AND-ed with the global filters for the particular Magic node).

    Here is one example how the new Filter option could simplify masks when applied on the local level. The old mask has Filter assigned only to the global node:
    Files rated >= 4 stars from Artists with avg. file rating >= 4 stars|Filter:Songs.Rating >= 80 AND SongArtists.ID IN (SELECT ArtistsSongs.IDArtist FROM Songs INNER JOIN ArtistsSongs ON Songs.ID = ArtistsSongs.IDSong AND IfNull(ArtistsSongs.PersonType, 1) = 1 INNER JOIN Artists ON ArtistsSongs.IDArtist = Artists.ID WHERE Songs.Rating >= 0 GROUP BY ArtistsSongs.IDArtist HAVING Avg(Songs.Rating) >= 80)\<Artist>

    The new mask has Filter assigned also to the local "Artist" node, but such mask is shorter and simpler giving the same displayed filelist:
    Files rated >= 4 stars from Artists with avg. file rating >= 4 stars|Filter:Songs.Rating >= 0\<Artist|Filter:Avg(Songs.Rating) >= 80>

    The first combo box in the Filter group contains the list with the "AND" and "OR" items that you could select if you want such operators on the begin of the adding string. The next combo box is enabled only if you have selected local node in the Nodes list box and it contains list with the aggregate functions that could be used within the HAVING part of query (Count, Avg, ...). The next combo box contains list with all available fields, similarly to the Fields list box, but it has also one new item: "Any". If you choose that item and add it to the Filter string, you would get filtered files by any field that is specified on the Search tab in the Options dialog box.

    The next combo box contains the list with operators that depends if the selected field from the previous combo box has the string, numeric or date/time value. If you have selected some string or date/time field, the last combo box in this group would be dynamically filled with all values of that field from all files (that could take some time for complex fields); if you have selected some numeric field, the spin control would be displayed which allows changing of that numeric value.

    When you have selected all wanted items in the previously mentioned Filter controls, you could click the Add button located on the right side of the Filter group to add that construction to the main Filter text box. You could type some new filter from scratch or modify the existing one by editing that text box. If you have selected some part of the text in that text box, you could click on the Del button to remove it, or you could click on the "(.)" button to surround the selected text with the parenthesis.

    You could turn on the SQL check box that is located on the left of the Filter text box if you want to see how some MN field will be converted to the appropriate SQL field(s). For example, instead of the <Rating> MN field I would get Songs.Ratings, or instead of the <Weeks since added> I would get Cast(JulianDay(Date('now', '-6 days', 'weekday 1', '6 days')) - JulianDay(Date(Songs.DateAdded + JulianDay('1899-12-30'))) As integer) / 7. This option is not reversible, i.e. if you turn it off after some MN field is already converted to the corresponding SQL field(s), you cannot get the original MN field again.

    Icon
    The next control after the Filter group is the Icon combo box (the corresponding qualifier is Icon). It is enabled only for the group and global nodes, while the icons for the local nodes are automatically set depending of the related field. The selected icon will be displayed for the corresponding node in the Media Tree and on the toolbar button if that option is enabled for the selected mask (in that case the toolbar button has the same icon as the global node). You could choose some of the built-in icons represented by their number (the built-in icons for the Glided skin with their numbers could be downloaded from here).

    If you choose "Standard" from the Icon combo box you will get displayed icon of the folder, if you choose "Top level" you will get displayed icon of the topmost local node and its related field, while if you choose "Bottom level" you will get displayed icon of the bottommost local node and its related field. Finally, you have a possibility to show your own 16x16 icon (e.g. if you find it somewhere on the Internet) if you choose "ICO file" item from the Icon combo box. In that case you should specify the location of the wanted ICO file.

    Top items
    The Top items control is enabled only for the local nodes. With that control you could set the number of displayed sub-nodes of the selected node (the corresponding qualifier is Top). For example, if I have "Album" node selected in the Nodes list box for the mask Test\<Artist>\<Album>, and if I set 10 with the Top items control, I could get displayed 10 albums per artist at most.

    Min. files, Max. files
    The Min. files, Max. files and other controls that are below them are enabled only for the local nodes. With the Min. files you could set the minimal number of files for some field to get displayed its node (the corresponding qualifier is Min tracks), and with the Max. files you could set the maximal number of files (the corresponding qualifier is Max tracks). For example, if I have the "Artist" node selected in the Nodes list box for the mask Test\<Artist>, and if I set 10 with the Min. files control, I could get displayed only nodes for artists that have at least 10 files.

    Substr. start
    With the Substr. start, Trim and other controls below them you could set which part of the selected field you want to get displayed as the caption of local nodes. The Substr. start control determines the starting position of the substring that should be returned (the corresponding qualifier is Substring start). For example, if some field contains "The Beatles" and if I specify 5 with that control, I will get displayed "Beatles" in the caption of the corresponding node. If the negative number is specified, the first character of the substring is found by counting from the right rather than the left, e.g. with -5 I will get "atles".

    Substr. length / Trim
    The next control has two captions, depending of the value set by Substr. start control. If Substr. start is zero, the next control has Trim caption; in other cases it is Substr. lenght, but in general their effect is the same: with that control you could set how many characters of the field you want to display from the left to the right (if the Substr. lenght value is positive) or from the right to the left (if it is negative), starting from the character specified by Substr. start (the corresponding qualifier is Trim). If Substr. start is zero, the result will be same as if it is 1. If Substr. lenght is zero, then the whole string is returned starting from the Substr. start in the proper direction.

    Examples with the same "The Beatles" text:
  • Substr. start = 5 and Substr. lenght = 4 shows "Beat";
  • Substr. start = -5 and Substr. lenght = 4 shows "atle";
  • Substr. start = 5 and Substr. lenght = -4 shows "The ";
  • Substr. start = -5 and Substr. lenght = -4 shows "e Be".

    Split by
    The Split by group of controls allows parsing of the field of the corresponding node: within the text box you could specify with which string you want to split the original text (the corresponding qualifier is Split by), with the combo box you could determine the way of parsing (the Split Mode qualifier) and with the spin control you could set the optional numerical value (the Split part qualifier) if it is applicable for the selected item that is set in the previous combo box.

    The first four items from the Split mode combo box that start with the "String *" don't affect the enabled state of other controls in the dialog box because they are based on the SQL code to do parsing of the field, but the complexity of the implemented code raises exponentially with the Split part value specified with the spin box, and for the large numbers you could even get the error message! The remaining items from the Split mode combo box don't have that problem since they are not using the SQL code, but VBScript instead. However, the drawback of the remaining items is that they cannot be used with the Sort by/Statistics qualifiers as well as almost none of the Show * qualifiers.

    One important note: the ";" and "; " are not the same strings and using them in the Split by qualifier will give you the different results. The detailed explanation about the qualifiers related to this group of controls could be found in the Information about version 4 sections on the download page of the older versions of this add-on.

    Left of
    The next control has two meanings, depending of the following Right of control: if the Right of text box is empty, the first control has the Left of caption, otherwise it is Right until. It is somewhat awkward order of the controls, it would be better and more intuitive if the Right until has separate control on the right side of the Right of control, but in that case the Settings dialog box would be even larger and more overcrowded than it is now. Anyway, one more reason why this strange decision was made is because the Left of and Right of controls cannot be used at the same time, so it was quite logical to use the same controls for the Left of and Right until (the similar reasons was used with the Show node if empty and Show nodes).

    With the Left of control you could get all characters of the field to the left of the specified string displayed on the related nodes (the corresponding qualifier is Left of). For example, if the field has "The Beatles" node and if I specify "eat" I would get displayed "The B".

    The Show if contain check box located under the Left of text box determines what will happen if the field of the selected node doesn't contain the string specified in the Left of text box: if it is turned off, the node with the whole text of the field will be displayed; if it is turned on, there would not be displayed node for that field value at all. For example, with the same "The Beatles" field, if I specify "abc" in the Left of text box and if I have Show if contain turned off I will get "The Beatles" node, but if it is turned on I will not get any node for that field value (in that case the files by The Beatles could be found in the "Unknown" node if that node is enabled with the corresponding option). There is not corresponding qualifier for the Show if contain check box, but if you turn it on, the Left of qualifier will become Exclusive Left of.

    Right of, Right until
    The Right of control has the similar effect as the Left of, but it works in another direction: with it you could get all characters of the field to the right of the specified string displayed on the related nodes (the corresponding qualifier is Right of). For example, if the field has "The Beatles" node and if I specify "eat" I would get displayed "les".

    The Show if contain check box under the Right of text box has the same effect as it is the case with the check box under the Left of text box: if I specify "abc" in the Right of text box and if I have Show if contain turned off I will get "The Beatles" node, otherwise I will not get any node for that field value. Similarly to the previous Show if contain check box, if this one is turned on, the Right of qualifier will become Exclusive Right of.

    If the Right of text box has specified some string, you could also specify Right until string to delimit the right end of the result (the corresponding qualifier is Right until). For example, if the field has "The Beatles" node and if I specify "Be" for Right of and "es" for the Right until i will get the node "atl". Again, similarly to the previous cases with the Show if contain check box, if this one is turned on, the Right until qualifier will become Exclusive Right until.

    Left of/Right of examples
    Here are some examples with the (Exclusive) Left of and (Exclusive) Right of qualifiers related to the previous options applied to the "Path" field with following files:
  • c:\Angie Stone - I Wasn't Kidding [Freemasons Vocal Club].mp3
  • c:\Faith Evans - Mesmerized [Freemasons Full Vocal Mix].mp3
  • c:\Freemasons feat. Amanda Wilson - I Feel Like.mp3
  • c:\Freemasons feat. Amanda Wilson - Love on My Mind [Club Mix].mp3
  • c:\Freemasons feat. Siedah Garrett - Rain Down Love [Vocal Club Mix].mp3

    Left of: feat. (" feat. " is specified as a separator) returns the next nodes:
  • c:\Angie Stone - I Wasn't Kidding [Freemasons Vocal Club].mp3
  • c:\Faith Evans - Mesmerized [Freemasons Full Vocal Mix].mp3
  • c:\Freemasons

    Exclusive Left of: feat. returns:
  • "Unknown" (node with all files which don't contain " feat. " in the path)
  • c:\Freemasons

    Right of: feat. returns:
  • c:\Angie Stone - I Wasn't Kidding [Freemasons Vocal Club].mp3
  • c:\Faith Evans - Mesmerized [Freemasons Full Vocal Mix].mp3
  • Amanda Wilson - I Feel Like.mp3
  • Amanda Wilson - Love on My Mind [Club Mix].mp3
  • Siedah Garrett - Rain Down Love [Vocal Club Mix].mp3

    Exclusive Right of: feat. returns:
  • "Unknown" (node with all files which don't contain " feat. " in the path)
  • Amanda Wilson - I Feel Like.mp3
  • Amanda Wilson - Love on My Mind [Club Mix].mp3
  • Siedah Garrett - Rain Down Love [Vocal Club Mix].mp3

    Right of:[|Right until: Mix] ("[" is the starting and "Mix]" is the terminating string) returns:
  • Freemasons Vocal Club].mp3
  • Freemasons Full Vocal
  • c:\Freemasons feat. Amanda Wilson - I Feel Like.mp3
  • Club
  • Vocal Club

    Exclusive Right of:[|Right until: Mix] returns:
  • "Unknown" (node with all files which don't contain "[" in the path)
  • Freemasons Vocal Club].mp3
  • Freemasons Full Vocal
  • Club
  • Vocal Club

    Exclusive Right of:[|Exclusive Right until: Mix] returns:
  • "Unknown" (node with all files which don't contain "[" and " Mix]" in the path)
  • Freemasons Full Vocal
  • Club
  • Vocal Club

    The strings for parsing could be specified more than once with all Left/Right of qualifiers, and they should be separated with "|".

    Exclusive Right of:[|Exclusive Right until: Mix]| Club] returns:
  • "Unknown" (node with all files which don't contain "[" and " Mix]" or " Club]" in the path)
  • Freemasons Vocal
  • Freemasons Full Vocal
  • Club
  • Vocal Club

    Some more examples about the related (Exclusive) Left of and (Exclusive) Right of qualifiers could be found in the mentioned PDF manual.

    Sort files / Sort nodes (prefixes)
    The sorting and statistics controls on the right side of the Settings dialog box could be used only with the global and local nodes, but not with the group nodes. The sorting group of controls has two different meanings depending of the selected node in the Nodes list box: if you have selected global node, this group will have the Sort files caption, but if you have selected some local node, this group will have the Sort nodes (prefixes) caption. So, with the same controls you could set both sorting of the files and sorting of the nodes independently (the corresponding qualifier is Sort by).

    If you have selected global node, i.e. when this group of controls has the Sort files caption, then the first combo box in this group is disabled. When you have selected local node, i.e. when there is Sort nodes (prefixes) caption, then the first combo box is enabled and it contains list of available aggregate functions that could be used for sorting of nodes and for creating of the multi-field captions displayed on the local nodes as prefixes to the main field selected in the Nodes list box. More about that will be described latter in the Multi-field captions section.

    Beside of the standard SQL aggregate functions as Count, Avg, Max, Min and Sum, the list of sorting functions include also WAvg and Range custom functions. The Range(field) is equal to Max(field) - Min(field), while the WAvg is the weighted average that is most useful with the "Played", "Rating" and "Bitrate" fields, e.g. WAvg(Played) is same as Sum(Played * Length) / Sum(Length).

    The second combo box in this group contains the list of available fields and that list is filled dynamically depending of some other settings. If you have selected global node in the Nodes list box (i.e. when you want to set sorting of files), this combo box contains only simple fields that have directly corresponding fields in the Songs table of the database, which are actually the same fields that you see on the column header of the main filelist.

    If you have selected local node in the Nodes list box (i.e. if you want to set sorting of nodes or to set prefixes for multi-field captions), the second combo box will contain fields depending of the selected aggregate function from the previous combo box. If you have selected "Count" function, the second combo box will contain all fields that could be found in the Fields list box as well, with the addition of the "All" and "Files" items. In most cases the Count(All) and Count(Tracks) has the same effect and will return the number of files for the particular node. If you select some of the remaining functions from the first combo box (Avg, Max, ...) , the second combo box will contain only fields that are numerical (e.g. Year, Bitrate, ...). The only exception to this rule are the Custom fields that are added to this list because some users use them to store numerical values.

    If you have selected blank item in the first combo box, the second combo box will contain the list with the same fields as with the "Count" function excluding the "All" and "Files" items. You could use blank item to sort nodes, e.g. if you want them sorted only by values of some field instead of some aggregate function applied to the same field, but this item is useful mainly for creating of the multi-field captions.

    When you have selected wanted items in the previously two mentioned combo boxes, you could add that construction to the list box under them by click on the Add button that is located on the right of the sorting controls. If you want to remove some item from that list box, you should select it and after that click on the Del button. If you want to move some item vertically in the list, you should select it and click on the Up/Down spin control that is located on the left side of that list. The value of the first item in the list will be displayed first in the caption of the nodes, and so on. The order of items in that list also affects the sorting order of nodes.

    Random
    You could use the Random check box if you want random sorting. If you turn on this check box while some item is selected in the previous list box with sorting keys, that item would be randomly sorted which has sense only if the item in the list was set using the blank item from the first combo box, i.e. you have specified field without aggregate function. For example, the mask Test\<Genre|Sort by: Count(All), Artist Random> will have nodes with the genres that are sorted using Count(All) as the first sorting key and after that they would be randomly sorted by artists.

    Well, maybe this is not too much useful for the nodes, but you could apply the same thing to the global node to get randomly sorted files in the filelist. For example, if I have the mask Test|Sort by: Genre Random, Artist, Album Random I will get files grouped first by genres where their order will be random, then within each genre I will get files grouped by artists and their order will be alphabetical, and finally within each artist I will get files grouped by albums which will be ordered randomly.

    If you turn on the Random check box while none item is selected in the list box with the sorting keys located above it, the random order will be applied to the main field of the selected local node (the corresponding qualifier in that case is Sort order:Random). For example, if I select "Artist" node in the Nodes list box and turn on the Random check box I could get this mask Test\<Artist|Sort order: Random>.

    Desc. order
    The Desc. order check box could be used similarly to the Random check box depending of that if some item is selected or not in the list box above it. If that check box is turned on for some item, that value will be sorted in the descending order. For example, if I add Max(Year) to the list box with the sorting keys, then I select that item and turn on the Desc. order check box, I could get this mask: Test\<Album|Sort by: Max(Year) Desc> where albums will be sorted by years from the newest to the oldest. In this example, the year information will be displayed on the begin of each node as a prefix to the album name separated with " - ".

    If you turn on the Desc check box while none item is selected in the list box with the sorting keys located above it, the descending order will be applied to the main field similarly to the Random check box (the corresponding qualifier in that case is Sort order:Desc).

    Show sort key
    The Show sort key check box allows toggling of the visibility for some item from the list of sorting keys on the captions of nodes, e.g. if you want to sort nodes using some field, but you don't want to display that field in the front of the main field (the corresponding qualifier is Show sort key). So, if I modify the previous example like this Test\<Album|Sort by: Max(Year) Desc|Show sort key:0>, I will get albums sorted by year, but the year value will not be displayed in the front of the album name.

    Statistics (suffixes)
    The statistics group of controls (having the corresponding Statistics qualifier) has a very similar usage as the sorting group, but with some differences. First of all, its first combo box is enabled even with the global node, so you could choose some aggregate function applied on some field(s) to get adequate value(s) on the right side of the caption of the global node displayed inside of the parentheses. This list of functions contains one function more: "Concat", e.g. the mask Test\<Title|Statistics: Concat(Playlist)> will display the concatenated names of all static playlists in which specified title appears.

    The blank item in the first Statistics combo box is not available when you have selected global node. If you choose "Count" item from that list of aggregate functions, the next combo box will contain the same fields as the corresponding sorting list with one additional list item: "Items". If you add Count(Items) to some node in the mask, you will get displayed number of its sub-nodes. For example, if I have Test\<Artist|Statistics: Count(Items)>\<Album>, I will get displayed number of albums for each artist. Actually, I could get the same result using Test\<Artist|Statistics: Count(Album)>\<Album>, but in that case if I replace "Album" node with some another I would need to modify the Statistics qualifier as well.

    Multi-field captions
    As it is stated earlier, the sorting and statistics controls could be used to set prefixes and suffixes in the multi-field captions of nodes if you select the blank item from the list of the aggregate functions when you add fields to their lists. The fields that are added without aggregate functions to the list of sorting keys will be displayed as prefixes to the main field of the selected node and, similarly, the fields that are added to the statistics list will be displayed as suffixes to the main field.

    For example, there is not the "Season#, Episode# - Title (Length)" predefined field, but I could get such caption on the nodes if I concatenate the existing fields with the help of the Sort nodes and Statistics controls. Firstly, I should add the "Title" field to the Nodes list box which would be the main field of the new local node that I should select. Then I need to select the blank item in the first sorting combo box and "Season #" field from the seconde combo box, and I should add that field to the list using the Add button. After that I need to do the same with the "Episode #" field. Then I should select blank item in the first statistics combo box and to choose "Length" from the second combo box. After I add that item to the statistics list box, I could get the next mask: Test\<Title|Sort by:Season number, Episode number|Statistics:Length> which will result with the wanted caption on the nodes.

    Mask
    The Mask text box is located near the bottom of the Settings dialog box. It displays the whole mask and its content is automatically updated whenever you modify some of the previous controls above it. However, this works in other way as well, i.e. you could type some mask from scratch or modify some existing one in the Mask text box and the corresponding controls above it will be automatically updated. Of course, you could copy/paste masks to that text box, e.g. if you find it posted in the Forum.

    MagicNodes-5.0 - Choose Magic Node

    ... (Choose Magic Node)
    Searching the Caption combo box for some particular mask that you want to load could be very tedious task which could be avoided using the "..." button that is located on the right side of the Mask text box. If you click on it, you will get opened the Choose Magic Node dialog box that is similar to the Manage Magic Nodes dialog box containing the table with all available masks. You could find the masks in that table that contain the wanted text if you type it in the Find text box. All masks that contain the wanted text will have ticked check boxes on the left side of the table. You could jump to the next or previous mask that contains the specified text using the Next and Prev buttons. With the Match case and Regular expressions check boxes you could further refine the searching results. After you find the wanted mask, you could select it in the table and click the OK button which will load that mask in the Settings dialog box.

    "^" / "_" (toggling dialog mode)
    The next button toggles the visibility of controls in the Settings dialog box and it has two possible captions: "^" and "_". If the Settings dialog box contains all previously mentioned controls, that button has the "^" caption and it is located on the right side of the Mask text box. However, if you click on that button it will move to the top of the Settings dialog box getting the "_" caption, while almost all other controls from that dialog will be replaced by just one multi-line text box in which you could type the whole mask. This mode is useful if you want to see some long mask in full or if you prefer typing of the masks from scratch. If you click on the "_" button, all other controls from the Settings dialog box will be displayed again.

    Select, Move
    There are several command buttons on the very bottom of the Settings dialog box that affects the currently displayed mask. The Select button could bring the focus to the node in the Media Tree related to the current mask. The Move spin control allows moving of the current mask up or down in the list of masks which would be reflected in the text located on the right side of that spin control which displays the serial number of the current mask and the total numbers of masks.

    New, Update / Rename
    The New button allows creating of the new mask and it sets all controls of the Settings dialog box to their initial (blank) state. The following button has two captions depending of the modifications made in the dialog: Update and Rename. If you have modified just the Caption string, that button will have the Rename caption; if you use any other previously mentioned control and modify the related qualifier, that button will have the Update caption. Actually, the resulting effect is very similar and by clicking on that button you could confirm that you want to save modifications of the currently displayed mask.

    Add, Delete, Close
    The Add button allows adding of the currently displayed mask to the list of masks stored in the MediaMonkey.ini file. That button is enabled only if you have typed some new mask (after the click on the New button) or if you have modified the Caption, grouping or positioning of some existing mask. That means that you cannot have two masks/nodes with the same caption under the same parent node.

    You could use the Delete button if you want to remove the currently displayed mask permanently, so be careful using it. With the Close button you could close the Settings dialog box, while the currently displayed mask will be stored in the INI file using the zero serial number (if the mask is modified, but not saved using the Update or Add buttons).

    MagicNodes-5.0 - Manage Masks

    Manage Magic Nodes
    The Manage Magic Nodes dialog box is similar to the mentioned Choose Magic Node dialog box with the same Find options for searching masks, but it also contains several additional controls that allow some operations on the mask(s) selected/checked in the table. There are two radio buttons on the top of the dialog box: MediaMonkey.ini and File. If you select the MediaMonkey.ini option, you will get displayed all MN masks that are stored in the main MediaMonkey INI file, i.e. the masks that have displayed the corresponding nodes in the Media Tree. You will be able to export such masks, as well as to add/edit, delete or move them.

    If you choose the File option, you could get displayed masks from some external INI file which could contain e.g. your previously exported masks. You could type its path in the following text box or you click on the "..." button and find that INI file in the new Open File dialog box. You will be able to import such masks, as well as to delete or move them (if the loaded INI file is not marked to open as read-only).

    The masks and their groups could be alphabetically sorted if you click on the table header that contains displayed the information about loaded masks. This operation is not reversible, so be careful using this option and make a backup of your masks first. On the right side of the table header is located the Word wrap check box that could be used to toggle the type of display of masks in the table.

    Selecting/checking of the mask(s) on which you want to implement some operation could be done in two ways: you could use the check boxes located on the left side of the table or you could select the wanted mask directly in the table. Using the second way you could select only one mask at the time and that way has the precedence over those two ways of selecting, i.e. even if you have some or all masks checked in the table, if you choose some operation as Delete it will be applied only on the selected mask, but not on the checked masks. If you want to deselect the currently selected mask, e.g. if you want to do some operation against the checked masks, then you should click on the already selected mask again.

    The Move operation could be done only on a single mask at the time that is selected in the table. Using the Up and Down buttons you could move the selected mask in the appropriate direction in the list of masks. Those two buttons have the auto-repeat possibility, i.e. it is enough to click on some of them and the selected mask will continue to move in the table until you release that button.

    The next button has two possible captions: Add and Edit. It will have the Add caption if you don't have any mask selected in the table; if you click on it, you would get opened the Add Magic Node dialog box that is the same to the Edit Magic Node dialog box, but it contains all controls set to their initial (blank) state and it allows adding of some new mask to the list of masks.

    If you select some mask in the table, the mentioned button will have the Edit caption; if you click on it, you would get opened the Edit Magic Node dialog box which is the same as if you choose such command from the pop-up menu over some selected Magic node; in this case all controls from that dialog box will be set accordingly to the selected mask which means that you could use that dialog box to modify the existing mask. You could also open the mentioned dialog box to edit some mask if you click its serial number displayed in the "#" column of the table for that mask.

    You could use the Delete button if you want to remove the selected/checked mask(s) permanently, so be careful using it. The enabled state of the next two buttons, Export and Import, depends of the selected option on the top of the dialog box: as it is already explained, you could export the selected/checked masks from the MediaMonkey.ini file or you could import the selected/checked masks from the specified external INI file.

    MagicNodes-5.0 - Options

    Magic Nodes Options
    The Magic Nodes Options dialog box could be opened from the Edit / Magic Nodes menu or from the Tools / Extensions menu with the selected Magic Nodes item in the list of the add-ons. It contains some less important options that affect behavior of this add-on and/or all Magic nodes. The same options could be found on the General / Magic Nodes page in the program's built-in Options dialog box that could be opened from the Tools menu.

  • Skip expanding of the Magic Nodes branch during start-up: you could turn this option on if you want that when starting the program the Magic Nodes tree is not expanded.

  • Allow modifying of fields data by drag & drop or renaming tree nodes: you could turn this option off if you don't want to rename the field value of the selected node directly in the Media Tree or you don't want drag&drop option to be enabled for the Magic nodes. By the way, drag&drop and renaming are not allowed at all for nodes which contain only some part of the field, i.e. nodes with the Left of/Right of/Trim/SubStr/Split by qualifiers. The drag&drop operation updates fields for all parent nodes of the target node, e.g. if you have the mask Test\<Genre>\<Artist>\<Album> and if you drop selected tracks to some album node, you will get updated the genre and artist as well beside of the album.

  • Display sorting/statistic results only if all values are defined: you could turn this option off if you want to get sorting/statistical values on the caption of the Magic nodes even if some files don't have defined the affected field value. For example, if the mentioned option is turned on, the mask Test\<Album|Sort by: Avg(Rating)> only displays the average rating in the front of the album names for the albums where all tracks have been rated; for the other album nodes, just the album names are displayed. So, you should turn off the mentioned option if you want to display these rating values even for those albums which only have some tracks rated.

  • Display sorting/statistic results for Rating rounded to the nearest half star: you could turn this option off if you don't want to get displayed ratings using sorting/statistics qualifiers rounded to the nearest 0.5 stars.

  • Move prefixes to the end if "Ignore prefixes" option on Appearance page is turned on: if you turn this option on, the prefixes will be moved to the end of the node captions, e.g. "The Beatles" will be displayed as "Beatles, The"; if you turn it off, the fields will be displayed as they are stored in the database, e.g. "The Beatles", but the sorting of the nodes will be still correct as if the prefixes are moved to the end, with "The Beatles" node inside of the "B" branch; in both cases it is assumed that the Ignore prefixes option on the Appearance page is already turned on.

  • Ignore prefixes when sorting by: within the following text box you could specify which MN fields should have ignored prefixes when displaying those field on the captions of the Magic nodes. The field names should be typed manually separated with the "," character.

  • Allow editing of SQL queries: you could turn this option on if you want to see or edit the SQL queries when you expand and/or select some Magic node:
  • Show elapsed time in the progress bar after SQL queries: you could turn this option on if you want to get displayed the progress bar on the bottom of the main window of the program with the information about the time that is elapsed after some Magic node is expanded or selected.
  • Modeless MN Settings dialog box (allowed access to other parts of the program): you could turn this option on if you want to get modeless Magic Nodes Settings dialog box which allows access to the other parts of the program, e.g. you could navigate through the Media Tree with the already opened that dialog; when that option is turned off, the mentioned dialog box will be modal and you need to close it if you want to use the other parts of the program.
  • Trim caption of toolbar buttons (maximal number of characters): you could set the maximal number of characters that can be displayed in the toolbar buttons of Magic nodes (if the related option is used in the masks).

    Auto-DJ using Magic Nodes
    There is one option related to the Magic Nodes that is not available in any mentioned dialog boxes, not even in the Magic Nodes Options dialog box. It is located on the Player / Auto-DJ page in the Options dialog box that could be opened from the Tools menu and it could be used to set some Magic node as the source for Auto-DJ. You could choose the "Magic Nodes" item from the Add files from combo box and after that you could select some MN mask from the combo box that is located under the previous one, or you could click on the "..." button from the right side of that combo box and you will get opened Choose Magic Node dialog box where you could find the mask that you want to use for Auto-DJ.

    Additional Information:

    If you select some Magic node and choose the Adjust Magic Node option you could get something like this (the dialog could be resized):

    Magic Nodes 5.0 - Adjust node 01

    Now it is much easier to adjust some parameters of some existing masks than modifying them in the Filter area of the Settings dialog box - just move the corresponding slider or use the spin control. To allow this the add-on uses the new tags with the syntax similar to those that I have already implemented in the RegExp Find & Replace add-on. Here is what you need to add to the existing mask to get the Adjust dialog box on the screenshot:

    <Group|Name:Album Ratings|Show tracks:No>\(Complete) Albums with (weighted) avg. file rating >= <ID:3> stars|Icon:Top level|Filter:Songs.IDAlbum IN (SELECT IDAlbum FROM Songs WHERE Rating >= 0 <If|Caption:Only complete albums having number of files equal to maximal track #|Value=1|ID:1>AND Songs.IDAlbum IN (SELECT IDAlbum FROM Songs GROUP BY IDAlbum HAVING Count(*) = Max(Cast(TrackNumber As integer)) AND Count(*) >= <Number|Caption:Min. number of files per album|Value:5|MinValue:1|MaxValue:20|ID:2>) <End If>GROUP BY IDAlbum HAVING <If|Caption:Average file rating weighted by track length|Value:1>Sum(SongLength * Rating) / Sum(SongLength)<Else>Avg(Rating)<End If> >= <Number|Caption:Min. rating (stars)|Value:4|MinValue:0|MaxValue:5|ID:3> * 20)\<Album with Album Artist|Statistic:Count(All), Avg(Rating)>

    The parameters that could be used for adjustment are:
  • Min tracks, Max tracks and Top qualifiers;
  • String, Number, If, Else, End If and ID tags inside of the Filter qualifier.

    As you could see from the screenshot, the <Number> tag is displayed using spin/slider controls. The <If> / <End If> construction is represented using check box that is checked if the Value argument of <If> tag is 1. The <String> tag (that is not included in the previous mask) would be displayed as a text box.

    The syntax of tags is:
    <tag_name|Value:"text"|Caption:"text"|ID:number|MinValue:number|MaxValue:number>

    The Value argument is mandatory for <String> and <Number> tags, the other arguments are optional.
    The Caption argument is also optional, but it could display some descriptive text next to the control.
    The MinValue and MaxValue could be used only with the <Number> tag to specify a range of the spin control.

    The <ID> tag allows variables to be used several times in the Filter and should have only one argument, e.g. <ID=1>.
    That tag will be replaced in query during run-time with the Value argument of some another <String>/<Number>/<If> tag with the same ID argument.
    The ID argument could be also used to specify order of controls in the dialog box.

    The <If> tag has three different forms:
    1) The standard one is when you specify the Caption and Value arguments. It could have have 0 and 1 as a Value argument, or "False" and "True".
    If the Value is 1, the text between <If> and <End If> tags will be included in the Filter query; otherwise, if the Value is 0, the text will be omitted.
    If the Value is 1 and if <Else> tag is specified between <If> and <End If> tags, then only the text between <If> and <Else> tags will be included in the Filter query, but the text between <Else> and <End If> tags will be omitted; if the Value is 0, the text between <If> and <Else> tags will be omitted and the text between <Else> and <End If> tags will be included.
    If you use the <Else> tag without the Caption argument, the whole <If> <Else> <End If> construction will be displayed as a check box in the Adjust dialog box. However, if you specify the Caption argument in the <Else> tag, the same construction will be displayed as a group containing two radio buttons; the first button will display the Caption specified in the <If> tag, and the second one will display the Caption specified in the <Else> tag.
    The <If> tag in the first form could have specified ID argument as well.

    2) The second form of the <If> tag is when you specify only ID argument. In this case it could be treated as if it has the Value as another <If> tag with the same ID argument that has specified the Value argument. The second form (with only ID argument) is not displayed in the Adjust dialog box as any control, but its nested controls/tags will be displayed next to the controls/tags contained in the corresponding <If> tag that has specified the Value argument.

    3) The third form is when you specify the Value argument without the Caption argument. This form will not be displayed in the Adjust dialog box either. It is mostly useful if you want to specify some VBscript expression in the Value argument, e.g. <If Value="Len(""<ID:2>"") > 0"> ... <End If>, which will have included/excluded text in the Filter query depending of the result of that expression.

    The <End If> tags should not have any specified argument.
    The text between <If> and <End If> tags could contain another tags which would have corresponding controls enabled if the Value of <If> tag is 1. The text between <If> and <End If> tags could contain even another <If> / <End If> blocks, which means that they could be nested without any limit on depth.

    There is no limit for the number of tags and corresponding controls per mask. Adding those new tags is optional. If you don't add them, your masks will be as before, but without possibility to adjust them using the new Adjust Magic Node option. The masks with new tags are longer and somewhat harder to write, but you could do that just once and after that their adjustment will be child's play. Of course, all predefined masks are already written with such new tags so you could use them out of the box.

    Here is one more example:

    Magic Nodes 5.0 - Adjust node 02

    <Group|Name:Random|Show tracks:No>\<ID:1> Random files (rated <ID:3> stars or more) from each Artist (having at least <ID:5> files)|Icon:Top level|Filter:Songs.ID IN (SELECT Songs.ID FROM Songs, (SELECT IDArtist FROM ArtistsSongs WHERE IfNull(ArtistsSongs.PersonType, 1) = 1 GROUP BY IDArtist<If|Caption:Show only artists that have at least the specified number of files|Value:1|ID:4> HAVING Count(*) >= <Number|Caption:Minimum of files|Value:5|MinValue:0|ID:5><End If>) AS T1 WHERE Songs.ID IN (SELECT Songs.ID FROM Songs, ArtistsSongs WHERE Songs.ID = ArtistsSongs.IDSong AND ArtistsSongs.IDArtist = T1.IDArtist <If|Caption:Show only if files are rated more or equal than the specified number|Value:1|ID:2>AND Rating >= <Number|Caption:Rating (stars)|Value:3|MinValue:0|MaxValue:5|ID:3> * 20 <End If>ORDER BY Random() LIMIT <Number|Caption:Files per artist|Value:2|MinValue:0|ID:1>))|Sort by:Multi artist Random\<Artist>

    The color highlighting of tags is not implemented in the add-on. I used it here just to show what is added.

    Important:

    With the previous versions the Filter text box contained WHERE part of the SQL expression for the whole mask, i.e. it was always displayed no matter which node is selected in the Nodes list box, although it was assigned only to the global node. However, with this version the Filter qualifier could be assigned also to any local field/node selected in the Nodes list box containing the corresponding HAVING part of the SQL expression. So, with this version if you want to see the WHERE part of the Filter expression which would be applied to the whole mask you need to select the global node in the Nodes list box.

    The Show tracks qualifier has No as default value (when it is unspecified) for nodes on the Group levels, which is different from the previous versions where Yes was default. If you have some old masks without specified that qualifier on the group levels, then you should update them appropriately. Fortunately, with the new version of this add-on it is enough to update the mentioned qualifier only to one mask and all other masks within the same group will be updated automatically.

    In the new version the backslash ("\") character doesn't need to be escaped inside of the Left of, Right of and Split by qualifiers with one additional "\" character. For example, instead of "c:\\My Music\\" now it should be "c:\My Music\". If you have your own created masks with escaped backslash characters, you should update them with removed escapes.

    The Show sort key qualifier is changed to support multiple fields of Sort by qualifier as prefixes. All old masks with Show sort key qualifier with value greater than 2 will not show the wanted results, so you should update them appropriately. The first three values has the same behavior as before:
  • 0 = don't display any field as prefix;
  • 1 = show only first specified field;
  • 2 = show only second specified field.

    The old behavior:
  • 3 = show only third specified field;
  • 4 = short only fourth specified field;
  • 5 = show only fifth specified field, and so on.

    The new behavior:
  • 3 = show only first and second specified fields;
  • 4 = show only third specified field;
  • 5 = show only first and third specified fields, and so on.

    As you could guess, the new value is using the bitwise representation of fields, which means that the lowest bit represents the first field, the next bit represents the second field, and so on. However, you don't need to do any bitwise operation by yourself - you could just turn on the Show sort key check box in the Settings dialog box for those fields that you want to get displayed and the corresponding value will be added to the mask by the add-on automatically.

    The Show sort key qualifier now supports -1 as the valid value which means that all specified fields of Sort by qualifier will be displayed. That value is default when the mentioned qualifier is omitted from the mask, which is one more thing regarding to that qualifier that is changed in the new version - its default value was 1 in older versions, i.e. only the first specified field was displayed with the omitted Show sort key qualifier.

    The Sort order: Random qualifier specified on a node at the local level was used for sorting of both sub-nodes of that node and the files in the filelist. In the new version only sub-nodes are randomly sorted in that case. If you want to apply random sorting order to the filelist you could specify Sort order: Random to the global node, or you could use Sort by qualifier applied to the global node with Random quasi-sorting order specified to any supported field, e.g. Sort by: Genre Random.

    Additional INI keys

    There are some new keys in the [MagicNodes] section of the MediaMonkey.ini file for some less used options that are not represented in GUI:
  • BitrateNodeRange - nodes displaying Bitrate are grouped by their range of bitrates, default value is 16 which means that there would be displayed nodes: 16 kbps, 32 kbps, 48 kbps, and so on;

  • FormatSeasonEpisodeNumbers - if this key is = 0 the Season# and Episode# nodes will be displayed as they are stored in the database, if it is = 1 then these nodes will be displayed as "Season #xx" and "Episode #xx", default value is 1.

    Notice

    This add-on is a false positive reported as a worm by F-Secure. The author of F-Secure promised me that will update its database and put the add-on on the white-list, but still didn't. If you go to the www.virustotal.com/en/ site, you will see that it is safe tested by 54 popular anti-virus engines; the only one reporting a worm in it is F-Secure. By the way, the F-Secure was constantly having the largest number of false positives in last few years according to the Real-World Protection Test by AV-Comparatives.

    If you are interested about my other add-ons for MediaMonkey, you could visit the following page.