Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004
    Location
    Cessnock, NSW, Australia
    Posts
    34

    Huh? More elegant mp3

    This is my quick and dirty effort at an mp3 player loosely based on a slideshow example from somewhere on the forums
    __________________________________________________ _______________






    Page properties code:
    ---> on open tab:
    ------------------------------------------------
    -- Thanks TJ for the original code example
    ------------------------------------------------
    --Disable listbox Updating

    ListBox.SetUpdate("ListBox1", false);
    -- commented out the browse function below and just made it so that it lists the folder contents
    -- folder = Dialog.FolderBrowse("Open the images Folder for a list of pictures. Just click OPEN", "AutoPlay\\docs\\music");

    Folder.SetCurrent("AutoPlay\\Docs\\music");
    folder = Folder.GetCurrent();

    --populate tables with all the .mp3 and .wma files
    file_mp3 = File.Find(folder, "*.mp3", false, false, nil);
    file_wma = File.Find(folder, "*.wma", false, false, nil);
    audio = {file_mp3, file_wma};

    --do the following for each file:
    for k in audio do --loops through the different audio types
    for j,file_path in audio[k] do --loops through each audio file

    --dump data to listbox
    ListBox.AddItem("ListBox1", String.SplitPath(file_path).Filename, file_path);
    end
    end

    --hopefully reenable update of the listbox
    ListBox.SetUpdate("ListBox1", true);
    __________________________________________________ ________






    --->On close tab

    --- hopefully this clears the listbox
    ListBox.DeleteItem("ListBox1", LB_ALLITEMS);
    __________________________________________________ _________





    List box
    L-----> action / select

    selected = ListBox.GetSelected("ListBox1");


    for j,k in selected do

    -- this is the original load routine
    Image.Load("picture", ListBox.GetItemData("ListBox1", k));


    -- we dump " ListBox.GetItemData("ListBox1", k) " in instead of the filepath
    Audio.Load(CHANNEL_NARRATION, ListBox.GetItemData("ListBox1", k), true, false);

    end




    If anyone knows of a more elegant way to do this could they please let me know

    Thanks Gabby

  2. #2
    Join Date
    Dec 2004
    Posts
    17

  3. #3
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by gabrielfenwich
    If anyone knows of a more elegant way to do this could they please let me know
    If it isn't broke then don't try and fix it.
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

Similar Threads

  1. mp3 Reading In A Play List
    By irrelevant in forum AutoPlay Media Studio 4.0
    Replies: 10
    Last Post: 10-02-2003, 10:58 PM
  2. Scrolling title in mp3 player (i'm a newbie)
    By MaDePmAx in forum AutoPlay Media Studio 4.0
    Replies: 1
    Last Post: 09-21-2003, 04:58 AM
  3. I need help about my MP3 player....
    By dinesh in forum AutoPlay Media Studio 4.0
    Replies: 3
    Last Post: 04-08-2003, 06:34 AM
  4. HOWTO: Set up an MP3 Playlist
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-24-2002, 11:57 AM
  5. Help with the Blue Gel MP3 Player
    By unknown user in forum AutoPlay Menu Studio 3.0
    Replies: 4
    Last Post: 07-24-2002, 01:26 PM

Posting Permissions

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