mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
Hi all.

in my MP3 player ( i know, there a plenty of them ) i have a scrollbar wich i like to move from left to the right during the lengt of a song.

i have no clue how to do that. confused
Help is most appreciated.

Greetz
Aaron


Deridio fatum
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
It would help us, if you'd supply the code that you currently have, or tell us which mp3 player you're using (and if necessary, include a link to it).

Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
sorry, my fault. I'm writing my own mp3 player for mirc.
in mirc code that is. blush
i think it should be something like
Code:
alias soma { if ($dialog(soma)) { did -c 47 $calc(($soma.pos / $soma.length) * 200) } }

however; can't seem to let it work

Greetz
Aaron


Deridio fatum
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
I had this sample laying around, you might make it work with what this has
Code:
alias amp3 { dialog -m amp3 amp3 }

dialog amp3 {
  title "Completely Random Wav and MP3 Juke Box"
  size 5 95 300 40
  option dbu
  button "Cancel" 999, 0 0 0 0, cancel
  combo 1, 5 5 290 180, drop, sort, autohs
  scroll "", 2, 5 15 290 10, horizontal range 0 1000
  button "Folder", 3, 5 25 25 10
  button "Stop", 4, 30 25 25 10
  button "Reset", 5, 55 25 25 10
  button "", 6, 80 25 25 10
}

on *:dialog:amp3:init:0:{
  var %folder = $sdir($mp3dir,Select Folder,GO)
  .echo -q $findfile(%folder,*.mp3,0,did -a amp3 1 $1-)
  .echo -q $findfile(%folder,*.wav,0,did -a amp3 1 $1-)
  .enable #play_another_MP3
  did -c amp3 1 $r(1,$did(1).lines)
  randomreplay
}

on *:dialog:amp3:sclick:1:{
  splay stop
  randomreplay
}
on *:dialog:amp3:sclick:3:{
  splay stop
  did -r amp3 1
  var %folder = $sdir($mp3dir,Select Folder,GO)
  .echo -q $findfile(%folder,*.mp3,0,did -a amp3 1 $1-)
  .echo -q $findfile(%folder,*.wav,0,did -a amp3 1 $1-)
  did -c amp3 1 $r(1,$did(1).lines)
  randomreplay
}
on *:dialog:amp3:sclick:4:{ splay stop }
on *:dialog:amp3:sclick:5:{
  splay stop
  did -c amp3 1 $r(1,$did(1).lines)
  randomreplay
}


on *:dialog:amp3:sclick:999:{
  splay stop
  .timerscrollbarinjukebox off
  .disable #play_another_MP3
}
#play_another_MP3 off
on *:mp3end:{
  did -c amp3 1 $r(1,$did(amp3,1).lines)
  .timerplay_another 1 10 randomreplay
}
on *:waveend:{
  did -c amp3 1 $r(1,$did(amp3,1).lines)
  .timerplay_another 1 10 randomreplay
}
alias randomreplay { splay " $+ $did(amp3,1).seltext $+ "  |  .timerscrolldelay 1 1 rescrollamp3 }

alias randommp3jukeboxscroll {
  if ($insong == $true) { did -c amp3 2 $left($remove($round($calc($insong.pos / $insong.length),3),.) $+ 00 ,4)  |  rescrollamp3 }
  if ($inwave == $true) { did -c amp3 2 $left($remove($round($calc($inwave.pos / $inwave.length),3),.) $+ 00 ,4)  |  rescrollamp3 }
  if (($insong == $false) && ($inwave == $false)) { .timerscrollbarinjukebox off  |  did -c amp3 2 0 }
}
alias rescrollamp3 { .timerscrollbarinjukebox 0 0 randommp3jukeboxscroll }

#play_another_MP3 end

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
chopped it down a bit, hope its more clear
Code:
;;;;;;;;;;;;;;;;;;;
;scrollbar sample ;
;;;;;;;;;;;;;;;;;;;

alias mp3scroll dialog -m mp3scroll mp3scroll
dialog mp3scroll {
  title "Scrolling Along"
  size -1 -1 200 30
  option dbu
  combo 100, 0 0 200 100, sort drop
  scroll "", 200, 0 10 200 15, horizontal range 0 1000
  button "", 999, 0 0 0 0, cancel
}
on *:dialog:mp3scroll:init:0:{
  var %null = $findfile($mp3dir,*.mp3,0,did -a mp3scroll 100 $nopath($1-))
  did -c mp3scroll 100 $r(1,$did(mp3scroll,100).lines)
  splay " $+ $did(mp3scroll,100).seltext $+ "
  rescrollmp3scroll
}
on *:dialog:mp3scroll:sclick:999:{ .timermp3scroll off | splay stop }
on *:dialog:mp3scroll:sclick:100:{ splay stop | splay $did(mp3scroll,100).seltext | .timerscrolldelay 1 1 rescrollmp3scroll  }

alias mp3scrolleplay { splay " $+ $did(mp3scroll,100).seltext $+ "  |  .timerscrolldelay 1 1 rescrollmp3scroll }
alias remp3scroll {
  if ($insong == $true) { did -c mp3scroll 200 $left($remove($round($calc($insong.pos / $insong.length),3),.) $+ 00 ,4)  |  .timerscrolldelay 1 1 rescrollmp3scroll  }
  if ($insong == $false) { .timermp3scroll off }
}
alias rescrollmp3scroll { .timermp3scroll 0 0 remp3scroll }

Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
works great.
thank you very much for this routine

with thanks
Aaron


Deridio fatum

Link Copied to Clipboard