small mp3 player

By eXiled on Oct 12, 2007

Simple and small, click sel and you're ready to go. Everything else should be easy to figure out. If not, ask and you will be assisted. The scroll to the very right of the dialog is a volume bar, feel free to edit that as you like. Hope this mp3 player meets the criteria I received through comments. :) /mp3 to open

dialog mp3 {
  title "Mp3 player"
  size -1 -1 271 71
  option pixels
  scroll "", 1, 4 2 16 64, left range 0 100
  edit "", 2, 27 4 238 20, read autohs
  edit "", 4, 28 26 88 20, read
  button "Play", 3, 157 25 36 21
  button "Paus.", 5, 193 25 36 21
  button "Stop", 6, 229 25 36 21
  scroll "", 8, 24 52 242 16, horizontal top range 0 100
  button "Sel:", 10, 121 25 36 21
}

on *:dialog:mp3:close:0:{ if ($inmp3) { splay stop | .timerlength off } }

on *:dialog:mp3:sclick:*:{
  if ($did = 3) { 
    splay -p %mp3_
    did -ra $dname 2 $iif(!$sound($insong.fname).artist, $remove($nopath(%mp3_),.mp3), $sound($insong.fname).title - $sound($insong.fname).artist)
    .timerlength 0 1 /mp3_seek
  }
  if ($did = 5) { 
    if (!%mp3pause) { 
      %mp3pause = 1
      splay pause
      .timerlength -p
      halt
    }
    elseif (%mp3pause = 1) { 
      splay resume 
      .timerlength -r
      unset %mp3pause
      halt
    }
  }
  if ($did = 6) { 
    if ($inmp3) { 
      splay stop
      .timerlength off
      did -r $dname 2,4
    }
  }
  if ($did = 10) { 
    set %mp3_ $$sfile(C:,Choose file to play) 
    splay -p %mp3_
    did -ra $dname 2 $iif(!$sound($insong.fname).artist, $remove($nopath(%mp3_),.mp3), $sound($insong.fname).title - $sound($insong.fname).artist)
    .timerlength 0 1 /mp3_seek
  }
}

;nT0xIc8 - scroll (edit - eXiled)
on *:dialog:mp3:scroll:8:{
  if ($insong) { 
    var %t = $round($calc($did(mp3,8).sel / 22000 * $insong.length),0) 
    splay seek $calc((%t + $did(mp3,8).sel) * 200) 
  } 
} 

on *:dialog:mp3:scroll:1:{ 
  var %t = $round($calc($did(mp3,1).sel / 65535),0) 
  vol -v $calc((%t + $did(mp3,1).sel) * 700) 
}

alias -l mp3_seek {
  ;nt0xic8 - scroll
  did -c mp3 8 $round($calc($calc($insong.pos / $insong.length) * 100),0) 
  did -ra mp3 4 $backlength
}

alias mp3 { dialog $iif(!$dialog(mp3),-m,-v) mp3 mp3 }
alias -l backlength { if ($insong) { return $+(-,$gmt($calc($calc($insong.length / 1000) - $calc($insong.pos / 1000)),nn:ss)) } }

Comments

Sign in to comment.
L0ckp1ck   -  Feb 16, 2010

this is pretty good, could use a /say option and u have to keep finding the folders your songs are in

 Respond  
Tippy   -  Oct 19, 2007

I can not get that right!

Maybe someday i will learn lol :)

 Respond  
Tippy   -  Oct 19, 2007

[quote=\"exiled\"][/quote]

No problem It\'s just a option :) It\'s good for your first/second script on here!

 Respond  
Kyousoukyoku   -  Oct 14, 2007

Pretty cool, but why not make this a Command-line mp3 player? Since you are already using the titlebar anyway. ;) Do like the idea though, very nice.

 Respond  
eXiled   -  Oct 14, 2007

Nice I like it but who\'s gonna want a mp3 countdown my advice is make a mp3 player with this countdown installed so if they get one thing they get the other as well.Your good though no bugs keep it up.

Regards,

Tippy

Thanks Tippy. This is just a little snippet I decided to make for other people to use. The really cool part in this snippet was the $backlength, and that was the main focus. The whole point was to introduce something different. Thanks again Tippy, and one day I will release a full audio player on here. :P

 Respond  
Tippy   -  Oct 14, 2007

Nice I like it but who\'s gonna want a mp3 countdown my advice is make a mp3 player with this countdown installed so if they get one thing they get the other as well.Your good though no bugs keep it up.

Regards,

Tippy

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.