FastNode GUI: grafical frontend panel for Magic Nodes
-
- Posts: 150
- Joined: Wed Dec 07, 2005 9:56 am
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
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
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
and
- use of dedicated <empty>-tags for unused fields
- changed option sheet according to new shortcutfield
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]
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")
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
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
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
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]
Not programming at the moment :-(
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
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
-
- Posts: 5559
- Joined: Wed Feb 07, 2007 11:07 pm
- Location: New Jersey, USA
- Contact:
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
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
You need to put these lines at the end of your MagicNodes file (back it up first!)...
And then the rest of the code wants to go into a separate script file in the Auto folder.
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
' ___________________________________________________________________________________________
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.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
-
- Posts: 5559
- Joined: Wed Feb 07, 2007 11:07 pm
- Location: New Jersey, USA
- Contact:
-
- Posts: 223
- Joined: Sun Apr 29, 2007 9:45 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
http://www.mediamonkey.com/forum/viewto ... 68&start=0 by ZvezdanD
-
- Posts: 5559
- Joined: Wed Feb 07, 2007 11:07 pm
- Location: New Jersey, USA
- Contact:
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
"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