tAmp

By tai on Oct 08, 2007

Simple dialog and code to play a file. Supports Wav, MIDI, and mp3 files. Simple to use, type /t-amp and then type ej. to select a song from the C: hard drive. The "-" gives the option to give it's basic format or a slightly larger format. Supports a repeat option as well.

Regards,

tai

;: tAmp - arucard(tai)
;: "ej." button to select a song
;: /t-amp to open
;: The "-" displays the dialog in a basic format or extended
;: Remember, ripping is awful and hated. Don't do it. 
;: My regards,
;:
;: arucard(tai)

dialog tamp {
  title "tai-amp"
  size -1 -1 130 42
  option dbu
  button "=", 2, 4 3 23 12
  button "|>", 3, 27 3 23 12
  button "||", 4, 50 3 23 12
  scroll "", 6, 4 17 125 8, range 0 100 horizontal bottom
  button "ej.", 7, 73 3 18 12
  radio "rep.", 8, 91 3 19 12, flat push
  edit "", 5, 3 30 123 10, read autohs
  button "-", 1, 110 3 18 12
}

on *:dialog:tamp:init:0:{ 
  did -a $dname 5 $remove($nopath(%tai-amp.insong),.mp3,.midi,.wav,)
  tai-amp -ply 
}

on *:dialog:tamp:close:0: tai-amp -s  

alias t-amp dialog $iif(!$dialog(tamp),-m tamp,-v tamp) tamp

on *:dialog:tamp:sclick:*:{ 
  if ($did = 7) tai-amp -ej
  if ($did = 2) tai-amp -s
  if ($did = 4) tai-amp -pa
  if ($did = 8) tai-amp -r
  if ($did = 3) tai-amp -ply
  if ($did = 1) {
    if (!%tai-amp.insong.dialog) { 
      dialog -s tamp -1 -1 260 32 
      set %tai-amp.insong.dialog dude
      halt
    }
    else { 
      unset %tai-amp.insong.dialog 
      dialog -s tamp -1 -1 260 90
      halt
    }
  }
}

;nt0xic8 - scroll
on *:dialog:tamp:scroll:6:{
  if ($insong) { 
    var %t $round($calc($did(tamp,6).sel / 22000 * $insong.length),0) 
    splay seek $calc((%t + $did(tamp,6).sel) * 200) 
  } 
} 

alias tai-amp { 
  if ($dialog(tamp)) { 
    if ($1) { 
      if ($v1 = -ej) { 
        var %ej. $sfile(C:,choose a file to play)
        set %tai-amp.insong %ej.
        splay %ej.
        did -ra tamp 5 $remove($nopath(%tai-amp.insong),.mp3,.midi,.wav,)
        .timerseek 0 1 /tai-amp.scroll
      }
      if ($v1 = -s && $insong) { splay stop | .timerseek off }
      if ($v1 = -ply && %tai-amp.insong) { 
        splay %tai-amp.insong  
        did -ra tamp 5 $remove($nopath(%tai-amp.insong),.mp3,.midi,.wav)
        ;nt0xic8 - scroll
        .timerseek 0 1 /tai-amp.scroll
      }
      if ($v1 = -pa) { 
        if (!%tai-amp.pause) { 
          set %tai-amp.pause !
          splay pause
          halt 
        }
        else { 
          unset %tai-amp.pause
          splay resume
          halt
        }
      }
      if ($v1 = -r) {
        if (!%tai-amp_.status_repeat) { 
          set %tai-amp_.repeat true | set %tai-amp_.status_repeat 1 | halt
        }
        else { unset %tai-amp_.repeat %tai-amp_.status_repeat | halt }
      }
    }
  }
}
;nt0xic8 - scroll
alias tai-amp.scroll { did -c tamp 6 $round($calc($calc($insong.pos / $insong.length) * 100),0) }
on *:MP3END: if (%tai-amp_.repeat = true) tai-amp -ply
on *:WAVEEND: if (%tai-amp_.repeat = true) tai-amp -ply
on *:MIDIEND: if (%tai-amp_.repeat = true) tai-amp -ply

Comments

Sign in to comment.
Kyousoukyoku   -  Oct 09, 2007

Pretty simple, yet easy to use. 5/10

 Respond  
tai   -  Oct 08, 2007

Yeah, that would be pretty cool. I decided to release a basic version first while developing the full version. The full version will be a LOT better, but I figured I might as well put the beta out. Thanks.

 Respond  
RubixCube   -  Oct 08, 2007

It\'s pretty nice, simple, and clean. Coding looks a bit disorganized but that\'s okay. I\'d have to say this is pretty useful. It would be great if you supported playlist capabilities. =)

 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.