Project

General

Profile

Custom toolbar media player control buttons example

Added by Mr. BS over 1 year ago

Screenshot

Media Player custom buttons

Code

on *:START: media_control
on *:UNLOAD: media_control -r

menu @* {
  $iif($bname,Remove):toolbar -d $bname
  -
}

; For players supported by AdiIRC to send control commands
alias media_control {
  if ($1 == -r) {
    tokenize 32 wprev wpause wplay wstop wnext wnp separador3 | toolbar -d $*
    return
  }
  toolbar -az1 wprev "Play previous song" custom_icons\wprev24px.ico "/wprev" @t
  toolbar -az1 wpause "Pause" custom_icons\wpause24px.ico "/wpause" @t
  toolbar -az1 wplay "Play" custom_icons\wplay24px.ico "/wplay" @t
  toolbar -az1 wstop "Stop" custom_icons\wstop24px.ico "/wstop" @t
  toolbar -az1 wnext "Play next song" custom_icons\wnext24px.ico "/wnext" @t
  toolbar -az1 wnp "Show current song" custom_icons\wnp24px.ico "/np" @t
  toolbar -as separador3
}

; Generic mode to send standard Windows media keys
alias media_control2 {
  if ($1 == -r) {
    tokenize 32 wprev wpause wplay wstop wnext wnp separador3 | toolbar -d $*
    return
  }
  toolbar -az1 wprev "Play previous song" custom_icons\wprev24px.ico "SendKey {Media_Prev}" @t
  toolbar -az1 wpause "Pause" custom_icons\wpause24px.ico "SendKey {Media_Play_Pause}" @t
  toolbar -az1 wplay "Play" custom_icons\wplay24px.ico "SendKey {Media_Play_Pause}" @t
  toolbar -az1 wstop "Stop" custom_icons\wstop24px.ico "SendKey {Media_Stop}" @t
  toolbar -az1 wnext "Play next song" custom_icons\wnext24px.ico "SendKey {Media_Next}" @t
  toolbar -az1 wnp "Show current song" custom_icons\wnp24px.ico "/np" @t
  toolbar -as separador3
}

alias sendkey {
  var %name sk $+ $ticks
  .comopen %name WScript.Shell
  .comclose %name $com(%name,SendKeys,3,bstr,$replacex($1-,{space},$chr(32)))
}

Restart AdiIRC to take effect or run /media_control first time.

Two versions are included in example, /media_control will use internal AdiIRC commands to control players. Already /media_control2 is a generic mode to send standard Windows media keys.

Icons used is attached bellow.