All pastes #837800 Raw Edit

Untitled

public text v1 · immutable
#837800 ·published 2007-12-29 22:40 UTC
rendered paste body
Menu * { 
  iPod!:/dialog -md eMP3 eMP3 
} 
alias wtfz { 
  var %x = 1 
  while ($did(emp3,2,%x)) { 
    if (!$did(emp3,2,$calc(%x + 1))) { 
      set %naabedie " $+ $readini(mp3player.ini,Directory,%playlist) $+ $did(emp3,2,$r(1,%x)) $+ .mp3 $+ " 
      did -ra emp3 999 $remove($nopath(%naabedie),.mp3) 
      if ($did(emp3,2,$calc(%x + 1))) && (%naabedie == $insong.fname) { set %naabedie " $+ $readini(mp3player.ini,Directory,%playlist) $+ $did(emp3,2,$calc(1 + %x)) $+ .mp3 $+ " 
        did -ra emp3 999 $remove($nopath(%naabedie),.mp3) 
      } 
      if (!$did(emp3,2,$calc(%x + 1))) && (%naabedie == $insong.fname) { set %naabedie " $+ $readini(mp3player.ini,Directory,%playlist) $+ $did(emp3,2,$calc(%x - 1)) $+ .mp3 $+ " } 
    did -ra emp3 999 $remove($nopath(%naabedie),.mp3)    } 
    inc %x 
  } 
} 
Dialog eMP3 { 
  Title "iPod Dutch V4.0 door Lorre" 
  size -1 -1 150 207 
  option dbu 
  Button "Afspeellijst 1", 1, 20 39 55 14 
  Button "Afspeellijst 2", 22, 75 39 55 14 
  Check "Set", 23, 3 40 17 10 
  Edit "Rating:", 90, 50 55 50 10, center read 
  Button "+", 89, 38 55 10 10 
  Button "-", 91, 102 55 10 10 
  List 2, 20 66 110 100, vsbar 
  Button "Speel", 8, 13 161 30 10 
  Button "Pauzeer", 10, 43 161 30 10 
  Button "Stop", 9, 103 161 30 10 
  Button "+", 50, 35 175 10 10 
  Edit "1", 51, 47 175 50 10, center read 
  Button "-", 52, 100 175 10 10 
  Button "Zeg", 92, 102 186 20 10 
  Button "+", 100, 122 186 10 10 
  Button "-", 101, 132 186 10 10 
  Check "Amsg", 123, 45 186 23 10 
  Check "Stil", 124, 75 186 23 10 
  button "Overslaan", 3, 73 161 30 10 
  check "Shuffle", 6, 3 175 25 10 
  button "Zet als volgende", 165, 15 196 62 10, center 
  button "Nieuwe volgende", 166, 77 196 52 10, center 
  check "Herhaal", 7, 115 175 27 10 
  text "Volgend Lied:", 992, 20 20 110 10, center 
  text "Momenteel:", 754, 20 2 110 9, center 
  edit "", 97, 20 9 119 10, center read 
  edit "", 999, 20 27 119 10, center read 
  edit "", 54, 1 186 40 10, center disable 
} 
on *:Dialog:eMP3:sclick:100: { 
  var %seek = $round($calc($calc($insong.length / 10 ) + $insong.pos),0) 
  splay -p seek %seek 
} 
on *:Dialog:eMP3:sclick:101: { 
  var %sek = $round($calc($insong.pos - $calc($insong.length / 10 )),0) 
  splay -p seek %sek 
} 
on *:Dialog:eMP3:sclick:92: { 
  set %true on 
  /iamsg 
} 
on *:Dialog:eMP3:sclick:1: { 
  set %playlist playlist1 
  if ($did(23).state == 1 ) { 
    did -r eMp3 2 
    .writeini mp3player.ini Directory Playlist1 $sdir(*,Select your music directory) 
    set %naamlijst1 $$?="Name for the Playlist?" 
    did -ra $dname 1 %naamlijst1 
  noop $findfile($readini(mp3player.ini,directory,Playlist1),*.mp3,0,did -a emp3 2 $nopath($left($1-,-4))) } 
  elseif ($did(23).state == 0 ) { 
    did -r $dname 2 
    noop $findfile($readini(mp3player.ini,directory,Playlist1),*.mp3,0,did -a eMP3 2 $nopath($left($1-,-4))) 
  } 
} 
on *:Dialog:eMP3:sclick:22: { 
  set %playlist playlist2 
  if ($did(23).state == 1 ) { 
    did -r eMp3 2 
    .writeini mp3player.ini Directory Playlist2 $sdir(*,Select your music directory) 
    set %naamlijst2 $$?="Name for the Playlist?" 
    did -ra $dname 22 %naamlijst2 
    noop $findfile($readini(mp3player.ini,directory,Playlist2),*.mp3,0,did -a emp3 2 $nopath($left($1-,-4))) 
  } 
  elseif ($did(23).state == 0 ) { 
    did -r $dname 2 
    noop $findfile($readini(mp3player.ini,directory,Playlist2),*.mp3,0,did -a emp3 2 $nopath($left($1-,-4))) 
  } 
} 
ON *:DIALOG:emp3:init:*:{ 
  mp3test 
  did -ra $dname 1 %naamlijst1 
  did -ra $dname 22 %naamlijst2 
  noop $findfile($readini(mp3player.ini,directory,%playlist),*.mp3,0,did -a eMP3 2 $nopath($left($1-,-4))) 
  did -ra $dname 51 $int($calc(( $vol(master) / 65535) * 100)) $+ % 
  if (%herhaal == on) did -c $dname 7 
  if (%shuffle == on) did -c $dname 6 
  if (%mute == on) { did -c $dname 124 | did -ra $dname 51 0% } 
  if (%amsg == on) did -c $dname 123 
  if ($insong.fname != $null) { 
    did -ra $dname 97 $remove($nopath($insong.fname),.mp3) 
  did -ra $dname 999 $remove($nopath(%naabedie),.mp3) } 
  did -ra $dname 90 Rating: $ano 
  did -ra $dname 54 00:00/00:00 
} 
on *:dialog:emp3:sclick:166:{ 
  wtfz 
  if ($did(emp3,6).state == 0) did -c $dname 6 
  did -ra emp3 999 $remove($nopath(%naabedie),.mp3) 
} 
alias mp3timer { 
  if ($left($did(emp3,54),4) == $right($did(emp3,54),4)) && (%mp3timer) { halt } 
  set %mp3timer $round($calc(($insong.pos / 1000) - $calc(($left(%pause,2) * 60) + $right(%pause,2))),0) 
  did -ra emp3 54 $iif($mid($duration(%mp3timer,3),4,3) == 00:,00 $+ $right($duration(%mp3timer,3),3),$remove($duration(%mp3timer,3),00:)) $+ / $+ $iif($mid($duration($calc($insong.length / 1000),3),4,3) == 00:,00 $+ $right($duration($calc($insong.length / 1000),3),3),$remove($duration($calc($insong.length / 1000),3),00:)) 
} 
alias mp3test { 
  unset %mp3timer 
  if (%pause) { 
    set %mp3timer $calc(($left(%pause,2) * 60) + $right(%pause,2)) 
    timermp3 $round($calc(($insong.length / 1000) - $calc(($left(%pause,2) * 60) + $right(%pause,2))),0) 1 /mp3timer 
    unset %pause 
    halt 
  } 
  if (!$timer(mp3)) timermp3 $calc($round($insong.length,0) / 1000)) 1 /mp3timer 
} 
on *:dialog:emp3:close:0:{ 
  $iif($did(emp3,7).state == 1, set %herhaal on, set %herhaal off) 
  $iif($did(emp3,6).state == 1, set %shuffle on, set %shuffle off) 
  $iif($did(emp3,123).state == 1, set %amsg on, set %amsg off) 
  $iif($did(emp3,124).state == 1, set %mute on, set %mute off) 
  /timermp3 off 
  /timeriamsg off 
  splay stop 
} 

