FastNode GUI: grafical frontend panel for Magic Nodes

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: FastNode GUI: grafical frontend panel for Magic Nodes

by nynaevelan » Thu Jul 26, 2007 11:17 pm

Ok, I've been able to get the fastnode to work, however some of my magic nodes will not work. I must be entering the code incorrectly. Here is an example of one of my MN's which I would like to use within fastnode.

"Never Played by Artist/Genre|filter:PlayCounter =0|icon:top level\<genre>\<artist>\<title>"

Yet, no matter how I enter the code I get the following error message "the mask you entered is not valid. Please check your gui options." Does anyone have any idea how to fix this?

Nyn

by Diabolic-Destiny » Wed Jul 25, 2007 8:32 pm

is this compatible with the unofficial version of magic nodes which works with mm 3.0

http://www.mediamonkey.com/forum/viewto ... 68&start=0 by ZvezdanD

by nynaevelan » Wed Jul 25, 2007 7:22 am

TM:

Thank you very much, I tried to follow the instructions in the first post but it got a little confusing. I appreciate all the help you all have given me to help make MM a superb program.

Nyn

by trixmoto » Wed Jul 25, 2007 4:05 am

You need to put these lines at the end of your MagicNodes file (back it up first!)...

Code: Select all

'       ________________________________________________________________________________
'        Sub CreateNodeExternalCall(usermask)
'
'             Dim iniMask, i, wellFormedMask, singleLineMask
'
'             If usermask = "" Then Exit Sub
'
'             wellFormedMask = CheckMask(usermask)
'             singleLineMask = Cond(InStr(usermask, vbCr) = 0, True, False)
'
'             If wellFormedMask And singleLineMask Then
'                  For i = 1 To MasksInIniFile
'                       iniMask = getIniMask(i)
'                       If iniMask = "" Then
'                            SetIniMask i, usermask
'                            SetIniMask 0, usermask   ' mask0 is used as a default/temporary mask
'                            ResetEditDeleteMenus
'                            Dim pn: pn = getQualifierValue(usermask, "child of", "MAGIC", True)
'                            If pn = "MAGIC" Then
'                                 ResetCustomNodeRoot
'                            Else
'                                 CreateCustomNode Eval("SDB.MainTree.Node_" & pn), 1, usermask, i
'                            End If
'                            expandCustomNode (i)
'                            Exit Sub
'                       End If
'                  Next
'             Else
'                  SetIniMask 0, Cond(wellFormedMask, Left(usermask, InStr(usermask, vbCr)), usermask)
'                  SDB.MessageBox Cond(wellFormedMask, _
   '                            "The mask you entered spans several lines. Masks must fit in one line in order to be valid.", _
   '                            "The mask you entered is not valid. Please check GUI Options."), mtError, Array(mbOK)
'                  Exit Sub
'             End If
'
'             SDB.MessageBox "You have exceeded the allowed limit of Magic Nodes. You can increase this limit by modifying the constant" & _
   '                       " masksInIniFile in the script source and restarting MediaMonkey.", mtError, Array(mbOK)
'
'        End Sub
'
'        _______________________________________________________________________________________
'        Sub DeleteNodeExternalCall(NodeString)
'             Dim i
'             For i = 1 To MasksInIniFile
'                  If getIniMask(i) = NodeString Then
'                       SetIniMask i, ""
'                       SDB.objects("submnu_edit" & i).Visible = False
'                       SDB.objects("submnu_delete" & i).Visible = False
'                       If getQualifierValue(NodeString, "child of", "MAGIC", True) <> "MAGIC" Then
'                            ShowRestartMsg
'                       Else
'                            ResetCustomNodeRoot
'                       End If
'                       Exit Sub
'                  End If
'             Next
'        End Sub
'        ___________________________________________________________________________________________ 
And then the rest of the code wants to go into a separate script file in the Auto folder.

by nynaevelan » Tue Jul 24, 2007 6:31 pm

Hi:

I would like to give this script a try, however not being a "coder", I am confused as to what part of the code I should be adding to the Magic Nodes script. Can anyone help me?? Please don't tell me line numbers because I have tried to look at the line numbers and I don't think I am adding the correct lines. Could you give me examples of the text in the starting and ending lines??

Nyn

