Announcement

Collapse
No announcement yet.

Progress bar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Progress bar

    People, urgent need, I created a music player, and I need to place a progress bar that accompanies the beginning till the music teminar.
    Can anyone help me please?

  • #2
    Originally posted by Emerson Costa View Post
    People, urgent need, I created a music player, and I need to place a progress bar that accompanies the beginning till the music teminar.
    Can anyone help me please?
    I am sure there are many examples about for this from along time back, but thse kind of apps never take off so there just created to get started.
    Plugins or Sources MokoX
    BunnyHop Here

    Comment


    • #3
      Already I rummaged through everything here, and found nehum example.

      Comment


      • #4
        Originally posted by Emerson Costa View Post
        Already I rummaged through everything here, and found nehum example.
        I know for a fact there are example about I used them myself along time ago so just dig about, I don't have time to dig or I would point you to them.
        Plugins or Sources MokoX
        BunnyHop Here

        Comment


        • #5
          I haven't tested it but the basic idea should be something like this:

          Put this code after you load the music for e.g.:
          Code:
          -- Load music
          Audio.Load(CHANNEL_BACKGROUND, "AutoPlay\\Audio\\song.mp3", true, false);
          
          nLength = Audio.GetLength(CHANNEL_BACKGROUND);
          Progress.SetRange("Progress1", 0, nLength);
          Progress.SetStep("Progress1", 1);
          Progress.SetCurrentPos("Progress1", 0);
          
          Page.StartTimer(1000, 1);
          onAudio event of the page: (This piece of code will stop the timer once the music finished, is paused or is stopped. Remember to start the timer again if you have a resume button)
          Code:
          if (e_State ~= "Play") and (e_Channel == CHANNEL_BACKGROUND) then
          	Page.StopTimer(1);
          end
          onTimer event:
          Code:
          if (e_ID == 1) then
          	Progress.StepIt("Progress1");
          end

          Comment

          Working...
          X