Advertisement
Guest User

Pongalo a Decir Musica Cuanto Dura Ect Porfabor ;:c

a guest
Aug 1st, 2014
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.37 KB | None | 0 0
  1. ;dcx alias
  2. alias -l dcx {
  3. if ($isid) returnex $dll($mircdir $+ MP3\DLL\dcx.dll,$1,$2-)
  4. else dll " $+ $mircdir $+ MP3\DLL\dcx.dll $+ " $1 $2-
  5. }
  6.  
  7. ;xdid alias
  8. alias -l xdid {
  9. if ( $isid ) returnex $dcx( _xdid, $1 $2 $prop $3- )
  10. dcx xdid $2 $3 $1 $4-
  11. }
  12.  
  13. ;xdialog alias
  14. alias -l xdialog {
  15. if ( $isid ) returnex $dcx( _xdialog, $1 $prop $2- )
  16. dcx xdialog $2 $1 $3-
  17. }
  18.  
  19. #fkeys on
  20. alias FF1 { dialog $iif($dialog(mp3),-v,-md) mp3 mp3 }
  21. alias FF2 { if ($insong) { if ($insong.pause) splay resume | else splay pause } }
  22. alias FF3 { $mp3broadcast }
  23. #fkeys end
  24.  
  25. ;on load events
  26. on *:load: {
  27. set %dialog mp3
  28. echo -a
  29. echo -a
  30. /mkdir Color
  31. set %fontsize 12
  32. set %dbg 0,0,0
  33. set %bgbg 0,0,0
  34. set %bgtxt 255,255,255
  35. set %mqtxt 255,255,255
  36. set %mqbg 127,127,127
  37. set %bxtxt 255,255,255
  38. set %bdr 255,255,255
  39. set %scrollc 255,0,0
  40. /alias F10 FF1
  41. /alias F11 FF2
  42. /alias F12 FF3
  43. }
  44.  
  45. ;mdx alias
  46. alias -l mdx {
  47. return MP3\DLL\mdx.dll
  48. }
  49.  
  50. ;menu
  51. menu * {
  52. .MP3 Player: { dialog $iif($dialog(mp3),-v,-md) mp3 mp3 }
  53. }
  54.  
  55. ;alias to open dialog
  56. alias mp3 { dialog $iif($dialog(mp3),-v,-md) mp3 mp3 }
  57.  
  58. ;mp3 player dialog
  59. dialog mp3 {
  60. title "MP3 Player"
  61. size -1 -1 387 380
  62. option pixels
  63. list 1, 5 5 185 290, hsbar vsbar size
  64. button "9", 5, 203 101 50 20, flat
  65. button ";", 6, 233 126 50 20, flat
  66. button "4", 7, 296 126 50 20, flat
  67. button ":", 8, 326 101 50 20, flat
  68. button "Add Directory", 9, 203 215 80 25, flat
  69. button "<", 22, 263 101 50 20, flat
  70. button "Remove All", 26, 290 215 80 25, flat
  71. button "Add File", 27, 203 246 80 25, flat
  72. button "Remove File", 28, 290 246 80 25, flat
  73. edit "", 3, 5 305 185 20, read
  74. edit "", 34, 5 330 185 20, read
  75. button "Hide", 19, 203 327 170 20, flat
  76. button "MP3 Information", 18, 203 305 170 20, flat
  77. button "Broadcast now!", 23, 203 283 170 20, flat
  78. check "", 43, 351 171 20 17
  79. edit "", 45, 5 355 225 20
  80. button "Search", 57, 235 355 65 20, group
  81. button "Search + Play", 58, 305 355 75 20, group
  82. menu "File", 15
  83. item "Play Options", 16, 15
  84. item "Broadcasting", 17, 15
  85. item "break", 30, 15
  86. item "Exit", 21, 15
  87. menu "View", 52
  88. item "Filepath", 53, 52
  89. item "break", 59, 52
  90. item "Colors", 60, 52
  91. item "Font", 61, 52
  92. menu "Tools", 30
  93. menu "Function Keys", 54, 30
  94. item "On", 46, 54
  95. item "Off", 47, 54
  96. item "Status", 48, 54
  97. item "break", 55, 54
  98. item "Editor", 56, 54
  99. menu "Export to Text", 33, 30
  100. item "Write to MP3 List", 36, 33
  101. item "View MP3 List", 35, 33
  102. item "break", 51, 30
  103. item "ID3 Tag Editor", 44, 30
  104. menu "Help", 24
  105. item "Topics", 31, 24
  106. item "break", 32, 24
  107. item "About", 25, 24
  108. }
  109.  
  110. ;mp3 help
  111. on *:dialog:mp3:menu:31: {
  112. dialog $iif($dialog(faq),-v,-md) faq faq
  113. }
  114.  
  115. ;enable function keys
  116. on *:dialog:mp3:menu:46: {
  117. enable #fkeys
  118. echo -a
  119. }
  120.  
  121. ;disable function keys
  122. on *:dialog:mp3:menu:47: {
  123. disable #fkeys
  124. echo -a
  125. }
  126.  
  127. ;view status
  128. on *:dialog:mp3:menu:48: {
  129. if ($group(#fkeys) == on) {
  130. echo -a
  131. }
  132. elseif ($group(#fkeys) == off) {
  133. echo -a
  134. }
  135. }
  136.  
  137. ;open id3 tag editor
  138. on *:dialog:mp3:menu:44: {
  139. dialog $iif($dialog(id3),-v,-md) id3 id3
  140. }
  141.  
  142. ;open mp3 info dialog
  143. on *:dialog:mp3:sclick:18: {
  144. dialog $iif($dialog(mp3.info),-v,-md) mp3.info mp3.info
  145. }
  146.  
  147. ;mp3 info dialog
  148. dialog mp3.info {
  149. title "MP3 Information"
  150. size -1 -1 360 219
  151. option pixels
  152. edit "", 1, 0 0 360 20, read
  153. edit "", 2, 0 20 360 20, read
  154. edit "", 3, 0 40 360 20, read
  155. edit "", 4, 0 60 360 20, read
  156. button "Close", 6, 0 200 360 18, flat
  157. edit "", 5, 0 80 360 20, read
  158. edit "", 8, 0 100 360 20, read
  159. edit "", 9, 0 140 360 20, read
  160. edit "", 10, 0 120 360 20, read
  161. edit "", 7, 1 160 360 20, read
  162. edit "", 11, 1 180 360 20, read
  163. }
  164.  
  165. ;mp3 info initialization
  166. on *:dialog:mp3.info:init:0: {
  167. dll $mdx SetMircVersion $version
  168. dll $mdx MarkDialog $dname
  169. dll $mdx SetColor $dname 1,2,3,4,5,8,9,10,7,11 background $rgb( [ %bgbg ] )
  170. dll $mdx SetColor $dname 1,2,3,4,5,8,9,10,7,11 textbg $rgb( [ %bgbg ] )
  171. dll $mdx SetColor $dname 1,2,3,4,5,8,9,10,7,11 text $rgb( [ %bgtxt ] )
  172. dll $mdx SetFont $dname 1,2,3,4,5,8,9,10,7,11 - $+ %fontsize 400 %font
  173. var %title2 = $iif($sound($read(playlist.txt,%songnum)).title,$v1,$regsubex($gettok($nopath($insong.fname),-1,45),/(\.mp3)$/,))
  174. var %artist2 = $iif($sound($read(playlist.txt,$did(1).sel)).artist,$v1,$gettok($nopath($insong.fname),-2,45))
  175. var %len2 = $remove($duration($calc($insong.length /1000),3),00:)
  176. var %bit2 = $sound($read(playlist.txt,%songnum)).bitrate
  177. var %genre2 = $iif($sound($insong.fname).genre, $sound($insong.fname).genre, Unknown genre)
  178. var %album2 = $iif($sound($insong.fname).album, $sound($insong.fname).album, Unknown album)
  179. var %size2 = $bytes($file($insong.fname).size).suf
  180. var %year2 = $iif($sound($insong.fname).year, $sound($insong.fname).year, Unknown year)
  181. var %comment2 = $iif($sound($insong.fname).comment, $sound($insong.fname).comment, No comment)
  182. did -a $dname 1 Title: %title2
  183. did -a $dname 2 Artist: %artist2
  184. did -a $dname 3 Length: %len2
  185. did -a $dname 4 Played: $readini(playcount.ini,plays,$replace($insong.fname,$chr(32),_))) time(s)
  186. did -a $dname 5 Album: %album2
  187. did -a $dname 8 Genre: %genre2
  188. did -a $dname 9 Year: %year2
  189. did -a $dname 10 Comment: %comment2
  190. did -a $dname 7 Size: %size2
  191. did -a $dname 11 Bitrate: %bit2 $+ kbps
  192. }
  193.  
  194. ;mp3 info close
  195. on *:dialog:mp3.info:sclick:6: { dialog -x $dname }
  196.  
  197. ;broadcast now button
  198. on *:dialog:mp3:sclick:23: { $mp3broadcast }
  199.  
  200. ;open font dialog
  201. on *:dialog:mp3:menu:61: {
  202. dialog $iif($dialog(font),-v,-md) font font
  203. }
  204.  
  205. ;font dialog
  206. dialog font {
  207. title "Set Font"
  208. size -1 -1 250 64
  209. option pixels
  210. edit "", 1, 125 15 115 20
  211. combo 2, 10 15 100 70, drop
  212. box "Size", 3, 5 0 110 40
  213. box "Font", 4, 120 0 125 40
  214. button "Apply", 5, 180 42 65 20
  215. }
  216.  
  217. ;font init
  218. on *:dialog:font:init:0: {
  219. did -a $dname 2 10
  220. did -a $dname 2 11
  221. did -a $dname 2 12
  222. did -a $dname 2 13
  223. did -a $dname 2 14
  224. if (%fontsize == 10) { did -c $dname 2 1 }
  225. if (%fontsize == 11) { did -c $dname 2 2 }
  226. if (%fontsize == 12) { did -c $dname 2 3 }
  227. if (%fontsize == 13) { did -c $dname 2 4 }
  228. if (%fontsize == 14) { did -c $dname 2 5 }
  229. did -a $dname 1 %font
  230. }
  231.  
  232. ;font sclick events
  233. on *:dialog:font:sclick:5: {
  234. set %fontsize $did(2).seltext
  235. set %font $did(1).text
  236. dialog -x $dname
  237. dialog -x mp3
  238. dialog -md mp3 mp3
  239. }
  240.  
  241. alias cb_scroll {
  242. var %dname = $1, %devent = $2, %did = $3
  243. if (%devent == tracking) {
  244. if (%did == 13) {
  245. if (!$insong) halt
  246. if (!%mp3tseek) {
  247. .timerpos.update -p
  248. set %mp3tseek $true
  249. }
  250. .timermp3tseek -m 1 500 splay seek $int($calc(($xdid(mp3,13).value /10000) * $insong.length)) $chr(124) unset %mp3tseek $chr(124) .timerpos.update -r
  251. }
  252. if (%did == 12) {
  253. vol -v $xdid(mp3,12).value
  254. xdid -t mp3 14 Volume: $round($calc($vol(master) / 65535 * 100),0) $+ %
  255. }
  256. }
  257. }
  258.  
  259. ;mp3 dialog initialisation
  260. on *:dialog:mp3:init:0: {
  261. dcx Mark $dname cb_scroll
  262. xdialog -g $dname +b $rgb( [ %dbg ] )
  263. xdialog -c $dname 12 scroll 203 172 124 17 horizontal bottom
  264. xdialog -c $dname 13 scroll 203 61 170 17 horizontal bottom
  265. xdialog -c $dname 10 box 193 1 190 41 rounded transparent
  266. xdialog -c $dname 11 box 193 46 190 38 rounded transparent
  267. xdialog -c $dname 4 box 193 87 191 65 rounded transparent
  268. xdialog -c $dname 29 box 193 201 190 78 rounded transparent
  269. xdialog -c $dname 14 box 193 154 141 43 rounded transparent
  270. xdialog -c $dname 38 box 339 154 44 43 rounded transparent
  271. xdid -f $dname 10 +a default 9 %font
  272. xdid -f $dname 29 +a default 9 %font
  273. xdid -f $dname 4 +a default 9 %font
  274. xdid -f $dname 14 +a default 9 %font
  275. xdid -f $dname 11 +a default 9 %font
  276. xdid -f $dname 38 +a default 8 %font
  277. xdid -t $dname 38 Mute
  278. xdid -t $dname 14 Volume: $round($calc($vol(master) / 65535 * 100),0) $+ %
  279. xdid -t $dname 10 Now Playing
  280. xdid -t $dname 29 MP3 Files
  281. xdid -t $dname 4 Controls
  282. xdid -t $dname 11 Position: $iif($int($calc(($insong.pos /1000)/60)) > 10,$int($calc(($insong.pos /1000)/60)), 0 $+ $int($calc(($insong.pos /1000)/60)) ) $+ : $+ $iif($round($calc(($insong.pos /1000) - $int($calc(($insong.pos /1000)/60))*60),0) > 10, $round($calc(($insong.pos /1000) - $int($calc(($insong.pos /1000)/60))*60),0), 0 $+ $round($calc(($insong.pos /1000) - $int($calc(($insong.pos /1000)/60))*60),0)) $+ / $+ $remove($duration($calc($insong.length /1000),3),00:)
  283. xdid -C $dname 10 +t $rgb( [ %bxtxt ] )
  284. xdid -C $dname 29 +t $rgb( [ %bxtxt ] )
  285. xdid -C $dname 4 +t $rgb( [ %bxtxt ] )
  286. xdid -C $dname 14 +t $rgb( [ %bxtxt ] )
  287. xdid -C $dname 11 +t $rgb( [ %bxtxt ] )
  288. xdid -C $dname 38 +t $rgb( [ %bxtxt ] )
  289. xdid -C $dname 10 +r $rgb( [ %bdr ] )
  290. xdid -C $dname 29 +r $rgb( [ %bdr ] )
  291. xdid -C $dname 4 +r $rgb( [ %bdr ] )
  292. xdid -C $dname 14 +r $rgb( [ %bdr ] )
  293. xdid -C $dname 11 +r $rgb( [ %bdr ] )
  294. xdid -C $dname 38 +r $rgb( [ %bdr ] )
  295. xdid -C $dname 13 +b $rgb( [ %scrollc ] )
  296. xdid -C $dname 12 +b $rgb( [ %scrollc ] )
  297. xdid -C $dname 13 +g $rgb(0,0,0)
  298. xdid -C $dname 13 +G $rgb(255,255,255)
  299. xdid -r $dname 12 0 65535
  300. xdid -r $dname 13 0 100
  301. dll $mdx SetMircVersion $version
  302. dll $mdx MarkDialog $dname
  303. dll $mdx DynamicControl create $dname 2 edit 203 16 170 20 read autohs
  304. dll $mdx SetColor $dname 23,18,19,57,58 background $rgb( [ %dbg ] )
  305. dll $mdx SetFont $dname 5,6,7,8,22 -14 400 Webdings
  306. dll $mdx SetFont $dname 18,57,58,19,20,23,26,27,28,9,3,34,45 -11 400 %font
  307. dll $mdx SetFont $dname 2 -11 400 %font
  308. dll $mdx SetFont $dname 1 - $+ %fontsize 400 %font
  309. dll $mdx SetColor $dname 1 background $rgb( [ %bgbg ] )
  310. dll $mdx SetColor $dname 1 textbg $rgb( [ %bgbg ] )
  311. dll $mdx SetColor $dname 2 textbg $rgb( [ %mqbg ] )
  312. dll $mdx SetColor $dname 2 background $rgb( [ %dbg ] )
  313. dll $mdx SetColor $dname 1 text $rgb( [ %bgtxt ] )
  314. dll $mdx SetColor $dname 2 text $rgb( [ %mqtxt ] )
  315. dll $mdx SetColor $dname 5,6,7,8,9,22,26,27,28,20,19,18,23,57,58 background $rgb( [ %dbg ] )
  316. dll $mdx SetColor $dname 45,3,34,43 background $rgb( [ %dbg ] )
  317. dll $mdx SetColor $dname 45,3,34 textbg $rgb( [ %dbg ] )
  318. dll $mdx SetColor $dname 3,45,34 text $rgb( [ %bgtxt ] )
  319. dll $mdx SetBorderStyle $dname 5,6,7,8,9,22,26,27,28,20,19,18,23,57,58
  320. var %a = 1, %b = playlist.txt
  321. while ( %a <= $lines(%b) ) {
  322. did -a $dname 1 $left($nopath($read(%b,%a)),-4)
  323. inc %a
  324. }
  325. if (!$sound($insong.fname)) {
  326. did -a $dname 2 Nothing is playing.
  327. did -b $dname 6,22,18
  328. xdid -t mp3 11 Position: 00:00/00:00
  329. }
  330. if ($sound($insong.fname)) {
  331. did -b $dname 44
  332. did -e $dname 53
  333. }
  334. if ($vol($insong.fname).mute) {
  335. did -c $dname 43
  336. }
  337. if (!$did(1).lines) {
  338. did -b $dname 36
  339. }
  340. did -b $dname 57,58
  341. did -a $dname 34 Played: $readini(playcount.ini,plays,$replace($insong.fname,$chr(32),_)))
  342. did -z $dname 1
  343. did -a $dname 3 Total MP3's: $did(1).lines
  344. did -c $dname 12 $vol(master)
  345. if ($readini(playcount.ini,plays,$replace($read(playlist.txt,%songnum),$chr(32),_))) did -o $dname 34 1 Played: $v1
  346. if ($insong) {
  347. did -c $dname 1 %songnum
  348. did -o $dname 2 1 $left($nopath($insong.fname),-4)
  349. did -z $dname 13 0 10000
  350. did -c $dname 13 $calc(($insong.pos / $insong.length)*10000)
  351. .timerpos.update -r
  352. if (%mp3.sm != none && $width($left($nopath($insong.fname),-4),Arial,10) > 150) .timerscrolltitle 0 1 scrolltitle
  353. .timerpos.txt 1 1 calcnewpos
  354. }
  355. }
  356.  
  357. ;calcnewpos alias
  358. alias -l calcnewpos {
  359. var %x $int($calc(($insong.pos /1000)/60))
  360. var %y $round($calc(($insong.pos /1000) - %x *60),0)
  361. var %a $iif(%x > 10,%x,0 $+ %x)
  362. var %b $iif(%y > 10,%y,0 $+ %y)
  363. if ($dialog(mp3)) xdid -t mp3 11 $+(Position: %a,:,%b,/,$iif($insong.fname, $remove($duration($calc($insong.length /1000),3),00:), 00:00))
  364. .timer 1 1 calcnewpos
  365. }
  366.  
  367. ;help dialog
  368. dialog faq {
  369. title "Help"
  370. size -1 -1 165 115
  371. option pixels
  372. list 1, 5 27 155 65, vsbar size
  373. button "Close", 2, 95 92 65 20
  374. text "Double click a topic.", 3, 7 8 150 17
  375. }
  376.  
  377. ;faq initialization
  378. on *:dialog:faq:init:0: {
  379. did -a $dname 1 MP3 Player
  380. did -a $dname 1 Play Options
  381. did -a $dname 1 Broadcasting
  382. did -a $dname 1 Color Changer
  383. did -a $dname 1 Font
  384. did -a $dname 1 Function Keys Editor
  385. did -a $dname 1 ID3 Tag Editor
  386. }
  387.  
  388. ;faq close
  389. on *:dialog:faq:sclick:2: {
  390. dialog -x $dname
  391. }
  392.  
  393. ;double click events
  394. on *:dialog:faq:dclick:1: {
  395. if ($did(1).sel == 1) {
  396. run MP3\Help\MP3.html
  397. }
  398. if ($did(1).sel == 2) {
  399. run MP3\Help\Options.html
  400. }
  401. if ($did(1).sel == 3) {
  402. run MP3\Help\Broadcasting.html
  403. }
  404. if ($did(1).sel == 4) {
  405. run MP3\HTML\Color.html
  406. }
  407. if ($did(1).sel == 5) {
  408. run MP3\Help\Font.html
  409. }
  410. if ($did(1).sel == 6) {
  411. run MP3\Help\Function Keys.html
  412. }
  413. if ($did(1).sel == 7) {
  414. run MP3\Help\ID3 Tag Editor.html
  415. }
  416. }
  417.  
  418. ;dialog close
  419. on *:dialog:mp3:close:0: {
  420. .timerpos.update -p
  421. .timerscrolltitle off
  422. .timerpos.txt off
  423. set %dialog mp3
  424. }
  425.  
  426. ;dialog buttons
  427. ;click in list
  428. on *:dialog:mp3:dclick:1: {
  429. set %songnum $did(1).sel
  430. mp3play $read(playlist.txt,%songnum)
  431. did -e $dname 6,22,18,53
  432. did -b $dname 44
  433. .timerpos.txt 1 1 calcnewpos
  434. }
  435.  
  436. ;total played
  437. on *:dialog:mp3:sclick:1: {
  438. did -ra $dname 34 Played: $iif($readini(playcount.ini,plays,$replace($read(playlist.txt,$did(1).sel),$chr(32),_)),$v1,0)
  439. }
  440.  
  441. ;search function
  442. on *:dialog:mp3:sclick:57: {
  443. var %did45 = $did(45).text
  444. $iif($didwm(mp3,1,* $+ %did45 $+ *), did -c $dname 1 $didwm(mp3,1,* $+ %did45 $+ *), did -ra $dname 45 No results found.)
  445. if ($did(45).text === No results found.) {
  446. halt
  447. }
  448. else {
  449. did -r $dname 45
  450. did -b $dname 57,58
  451. }
  452. }
  453.  
  454. ;search + play function
  455. on *:dialog:mp3:sclick:58: {
  456. var %did45 = $did(45).text
  457. $iif($didwm(mp3,1,* $+ %did45 $+ *), did -c $dname 1 $didwm(mp3,1,* $+ %did45 $+ *), did -ra $dname 45 No results found.)
  458. if ($did(45).text === No results found.) {
  459. halt
  460. }
  461. else {
  462. set %songnum $did(1).sel
  463. mp3play $read(playlist.txt,%songnum)
  464. did -r $dname 45
  465. did -e $dname 6,22,18,53
  466. did -b $dname 44,57,58
  467. .timerpos.txt 1 1 calcnewpos
  468. }
  469. }
  470.  
  471. ;mute
  472. on *:dialog:mp3:sclick:43: {
  473. $iif($did(43).state == 1,vol -pu1,vol -pu2)
  474. }
  475.  
  476. ;back button
  477. on *:dialog:mp3:sclick:5: {
  478. if (%rplay) {
  479. did -c $dname 1 $rand(1,$did($dname,1).lines)
  480. .timerpos.txt 1 1 calcnewpos
  481. }
  482. elseif ($did($dname,1).sel == 1) {
  483. halt
  484. }
  485. did -c $dname 1 $calc($v1 - 1)
  486. set %songnum $did($dname,1).sel
  487. mp3play $read(playlist.txt,%songnum)
  488. did -e $dname 6,22,18,53
  489. did -b $dname 44
  490. .timerpos.txt 1 1 calcnewpos
  491. }
  492.  
  493. ;stop button
  494. on *:dialog:mp3:sclick:22: {
  495. $mp3stop
  496. }
  497.  
  498. ;forward button
  499. on *:dialog:mp3:sclick:8: {
  500. if (%rplay) {
  501. did -c $dname 1 $rand(1,$did($dname,1).lines)
  502. set %songnum $did($dname,1).sel
  503. mp3play $read(playlist.txt,%songnum)
  504. did -e $dname 6,22,18,53
  505. did -b $dname 44
  506. .timerpos.txt 1 1 calcnewpos
  507. }
  508. else {
  509. did -c $dname 1 $calc($did($dname,1).sel + 1)
  510. set %songnum $did($dname,1).sel
  511. mp3play $read(playlist.txt,%songnum)
  512. did -e $dname 6,22,18,53
  513. did -b $dname 44
  514. .timerpos.txt 1 1 calcnewpos
  515. }
  516. }
  517.  
  518. ;pause button
  519. on *:dialog:mp3:sclick:6: {
  520. if ($insong) {
  521. set %pauseb on
  522. if (!$insong.pause) {
  523. splay pause
  524. .timerpos.txt -p
  525. }
  526. else {
  527. splay resume
  528. set %pauseb off
  529. .timerpos.txt -r
  530. }
  531. }
  532. }
  533.  
  534. ;play button
  535. on *:dialog:mp3:sclick:7: {
  536. if ($insong.pause) {
  537. splay resume
  538. }
  539. else {
  540. set %songnum $did(1).sel
  541. mp3play $read(playlist.txt,%songnum)
  542. .timerpos.txt 1 1 calcnewpos
  543. }
  544. did -e $dname 6,22,18,53
  545. did -b $dname 44
  546. }
  547.  
  548. ;directory button
  549. on *:dialog:mp3:sclick:9: {
  550. $mp3choosedir
  551. }
  552.  
  553. ;remove all button
  554. on *:dialog:mp3:sclick:26: {
  555. $mp3remall
  556. }
  557.  
  558. ;add file button
  559. on *:dialog:mp3:sclick:27: {
  560. $mp3addfile
  561. }
  562.  
  563. ;delete file button
  564. on *:dialog:mp3:sclick:28: {
  565. $mp3remfile
  566. }
  567.  
  568. ;close button
  569. on *:dialog:mp3:sclick:19: {
  570. .timerpos.update -p
  571. .timerscrolltitle off
  572. set %dialog mp3
  573. dialog -x $dname
  574. }
  575.  
  576. ;menu item exit
  577. on *:dialog:mp3:menu:21: {
  578. .timerpos.update -p
  579. set %dialog mp3
  580. dialog -x $dname
  581. }
  582.  
  583. ;mp3end
  584. on *:MP3END: {
  585. .timerscrolltitle off
  586. unset %mp3.scroll*
  587. if (%cplay) {
  588. if (%songnum < $lines(playlist.txt)) {
  589. inc %songnum
  590. mp3play $read(playlist.txt,%songnum)
  591. halt
  592. }
  593. if ($dialog(mp3)) {
  594. did -c mp3 1 %songnum
  595. }
  596. unset %songnum
  597. unset %cplay
  598. }
  599. elseif (%rplay) {
  600. if ($lines(playlist.txt) !> 1) {
  601. unset %rplay
  602. goto off
  603. }
  604. :picksong
  605. var %song = $read(playlist.txt)
  606. if ($readn == %songnum) {
  607. goto picksong
  608. }
  609. set %songnum $readn
  610. if ($dialog(mp3)) {
  611. did -c mp3 1 $readn
  612. }
  613. mp3play %song
  614. halt
  615. }
  616. elseif (%repeat) {
  617. mp3play $read(playlist.txt,%songnum)
  618. halt
  619. }
  620. if ($dialog(mp3)) {
  621. did -z mp3 13 0 0
  622. did -r mp3 2
  623. if ($did(mp3,1).sel == %songnum) {
  624. did -ra mp3 34 $calc($did(mp3,34)+1)
  625. }
  626. }
  627. :off
  628. timerpos off
  629. unset %songnum
  630. }
  631.  
  632. ;enable buttons on edit
  633. on *:dialog:mp3:edit:*: {
  634. if ($did == 45) {
  635. if ($did(45).text) {
  636. did -e $dname 57,58
  637. }
  638. elseif (!$did(45).text) {
  639. did -b $dname 57,58
  640. }
  641. }
  642. }
  643.  
  644. ;aliases
  645. ;directory alias
  646. alias -l mp3choosedir {
  647. if ($sdir(.,Choose mp3 directory)) {
  648. did -r mp3 1
  649. write -c playlist.txt
  650. var %x = 1, %d = $v1
  651. while ($findfile(%d,*.mp3,%x)) {
  652. write playlist.txt $v1
  653. did -a mp3 1 $left($nopath($v1),-4)
  654. inc %x
  655. }
  656. did -ra mp3 3 Total MP3's: $calc(%x - 1)
  657. }
  658. did -z mp3 1
  659. }
  660.  
  661. ;add file alias
  662. alias -l mp3addfile {
  663. if ($sfile(*.mp3,Choose an mp3 file to add)) {
  664. write playlist.txt $v1
  665. did -a mp3 1 $left($nopath($v1),-4)
  666. did -ra mp3 3 Total MP3's: $did(mp3,1).lines
  667. }
  668. }
  669.  
  670. ;remove file alias
  671. alias -l mp3remfile {
  672. if (!$did(1).sel) {
  673. noop $input(You did not select a file to delete.,uwo,Error!)
  674. }
  675. if ($input(Are you sure you want to remove this file from your playlist?,yuw,Attention!) == $true) {
  676. if ($exists(playlist.txt) && $did(mp3,1).sel) {
  677. var %l = $did(mp3,1).lines, %s = $v1
  678. if (%l == 1) .remove playlist.txt
  679. else write -dl playlist.txt %s
  680. did -d $dname 1 %s
  681. if (%l) {
  682. if (%s <= %l) {
  683. did -c $dname 1 %s
  684. }
  685. else {
  686. did -c $dname 1 %l
  687. did -ra mp3 3 Total MP3's: %l
  688. }
  689. }
  690. else {
  691. halt
  692. }
  693. }
  694. }
  695. }
  696.  
  697. ;remove all alias
  698. alias -l mp3remall {
  699. if ($input(Are you sure you want to remove all files from the list?,yuw,Attention!) == $true) {
  700. .remove playlist.txt
  701. did -r mp3 1
  702. did -ra mp3 3 0
  703. if ( $insong ) mp3stop
  704. did -ra mp3 3 Total MP3's: $did(1).lines
  705. did -b $dname 36
  706. else { halt }
  707. }
  708. }
  709.  
  710. ;play alias
  711. alias -l mp3play {
  712. splay $$1-
  713. .timerscrolltitle off
  714. unset %mp3.scroll*
  715. writeini playcount.ini plays $replace($1-,$chr(32),_) $calc($readini(playcount.ini,plays,$replace($1-,$chr(32),_))+1)
  716. if ( %broadcasting ) mp3broadcast
  717. if ( $dialog(mp3) ) {
  718. did -c mp3 13 0
  719. did -o mp3 2 1 $left($nopath($1-),-4)
  720. did -z mp3 13 0 10000
  721. did -ra mp3 34 Played: $readini(playcount.ini,plays,$replace($1-,$chr(32),_))
  722. timerpos on
  723. if ( %mp3.sm != none && $width($left($nopath($1-),-4),Arial,10) > 120 ) .timerscrolltitle 0 1 scrolltitle
  724. }
  725. }
  726.  
  727. ;stop alias
  728. alias -l mp3stop {
  729. if ( $insong ) {
  730. splay stop
  731. did -r mp3 2
  732. timerpos off
  733. did -z mp3 13 0 0
  734. unset %songnum
  735. .timerscrolltitle off
  736. unset %mp3.scroll*
  737. did -ra $dname 2 Nothing is playing.
  738. did -u $dname 1
  739. }
  740. did -b $dname 6,22,18,53
  741. did -e $dname 44
  742. }
  743.  
  744. ;timerpos alias
  745. alias -l timerpos {
  746. if ( $1 == on ) .timerpos.update 0 1 did -c mp3 13 $!calc(( $!insong.pos / $!insong.length )*10000)
  747. elseif ( $1 == off ) .timerpos.update off
  748. }
  749.  
  750. ;backlength alias
  751. alias -l backlength {
  752. if ($insong) { return $+(-,$gmt($calc($calc($insong.length / 1000) - $calc($insong.pos / 1000)),nn:ss))
  753. }
  754. }
  755.  
  756. ;scroll title alias
  757. alias -l scrolltitle {
  758. var %t = $did(mp3,1,%songnum) $iif(!%mp3.sm, $chr(160) $chr(160) $chr(160) $chr(160) $chr(160) $chr(160) $chr(160) $did(mp3,1,%songnum)), %l = $calc($len($did(mp3,1,%songnum))+7)
  759. if ( %mp3.scroll == $null ) {
  760. set %mp3.scroll.dir inc
  761. set %mp3.scroll 0
  762. set %mp3.scroll.len $len(%t)
  763. did -o mp3 2 1 $mid(%t,1,%mp3.scroll.len)
  764. }
  765. elseif ( %mp3.sm == two && %mp3.scroll !> 1 ) {
  766. set %mp3.scroll.dir inc
  767. set %mp3.scroll 2
  768. did -o mp3 2 1 $mid(%t,2,%mp3.scroll.len)
  769. }
  770. else {
  771. if ( !%mp3.sm ) && (%mp3.scroll > %l) set %mp3.scroll 1
  772. if ( !%mp3.sm ) did -o mp3 2 1 $mid(%t,%mp3.scroll,%mp3.scroll.len)
  773. %mp3.scroll.dir %mp3.scroll 2
  774. if ( %mp3.sm == two ) {
  775. if ( $width($mid(%t,%mp3.scroll,%mp3.scroll.len),Arial,10) > 120 ) did -o mp3 2 1 $mid(%t,%mp3.scroll,%mp3.scroll.len)
  776. else {
  777. set %mp3.scroll.dir dec
  778. dec %mp3.scroll 2
  779. did -o mp3 2 1 $mid(%t,$iif(%mp3.scroll,$v1,1),%mp3.scroll.len)
  780. }
  781. }
  782. }
  783. }
  784.  
  785. ;broadcasting alias
  786. alias -l mp3broadcast {
  787. if ( !%broadcastformat || !%broadcastchannels ) { echo -a 0,0/11,0/0,11/12,11/11,12/2,12/12,2/1,2/2,1/1,1/0,1 MP3 Player Broadcast options not set up correctly. | return }
  788. if ( !$insong ) { echo -a 0,0/11,0/0,11/12,11/11,12/2,12/12,2/1,2/2,1/1,1/0,1 MP3 Player Broadcast: Cannot broadcast while no song is playing. | return }
  789. var %title = $iif($sound($read(playlist.txt,%songnum)).title,$v1,$regsubex($gettok($nopath($insong.fname),-1,45),/(\.mp3)$/,))
  790. var %artist = $iif($sound($read(playlist.txt,%songnum)).artist,$v1,$gettok($nopath($insong.fname),-2,45))
  791. var %len = $remove($duration($calc($insong.length /1000),3),00:)
  792. var %rem = $remove($duration($calc(($insong.length -$insong.pos) /1000),3),00:)
  793. var %bit = $sound($read(playlist.txt,%songnum)).bitrate
  794. var %genre = $iif($sound($insong.fname).genre, $sound($insong.fname).genre, Unknown genre)
  795. var %album = $iif($sound($insong.fname).album, $sound($insong.fname).album, Unknown album)
  796. var %size = $bytes($file($insong.fname).size).suf
  797. var %mode = $mp3($insong.fname).mode
  798. var %frequency = $+($round($calc($mp3($insong.fname).sample / 1000),0)),kHz)
  799. var %pos = $iif($int($calc(($insong.pos /1000)/60)) > 10,$int($calc(($insong.pos /1000)/60)), 0 $+ $int($calc(($insong.pos /1000)/60)) ) $+ : $+ $iif($round($calc(($insong.pos /1000) - $int($calc(($insong.pos /1000)/60))*60),0) > 10, $round($calc(($insong.pos /1000) - $int($calc(($insong.pos /1000)/60))*60),0), 0 $+ $round($calc(($insong.pos /1000) - $int($calc(($insong.pos /1000)/60))*60),0))
  800. var %year = $iif($sound($insong.fname).year, $sound($insong.fname).year, Unknown year)
  801. var %comment = $iif($sound($insong.fname).comment, $sound($insong.fname).comment, No comment)
  802. var %long = $longfn($insong.fname)
  803. var %short = $shortfn($insong.fname)
  804. var %sample = $left($sound($insong.fname).sample,-3) kHz
  805. var %copyright = $iif($sound($insong.fname).copyright, Yes, No)
  806. var %msg = $replace(%broadcastformat,&title,%title,&year,%year,&mode,%mode,&genre,%genre,&artist,%artist,&len,%len,&album,%album,&comment,%comment,&sample,%sample,&size,%size,&rem,%rem,&pos,%pos,&long,%long,&short,%short,&copyright,%copyright,&frequency,%frequency,&bitrate,%bit,&playcount,$readini(playcount.ini,plays,$replace($insong.fname,$chr(32),_)))
  807. if (%broadcastchannels == all) $iif(%bc.msg == describe,ame,amsg) %msg
  808. if (%broadcastchannels == active) $iif(%bc.msg,%bc.msg,msg) $active %msg
  809. else {
  810. tokenize 44 %broadcastchannels
  811. var %i = 1
  812. while $(,$ $+ %i) {
  813. msg $v1 %msg
  814. inc %i
  815. }
  816. var %c = $addtok(%c,$iif(#* !iswm $v1,$chr(35) $+ $v2,$v2),44)
  817. inc %i
  818. }
  819. }
  820.  
  821. ;options dialog
  822. on *:dialog:mp3:menu:16: {
  823. dialog $iif($dialog(mp3.options),-v,-md) mp3.options mp3.options
  824. }
  825.  
  826. dialog mp3.options {
  827. title "Configuration Options"
  828. size -1 -1 295 110
  829. option pixels
  830. box "Play options", 1, 5 0 290 35
  831. radio "Normal", 2, 15 15 60 17
  832. radio "Continuous", 3, 80 15 80 17
  833. radio "Random", 4, 160 15 60 17
  834. button "Close", 5, 5 80 285 25
  835. box "Scrolling Method", 10, 5 40 285 35
  836. radio "None", 11, 15 55 60 17
  837. radio "Two-way", 12, 80 55 80 17
  838. radio "Forwards only", 13, 160 55 85 17
  839. radio "Repeat", 6, 225 15 66 17
  840. }
  841.  
  842. ;options initialization
  843. on *:dialog:mp3.options:init:0: {
  844. if (%cplay) {
  845. did -c $dname 3
  846. .timer 1 0 did -u $dname 2
  847. }
  848. elseif (%repeat) {
  849. did -c $dname 6
  850. }
  851. elseif (%rplay) {
  852. did -c $dname 4
  853. }
  854. else {
  855. did -c $dname 2
  856. }
  857. if (!%mp3.sm) {
  858. did -c $dname 13
  859. }
  860. elseif (%mp3.sm == two) {
  861. did -c $dname 12
  862. }
  863. else {
  864. did -c $dname 11
  865. }
  866. }
  867.  
  868. ;options sclick events
  869. on *:dialog:mp3.options:sclick:*: {
  870. if ( $did == 2 ) {
  871. unset %rplay
  872. unset %repeat
  873. unset %cplay
  874. did -c $dname $iif(!%mp3.sm,13,$iif(%mp3.sm == two,12,11))
  875. }
  876. if ( $did == 3 ) {
  877. unset %rplay
  878. unset %repeat
  879. set %cplay on
  880. did -c $dname $iif(!%mp3.sm,13,$iif(%mp3.sm == two,12,11))
  881. }
  882. if ( $did == 6 ) {
  883. unset %rplay
  884. unset %cplay
  885. set %repeat 1
  886. did -c $dname $iif(!%mp3.sm,13,$iif(%mp3.sm == two,12,11))
  887. }
  888. if ( $did == 4 ) {
  889. unset %cplay
  890. unset %repeat
  891. set %rplay on
  892. did -c $dname $iif(!%mp3.sm,13,$iif(%mp3.sm == two,12,11))
  893. }
  894. if ( $did == 5 ) {
  895. dialog -x $dname
  896. }
  897. if ( $did == 11 ) {
  898. .timerscrolltitle off
  899. unset %mp3.scroll*
  900. set %mp3.sm none
  901. if ( $insong ) did -o mp3 2 1 $did(mp3,1,%songnum)
  902. did -c $dname $iif(%cplay,3,$iif(%rplay,4,$iif(%repeat,6,2)))
  903. }
  904. if ( $did == 12 ) {
  905. unset %mp3.scroll*
  906. set %mp3.sm two
  907. if ( $insong ) .timerscrolltitle 0 1 scrolltitle
  908. did -c $dname $iif(%cplay,3,$iif(%rplay,4,$iif(%repeat,6,2)))
  909. }
  910. if ( $did == 13 ) {
  911. unset %mp3.scroll*
  912. unset %mp3.sm
  913. if ( $insong ) .timerscrolltitle 0 1 scrolltitle
  914. did -c $dname $iif(%cplay,3,$iif(%rplay,4,$iif(%repeat,6,2)))
  915. }
  916. }
  917.  
  918. ;open about dialog
  919. on *:dialog:mp3:menu:25: {
  920. dialog $iif($dialog(mp3.about),-v,-md) mp3.about mp3.about
  921. }
  922.  
  923. ;about dialog
  924. dialog mp3.about {
  925. title "About"
  926. size -1 -1 220 165
  927. option pixels
  928. text "MP3 Player made by Neptune and Daveoh.", 1, 5 5 210 18
  929. text "You are free to use this MP3 Player script to help you build your own, but please don't take the script and just call it your own, as it isn't fair for the people who put hard work into making it.", 2, 5 65 210 70
  930. button "Close", 3, 5 140 210 20
  931. text "Neptune:", 4, 5 28 50 17
  932. link "irc.PurpleSurge.com", 5, 59 28 100 17
  933. text "Daveoh:", 6, 6 45 50 17
  934. link "irc.Quakenet.org", 7, 60 45 100 17
  935. }
  936.  
  937. ;links
  938. on *:dialog:mp3.about:sclick:*: {
  939. if ($did == 3) {
  940. dialog -x $dname
  941. }
  942. if ($did == 5) {
  943. server -m irc.PurpleSurge.com
  944. }
  945. if ($did == 7) {
  946. server -m irc.Quakenet.org
  947. }
  948. }
  949.  
  950. ;broadcasting dialog
  951. on *:dialog:mp3:menu:17: {
  952. dialog $iif($dialog(mp3.bc),-v,-md) mp3.bc mp3.bc
  953. }
  954.  
  955. ;broadcasting dialog
  956. dialog mp3.bc {
  957. title "Broadcasting"
  958. size -1 -1 400 294
  959. option pixels
  960. box "Now Playing Message", 1, 5 5 390 145
  961. edit "", 2, 10 20 380 80, read autovs multi vsbar
  962. edit %broadcastformat, 3, 10 105 380 20, autohs
  963. box "Channels", 10, 7 150 390 70
  964. text "Enter the channels you would like to broadcast to, separated by a comma. For all channels, type 'all'. To display to active channel only, type 'active'.", 11, 12 165 380 40
  965. edit %broadcastchannels, 12, 12 195 380 20
  966. box "Automatic broadcasting status", 20, 7 225 166 40
  967. radio "Enabled", 21, 22 240 65 17, group
  968. radio "Disabled", 22, 92 240 65 17
  969. button "Broadcast now!", 23, 7 267 90 25
  970. button "Close", 40, 100 267 90 25
  971. radio "Message", 4, 192 240 65 15, group
  972. radio "Describe (/me)", 5, 262 240 100 15
  973. box "Method", 6, 177 225 190 40
  974. button "ASCII", 7, 10 126 75 20
  975. button "Preview", 8, 90 126 75 20
  976. text "Preview will not show dynamic tokens.", 9, 170 128 220 20
  977. }
  978.  
  979. ;broadcasting initialization
  980. on *:dialog:mp3.bc:init:0:{
  981. if (!$did(3).text || !$did(12).text) {
  982. did -b $dname 23
  983. }
  984. if (!$did(3).text) {
  985. did -b $dname 8
  986. }
  987. var %cmd = did -a $dname 2 $crlf $chr(32)
  988. did -a $dname 2 This is the format your broadcasting will be displayed in. Available dynamic tokens are:
  989. %cmd &title - The title of the playing song
  990. %cmd &artist - The artist of the playing song
  991. %cmd &album - Album of the playing song
  992. %cmd &genre - Genre of the playing song
  993. %cmd &year - Year of the playing song
  994. %cmd &len - The length of the playing song
  995. %cmd &rem - The remaining length of song
  996. %cmd &playcount - No. of times the song has been played
  997. %cmd &pos - The position of the song
  998. %cmd &bitrate - The song's bitrate
  999. %cmd &mode - How the song is being played
  1000. %cmd &frequency - Frequency of the song
  1001. %cmd &sample - Returns the sample rate of the song
  1002. %cmd &size - Size of the MP3 file
  1003. %cmd &comment - Returns any comments on the song
  1004. %cmd &long - Returns the long filepath of the song
  1005. %cmd &short - Returns the short filepath of the song
  1006. %cmd &copyright - Returns Yes if song is copyrighted, otherwise returns No
  1007. %cmd NOTE: &album and &genre will appear blank if it is not found
  1008. if ( !%broadcasting ) did -c $dname 22
  1009. else did -c $dname 21
  1010. did -c $dname $iif(%bc.msg == describe,5,4)
  1011. }
  1012.  
  1013. ;broadcasting sclick events
  1014. on *:dialog:mp3.bc:sclick:*: {
  1015. if ($did == 8) {
  1016. echo -a 0,0/11,0/0,11/12,11/11,12/2,12/12,2/1,2/2,1/1,1/0,1 Broadcast Preview: $+  $did(3).text
  1017. }
  1018. if ($did == 7) {
  1019. dialog $iif($dialog(ASCII),-v,-md) ASCII ASCII
  1020. }
  1021. if ($did == 21) {
  1022. set %broadcasting 1
  1023. }
  1024. elseif ($did == 22) {
  1025. unset %broadcasting
  1026. }
  1027. elseif ($did == 23) {
  1028. $mp3broadcast
  1029. }
  1030. elseif ($did == 4) {
  1031. set %bc.msg msg
  1032. }
  1033. elseif ($did == 5) {
  1034. set %bc.msg describe
  1035. }
  1036. elseif ($did == 40) {
  1037. dialog -x $dname
  1038. }
  1039. }
  1040.  
  1041. ;broadcasting edit events
  1042. on *:dialog:mp3.bc:edit:*: {
  1043. if ($did == 3) {
  1044. set %broadcastformat $did(mp3.bc,3).text
  1045. }
  1046. if ($did == 12) {
  1047. set %broadcastchannels $remove($did($v1).text,$chr(32))
  1048. }
  1049. if ($did(3).text) && ($did(12).text) {
  1050. did -e $dname 23
  1051. }
  1052. else {
  1053. did -b $dname 23
  1054. }
  1055. if ($did(3).text) {
  1056. did -e $dname 8
  1057. }
  1058. else {
  1059. did -b $dname 8
  1060. }
  1061. }
  1062.  
  1063. ;Export
  1064. on *:dialog:mp3:menu:36: {
  1065. if ($input(Using this function will cause mIRC to freeze for about 15-30 seconds depending on how many MP3 files you have. If you click anything else during this time mIRC will crash. Do you wish to continue?,yuw,Attention!) == $true) {
  1066. write -c mp3list.txt
  1067. var %m = $lines(playlist.txt)
  1068. while (%m) {
  1069. var %l = $read(playlist.txt,%m)
  1070. write mp3list.txt $iif($sound(%l).title,$v1,$regsubex($gettok($nopath(%l),-1,45),/(\.mp3)$/,)) - $&
  1071. $iif($sound(%l).artist,$v1,$gettok($nopath(%l),-2,45)) - $&
  1072. $remove($duration($calc($sound(%l).length /1000),3),00:)
  1073. dec %m
  1074. }
  1075. echo -a 0,0/11,0/0,11/12,11/11,12/2,12/12,2/1,2/2,1/1,1/0,1 MP3 list updated!
  1076. }
  1077. }
  1078.  
  1079. ;Open MP3List.txt
  1080. on *:dialog:mp3:menu:35: {
  1081. run mp3list.txt
  1082. }
  1083.  
  1084. ;ASCII dialog
  1085. dialog ASCII {
  1086. title "ASCII"
  1087. size -1 -1 260 140
  1088. option pixels
  1089. list 1, 1 1 115 95, vsbar size
  1090. button "Copy to Clipboard", 2, 2 97 115 20, flat
  1091. button "Close", 3, 2 117 115 20, flat
  1092. edit "", 4, 130 15 55 20
  1093. button "Search", 5, 190 15 55 20
  1094. box "Character Number", 7, 120 0 135 40
  1095. edit "", 8, 130 55 55 20
  1096. button "Search", 9, 190 55 55 20
  1097. edit "", 10, 130 78 100 20, read
  1098. box "Symbol Number", 11, 120 40 135 63
  1099. edit "", 12, 120 105 135 33, read autovs multi
  1100. }
  1101.  
  1102. ;ascii mouse events
  1103. on *:dialog:ascii:mouse:*: {
  1104. if ($did == 1) {
  1105. did -ra $dname 12 This is a list of $crlf $+ ASCII characters.
  1106. }
  1107. if ($did == 2) {
  1108. did -ra $dname 12 Use this to copy what $crlf $+ you have selected.
  1109. }
  1110. if ($did == 3) {
  1111. did -ra $dname 12 Use this to close the $crlf $+ dialog.
  1112. }
  1113. if ($did == 4) {
  1114. did -ra $dname 12 Type in an ASCII $crlf $+ number here.
  1115. }
  1116. if ($did == 5) {
  1117. did -ra $dname 12 Click this to search $crfl $+ for an ASCII character.
  1118. }
  1119. if ($did == 8) {
  1120. did -ra $dname 12 Insert an ASCII symbol $ctrl $+ here.
  1121. }
  1122. if ($did == 9) {
  1123. did -ra $dname 12 Use this to search $crfl $+ for an ASCII symbol.
  1124. }
  1125. if ($did == 10) {
  1126. if (!$did(10).text) {
  1127. did -ra $dname 12 Search for an ASCII symbol.
  1128. }
  1129. else {
  1130. did -ra $dname 12 This is the ASCII symbol $crlf $+ you searched for.
  1131. }
  1132. }
  1133. }
  1134.  
  1135. ;ascii alias
  1136. alias -l chars {
  1137. did -a $dname 1 -----------------
  1138. did -a $dname 1 NOT ALL ASCII
  1139. did -a $dname 1 CHARACTERS
  1140. did -a $dname 1 WORK IN mIRC,
  1141. did -a $dname 1 SO EXPERIMENT!
  1142. did -a $dname 1 -----------------
  1143. var %x = 1, %y = 255
  1144. while (%x <= %y) {
  1145. did -a $dname 1 $chr(%x)
  1146. inc %x
  1147. }
  1148. }
  1149.  
  1150. ;ascii initialization
  1151. on *:dialog:ascii:init:0: {
  1152. did -b $dname 5,9
  1153. $chars
  1154. }
  1155.  
  1156. ;ascii edit events
  1157. on *:dialog:ascii:edit:*: {
  1158. if ($did == 4) {
  1159. if (!$did(4).text) {
  1160. did -b $dname 5
  1161. }
  1162. else {
  1163. did -e $dname 5
  1164. }
  1165. }
  1166. if ($did == 8) {
  1167. if (!$did(8).text) {
  1168. did -b $dname 9
  1169. }
  1170. else {
  1171. did -e $dname 9
  1172. }
  1173. }
  1174. }
  1175.  
  1176. ;ascii sclick events
  1177. on *:dialog:ascii:sclick:*: {
  1178. if ($did == 1) {
  1179. if (!$did(1).sel) {
  1180. did -b $dname 2
  1181. }
  1182. elseif ($did(1).sel) {
  1183. did -e $dname 2
  1184. }
  1185. }
  1186. if ($did == 3) {
  1187. dialog -x $dname
  1188. }
  1189. if ($did == 2) {
  1190. clipboard $did(1).seltext
  1191. dialog -t ascii ASCII: Copied to clipboard
  1192. .timercop 1 1 dialog -t ascii ASCII
  1193. }
  1194. if ($did == 5) {
  1195. if ($did(4).text > 255) {
  1196. noop
  1197. $input(Please do not enter a number above 255.,uwo,Error!)
  1198. }
  1199. else {
  1200. did -c $dname 1 $calc($did(4).text + 6)
  1201. }
  1202. }
  1203. if ($did == 9) {
  1204. did -ra $dname 10 $chr( $+ $did(8).text $+ )
  1205. }
  1206. }
  1207.  
  1208. /*
  1209. ID3 Tag Editor
  1210. Author: PR|MuS
  1211. Email: Shredplayer@email.com
  1212. Script Environment: Remotes
  1213. Comments: a mini ID3 editor for editing ID3 Tags
  1214. */
  1215.  
  1216. ;id3 dialog
  1217. dialog ID3 {
  1218. title "ID3 Tag Editor"
  1219. size -1 -1 295 93
  1220. option pixels
  1221. edit "", 1, 3 2 200 20, read autohs
  1222. button "Browse", 2, 208 2 85 20
  1223. edit "", 3, 3 24 285 22, autohs
  1224. combo 4, 123 47 110 120, size drop
  1225. button "Update", 5, 3 70 150 20
  1226. button "", 7, 0 0 0 0, hide ok
  1227. combo 8, 3 47 120 180, size drop
  1228. }
  1229.  
  1230. ;dialog events
  1231. on *:dialog:ID3:*:*:{
  1232. if $devent == init {
  1233. did -a $dname 1 No file selected.
  1234. did -f $dname 2
  1235. genre
  1236. did -b $dname 8,5
  1237. didtok -a $dname 4 32 Title Artist Album Year Comment Genre
  1238. }
  1239. if $devent == sclick {
  1240. if $did == 2 {
  1241. did -ra $dname 1 $file="Choose an .mp3" *.mp3
  1242. if .mp3 !isin $did(1) { did -ra $dname 1 | did -b $dname 5 }
  1243. else { did -e $dname 5 }
  1244. }
  1245. if $did == 4 {
  1246. did -f $dname 3
  1247. dialog -t $dname $+(ID3 Tag Editor:,$chr(32),$did(4).seltext)
  1248. did -ra $dname 3 $mPR0P($did(1),$did(4).sel)
  1249. if $did(4).sel == 6 { did -c $dname 8 $didwm(8,$did(3)) }
  1250. }
  1251. if $did == 5 && $did(4).sel {
  1252. var %file = $shortfn($did(ID3,1))
  1253. $EDIT(%file,$did(4).sel)
  1254. }
  1255. if $did(4).sel == 6 { did -e $dname 8 | did -m $dname 3 }
  1256. else { did -b $dname 8 | did -n $dname 3 }
  1257. if $did == 8 && $did(4).sel == 6 { did -ra $dname 3 $did(8).seltext }
  1258. }
  1259. }
  1260.  
  1261. ;prop alias
  1262. alias -l mPR0P {
  1263. if $2 == 1 return $mp3($1).title
  1264. elseif $2 == 2 return $mp3($1).artist
  1265. elseif $2 == 3 return $mp3($1).album
  1266. elseif $2 == 4 return $mp3($1).year
  1267. elseif $2 == 5 return $mp3($1).comment
  1268. elseif $2 == 6 return $mp3($1).genre
  1269. }
  1270.  
  1271. ;edit alias
  1272. alias -l EDIT {
  1273. bread $1 $B_CALC($1,128) 3 &tag
  1274. if ($bvar(&tag,1-3).text != TAG) {
  1275. bwrite $1 $B_CALC($1,128) 3 TAG
  1276. bset &fill 125 0
  1277. bwrite $1 $B_CALC($1,125) 124 &fill
  1278. bunset &fill
  1279. }
  1280. if ($mp3($1).version == MPEG 1.0 Layer 3) {
  1281. if ($did(ID3,3)) {
  1282. bset &val $N_BYTE($2) $iif($2 == 6,$calc($did(ID3,8).sel - 1),$did(ID3,3))
  1283. bwrite $1 $S_BYTE($1,$2) $N_BYTE($2) &val
  1284. $iif($2 < 6,.bwrite $1 $S_BYTE($1,$2) $N_BYTE($2) $did(ID3,3))
  1285. }
  1286. else {
  1287. bset &val 30 $asc($chr(32))
  1288. bwrite $1 $S_BYTE($1,$2) $N_BYTE($2) &val
  1289. }
  1290. bunset &val
  1291. dialog -t $dname $+(ID3 Tag Editor:,$chr(32),Updated!)
  1292. }
  1293. }
  1294.  
  1295. ;B_CALC alias
  1296. alias -l B_CALC {
  1297. return $calc($file($1).size - $2)
  1298. }
  1299.  
  1300. ;N_BYTE alias
  1301. alias -l N_BYTE {
  1302. return $gettok(30 30 30 4 30 1,$1,32)
  1303. }
  1304.  
  1305. ;S_BYTE alias
  1306. alias -l S_BYTE {
  1307. return $calc($file($1).size - $gettok(125 95 65 35 31 1,$2,32))
  1308. }
  1309.  
  1310. ;genre alias
  1311. alias -l genre {
  1312. didtok ID3 8 44 Blues,Classic Rock,Country,Dance,Disco,Funk,Grunge,Hip-Hop,Jazz,Metal,New Age,Oldies,Other,Pop,R&B,Rap,Reggae,Rock,Techno,Industrial,Alternative,Ska,Death Metal,Pranks,SoundTrack,Euro-Techno,Ambient,Trip-Hop,Vocal,Jazz+Funk,Fusion,Trance,Classical,Instrumental,Acid,House,Game,Sound Clip,Gospel,Noise,Alternative Rock $&
  1313. ,Bass,Soul,Punk,Space,Meditative,Instrumental Pop,Instrumental Rock,Ethnic,Gothic,Darkwave,Techno-Industrial,Electronic,Pop-Folk,Euro Dance,Dream,Southern Rock,Comedy,Cult,Gangsta Rap,Top 40,Christian Rap,Pop/Funk,Jungle,Native American,Cabaret,New Wave,Psychedelic,Rave,Showtunes,Trailer,Lo-Fi,Tribal,Acid Punk,Acid Jazz,Polka,Retro,Musical,Rock n' Roll
  1314. didtok ID3 8 44 Hard Rock,Folk,Folk-Rock,National Folk,Swing,Fast Fusion,Bebop,Latin,Revival,Celtic,Bluegrass,Avantgarde,Gothic Rock,Progressive Rock,Psychedelic Rock,Symphonic Rock,Slow Rock,Big Band,Chorus,Easy Listening,Acoustic,Humour,Speech,Chanson,Opera,Chamber Music,Sonata,Symphony,Booty Bass,Primus,Porn Groove,Satire,Slow Jam,Club,Tango $&
  1315. ,Samba,Folklore,Ballad,Power Ballad,Rhythmic Soul,Freestyle,Duet,Punk Rock,Drum Solo,Acapella,Euro-House,Dance Hall,
  1316. }
  1317.  
  1318. ;open filepath dialog
  1319. on *:dialog:mp3:menu:53: {
  1320. if (!$insong.fname) {
  1321. noop $input(There is nothing playing.,uwo,Error!)
  1322. }
  1323. else {
  1324. dialog $iif($dialog(filepath),-v,-md) filepath filepath
  1325. }
  1326. }
  1327.  
  1328. ;filepath dialog
  1329. dialog filepath {
  1330. title "Filepath"
  1331. size -1 -1 285 145
  1332. option pixels
  1333. edit "", 1, 7 15 270 20, read autohs
  1334. box "Long Filepath", 2, 2 0 280 40
  1335. edit "", 3, 7 55 270 20, read autohs
  1336. box "Short Filepath", 4, 2 40 280 40
  1337. button "Refresh", 5, 145 122 65 20
  1338. button "Close", 6, 215 122 65 20
  1339. edit "", 7, 8 95 270 20, read autohs
  1340. box "File Name", 8, 3 80 280 40
  1341. }
  1342.  
  1343. ;filepath initialization
  1344. on *:dialog:filepath:init:0: {
  1345. did -a $dname 1 $longfn($insong.fname)
  1346. did -a $dname 3 $shortfn($insong.fname)
  1347. did -a $dname 7 $nopath($insong.fname)
  1348. }
  1349.  
  1350. ;filepath sclick events
  1351. on *:dialog:filepath:sclick:*: {
  1352. if ($did == 5) {
  1353. if (!$insong.fname) {
  1354. noop $input(There is no song playing.,uwo,Error!)
  1355. }
  1356. else {
  1357. did -ra $dname 1 $longfn($insong.fname)
  1358. did -ra $dname 3 $shortfn($insong.fname)
  1359. }
  1360. }
  1361. if ($did == 6) {
  1362. dialog -x $dname
  1363. }
  1364. }
  1365.  
  1366. ;open function keys editor
  1367. on *:dialog:mp3:menu:56: {
  1368. dialog $iif($dialog(feditor),-v,-md) feditor feditor
  1369. }
  1370.  
  1371. ;function keys editor dialog
  1372. dialog feditor {
  1373. title "Function Keys Editor"
  1374. size -1 -1 320 65
  1375. option pixels
  1376. combo 1, 10 15 90 55, drop
  1377. box "Open MP3", 2, 5 0 100 40
  1378. combo 3, 115 15 90 55, drop
  1379. box "Pause / Resume", 4, 110 0 100 40
  1380. combo 5, 220 15 90 55, drop
  1381. box "Broadcast", 6, 215 0 100 40
  1382. button "Apply", 7, 180 43 65 20
  1383. button "Close", 8, 250 43 65 20
  1384. }
  1385.  
  1386. ;function keys editor initialization
  1387. on *:dialog:feditor:init:0: {
  1388. did -a $dname 1 F1
  1389. did -a $dname 1 F2
  1390. did -a $dname 1 F3
  1391. did -a $dname 1 F4
  1392. did -a $dname 1 F5
  1393. did -a $dname 1 F6
  1394. did -a $dname 1 F7
  1395. did -a $dname 1 F8
  1396. did -a $dname 1 F9
  1397. did -a $dname 1 F10
  1398. did -a $dname 1 F11
  1399. did -a $dname 1 F12
  1400. did -a $dname 3 F1
  1401. did -a $dname 3 F2
  1402. did -a $dname 3 F3
  1403. did -a $dname 3 F4
  1404. did -a $dname 3 F5
  1405. did -a $dname 3 F6
  1406. did -a $dname 3 F7
  1407. did -a $dname 3 F8
  1408. did -a $dname 3 F9
  1409. did -a $dname 3 F10
  1410. did -a $dname 3 F11
  1411. did -a $dname 3 F12
  1412. did -a $dname 5 F1
  1413. did -a $dname 5 F2
  1414. did -a $dname 5 F3
  1415. did -a $dname 5 F4
  1416. did -a $dname 5 F5
  1417. did -a $dname 5 F6
  1418. did -a $dname 5 F7
  1419. did -a $dname 5 F8
  1420. did -a $dname 5 F9
  1421. did -a $dname 5 F10
  1422. did -a $dname 5 F11
  1423. did -a $dname 5 F12
  1424. }
  1425.  
  1426. ;function keys editor sclick events
  1427. on *:dialog:feditor:sclick:*: {
  1428. if ($did == 7) {
  1429. /alias F1
  1430. /alias F2
  1431. /alias F3
  1432. /alias F4
  1433. /alias F5
  1434. /alias F6
  1435. /alias F7
  1436. /alias F8
  1437. /alias F9
  1438. /alias F10
  1439. /alias F11
  1440. /alias F12
  1441. set %f1 $did(1)
  1442. /alias aliases.ini %f1 FF1
  1443. set %f2 $did(3)
  1444. /alias aliases.ini %f2 FF2
  1445. set %f3 $did(5)
  1446. /alias aliases.ini %f3 FF3
  1447. dialog -t feditor Function Keys Editor: Updated
  1448. }
  1449. if ($did == 8) {
  1450. dialog -x $dname
  1451. }
  1452. }
  1453.  
  1454. ;open color changer
  1455. on *:dialog:mp3:menu:60: {
  1456. dialog $iif($dialog(color),-v,-md) color color
  1457. }
  1458.  
  1459. ;color dialog
  1460. dialog color {
  1461. title "Color Changer"
  1462. size -1 -1 245 440
  1463. option pixels
  1464. scroll "", 1, 40 305 192 12, horizontal range 0 255 bottom
  1465. text "Red", 2, 4 303 32 16
  1466. text "Blue", 3, 4 337 32 16
  1467. scroll "", 4, 40 339 192 12, horizontal range o 255 bottom
  1468. scroll "", 6, 40 322 192 12, horizontal range 0 255 bottom
  1469. text "Green", 7, 4 320 36 16
  1470. button "Clipboard", 9, 174 410 62 20
  1471. icon 10, 0 376 90 50
  1472. box "RGB Info", 11, 95 370 144 38
  1473. text "RGB ", 12, 102 386 50 16
  1474. text "", 14, 164 386 66 16
  1475. edit "", 5, 10 125 84 20, autohs
  1476. box "MP3 BG", 8, 5 110 96 40
  1477. edit "", 13, 10 170 84 20, autohs
  1478. box "List BG", 15, 5 155 96 40
  1479. edit "", 16, 114 170 86 20, autohs
  1480. box "List Text", 17, 111 155 94 40
  1481. edit "", 18, 10 210 84 20, autohs
  1482. box "Marquee Text", 19, 5 195 96 40
  1483. button "Apply", 20, 100 280 64 20
  1484. list 21, 10 15 194 70, vsbar size
  1485. button "Save Current", 22, 10 86 74 20
  1486. button "Delete", 23, 90 86 64 20
  1487. box "Presets", 24, 4 0 230 110
  1488. button "Apply", 25, 160 86 64 20
  1489. button "Share", 26, 170 280 64 20
  1490. edit "", 27, 116 210 84 20, autohs
  1491. box "Marquee BG", 28, 111 195 96 40
  1492. edit "", 29, 12 250 84 20, autohs
  1493. box "Box Text", 30, 5 235 96 40
  1494. edit "", 31, 116 250 84 20, autohs
  1495. box "Box Border", 32, 110 235 96 40
  1496. edit "", 33, 115 125 84 20, autohs
  1497. box "Scroll Color", 34, 110 110 96 40
  1498. }
  1499.  
  1500. ;color sclick events
  1501. on *:dialog:color:sclick:*: {
  1502. if ($did == 20) {
  1503. if (!$did(5).text || !$did(13).text || !$did(16).text || !$did(18).text || !$did(27).text || !$did(29).text || !$did(31).text || !$did(33).text) {
  1504. noop
  1505. $input(Please fill in ALL boxes.,uwo,Error!)
  1506. }
  1507. else {
  1508. set %dbg $did(5).text
  1509. set %bgbg $did(13).text
  1510. set %bgtxt $did(16).text
  1511. set %mqtxt $did(18).text
  1512. set %mqbg $did(27).text
  1513. set %bxtxt $did(29).text
  1514. set %bdr $did(31).text
  1515. set %scrollc $did(33).text
  1516. dialog -x $dname
  1517. dialog -x mp3
  1518. dialog -md mp3 mp3
  1519. }
  1520. }
  1521. if ($did == 22) {
  1522. var %co = $?="What would you like to name this color scheme?"
  1523. write -c Color\ $+ %co $+ .txt $did(5).text
  1524. write -a Color\ $+ %co $+ .txt $did(13).text
  1525. write -a Color\ $+ %co $+ .txt $did(16).text
  1526. write -a Color\ $+ %co $+ .txt $did(18).text
  1527. write -a Color\ $+ %co $+ .txt $did(27).text
  1528. write -a Color\ $+ %co $+ .txt $did(29).text
  1529. write -a Color\ $+ %co $+ .txt $did(31).text
  1530. write -a Color\ $+ %co $+ .txt $did(33).text
  1531. did -a $dname 21 %co
  1532. dialog $iif($dialog(color),-v,-md) color color
  1533. }
  1534. if ($did == 23) {
  1535. remove Color\ $+ $did(21).seltext $+ .txt
  1536. did -d $dname 21 $did(21).sel
  1537. }
  1538. if ($did == 25) {
  1539. set %dbg $read(Color\ $+ $did(21).seltext $+ .txt, 1)
  1540. set %bgbg $read(Color\ $+ $did(21).seltext $+ .txt, 2)
  1541. set %bgtxt $read(Color\ $+ $did(21).seltext $+ .txt, 3)
  1542. set %mqtxt $read(Color\ $+ $did(21).seltext $+ .txt, 4)
  1543. set %mqbg $read(Color\ $+ $did(21).seltext $+ .txt, 5)
  1544. set %bxtxt $read(Color\ $+ $did(21).seltext $+ .txt, 6)
  1545. set %bdr $read(Color\ $+ $did(21).seltext $+ .txt, 7)
  1546. set %scrollc $read(Color\ $+ $did(21).seltext $+ .txt, 8)
  1547. dialog -x $dname
  1548. dialog -x mp3
  1549. dialog -md mp3 mp3
  1550. }
  1551. if ($did == 9) {
  1552. clipboard $did(14).text
  1553. }
  1554. if ($did == 26) {
  1555. msg $active MP3 BG: $did(5).text - List BG: $did(13).text - List Text: $did(16).text - Marquee Text: $did(18).text - Marquee BG: $did(27).text - Box Text: $did(29).text - Box Border: $did(31).text - Scroll Color: $did(33).text
  1556. }
  1557. }
  1558.  
  1559. ;color initialization
  1560. on *:dialog:color:init:0: {
  1561. did -a $dname 5 %dbg
  1562. did -a $dname 13 %bgbg
  1563. did -a $dname 16 %bgtxt
  1564. did -a $dname 18 %mqtxt
  1565. did -a $dname 27 %mqbg
  1566. did -a $dname 29 %bxtxt
  1567. did -a $dname 31 %bdr
  1568. did -a $dname 33 %scrollc
  1569. noop $findfile(Color\,*.txt,0,did -a $dname 21 $left($nopath($1-),-4))
  1570. did -g $dname 10 MP3\square.bmp
  1571. did -a $dname 14 0,0,0
  1572. }
  1573.  
  1574. alias -l getrgb {
  1575. window -phn +b @prev -1 -1 80 50
  1576. drawfill -r @prev $rgb($1,$2,$3) 1 1 1
  1577. drawsave @prev getrgb.bmp
  1578. window -c @prev
  1579. }
  1580.  
  1581. on *:dialog:color:scroll:*: {
  1582. var %z = $did($dname,1).sel $did($dname,6).sel $did($dname,4).sel
  1583. getrgb %z
  1584. did -g $dname 10 getrgb.bmp
  1585. did -ra $dname 14 $+($did($dname,1).sel,$chr(44),$did($dname,6).sel,$chr(44),$did($dname,4).sel)
  1586. }
  1587.  
  1588. alias -l rgbview {
  1589. if (!$dialog(color)) {
  1590. dialog -md color color
  1591. }
  1592. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement