.jpg)
J'ai créé ce script pour vous donner un accès en un clic à plusieurs ambiances.
Cela ne fonctionne que pour la chanson en cours de lecture.
Vous devez l'enregistrer dans la section Scripts automatiques au format .vbs, puis recharger Media Monkey. Un panneau ancrable sera créé. Si vous fermez le panneau, vous pouvez le rouvrir en allant dans le menu Affichage, en bas, et en sélectionnant « Panneau de configuration d'ambiance ».
Lorsque vous cochez une case d'ambiance, celle-ci est ajoutée à l'ambiance de la chanson si elle n'y figure pas déjà. Des points-virgules sont également ajoutés pour les ambiances multiples.
En modifiant le code ci-dessous aux endroits que j'ai marqués, vous pouvez modifier la position et le nombre des cases à cocher ainsi que les genres que vous souhaitez qu'elles définissent.
Il devrait être assez facile de modifier le code pour créer un autre panneau qui vous permet de faire la même chose avec Occasions ou tout autre champ de texte.
Je connais à peine la programmation VBScript ou Mediamonkey, donc je ne pourrai pas répondre à toutes vos demandes à ce sujet, quelqu'un avec plus de temps et d'envie peut le récupérer pour vous !
Apprécier
Je tiens à remercier l'équipe de développement de Mediamonkey pour avoir créé un produit aussi génial, qui permet de faire autant de choses de manière autonome, puis de les développer grâce au code. C'est bien mieux qu'iTunes.
[code]
Dim Mnu, Pnl, Lbl, Lbl2
Sous-marin au démarrage
Définir UI = SDB.UI
Définir Pnl = UI.NewDockablePersistentPanel("TestingPanel")
si Pnl.IsNew alors
Pnl.DockedTo = 2
Pnl.Common.Width = 250
fin si
Pnl.Caption = "Panneau de réglage de l'ambiance"
Script.RegisterEvent Pnl, « OnClose », « PnlClose »
Définir Lbl = UI.NewLabel(Pnl)
Lbl.Autosize = faux
Lbl.Multiline = vrai
Lbl.Common.SetRect 10, 10, Pnl.Common.Width-20, Pnl.Common.Height-20
Lbl.Common.Anchors = 15 '1+2+4+8
« ne changez rien au-dessus de cette ligne
' UTILISEZ CETTE PARTIE POUR MODIFIER LES CASES À COCHER GENRE et position
« Modifiez les légendes des cases à cocher selon les genres souhaités
« Utilisez « SetRect » pour modifier la position de chaque case à cocher
« Copiez et collez 6 lignes de code de case à cocher pour ajouter une nouvelle case à cocher
« Tous les clics sur les cases à cocher sont gérés par le gestionnaire d'événements 1 en bas
'qui regarde la légende du contrôle qui l'appelle
Définir ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 0, 100, 20
'gauche, haut, largeur, hauteur
ChB.Caption = "Épique"
Script.RegisterEvent ChB.Common, « OnClick », « ChBClick »
Définir ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 123, 0, 100, 20
ChB.Caption = "Déterminé"
Script.RegisterEvent ChB.Common, « OnClick », « ChBClick »
Définir Chb = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 20, 100, 20
ChB.Caption = "Triste"
Script.RegisterEvent ChB.Common, « OnClick », « ChBClick »
Définir ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 123, 20, 100, 20
ChB.Caption = "Heureux"
Script.RegisterEvent ChB.Common, « OnClick », « ChBClick »
Définir Chb = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 40, 100, 20
ChB.Caption = "Éthéré"
Script.RegisterEvent ChB.Common, « OnClick », « ChBClick »
Définir ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 123, 40, 100, 20
ChB.Caption = "Paisible"
Script.RegisterEvent ChB.Common, « OnClick », « ChBClick »
Définir Chb = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 60, 100, 20
ChB.Caption = "Dingo"
Script.RegisterEvent ChB.Common, « OnClick », « ChBClick »
Définir ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 123, 60, 100, 20
ChB.Caption = "Effrayant"
Script.RegisterEvent ChB.Common, « OnClick », « ChBClick »
Définir Chb = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 80, 100, 20
ChB.Caption = "En colère"
Script.RegisterEvent ChB.Common, « OnClick », « ChBClick »
Définir ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 123, 80, 100, 20
ChB.Caption = "Romantique"
Script.RegisterEvent ChB.Common, « OnClick », « ChBClick »
Définir Chb = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 100, 100, 20
ChB.Caption = "Aventureux"
Script.RegisterEvent ChB.Common, « OnClick », « ChBClick »
Définir ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 123, 100, 100, 20
ChB.Caption = "Populaire"
Script.RegisterEvent ChB.Common, « OnClick », « ChBClick »
Définir Chb = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 3, 120, 100, 20
ChB.Caption = "Cool"
Script.RegisterEvent ChB.Common, « OnClick », « ChBClick »
Définir ChB = UI.NewCheckBox( Pnl)
ChB.Common.ControlName = "ChB"
ChB.Common.SetRect 123, 120, 100, 20
ChB.Caption = "Amusant"
Script.RegisterEvent ChB.Common, « OnClick », « ChBClick »
" ne changez rien en dessous de cette ligne
' Ajouter un élément de menu qui affiche le panneau après sa fermeture
Définir Sep = SDB.UI.AddMenuItemSep(SDB.UI.Menu_View,0,0)
Définir Mnu = SDB.UI.AddMenuItem(SDB.UI.Menu_View,0,0)
Mnu.Caption = "Panneau de réglage de l'humeur"
Mnu.Checked = Pnl.Common.Visible
Script.RegisterEvent Mnu, « OnClick », « ShowPanel »
Script.RegisterEvent SDB, "OnChangedSelection", "OnSelection"
Fin du sous-titrage
Sous-panneau d'affichage (élément)
Pnl.Common.Visible = pas Pnl.Common.Visible
Mnu.Checked = Pnl.Common.Visible
Fin du sous-titrage
Sous PnlClose( Élément)
Mnu.Checked = faux
Fin du sous-titrage
Sous-sélection
Fin du sous-titrage
Sous ChBClick( ChB)
Dim objSongList , objSongData
Définir objSongList = SDB.NewSongList
Définir objSongData = SDB.Player.CurrentSong
objSongList.Add(objSongData)
Dim StringMood, StringNewMood, StringAddMood
StringMood = objSongData.Mood
StringAddMood = ";" & ChB.Caption
Si InStr(StringMood,ChB.Caption) = 0 Alors
« Old Mood ne contient pas celui que vous avez vérifié.
StringNewMood = StringMood et StringAddMood
objSongData.Mood = StringNewMood
objSonglist.UpdateAll
Fin si « Si l'ancienne humeur contient la nouvelle humeur, aucune action n'est entreprise.
ChB.Checked = faux
Fin du sous-titrage
[/code]
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
Soumis par mutronbiphase
Mise à jour 31/05/2012
Historique des versions / Détails
- Version :
- 1
- Mise à jour:
- 31/05/2012
- Size:
- 4.86 KB
- Fonctionne avec :
- Media Monkey 4