Not programming at the moment :-(

by Begges » Mon Feb 05, 2007 2:53 pm

SHR,

as i am very busy at the moment with a lot of other things i have not the time to work on my MM-Scripts these days.
I have programmed them all in about 5 days to make MM look the way i love it, and they are all a bit quick and dirty. I have also some enhancemnts in mind but not the time.....

You're ideas sound great, go ahead!

Begges

by SHR » Thu Feb 01, 2007 7:13 pm

Cool work Begges. Magic Nodes are really great, but sometimes I wish it would be more dynamic. So I find your script really useful.
Are you still working on this approach?
Here are my suggestions and modifications to your script:
- Hotkey for FastNode

Code: Select all

      FastNodeName = SDB.IniFile.StringValue("FastNode_GUI", "NodeName") 
      FastNodeHotkey = SDB.IniFile.StringValue("FastNode_GUI", "NodeHotkey") ' added Hotkey feature
      DDsUsed = SDB.IniFile.StringValue("FastNode_GUI", "DDsUsed") 
and

Code: Select all

   GetString = FastNodeName

   ' Insert MagicNode Shortcut
   If FastNodeHotkey = "" then
   Else
      GetString = GetString & "|Shortcut:" & FastNodeHotkey
   End If

   ReDim DDIndex(DDsUsed) 
   'Get all DropDown-Values 
- use of dedicated <empty>-tags for unused fields

Code: Select all

'And sort out double entries (this makes no sense, or):
      DCounter = 0 
      For j = 0 To i 
         If DDIndex(i) = DDIndex(j) Then
            DCounter = DCounter + 1
         Else
            If Lcase(tags(DDIndex(i),2)) = "<empty>" Then DCounter = DCounter + 1
         End If
      Next 
      If DCounter <= 1 And DDIndex(i) >= 0 Then
         GetString = GetString & "\" & Tags(DDIndex(i), 2)
      End If
   Next 
   Set ParentForm = Nothing 
   Set Index = Nothing 
End Function 
- changed option sheet according to new shortcutfield

Code: Select all

'Set the layout of the options panel 
Sub InitGUIOptions(sheet) 
   Dim Label 
   Dim CB 
   Dim i 
   Dim EDName, EDCode 
    
   Set Label = SDB.UI.NewLabel(sheet) 
   Label.Common.SetRect 10, 10, 80, 20 
   Label.caption = "Configure available Fields (needs Restart to take effect):" 
   Label.AutoSize = True 
   Label.Alignment = 0 
   Set Label = Nothing 
    
   Set Label = SDB.UI.NewLabel(sheet) 
   Label.Common.SetRect 40, 25, 80, 20 
   Label.caption = "Active" 
   Label.AutoSize = True 
   Label.Alignment = 0 
   Set Label = Nothing 
    
   Set Label = SDB.UI.NewLabel(sheet) 
   Label.Common.SetRect 80, 25, 80, 20 
   Label.caption = "Name" 
   Label.AutoSize = True 
   Label.Alignment = 0 
   Set Label = Nothing 
    
   Set Label = SDB.UI.NewLabel(sheet) 
   Label.Common.SetRect 170, 25, 80, 20
   Label.caption = "Code" 
   Label.AutoSize = True 
   Label.Alignment = 0 
   Set Label = Nothing 
    
   For i = 1 To 10 
      Set Label = SDB.UI.NewLabel(sheet) 
      Label.Common.SetRect 20, 15 + i * 25 + 2, 80, 20 
      Label.caption = i 
      Label.AutoSize = True 
      Label.Alignment = 1 
      Set Label = Nothing 
      
      Set CB = SDB.UI.NewCheckbox(sheet) 
      CB.Common.SetRect 50, 15 + i * 25, 80, 20 
      CB.Common.ControlName = "CB" & i 
      CB.caption = "" 
      If SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Active") <> "" Then 
         CB.Checked = SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Active") 
      Else 
         CB.Checked = False 
      End If 
      Set CB = Nothing 
      
      Set EDName = SDB.UI.NewEdit(sheet) 
      EDName.Common.SetRect 80, 15 + i * 25, 80, 20
      EDName.Common.ControlName = "EDName" & i 
      If SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Name") <> "" Then 
         EDName.text = SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Name") 
      Else 
         EDName.text = "Name" 
      End If 
      Set EDName = Nothing 
      
      
      Set EDCode = SDB.UI.NewEdit(sheet) 
      EDCode.Common.SetRect 170, 15 + i * 25, 280, 20
      EDCode.Common.ControlName = "EDCode" & i 
      If SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Code") <> "" Then 
         EDCode.text = SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Code") 
      Else 
         EDCode.text = "<artist>"
      End If 
      Set EDCode = Nothing 
   Next 
    
   Set Label = SDB.UI.NewLabel(sheet) 
   Label.Common.SetRect 20, 295, 60, 20 
   Label.caption = "NodeName"
   Label.AutoSize = True 
   Label.Alignment = 0 
   Set Label = Nothing 
    
   Set EDName = SDB.UI.NewEdit(sheet) 
   EDName.Common.SetRect 80, 292, 80, 20
   EDName.Common.ControlName = "NodeName" 
   If SDB.IniFile.StringValue("FastNode_GUI", "NodeName") <> "" Then 
      EDName.text = SDB.IniFile.StringValue("FastNode_GUI", "NodeName") 
   Else 
      EDName.text = "FastNode" 
   End If 
   Set EDName = Nothing 

   ' Hotkey Field
   Set Label = SDB.UI.NewLabel(sheet)
   Label.Common.SetRect 170, 295, 60, 20
   Label.caption = "FastNode Hotkey"
   Label.AutoSize = True
   Label.Alignment = 0
   Set Label = Nothing

   Set EDName = SDB.UI.NewEdit(sheet)
   EDName.Common.SetRect 260, 292, 80, 20
   EDName.Common.ControlName = "NodeHotKey"
   If SDB.IniFile.StringValue("FastNode_GUI", "NodeHotkey") <> "" Then
      EDName.text = SDB.IniFile.StringValue("FastNode_GUI", "NodeHotkey")
   Else
      EDName.text = "Strg+F12"
   End If
   Set EDName = Nothing

   ' Number of DropDowns
   Set Label = SDB.UI.NewLabel(sheet) 
   Label.Common.SetRect 350, 295, 60, 20
   Label.caption = "DropDowns"
   Label.AutoSize = True 
   Label.Alignment = 0 
   Set Label = Nothing 
    
   Set EDName = SDB.UI.NewSpinEdit(sheet) 
   EDName.Common.SetRect 410, 292, 40, 20
   EDName.Common.ControlName = "DDsUsed" 
   EDName.minvalue = 1 
   EDName.maxvalue = 10 
   If SDB.IniFile.StringValue("FastNode_GUI", "DDsUsed") <> "" Then 
      EDName.value = SDB.IniFile.StringValue("FastNode_GUI", "DDsUsed") 
   Else 
      EDName.value = 3 
   End If 
   Set EDName = Nothing 
    
End Sub 

Sub SaveGUIOptions(sheet) 
   Dim i 
    
   For i = 1 To 10 
      SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Active") = sheet.Common.Childcontrol("CB" & i).Checked 
   Next 
    
   For i = 1 To 10 
      SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Name") = sheet.Common.Childcontrol("EDName" & i).text 
   Next 
    
   For i = 1 To 10 
      SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Code") = sheet.Common.Childcontrol("EDCode" & i).text 
   Next 
    
   SDB.IniFile.StringValue("FastNode_GUI", "NodeName") = sheet.Common.Childcontrol("NodeName").text 
   
   SDB.IniFile.StringValue("FastNode_GUI", "NodeHotkey") = sheet.Common.Childcontrol("NodeHotkey").text
    
   SDB.IniFile.StringValue("FastNode_GUI", "DDsUsed") = sheet.Common.Childcontrol("DDsUSed").value 
End Sub 
What do you think about adding modifier support for the node?
In my case it is possible to add modifiers by appending modifiers to the shortcut, but this isn't the way I think it should be done.
Or what about a complete gui for adding, editing or deleting of all Magic Nodes?[/code]

by teemac » Tue May 09, 2006 7:56 pm

Begges - thanks for trying to solve this problem.

I'll remove all my scripts and add them back one at a time and try to find the one that is causing problems.

I will post my results for you in a couple of days.

Thank you very much again

teemac (Australia) Gold User

by teemac » Sun May 07, 2006 10:32 pm

Begges - Thanks for the scripts - Removed old versions - Unzipped them both into scripts\auto in MediaMonkey - set options - restarted MediaMonkey - clicked GO - same errors - email sent to you with screen captures of the errors.

Could it be another active script using the same variables??

I'm not a scripter so any more help would be appreciated.

teemac (Australia) Gold User

by wallstreetwalker » Sun May 07, 2006 6:15 pm

just being lazy :
can you make a script installer for this one.
would be nice, will already try to so if i can get it working now thoo ...

... and thanks!


EDIT: got it working rather fast actually, looks great, well done thanks alot.

by teemac » Sat May 06, 2006 5:58 pm

Begges - I have PM'd you with my email address for a copy of your "MagicNodes.1.3b_GUI.vbs" so we can eliminate it from the problem.

Thank you very much.

teemac (Australia) Gold User

by Begges » Sat May 06, 2006 6:22 am

oh i mean line 782, of course ;-)