on *:dialog:emp3:sclick:165:{ set %naabedie $qt($findfile($readini(mp3player.ini,Directory,%playlist),$+(*,$did(2).seltext,.mp3),1,)) 
  did -ra emp3 999 $remove($nopath(%naabedie),.mp3) 
} 

on *:dialog:eMP3:sclick:6:{ did -u $dname 7 
  if ($did(6).state == 1) { wtfz } 
  if ($did(6).state == 0) { inext } 
} 
on *:dialog:emp3:sclick:3:{ 
  skip 
} 
alias skip { 
  timeriamsg off 
  splay -p %naabedie 
  did -ra emp3 999 $remove($nopath(%naabedie),.mp3) 
  did -ra emp3 97 $remove($nopath($insong.fname),.mp3) 
  did -ra emp3 90 Rating: $ano 
  if ($did(emp3,123).state == 1) iamsg 
  if ($did(emp3,6).state == 1) /wtfz 
  if ($did(emp3,6).state == 0) && ($did(emp3,7).state == 0) inext 
  if ($did(emp3,7).state == 1) set %naabedie $insong.fname 
  mp3test 
} 
on *:dialog:emp3:sclick:7:{ /did -u $dname 6 
  if ($did(7).state == 1) { set %naabedie $insong.fname 
  did -ra $dname 999 $remove($nopath($insong.fname),.mp3) } 
  if ($did(7).state == 0) { 
    if ($did(6).state == 1) { /wtfz | halt } 
    inext 
  } 
} 
on *:mp3end:{ 
  splay -p %naabedie 
  did -ra emp3 97 $remove($nopath($insong.fname),.mp3) 
  did -ra emp3 999 $remove($nopath(%naabedie),.mp3) 
  did -ra emp3 90 Rating: $ano 
  if ($did(emp3,123).state == 1) iamsg 
  if ($did(emp3,7).state == 1) set %naabedie $insong.fname 
  if ($did(emp3,6).state == 1) wtfz 
  if ($did(emp3,6).state == 0) && ($did(emp3,7).state == 0) inext 
} 
on *:Dialog:emp3:dclick:2: { 
  if (%dinges == on) splayfragment  
  if ($did(emp3,7).state == 1) { 
    set %naabedie $qt($findfile($readini(mp3player.ini,Directory,%playlist),$+(*,$did(2).seltext,.mp3),1,)) 
    splay -p $qt($findfile($readini(mp3player.ini,Directory,%playlist),$+(*,$did(2).seltext,.mp3),1,)) 
    if (%dinges == on) splayfragment 
    did -ra $dname 97 $remove($nopath($insong.fname),.mp3) 
    did -ra $dname 90 Rating: $ano 
    did -ra $dname 93 Tp: $hugo  
    did -ra emp3 999 $remove($nopath(%naabedie),.mp3) 
    mp3test 
    if ($did(emp3,123).state == 1) { iamsg } 
  } 
  else { 
    splay -p $qt($findfile($readini(mp3player.ini,Directory,%playlist),$+(*,$did(2).seltext,.mp3),1,)) 
    did -ra $dname 97 $remove($nopath($insong.fname),.mp3) 
    did -ra $dname 90 Rating: $ano 
    did -ra emp3 999 $remove($nopath(%naabedie),.mp3) 
    if ($did(EMP3,123).state == 1) { /iamsg } 
    $iif($did(6).state == 1, wtfz, inext) 
    if (%dinges == on) Splayfragment 
  } 
} 

