All pastes #79864 Raw Edit

Someone

public text v1 · immutable
·published 2006-07-05 20:14 UTC
rendered paste body
/np {



  set %title $dll(r1dll.dll, GetCurrentWinampSong, 0)

  if (%title == 0) {

    /echo $active *** No supported audio player found!

    return

  }



  set %kbps $dll(r1dll.dll, GetCurrentWinampSongKbps, 0)

  set %khz $dll(r1dll.dll, GetCurrentWinampSongKHz, 0)

  set %totaltime $dll(r1dll.dll, GetCurrentWinampSongTotalTime, 0)

  set %elapsedtime $dll(r1dll.dll, GetCurrentWinampSongElapsedTime, 0)

  set %channels $dll(r1dll.dll, GetCurrentWinampSongChannels, 0)

  set %filename $dll(r1dll.dll, GetCurrentWinampSongFileName, 0)



  set %t_mins 0

  set %e_mins 0



  set %t_secs %totaltime

  if (%totaltime == -1) {

    set %fileformat %filename

    goto totalloop

  }



  set %filesize 0



  if (%filename != $null) {

    set %filesize $file(%filename).size

    set %filesize $round($calc(%filesize / 1024 / 1024),2)

    set %fileformat $upper($gettok(%filename,-1, 46))

  }



  :totalloop

  if (%t_secs < 60) {

    goto endtotalloop

  }

  inc %t_mins

  dec %t_secs 60

  goto totalloop

  :endtotalloop



  set %e_secs %elapsedtime

  :elapsedloop

  if (%e_secs < 60) {

    goto endelapsedloop

  }

  inc %e_mins

  dec %e_secs 60

  goto elapsedloop

  :endelapsedloop



  if (%t_secs < 10) {

    set %filler2 0

  }

  if (%e_secs < 10) {

    set %filler 0

  }

  if (%t_secs <= 0) {

    set %total_string 

    if (%fileformat == $null) {

      set %file_string Streaming@ $+ %kbps $+ kbps

      goto ihatemircselse

    }

    if (%kbps == 0) {

      set %file_string Streaming: %filename

      goto ihatemircselse

    }

    set %file_string Streaming: %fileformat @ $+ %kbps $+ kbps

    :ihatemircselse

    goto noset

  }



  set %total_string / $+ %t_mins $+ : $+ %filler2 $+ %t_secs

  if (%filesize != 0) {

    set %file_string %fileformat $+ @ $+ %kbps $+ kbps, %filesize $+ mb

    goto noset

  }

  set %file_string %fileformat $+ @ $+ %kbps $+ kbps

  :noset

  if (%foobar == 1) {

    /describe $active is playing %title [foobar2k]

    goto duns

  }

  /describe $active is playing %title ( $+ %file_string $+ , %e_mins $+ : $+ %filler $+ %e_secs $+ %total_string $+ )

  :duns

  unset %filesize

  unset %file_string

  unset %total_string

  unset %filename

  unset %fileformat

  unset %filler2

  unset %filler

  unset %e_mins

  unset %e_secs

  unset %title

  unset %kbps

  unset %khz

  unset %t_mins

  unset %t_secs

  unset %elapsedtime

  unset %totaltime

  unset %channels

}