Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2006
    Posts
    3

    Two small but difficult questions..need help pls

    Hi All,

    I'm new to auto menuing but have managed to create a menu to play music files(ogg format). I have the 20 files set out as in track 1 and so on and have created a play all tracks button. Where I'm getting stuck is that I cannot for the life of me get the single tracks to play just the one selected, instead it seems to play as from that track to the end of the remaining files eg if I select track 7 it plays on from there to track 20. I can of course remove the global script then the single track will play and stop, but thats not what I want I want to do both, play one selected track and stop along with the option to play all tracks.

    I have created list boxes from reading up in the help file and downloaded an example from here and understand how they operate but again thats not what I'm after. I want a row of nicely created buttons 1 thru 20 single track play and the 21st button play all. I'm almost there but just need a shove in the right direction.

    I would also like to auto scroll my text along the bottom of the menu// not the track title i have done that bit I want normal auto scrolling text.

    many thanx for any help offered

  2. #2
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    Without seeing some of your code....no idea. Button 1-20 should be a simple load/play audio action (unless you're not providing all details).

    As for the scrolling text, use the On Timer event. There are some examples around the forum

  3. #3
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    You can use Page.CreateObject and Page.SetObjectScript to dynamically create buttons at run time. Shouldn't be that hard of a task just play with the coding, look at some examples and if you run into trouble, ask questions, post code and we will do our best to help.

    Tigg
    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

  4. #4
    Join Date
    Feb 2006
    Posts
    3

    Script Used

    Sorry about the failure to add the script.

    Here it is

    On Global Function

    -- keep track of the audio files
    audio_count = 1;

    --loads desired audio files into a table
    audio = {
    "Autoplay\\Audio\\chess\\Chess - 101 - Merano.ogg",
    "Autoplay\\Audio\\chess\\Chess - 102 - The Russian And Molokov- Where I Want To Be.ogg",
    "Autoplay\\Audio\\chess\\Chess - 103 - Opening Ceremony.ogg",
    "Autoplay\\Audio\\chess\\Chess - 104 - Quartet (A Model Of Decorum And Tranquility).ogg",
    "Autoplay\\Audio\\chess\\Chess - 105 - The American And Florence - Nobody's Side.ogg",
    "Autoplay\\Audio\\chess\\Chess - 106 - Chess.ogg",
    "Autoplay\\Audio\\chess\\Chess - 107 - Mountain Duet.ogg",
    "Autoplay\\Audio\\chess\\Chess - 108 - Florence Quits.ogg",
    "Autoplay\\Audio\\chess\\Chess - 109 - Embassy Lament.ogg",
    "Autoplay\\Audio\\chess\\Chess - 110 - Anthem.ogg",
    "Autoplay\\Audio\\chess\\Chess - 201 - Bangkok - One Night in Bangkok.ogg",
    "Autoplay\\Audio\\chess\\Chess - 202 - Heaven Help My Heart.ogg",
    "Autoplay\\Audio\\chess\\Chess - 203 - Argument.ogg",
    "Autoplay\\Audio\\chess\\Chess - 204 - I Know Him So Well.ogg",
    "Autoplay\\Audio\\chess\\Chess - 205 - The Deal No Deal.ogg",
    "Autoplay\\Audio\\chess\\Chess - 206 - Pity the Child.ogg",
    "Autoplay\\Audio\\chess\\Chess - 207 - Endgame.ogg",
    "Autoplay\\Audio\\chess\\Chess - 208 - Epilogue- You and I - The Story of Chess.ogg",
    };

    This is the on audio script

    if e_State == "Finish" then
    audio_count = audio_count + 1;
    --ensures a valid file will be loaded
    if audio_count < Table.Count(audio)+1 then
    Audio.Load(CHANNEL_USER1, audio[audio_count], true, false);
    end
    end


    this is the play all button script

    Audio.Stop(CHANNEL_ALL);
    Audio.Load(CHANNEL_USER1, audio[audio_count], true, false);


    This is one of the play track buttons (on click)

    Audio.Stop(CHANNEL_ALL);
    Audio.Load(CHANNEL_NARRATION, "AutoPlay\\Audio\\chess\\Chess - 101 - Merano.ogg", true, false);

    As you can see from reading the script. the button select will play the track selected but then carry on.. the play all function works fine. it's just the single track select where it falls short of what I'm trying to do

    thanks

  5. #5
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    Hmm, maybe a quick variable to check the state.

    if (e_State == "Finish") and playAll then
    audio_count = audio_count + 1;
    --ensures a valid file will be loaded
    if audio_count < Table.Count(audio)+1 then
    Audio.Load(CHANNEL_USER1, audio[audio_count], true, false);
    end
    end


    Audio.Stop(CHANNEL_ALL);
    playAll = true;
    Audio.Load(CHANNEL_USER1, audio[audio_count], true, false);

    Audio.Stop(CHANNEL_ALL);
    playAll = false;
    Audio.Load(CHANNEL_NARRATION, "AutoPlay\\Audio\\chess\\Chess - 101 - Merano.ogg", true, false);

  6. #6
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Here is an example on how to create buttons dynamically based on the table of audio file you have. The script will need some tweaking to make it work in your project and to make sure that buttons fit on the page and such. Give it a look, hopefully it will work out.

    Code:
    -- Button object properties table.
    tblBtnProps = {};
    tblBtnProps.ButtonFile = "AutoPlay\\Buttons\\10_112.btn";
    tblBtnProps.Text = "";
    tblBtnProps.FontName = "Verdana";
    tblBtnProps.FontSize = 15;
    tblBtnProps.FontWeight = FW_BOLD;
    tblBtnProps.FontItalic = false;
    tblBtnProps.FontStrikeout = false;
    tblBtnProps.FontScript = ANSI_CHARSET;
    tblBtnProps.FontAntiAlias = true;
    tblBtnProps.FontUnderline = false;
    tblBtnProps.XOffset = 0;
    tblBtnProps.YOffset = 0;
    tblBtnProps.Style = BTNSTYLE_STANDARD;
    tblBtnProps.ToggleState = BTN_TOGGLE_UP;
    tblBtnProps.Cursor = CURSOR_HAND;
    tblBtnProps.TooltipText = "";
    tblBtnProps.Y = 0;
    tblBtnProps.X = 0;
    tblBtnProps.Height = 25;
    tblBtnProps.Width = 60;
    tblBtnProps.Enabled = true;
    tblBtnProps.Visible = true;
    tblBtnProps.HighlightSound = SND_STANDARD;
    tblBtnProps.HighlightSoundFile = "";
    tblBtnProps.ClickSound = SND_STANDARD;
    tblBtnProps.ClickSoundFile = "";
    tblBtnProps.ColorNormal = Math.HexColorToNumber("FFFFFF");
    tblBtnProps.ColorHighlight = Math.HexColorToNumber("FFFFFF");
    tblBtnProps.ColorDown = Math.HexColorToNumber("FFFFFF");
    tblBtnProps.ColorDisabled = Math.HexColorToNumber("FFFFFF");
    tblBtnProps.Alignment = ALIGN_CENTER;
    
    
    nX = 20 -- starting horizontal position
    nY = 20 -- starting vertical Position
    
    for i,v in audio do
    	-- split the path of the audio to get the file name for the button
    	tbPath = String.SplitPath(audio[i]);
    	--set properties for text and page position of the button
    	tblBtnProps.Text = tbPath.Filename;
    	tblBtnProps.X = nX
    	tblBtnProps.Y = nY
    	--increment the vertical position of the button
    	nY = nY + tblBtnProps.Height + 5;
    	--create the button
    	Page.CreateObject(OBJECT_BUTTON, "AC_BTN_"..i, tblBtnProps);
    	strScript = "Audio.Load(CHANNEL_NARRATION, v, true, false);"
    	Page.SetObjectScript("AC_BTN_"..i, "On Click", strScript)
    end
    
    --create the play all button
    tblBtnProps.Text = "Play All";
    tblBtnProps.X = nX
    tblBtnProps.Y = nY
    Page.CreateObject(OBJECT_BUTTON, "AC_BTN_All", tblBtnProps);
    Page.SetObjectScript("AC_BTN_"..i, "On Click", "Play all script goes here")
    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

  7. #7
    Join Date
    Feb 2006
    Posts
    3
    thanx for the help guys, I can now scroll text to my hearts content lol.

Similar Threads

  1. Few simple questions...
    By daveinmb in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 03-22-2004, 01:49 AM
  2. quiz template - how to randomize questions
    By sue in forum AutoPlay Media Studio 5.0
    Replies: 8
    Last Post: 03-06-2004, 04:34 AM
  3. Weird Errors
    By RobbyH in forum AutoPlay Media Studio 4.0
    Replies: 9
    Last Post: 01-30-2003, 04:25 AM
  4. Help with randomizing questions and answers in a quiz application
    By TJ_Tigger in forum AutoPlay Media Studio 4.0
    Replies: 36
    Last Post: 11-21-2002, 02:36 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