FastNode GUI: grafical frontend panel for Magic Nodes

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

Moderators: Peke, Gurus

teemac
Posts: 30
Joined: Sun Apr 02, 2006 1:09 am

Post by teemac »

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
wallstreetwalker
Posts: 150
Joined: Wed Dec 07, 2005 9:56 am

Post by wallstreetwalker »

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.
PUNK IN DRUBLIC
teemac
Posts: 30
Joined: Sun Apr 02, 2006 1:09 am

Post by teemac »

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
teemac
Posts: 30
Joined: Sun Apr 02, 2006 1:09 am

Post by teemac »

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
SHR
Posts: 51
Joined: Sat Jan 20, 2007 11:17 am
Location: Cologne, Germany

Post by SHR »

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]
Begges
Posts: 20
Joined: Fri Apr 28, 2006 3:52 pm
Location: Germany

Not programming at the moment :-(

Post by Begges »

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
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Post by nynaevelan »

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
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

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.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Post by nynaevelan »

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
Diabolic-Destiny
Posts: 223
Joined: Sun Apr 29, 2007 9:45 pm

Post by Diabolic-Destiny »

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
Image
Image
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Post by nynaevelan »

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
Post Reply