我编写了这个脚本,让您只需单击一下即可访问多种心情。
它仅适用于当前正在播放的歌曲。
您需要将其保存在 Auto scripts 部分中作为 .vbs 文件,然后重新加载 media monkey。它将创建一个可停靠面板。如果您关闭该面板,您可以通过转到“查看”菜单重新打开它,转到底部,它是“情绪设置面板”
当您单击其中一个情绪复选框时,它会将其添加到歌曲的情绪中(如果尚未添加到那里)。它还会为多个情绪添加分号。
通过在我在标记的位置编辑下面的代码,您可以更改复选框的位置和数量以及您希望它们设置的类型。
修改代码以制作另一个面板应该足够容易,该面板可让您对“场合”或任何其他文本字段执行相同的操作。
我几乎不懂 VBScript 或 Mediamonkey 编程,因此我无法满足这方面的任何要求,但有更多时间和意愿的人可以帮您解决!
享受
我要感谢 Mediamonkey 的开发团队制作了如此出色的产品,它允许您自行完成如此多的功能,然后使用代码对其进行扩展。比 iTunes 更简单。
[代码]
昏暗的 Mnu、Pnl、Lbl、Lbl2
子启动时
设置 UI = SDB.UI
设置 Pnl = UI.NewDockablePersistentPanel(“TestingPanel”)
如果 Pnl.IsNew 那么
盈亏.DockedTo = 2
Pnl.Common.Width = 250
如果结束
Pnl.Caption = "心情设置面板"
脚本.RegisterEvent Pnl, "OnClose", "PnlClose"
设置 Lbl = UI.NewLabel(Pnl)
Lbl.Autosize = false
Lbl.Multiline = true
Lbl.Common.SetRect 10, 10, Pnl.Common.Width-20, Pnl.Common.Height-20
Lbl.Common.Anchors = 15 '1+2+4+8
'不要改变此行以上任何内容
' 使用此部分编辑复选框类型和位置
'将复选框标题更改为您想要的类型
'使用“SetRect”改变每个复选框的位置
'复制粘贴 6 行复选框代码来添加一个新的复选框
'所有复选框的点击都由底部的 1 个事件处理程序处理
'查看调用它的控件的标题
设置 ChB = UI.NewCheckBox(Pnl)
ChB.Common.ControlName = “ChB”
ChB.Common.SetRect 3, 0, 100, 20
'左,上,宽,高
ChB.Caption = “史诗”
脚本.RegisterEvent ChB.Common,“OnClick”,“ChBClick”
设置 ChB = UI.NewCheckBox(Pnl)
ChB.Common.ControlName = “ChB”
ChB.Common.SetRect 123, 0, 100, 20
ChB.Caption = “坚定”
脚本.RegisterEvent ChB.Common,“OnClick”,“ChBClick”
设置 Chb = UI.NewCheckBox(Pnl)
ChB.Common.ControlName = “ChB”
ChB.Common.SetRect 3, 20, 100, 20
ChB.Caption = “悲伤”
脚本.RegisterEvent ChB.Common,“OnClick”,“ChBClick”
设置 ChB = UI.NewCheckBox(Pnl)
ChB.Common.ControlName = “ChB”
ChB.Common.SetRect 123, 20, 100, 20
ChB.Caption = “快乐”
脚本.RegisterEvent ChB.Common,“OnClick”,“ChBClick”
设置 Chb = UI.NewCheckBox(Pnl)
ChB.Common.ControlName = “ChB”
ChB.Common.SetRect 3, 40, 100, 20
ChB.Caption = “空灵”
脚本.RegisterEvent ChB.Common,“OnClick”,“ChBClick”
设置 ChB = UI.NewCheckBox(Pnl)
ChB.Common.ControlName = “ChB”
ChB.Common.SetRect 123, 40, 100, 20
ChB.Caption = “和平”
脚本.RegisterEvent ChB.Common,“OnClick”,“ChBClick”
设置 Chb = UI.NewCheckBox(Pnl)
ChB.Common.ControlName = “ChB”
ChB.Common.SetRect 3, 60, 100, 20
ChB.Caption = “高飞”
脚本.RegisterEvent ChB.Common,“OnClick”,“ChBClick”
设置 ChB = UI.NewCheckBox(Pnl)
ChB.Common.ControlName = “ChB”
ChB.Common.SetRect 123, 60, 100, 20
ChB.Caption = “可怕”
脚本.RegisterEvent ChB.Common,“OnClick”,“ChBClick”
设置 Chb = UI.NewCheckBox(Pnl)
ChB.Common.ControlName = “ChB”
ChB.Common.SetRect 3, 80, 100, 20
ChB.Caption = “愤怒”
脚本.RegisterEvent ChB.Common,“OnClick”,“ChBClick”
设置 ChB = UI.NewCheckBox(Pnl)
ChB.Common.ControlName = “ChB”
ChB.Common.SetRect 123, 80, 100, 20
ChB.Caption = “浪漫”
脚本.RegisterEvent ChB.Common,“OnClick”,“ChBClick”
设置 Chb = UI.NewCheckBox(Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 100, 100, 20
ChB.Caption = “冒险”
脚本.RegisterEvent ChB.Common,“OnClick”,“ChBClick”
设置 ChB = UI.NewCheckBox(Pnl)
ChB.Common.ControlName = “ChB”
ChB.Common.SetRect 123, 100, 100, 20
ChB.Caption = “热门”
脚本.RegisterEvent ChB.Common,“OnClick”,“ChBClick”
设置 Chb = UI.NewCheckBox(Pnl)
ChB.Common.ControlName = “ChB”
ChB.Common.SetRect 3, 120, 100, 20
ChB.Caption = “酷”
脚本.RegisterEvent ChB.Common,“OnClick”,“ChBClick”
设置 ChB = UI.NewCheckBox(Pnl)
ChB.Common.ControlName = “ChB”
ChB.Common.SetRect 123, 120, 100, 20
ChB.Caption = “有趣”
脚本.RegisterEvent ChB.Common,“OnClick”,“ChBClick”
''不要更改此行以下的任何内容
' 添加在面板关闭后显示的菜单项
设置 Sep = SDB.UI.AddMenuItemSep(SDB.UI.Menu_View,0,0)
设置 Mnu = SDB.UI.AddMenuItem(SDB.UI.Menu_View,0,0)
Mnu.Caption = "心情设置面板"
Mnu.Checked = Pnl.Common.Visible
Script.RegisterEvent Mnu,“OnClick”,“ShowPanel”
Script.RegisterEvent SDB,“OnChangedSelection”,“OnSelection”
子目录结束
子显示面板(项目)
Pnl.Common.Visible = 非 Pnl.Common.Visible
Mnu.Checked = Pnl.Common.Visible
子目录结束
子盈亏平仓(项目)
Mnu.Checked = false
子目录结束
选择子程序
子目录结束
子 ChBClick( ChB)
昏暗的objSongList,objSongData
设置 objSongList = SDB.NewSongList
设置 objSongData = SDB.Player.CurrentSong
objSongList.添加(objSongData)
暗淡的 StringMood、StringNewMood、StringAddMood
StringMood = objSongData.Mood
StringAddMood = “;”&ChB.Caption
如果 InStr(StringMood,ChB.Caption) = 0 那么
“Old Mood 不包含您检查的那个。
StringNewMood = StringMood & StringAddMood
objSongData.Mood = StringNewMood
objSonglist.UpdateAll
End If ' 如果旧情绪包含新情绪,则不采取任何行动。
ChB.Checked = false
子目录结束
[/代码]
I made this script to give you one-click access to multiple moods.
Hide original
It only works for the currently PLAYING song.
You need to save it in the Auto scripts section as a .vbs file, and reload media monkey. It will create a dockable panel. If you close the panel you can reopen it by going to the View menu, go to the bottom, and it's "Mood Setting Panel"
When you click one of the mood checkboxes, it adds that to the mood for the song if it's not already on there. It also adds the semicolons for multiple moods.
By editing the below code in the places I marked out, you can change the position and number of the checkboxes as well as the genres you want them to set.
It should be easy enough to modify the code to make another panel that lets you do the same thing with Occasions or any other text field.
I hardly know VBScript or Mediamonkey programming so any requests on this I will not be able to do, someone with more time and inclination can pick that up for you!
Enjoy
I would like to thank Mediamonkey's dev team for making such an awesome product that allows you to do so much on its own, and then expand it using code. Beats Itunes easy.
[code]
Dim Mnu, Pnl, Lbl, Lbl2
Sub OnStartup
Set UI = SDB.UI
Set Pnl = UI.NewDockablePersistentPanel("TestingPanel")
if Pnl.IsNew then
Pnl.DockedTo = 2
Pnl.Common.Width = 250
end if
Pnl.Caption = "Mood Setting Panel"
Script.RegisterEvent Pnl, "OnClose", "PnlClose"
Set Lbl = UI.NewLabel(Pnl)
Lbl.Autosize = false
Lbl.Multiline = true
Lbl.Common.SetRect 10, 10, Pnl.Common.Width-20, Pnl.Common.Height-20
Lbl.Common.Anchors = 15 '1+2+4+8
'don't change anything above this line
' USE THIS PART TO EDIT CHECK BOXES GENRE and position
'Change Checkbox Captions to Genres you want
'Use "SetRect" to change position of each checkbox
'Copy paste 6 lines of checkbox code to add a new checkbox
'All clicks to checkboxes are handled by the 1 event handler at the bottom
'which looks at the caption of the control that calls it
Set ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 0, 100, 20
'left, top, width, height
ChB.Caption = "Epic"
Script.RegisterEvent ChB.Common, "OnClick", "ChBClick"
Set ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 123, 0, 100, 20
ChB.Caption = "Determined"
Script.RegisterEvent ChB.Common, "OnClick", "ChBClick"
Set Chb = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 20, 100, 20
ChB.Caption = "Sad"
Script.RegisterEvent ChB.Common, "OnClick", "ChBClick"
Set ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 123, 20, 100, 20
ChB.Caption = "Happy"
Script.RegisterEvent ChB.Common, "OnClick", "ChBClick"
Set Chb = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 40, 100, 20
ChB.Caption = "Ethereal"
Script.RegisterEvent ChB.Common, "OnClick", "ChBClick"
Set ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 123, 40, 100, 20
ChB.Caption = "Peaceful"
Script.RegisterEvent ChB.Common, "OnClick", "ChBClick"
Set Chb = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 60, 100, 20
ChB.Caption = "Goofy"
Script.RegisterEvent ChB.Common, "OnClick", "ChBClick"
Set ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 123, 60, 100, 20
ChB.Caption = "Scary"
Script.RegisterEvent ChB.Common, "OnClick", "ChBClick"
Set Chb = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 80, 100, 20
ChB.Caption = "Angry"
Script.RegisterEvent ChB.Common, "OnClick", "ChBClick"
Set ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 123, 80, 100, 20
ChB.Caption = "Romantic"
Script.RegisterEvent ChB.Common, "OnClick", "ChBClick"
Set Chb = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 100, 100, 20
ChB.Caption = "Adventurous"
Script.RegisterEvent ChB.Common, "OnClick", "ChBClick"
Set ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 123, 100, 100, 20
ChB.Caption = "Popular"
Script.RegisterEvent ChB.Common, "OnClick", "ChBClick"
Set Chb = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 120, 100, 20
ChB.Caption = "Cool"
Script.RegisterEvent ChB.Common, "OnClick", "ChBClick"
Set ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 123, 120, 100, 20
ChB.Caption = "Fun"
Script.RegisterEvent ChB.Common, "OnClick", "ChBClick"
''don't change anything below this line
' Add menu item that shows panel after it is closed
Set Sep = SDB.UI.AddMenuItemSep(SDB.UI.Menu_View,0,0)
Set Mnu = SDB.UI.AddMenuItem(SDB.UI.Menu_View,0,0)
Mnu.Caption = "Mood Setting Panel"
Mnu.Checked = Pnl.Common.Visible
Script.RegisterEvent Mnu, "OnClick", "ShowPanel"
Script.RegisterEvent SDB, "OnChangedSelection", "OnSelection"
End Sub
Sub ShowPanel(Item)
Pnl.Common.Visible = not Pnl.Common.Visible
Mnu.Checked = Pnl.Common.Visible
End Sub
Sub PnlClose( Item)
Mnu.Checked = false
End Sub
Sub OnSelection
End Sub
Sub ChBClick( ChB)
Dim objSongList , objSongData
Set objSongList = SDB.NewSongList
Set objSongData = SDB.Player.CurrentSong
objSongList.Add(objSongData)
Dim StringMood, StringNewMood, StringAddMood
StringMood = objSongData.Mood
StringAddMood = ";" & ChB.Caption
If InStr(StringMood,ChB.Caption) = 0 Then
'Old Mood does not contain the one you checked.
StringNewMood = StringMood & StringAddMood
objSongData.Mood = StringNewMood
objSonglist.UpdateAll
End If ' If Old Mood contains New Mood, no action is taken.
ChB.Checked = false
End Sub
[/code]
By
mutronbiphase
提交者 mutronbiphase
更新 31/05/2012