View Full Version : Popup notice
bobbie
04-18-2006, 01:41 PM
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?
Roboblue
04-18-2006, 06:12 PM
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)
Roboblue
04-18-2006, 06:26 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
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
--===============================
Make sure 'PopupMenu' is enabled from Project --> Plugins or it won't work :yes
bobbie
04-18-2006, 10:12 PM
The popup works but I was hoping to show the next song name.
Roboblue
04-18-2006, 10:28 PM
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
bobbie
04-19-2006, 04:14 AM
This is from the listbox :
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
Roboblue
04-19-2006, 09:41 AM
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.
bobbie
04-19-2006, 10:02 AM
Loading it with a browse button so hard to say what the folder will be.
Roboblue
04-19-2006, 10:15 AM
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.
bobbie
04-19-2006, 10:18 AM
I see. let me look at this somemore.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.