Can you do a popup notice when the music changes to the next song?
Maybe from the system icon, or is the popup menu plugin able to do this?
Professional Software Development Tools
Can you do a popup notice when the music changes to the next song?
Maybe from the system icon, or is the popup menu plugin able to do this?
I believe that it can. Add a Global like this
function SongPop()
tblMenu = {};
tblMenu[1] ={};
tblMenu[1].Text = "Song Is Done";
tblMenu[1].ID = 1;
tblMenu[1].Checked = false;
tblMenu[1].Enabled = true;
nLSelected = Application.ShowPopupMenu(200, 0, tblMenu , TPM_LEFTALIGN, TPM_TOPALIGN, true, true);
end
and put SongPop() on any event. (try it with a button untill you can get the right coordinates)
Last edited by Roboblue; 04-18-2006 at 06:20 PM.
You could also set the coordinates for above the tray, but you would have to check the system display res and have coordinates for each possible resolution.
The ClientCoordinates (true/false) parameter sets the popup coordinates reference to the application window, or the user's screen.
Yes, and if you have the popup menu plugin you could code something like
Make sure 'PopupMenu' is enabled from Project --> Plugins or it won't workCode:Return = {} x = 200; y = 0; tblMenu = { {text="Song Is Done",type=0,checked=false,enabled=true} }; Return[1] = PopupMenu.Show(tblMenu,x,y, PopupMenu.HALIGN_LEFT,PopupMenu.VALIGN_TOP); --=============================== --if (Return[1] ~= "CANCELLED") then --the menu is selected --end --===============================![]()
The popup works but I was hoping to show the next song name.
This is for Application.ShowPopupmenu, not the PopupMenu plugin.
If you have the song name in a variable (should be able to get it from the player or playlist), then just put the variable in the Text line of the menu table.
next song is "Who's Next", so
sName = "Who's Next"
function SongPop()
tblMenu = {};
tblMenu[1] ={};
tblMenu[1].Text = sName;
tblMenu[1].ID = 1;
tblMenu[1].Checked = false;
tblMenu[1].Enabled = true;
nLSelected = Application.ShowPopupMenu(200, 0, tblMenu , TPM_LEFTALIGN, TPM_TOPALIGN, true, true);
end
This is from the listbox :
Code:LB = "ListBox1"; -- Get the selected items tSelected = ListBox.GetSelected(LB); -- Because we are not allowing multiple select in the -- ListBox object, we are only concerned with tSelected[1] if tSelected then -- There is an item selected, get the data! sFile = ListBox.GetItemData(LB, tSelected[1]); nSize = File.GetSize (sFile); tFileAtt = File.GetAttributes (sFile); sFileCreated = tFileAtt.CreationDate; sFileLastAccess = tFileAtt.AccessDate; sFileLastWritten = tFileAtt.WriteDate; Paragraph.SetEnabled("Para_FileProps", true); Paragraph.SetText("Para_FileProps", "File Path : "..sFile.."\r\nFile Size : "..nSize.." bytes | Created : "..sFileCreated.."\r\nLast Access : "..sFileLastAccess.." | Last Written : "..sFileLastWritten); Paragraph.SetEnabled("Paragraph2", true); --else -- Display an error message --Dialog.Message("Error", "There is no item selected."); end
How are you populating the list box?
If you are inputting the song list manually at design time, then you have entered the song name into the text field of the list box.
then try
LB = "ListBox1";
tSelected = ListBox.GetSelected(LB);
if tSelected then
-- There is an item selected, get the data!
sFile = ListBox.GetItemData(LB, tSelected[1]);
sName = ListBox.GetItemText(LB, tSelected[1]);
nSize = File.GetSize (sFile);
tFileAtt = File.GetAttributes (sFile);
sFileCreated = tFileAtt.CreationDate;
sFileLastAccess = tFileAtt.AccessDate;
sFileLastWritten = tFileAtt.WriteDate;
Paragraph.SetEnabled("Para_FileProps", true);
Paragraph.SetText("Para_FileProps", "File Path : "..sFile.."\r\nFile Size : "..nSize.." bytes | Created : "..sFileCreated.."\r\nLast Access : "..sFileLastAccess.." | Last Written : "..sFileLastWritten);
Paragraph.SetEnabled("Paragraph2", true);
SongPop()
--else
-- Display an error message
--Dialog.Message("Error", "There is no item selected.");
end
If you are dynamically getting the listbox from a folder at runtime, then you'll have to make sure that the filename is the song name.
Loading it with a browse button so hard to say what the folder will be.
The popup will display whatever is in the Text field of the list box, regardless of how you populate the listbox. If the Text is awjndcvnWNEDC, then that is what will be popped up.
My point is, that to have a popup with the correct song name, then you'll need to have it in the Text field correctly.
The only other way(s) to do it is if it's in .ogg format and then you can use the Audio.GetOggTags to get the song name, or WORM was going to release (has released?) an .mp3 plugin/dll to read mp3 tags.
This is assuming the files have the tags filled correctly.
I see. let me look at this somemore.