by Begges » Sat May 06, 2006 6:19 am

could you explain exactly what you have done, please.
Also the Magic nodes codes and names you have put in.

Line 768 is part of unchanged magic node sript, maybe your magic node syntax is wrong.

Standard procedure is following:
- copy the extralines to magic Nodes and rename it to MagicNodes.1.3b_GUI.vbs and place it in the auto folder (normally it is there)
- save the GUI script also in the auto folder
- run MM
- there will be a message box remember you to set the options of Fast Node
- do this under Tools - Options
- Example for code: <artist>, <album> etc.
- Name the codes as you want
- make the parts active, which you want to use
- RESTART MM!
- and now it should work

by teemac » Sat May 06, 2006 1:59 am

I have redownloaded MagicNodes 1.3b, edited it as per instructions, placed both files in \Auto, removed the old magic nodes script - but still the exact same error message.

Can any one help me.

Thanks in advance,

teemac (Australia) Gold User

by teemac » Fri May 05, 2006 8:39 pm

Guest - I put the codes in the options panel and ticked the box to activate each one.

In the options panel it asks for how many drop downs - I selected 3 - these are the 3 fields I mean.

I don't know much about scripting, so if the error I said was in the other script - MagicNodes.1.3b_GUI.vbs - it must be an error when I pasted and removed the comments from the extras needed to be added to MagicNodes.vbs.

As posted these extras to add to MagicNodes.vbs have a lot of comment marks and a lot of extra spaces.

I will try again - thank you for your comments.

Top