UPDATE: panel with VBS buttons working great. Never got HTML buttons to work right. I thought I'd prefer those, but its all good at this point. Case closed.
TOUCHSCREEN + MUSIC = EXCELLENCE
TOUCHSCREEN + RtClk/MENUs = nuisance
TOUCHSCREEN + well-sized BUTTONS = the FUTURE
So I'm marrying tagging to panels with buttons, and I'm lovin it (©McDonalds Corp).
????????????????????? Is THIS possible: ?????????????????????
------------------- Dynamic buttons -------------------
So if the newly playing song's GENRE = LATIN.
a panel refreshes with a few predetermined buttons for BOOGALOO, SALSA, MAMBO
Pressing the button enters the buttons caption in a custom field for SUBGENRE.
I can think of several genres that would be WILDLY more useful in a 'more inclusive parent/more specific child' breakdown. I tried all night but couldn't get a hint if this is possible. I certainly don't know how to work the code. Thanks!
Dynamicly Generated Buttons in Panel?
Moderators: Gurus, Addon Administrators
-
- Posts: 64
- Joined: Mon Sep 03, 2012 12:06 pm
Dynamicly Generated Buttons in Panel?
Last edited by Just Guessing on Sun Sep 16, 2012 12:05 am, edited 1 time in total.
Re: Dynamicly Generated Buttons in Panel?
Yes, it's definitely possible to do this. Is there any part of it in particular that you are struggling with?
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: 64
- Joined: Mon Sep 03, 2012 12:06 pm
Re: Dynamicly Generated Buttons in Panel?
Err...all of it.Is there any part of it in particular that you are struggling with?
Well not exactly; I have succesfully gotten buttons (which write to desired tags); I've gotten the buttons to correctly handle multi-value entry; I've even gotten toolbar buttons going to show or hide the button's panel! And I am brand new at this stuff, so its VERY exciting to personalize my music interface this way.
But the REFRESH aspect, when the song changes, and the dynamic caption (which will be the tag) for the button; that's code I think I've seen but I cant understand what's at work.
I tried to 'hack' SongInfoPanel for experimentation (since it refreshes with new song changes), I was even able to get HTML buttons into its display that wrote to my tags [EDIT: wrong, I got vbs button outside of the HTML that wrote to the tags].
But the refresh/dynamic side wasn't there no matter what I tried.
I spent a long time trying, and finally thought I'd start by asking the knowlegable if it is even possible.
Last edited by Just Guessing on Thu Sep 06, 2012 10:00 am, edited 1 time in total.
Re: Dynamicly Generated Buttons in Panel?
You need to use an OnPlay event.
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: 64
- Joined: Mon Sep 03, 2012 12:06 pm
Re: Dynamicly Generated Buttons in Panel?
OK, some aspects of progress already; so a more specific request For aid:
I've Created a BUTTON Inside a SongInfoPanel script funtion.
SongInfoPanel uses HTML In this Function To draw the panel. Executed like this:
The variable SubGenre1 gets a refreshed value based on the now playing song's GENRE tag. Working!
But I can't get the button to do any tag writing (specificly, write the SubGenre1 value to Custom3).
Tried this in the function:
Tried this outside the function:
Does the Doc.Add aspect not permit true button functionality, Or something ?
I do like the button being an aspect of HTML as it will be nicely CSS'd in the end (I'm good with CSS).
I've Created a BUTTON Inside a SongInfoPanel script funtion.
SongInfoPanel uses HTML In this Function To draw the panel. Executed like this:
Code: Select all
Doc.Add " <INPUT TYPE='Button' NAME='SubGenreTag1' VALUE=" & SubGenre1 & ">"
But I can't get the button to do any tag writing (specificly, write the SubGenre1 value to Custom3).
Tried this in the function:
Code: Select all
Script.RegisterEvent Doc, "OnClick", "SubGenreTag1" ...
Code: Select all
Sub SubGenreTag1_OnClick(). . .
I do like the button being an aspect of HTML as it will be nicely CSS'd in the end (I'm good with CSS).
-
- Posts: 64
- Joined: Mon Sep 03, 2012 12:06 pm
Re: Dynamicly Generated Buttons in Panel?
PROBLEM HAS EVOLVED: Man, I got lots of trouble when for a while NOTHING seemed to work. Then I came to a point where line 1 below didn't work but line 2 did!
See the difference?? How could you; but at some point I copy/pasted some snippet somewhere and the space after the first 'img' is NOT a space but '/xe0' character. It spread like a virus too. What a waste of hours!
------- anyway -------------
Alright, someone be a script hero and help me with this last leg here! I'm begging!
I have a panel (very stripped/core version of the MMonkey SongInfoPanel script). The panel is drawn in HTML.
I have two buttons in the HTML which pass a variable to a sub so - when a button is pressed the Custom4 tag gets the variable written to it.
This works, but isn't handled right, as BOTH BUTTONS WRITE THE VARIABLE 'SubGenre222'.
If problem 1 gets fixed, then will have to figure out the proper way to write the tags. Without the commented out bits of the function above, the tags dont stick. Reopen mMonkey, they're gone. BUT with them uncommented, the tags were being written when a song changed, without any button pressing. Do I need a routine to check for the event?
or something? -- Thank You.
Code: Select all
... <img src='" & strAlbumArtFile & "'> ...
... <img src='" & strAlbumArtFile & "'> ...
------- anyway -------------
Alright, someone be a script hero and help me with this last leg here! I'm begging!
I have a panel (very stripped/core version of the MMonkey SongInfoPanel script). The panel is drawn in HTML.
I have two buttons in the HTML which pass a variable to a sub so - when a button is pressed the Custom4 tag gets the variable written to it.
This works, but isn't handled right, as BOTH BUTTONS WRITE THE VARIABLE 'SubGenre222'.
Code: Select all
Doc.Add " <HTML><HEADER></HEADER><BODY>... etc
Doc.Add " <BUTTON NAME='button1' Onclick=" & writeCustom4(SubGenreOne) & ">First button</button>"
Doc.Add " <BUTTON NAME='button2' Onclick=" & writeCustom4(SubGenreTwo) & ">Second button</button>"
...
Function writeCustom4(xxx)
' Dim SDB
' Set SDB = CreateObject("SongsDB.SDBApplication")
Dim nowsong
Set nowsong = SDB.Player.CurrentSong
nowsong.Custom4 = xxx
' Dim list
' Set list = SDB.NewSongList
' list.Add(nowsong)
' nowsong.UpdateAll
' list.UpdateAll
' Set list = Nothing
' Set SDB = Nothing
' Set nowsong = Nothing
' Set SubGenreOne = Nothing
' Set SubGenreTwo = Nothing
End Function
Code: Select all
"If IsObject(xxx) = True Then"