ON *:DIALOG:eMP3:sclick:8:{  
  if (%dinges == on) splayfragment 
  if ($insong.pause) {  splay resume 
    set %pause $left($did(54),5) 
  halt  } 
  if ($did(7).state) { 
    did -ra $dname 90 Rating: $ano 
    set %naabedie $qt($findfile($readini(mp3player.ini,Directory,%playlist),$+(*,$did(2).seltext,.mp3),1,)) 
    if ($did(emp3,123).state) { iamsg } 
    splay -p $qt($findfile($readini(mp3player.ini,Directory,%playlist),$+(*,$did(2).seltext,.mp3),1,)) 
    did -ra $dname 97 $remove($nopath($insong.fname),.mp3) 
  halt } 
  splay -p $qt($findfile($readini(mp3player.ini,Directory,%playlist),$+(*,$did(2).seltext,.mp3),1,)) 
  did -ra $dname 97 $remove($nopath($insong.fname),.mp3) 
  if ($did(EMP3,123).state == 1) { iamsg } 
  $iif($did(6).state == 1,wtfz,inext) 
} 
ON *:DIALOG:eMP3:Sclick:9:{ 
  /splay stop 
  /timermp3 off 
  timeriamsg off 
  did -ra $dname 90 Rating: 
  did -ra $dname 97 Now playing: Nothing 
  did -ra $dname 999 Next song: Nothing 
  did -ra $dname 93 Tp: 
  did -ra $dname 54 00:00/00:00 
} 
on *:dialog:eMP3:sclick:50:{ 
  /vol -v $calc( $vol(master) + 2500) 
  did -ra $dname 51 $int($calc(( $vol(master) / 65535) * 100)) $+ % 
} 
on *:dialog:eMP3:sclick:123: { 
  if ($did(EMP3,123).state == 0) { set %Amsg Lmao } 
  if ($did(EMP3,123).state == 1) { 
    set %Amsg On 
    timeriamsg off 
  } 
} 
ON *:DIALOG:eMP3:sclick:124:{ 
  if ($did(eMP3,124).state == 0) { vol -vu2 
    did -ra $dname 51 $int($calc(( $vol(master) / 65535) * 100)) $+ % 
  } 
  if ($did(eMP3,124).state == 1) {  vol -vu1 
    did -ra $dname 51 0% 

  } 
} 

on *:dialog:eMP3:sclick:52:{ 
  /vol -v  $calc( $vol(master) - 2500) 
  did -ra $dname 51 $int($calc(( $vol(master) / 65535) * 100)) $+ % 
} 
ON *:DIALOG:eMP3:sclick:10:{ 
  set %duurt $calc($calc($calc($floor($calc($insong.length / 60000)) * 60) + $floor($calc($remove($calc($insong.length / 60000),$left($calc($insong.length / 60000),2)) / 10 * 60 / 100000))) - $did(54)) 
  /splay pause 
} 

alias inext { 
  var %x = 1 
  while ($did(eMP3,2,%x)) { 
    if (!$did(emp3,2,$calc(%x + 2))) { 
      set %naabedie " $+ $readini(mp3player.ini,Directory,%playlist) $+ $did(emp3,2,1) $+ .mp3 $+ " 
      did -ra emp3 999 $remove($nopath(%naabedie),.mp3)  
      break 
    } 
    if ($did(eMP3,2,%x) == $remove($nopath($insong.fname),.mp3)) { 
      set %naabedie $qt($+($readini(mp3player.ini,Directory,%playlist),$did(emp3,2,$calc(%x + 2 )),.mp3)) 
      did -ra emp3 999 $remove($nopath(%naabedie),.mp3) 
      break 
    } 
    inc %x 
  } 
} 
alias mp3go { if (!$1) { //echo 4Input Required. | halt } 
  if ($left($1,1) != $chr(35)) { //echo 4Invalid Channel. | halt } 
  set %stop [ $+ [ $1 ] ] blaat 
  //echo 4Amsg naar $1 is van start gegaan. 
} 
alias mp3show { //echo 4De AMSG gaat naar: 
  var %x = 1 
  while ($var(stop*,%x)) { 
    echo -a 4 $+ $right($v1,-5) 
  inc %x } 
} 
alias mp3stop { if (!$1) { //echo 4Input Required. | halt } 
  if ($left($1,1) != $chr(35)) { //echo 4Channel is niet bruikbaar. | halt } 
  if (%stop [ $+ [ $1 ] ] == $null) { //echo 4The amsg wasn't going to $1 anyway. | halt } 
  unset %stop [ $+ [ $1 ] ] 
  //echo 4Amsg to $1 has been stopped. 
} 
alias iamsg { 
  timeriamsg 1 $iif(%true == on,0,15) mimsg 
  if (%true) unset %true 
} 
alias mimsg { 
  dani 
  track $remove($nopath($insong.fname),.mp3) 
  miamsg 
  unset %track 
  unset %artist 
  unset %dani_l11 
} 
alias miamsg { 
  if ($status != connected) //echo 14[12 $+ $me $+ 's Mp314] 14Artist04:07 %artist 04» 14Track04:07 %track 04» 14Length04:07 $iif($mid($duration($calc($insong.length / 1000),3),4,3) == 00:,00 $+ $right($duration($calc($insong.length / 1000),3),3),$remove($duration($calc($insong.length / 1000),3),00:)) minutes 14Rating04: 07 $+ %Dani_l11 
  else { 
    var %x = 1 
    while ($chan(%x)) {  
      if (%stop [ $+ [ $chan(%x) ] ] != $null) && ($chan(%x) ischan) { msg $chan(%x) 14[7Lorre's Ipod14] 7Artist14: %artist 04» 7Song14: %track 4» 7Lenght14: $iif($mid($duration($calc($insong.length / 1000),3),4,3) == 00:,00 $+ $right($duration($calc($insong.length / 1000),3),3),$remove($duration($calc($insong.length / 1000),3),00:)) Minutes. 7Rating14:  $+ %Dani_l11 } 
      inc %x 
    } 
  } 
} 
alias dani { 
  set %dani $readini(mp3player.ini,Rating,$replace($remove($nopath($insong.fname),.mp3), $chr(32),+)) 
  if (%dani == 1) set %dani_l11 7¤14-¤-¤-¤-¤ 
  if (%dani == 1.5) set %dani_l11 7¤-14¤-¤-¤-¤ 
  if (%dani == 2) set %dani_l11 7¤-¤14-¤-¤-¤ 
  if (%dani == 2.5) set %dani_l11 7¤-¤-14¤-¤-¤ 
  if (%dani == 3) set %dani_l11 7¤-¤-¤14-¤-¤ 
  if (%dani == 3.5) set %dani_l11 7¤-¤-¤-14¤-¤ 
  if (%dani == 4) set %dani_l11 7¤-¤-¤-¤14-¤ 
  if (%dani == 4.5) set %dani_l11 7¤-¤-¤-¤-14¤ 
  if (%dani == 5) set %dani_l11 7¤-¤-¤-¤-¤ 
  if (%dani == $null) set %dani_l11 14¤-¤-¤-¤-¤ 
} 
alias track { 
  set %track $right($remove($nopath($insong.fname),.mp3),- $+ $calc($calc($pos($remove($nopath($insong.fname),.mp3),$chr(32) $+ - $+ $chr(32))) + 2)) 
  if (%track == $null) set %track $1- 
  set %artist $left($remove($nopath($insong.fname),.mp3),$calc($pos($remove($nopath($insong.fname),.mp3),$chr(32) $+ - $+ $chr(32)) -1)) 
  if (%artist == $null) set %artist Unknown 
} 
alias rating { 
  if ($1 == $null) //echo Rating for $remove($nopath($insong.fname),.mp3) is $readini(mp3player.ini,Rating,$replace($remove($nopath($insong.fname),.mp3), $chr(32),+)) $+. 
  if ($1 != $null) { 
    set %rating $replace($readini(mp3player.ini,Directory,%playlist) $+ $1- $+ .mp3, $chr(32),+) $+ . 
    //echo 4Rating for $1- is $readini(mp3player.ini,rating,%rating) 
  } 
} 
on *:Dialog:eMP3:sclick:89: { 
  if ($readini(mp3player.ini,Rating,$replace($remove($nopath($insong.fname),.mp3), $chr(32),+)) == 5) //echo -a 4Je kan geen rating geven die hoger is dan 5. 
  else .writeini mp3player.ini Rating $replace($remove($nopath($insong.fname),.mp3), $chr(32),+) $calc($readini(mp3player.ini,Rating,$replace($remove($nopath($insong.fname),.mp3), $chr(32),+)) + 0.5 ) 
  did -ra $dname 90 Rating: $ano 
} 
on *:Dialog:eMP3:sclick:91: { 
  if ($readini(mp3player.ini,Rating,$replace($remove($nopath($insong.fname),.mp3), $chr(32),+)) == 1) //echo -a 4Je kan geen rating geven die lager is dan 1. 
  else .writeini mp3player.ini Rating $replace($remove($nopath($insong.fname),.mp3), $chr(32),+) $calc($readini(mp3player.ini,Rating,$replace($remove($nopath($insong.fname),.mp3), $chr(32),+)) - 0.5 ) 
  did -ra $dname 90 Rating: $ano 
} 
alias ano { 
  if ($readini(mp3player.ini,Rating,$replace($remove($nopath($insong.fname),.mp3), $chr(32),+)) == $null) return 0 
  else { 
    return $readini(mp3player.ini,Rating,$replace($remove($nopath($insong.fname),.mp3), $chr(32),+)) 
  } 
}