[script]
n0=;/////////////////////////////////////////////WinAmp Control/////////////////////////////////////////////
n1=alias WAC {
n2=  if $dialog(WAC) = $null { dialog -m WAC WAC 
n3=    { if ( %mplag == 0 ) { did -h WAC 14 hide | did -v WAC 13 show | did -b WAC 11 disable | did -b WAC 12 disable | did -b WAC 17 disable | did -b WAC 16 disable } } 
n4=    else { did -e WAC 11 enable | did -e WAC 12 enable | did -e WAC 17 enable | did -e WAC 16 enable }
n5=  }
n6=}
n7=dialog WAC {
n8=  title "Управление WinAmp"
n9=  size -1 -1 325 162
n10=  option pixels, notheme
n11=
n12=  box "Поиск трэка", 18, 0 120 323 40,
n13=  box "WinAmp", 9, 0 60 322 57,
n14=  box "Управление плагином", 15, 0 0 322 57,
n15=  button "Prev", 1, 3 76 65 17,  flat
n16=  button "Play", 2, 73 76 55 17,  flat
n17=  button "Stop", 3, 193 76 55 17,  flat
n18=  button "Next", 4, 253 76 65 17,  flat
n19=  button "Rew", 6, 3 96 75 17,  flat
n20=  button "Ff", 5, 243 96 75 17,  flat
n21=  button "Volume up", 7, 83 96 75 17,  flat
n22=  button "Volume down", 8, 163 96 75 17,  flat
n23=  button "Включить/Выключить", 10, 3 17 292 17,  flat
n24=  button "Опции", 11, 3 36 155 17,  flat
n25=  button "Сказать что играет", 12, 163 36 155 17,  flat
n26=  icon 13, 300 16 17 17, $mircdirSYSTEM\IMAGES\WAR.jpg, 0,
n27=  icon 14, 300 16 17 17, $mircdirSYSTEM\IMAGES\WAG.jpg, 0,
n28=  edit "Найти и запустить трэк (введи название)", 16, 3 137 235 20,  limit 40 autohs
n29=  button "Искать", 17, 243 138 75 17,  flat
n30=  button "Pause", 19, 133 76 55 17,  flat
n31=}
n32=;=============================
n33=on 1:dialog:WAC:init:*:{
n34=  if ( %mplag == 1 ) { }
n35=
n36=  if ( %mplag == 1 ) { did -h WAC 13 hide | did -v WAC 14 show  }
n37=  else { did -h WAC 13 hide | did -v WAC 14 show }
n38=}
n39=;=============================
n40=on 1:dialog:WAC:sclick:*:{
n41=  if ($did == 1) {
n42=    dde mPlug control <
n43=  }
n44=  if ($did == 2) {
n45=    dde mPlug control play
n46=  }
n47=  if ($did == 3) {
n48=    dde mPlug control stop
n49=  }
n50=  if ($did == 4) {
n51=    dde mPlug control >
n52=  }
n53=  if ($did == 6) {
n54=    dde mPlug control rew
n55=  }
n56=  if ($did == 5) {
n57=    dde mPlug control ff
n58=  }
n59=  if ($did == 7) {
n60=    dde mPlug control vup
n61=  }
n62=  if ($did == 8) {
n63=    dde mPlug control vdwn
n64=  }
n65=  if ($did == 10) {
n66=    if ( %mplag == 1 ) { dde mPlug control off | set %mplag 0 | did -h WAC 14 hide | did -v WAC 13 show | did -b WAC 11 disable | did -b WAC 12 disable | did -b WAC 16 disable | did -b WAC 17 disable }
n67=    else { dde mPlug control on | set %mplag 1 | did -h WAC 13 hide | did -v WAC 14 show | did -e WAC 11 enable  | did -e WAC 12 enable | did -e WAC 16 enable | did -e WAC 17 enable }
n68=  }
n69=  if ($did == 11) {
n70=    dde mPlug options
n71=  }
n72=  if ($did == 12) {
n73=    dde mPlug show
n74=  }
n75=  if ($did == 17) {
n76=    set %mpoisk $did(16).text
n77=    dde mPlug find "" %mpoisk
n78=  }
n79=  if ($did == 19) {
n80=    dde mPlug control pause
n81=  }
n82=}
n83=alias WAD {
n84=  if $dialog(WAD) = $null { dialog -m WAD WAD }
n85=}
n86=dialog WAD {
n87=  title "WinAmp Dialog"
n88=  size -1 -1 158 40
n89=  option pixels, notheme
n90=  button "WinAmp v. 2.x", 1, 0 0 155 17,  Cancel flat
n91=  button "WinAmp v. 5.x", 2, 0 20 155 17,  ok flat
n92=}
n93=;=============================
n94=on 1:dialog:WAD:sclick:*:{
n95=  if ($did == 1) {
n96=    if (!%winampc_cfg_language) { /set %winampc_cfg_language $mircdirSYSTEM\Scripts\wac\lang_Russian.wc2 }
n97=    /WACo
n98=  }
n99=  if ($did == 2) {
n100=    /WAC
n101=  }
n102=}
n103=
n104=alias WACo {
n105=  if $dialog(WACo) = $null { dialog -m WACo WACo }
n106=}
n107=dialog WACo {
n108=  title "WinAmp Control"
n109=  size -1 -1 247 39
n110=  option pixels, notheme
n111=
n112=  button "Prev", 1, 0 0 45 17,  flat
n113=  button "Play", 2, 50 0 45 17,  flat
n114=  button "Pause", 3, 100 0 45 17,  flat
n115=  button "Stop", 4, 150 0 45 17,  flat
n116=  button "Next", 5, 200 0 45 17,  flat
n117=  button "Сказать что играет", 6, 0 20 115 17,  flat
n118=  button "Настройка", 7, 130 20 115 17,  flat
n119=}
n120=
n121=;=============================
n122=on 1:dialog:WACo:init:*:{
n123=  .timerWC2_remote -oi 0 2 /winampc_updateremote
n124=  if %winampc_cfg2_track == 1 { did -e winampc_ircplayer 4,10
n125=    dialog -sb winampc_ircplayer -1 -1 127 30
n126=    did -ra winampc_ircplayer 10 $round($calc($winampc_getinfo(possec) / $winampc_getinfo(tracksec) *100),0)) $+ %
n127=    did -c winampc_ircplayer 4 $round($calc($winampc_getinfo(possec) / $winampc_getinfo(tracksec) *100),0))
n128=  }
n129=  ;  else { did -b winampc_ircplayer 4,10 | dialog -sb winampc_ircplayer -1 -1 127 22 }
n130=  if %winampc_cfg2_launch == 1 && $winampc_getinfo(state) == $ $+ WA_NOTRUNNING { dll $mircdirdll\WC2.dll WA_Link_Command START }
n131=}
n132=
n133=;=============================
n134=on 1:dialog:WACo:close:*:{
n135=  if ($did == 0) {
n136=    if %winampc_cfg2_exit == 1 && $winampc_getinfo(state) != $WA_NOTRUNNING { dll $mircdirdll\WC2.dll WA_Link_Command CLOSE }
n137=    .timerWC2_remote off
n138=  }
n139=
n140=}
n141=
n142=;=============================
n143=on 1:dialog:WACo:sclick:*:{
n144=  if ($did == 1) {
n145=    /dll $mircdirdll\WC2.dll WA_Link_Command Prev
n146=  }
n147=
n148=  if ($did == 2) {
n149=    /dll $mircdirdll\WC2.dll WA_Link_Command Play
n150=  }
n151=
n152=  if ($did == 3) {
n153=    /dll $mircdirdll\WC2.dll WA_Link_Command Pause
n154=  }
n155=
n156=  if ($did == 4) {
n157=    /dll $mircdirdll\WC2.dll WA_Link_Command Stop
n158=  }
n159=
n160=  if ($did == 5) {
n161=    /dll $mircdirdll\WC2.dll WA_Link_Command Next
n162=  }
n163=
n164=  if ($did == 6) {
n165=    /msg $active # $winampc_getmsg2(%winampc_msg)
n166=  }
n167=
n168=  if ($did == 7) {
n169=    /winampc_cfg
n170=  }
n171=}
