Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 11 of 11

Thread: Popup notice

  1. #1
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770

    Popup notice

    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?

  2. #2
    Join Date
    Dec 2003
    Posts
    891
    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.

  3. #3
    Join Date
    Dec 2003
    Posts
    891
    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.

  4. #4
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    Yes, and if you have the popup menu plugin you could code something like

    Code:
    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

  5. #5
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    The popup works but I was hoping to show the next song name.

  6. #6
    Join Date
    Dec 2003
    Posts
    891
    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

  7. #7
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    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

  8. #8
    Join Date
    Dec 2003
    Posts
    891
    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.

  9. #9
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    Loading it with a browse button so hard to say what the folder will be.

  10. #10
    Join Date
    Dec 2003
    Posts
    891
    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.

  11. #11
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    I see. let me look at this somemore.

Similar Threads

  1. Popup funnys
    By Bruce in forum AutoPlay Media Studio 5.0
    Replies: 10
    Last Post: 09-18-2005, 01:45 PM
  2. popup menu help
    By Roboblue in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 07-26-2005, 08:56 PM
  3. popup menu
    By rhosk in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 03-23-2004, 03:23 PM
  4. i can't add things to a popup menu HELP
    By cgirolet in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 01-09-2004, 06:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts