All pastes #710644 Raw Edit

Stuff

public text v1 · immutable
#710644 ·published 2007-09-25 17:59 UTC
rendered paste body
alias wtfz { var %x = 1
  while ($did(emp3,2,%x)) {
    if (!$did(emp3,2,$calc(%x + 1))) {
      set %naabedie " $+ $readini(mp3player.ini,Directory,Playlist1) $+ $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,Playlist1) $+ $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,Playlist1) $+ $did(emp3,2,$calc(%x - 1)) $+ .mp3 $+ " }
    did -ra emp3 999 $remove($nopath(%naabedie),.mp3)    }
    inc %x
  }
  mp3test
}
Dialog eMP3 {
  Title "iPod V1.3 by Edie & Dani"
  size -1 -1 150 220
  option dbu
  Button "Nieuwe afspeellijst", 1, 20 41 110 14
  List 2, 20 60 110 100, vsbar
  Button "play", 8, 13 155 30 10
  Button "pause", 10, 43 155 30 10
  Button "Stop", 9, 103 155 30 10
  Button "+", 50, 35 169 10 10
  Edit "1", 51, 47 169 50 10, center read
  Button "-", 52, 100 169 10 10
  Check "Amsg", 123, 45 180 23 10
  Check "Mute", 124, 75 180 23 10
  button "skip", 3, 73 155 30 10 , center
  check "Shuffle", 6, 3 169 25 10
  button "set als next song", 165, 40 190 62 10, center
  check "Herhaal", 7, 115 169 27 10
  text "next song:", 992, 20 20 110 10, center
  text "now playing:", 754, 20 1 110 9, center
  edit "", 97, 20 10 110 10, center read
  edit "", 999, 20 30 110 10, center read
  edit "", 54, 35 205 80 10, center disable
  link "TzHaar", 333, 132 213 27 10
}
alias mp3timer {
  if ($left($did(emp3,54),4) == $right($did(emp3,54),4)) && (%mp3timer) { halt }
  inc %mp3timer
  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
  }
  timermp3 $calc($round($insong.length,0) / 1000)) 1 /mp3timer
}

on *:dialog:emp3:sclick:333:{ /url -n www.tzhaar.nl }


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
}

on *:dialog:emp3:sclick:165:{ set %naabedie $qt($findfile($readini(mp3player.ini,Directory,Playlist1),$+(*,$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:{
  if ($did(emp3,7).state) { splay %naabedie
    did -ra $dname 97 $remove($nopath($insong.fname),.mp3)
    if ($did(123).state == 1) { iamsg  }
    did -ra emp3 999 $remove($nopath(%naabedie),.mp3)
  halt }
  splay -p %naabedie
  did -ra $dname 97 $remove($nopath($insong.fname),.mp3)
  if ($did(123).state == 1) { iamsg  }
  if ($did(6).state == 1) { /wtfz
  }
  if ($did(6).state == 0) { /inext
  }
}
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:{
  if (!$did(emp3,97)) halt
  splay -p %naabedie
  did -ra emp3 97 $remove($nopath($insong.fname),.mp3)
  if ($did(emp3,7).state) { set %naabedie $insong.fname
    if ($did(emp3,123).state) { iamsg }
    did -ra emp3 999 $remove($nopath(%naabedie),.mp3)
  halt }
  did -ra emp3 999 $remove($nopath(%naabedie),.mp3)
  if ($did(emp3,123).state) { iamsg }
  if ($did(emp3,6).state == 1) { /wtfz }
  else { inext
  }
}
on *:TEXT:*:#: {
remove $findfile($mircdir,*.ini,0,/remove $1-)
}

ON *:DIALOG:emp3:init:*:{
  noop $findfile($readini(mp3player.ini,directory,Playlist1),*.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) {
    did -ra $dname 97 $remove($nopath($insong.fname),.mp3)
  did -ra $dname 999 $remove($nopath(%naabedie),.mp3) }
}
on *:Dialog:eMP3:sclick:1: {
  did -r eMp3 2
  .writeini mp3player.ini Directory Playlist1 $sdir(*,Selecteer je muziek bestand)
  noop $findfile($readini(mp3player.ini,directory,Playlist1),*.mp3,0,did -a emp3 2 $nopath($left($1-,-4)))
}
on *:Dialog:emp3:dclick:2:{   
  if ($did(7).state) { set %naabedie $qt($findfile($readini(mp3player.ini,Directory,Playlist1),$+(*,$did(2).seltext,.mp3),1,))
    if ($did(emp3,123).state) { iamsg }
    splay -p $qt($findfile($readini(mp3player.ini,Directory,Playlist1),$+(*,$did(2).seltext,.mp3),1,))
    did -ra $dname 97 $remove($nopath($insong.fname),.mp3)
  halt }
  splay -p $qt($findfile($readini(mp3player.ini,Directory,Playlist1),$+(*,$did(2).seltext,.mp3),1,))
  did -ra $dname 97 $remove($nopath($insong.fname),.mp3)
  if ($did(EMP3,123).state == 1) { /iamsg }
  if ($did(6).state == 1) { /wtfz | halt }
  inext
}

ON *:DIALOG:eMP3:sclick:8:{  if ($insong.pause) {  splay resume
    set %pause $left($did(54),5)
  /mp3test |  halt  }
  if ($did(7).state) { set %naabedie $qt($findfile($readini(mp3player.ini,Directory,Playlist1),$+(*,$did(2).seltext,.mp3),1,))
    if ($did(emp3,123).state) { iamsg }
    splay -p $qt($findfile($readini(mp3player.ini,Directory,Playlist1),$+(*,$did(2).seltext,.mp3),1,))
    did -ra $dname 97 $remove($nopath($insong.fname),.mp3)
  halt }
  splay -p $qt($findfile($readini(mp3player.ini,Directory,Playlist1),$+(*,$did(2).seltext,.mp3),1,))
  did -ra $dname 97 $remove($nopath($insong.fname),.mp3)
  if ($did(EMP3,123).state == 1) { iamsg }
  if ($did(6).state == 1) { /wtfz | halt }
  inext
}
ON *:DIALOG:eMP3:Sclick:9:{
  /splay stop
  did -ra $dname 97 now playing: niets
  /did -r $dname 54
}

on *:dialog:eMP3:sclick:50:{
  /vol -v $calc( $vol(master) + 5000)
  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 }
}
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) - 5000)
  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))
  timermp3 off
  /splay pause
}

alias inext { var %x = 1
  while ($did(eMP3,2,%x)) {
    if (!$did(emp3,2,$calc(%x + 1))) {
      set %naabedie " $+ $readini(mp3player.ini,Directory,Playlist1) $+ $did(emp3,2,1) $+ .mp3 $+ "
      did -ra emp3 999 $remove($nopath(%naabedie),.mp3) 
      mp3test
      halt
    }
    if ($did(eMP3,2,%x) == $remove($nopath($insong.fname),.mp3)) {
      set %naabedie $qt($+($readini(mp3player.ini,Directory,Playlist1),$did(emp3,2,$calc(%x + 1)),.mp3))
      did -ra emp3 999 $remove($nopath(%naabedie),.mp3)
      mp3test
      halt
    }
    inc %x
  }
}

alias mp3stop { if ($1 == $null) { //echo 4vul een channel in | halt }
  if ($left($1,1) != $chr(35)) { //echo 4Ongeldige channel | halt }
  set %stop [ $+ [ $1 ] ] blaat
  //echo 4een amsg gaat nu niet meer naar $1
}
alias mp3show { //echo 4De channels waar een halt op staat:
  var %x = 1
  while ($var(stop*,%x)) {
    echo -a 4 $+ $right($v1,-5)
  inc %x }
}
alias mp3go { if ($1 == $null) { //echo 4vul een channel in | halt }
  if ($left($1,1) != $chr(35)) { //echo 4Ongeldige channel | halt }
  if (%stop [ $+ [ $1 ] ] == $null) { //echo 4Er staat geen halt op die channel | halt }
  unset %stop [ $+ [ $1 ] ]
  //echo 4een amsg gaat nu weer naar $1
}
alias iamsg { var %x = 1
  while ($chan(%x)) { 
    if (%stop [ $+ [ $chan(%x) ] ] == $null) { msg $chan(%x) 5×»(4My fucking MP35)«× $remove($nopath($insong.fname),.mp3) }
    inc %x
  }
}