Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;# msplay_beta_v600 Pre 1.0 Remake
- ;# Created by Sporc & Naki
- ;# 09/28/2007 1:00am EST
- /*
- v5-v5.3.6
- -Took scorps original sound script, soundchit5 and Modified it so it was smaller
- --Script consisted of two parts, msound and msplay
- ---Did away with msound and made it all as msplay using a lot of $iif()
- -Added a bunch of new features to the script
- --Added F'key support
- ---F8 - Plays random family guy file
- ---F7 - Specify file play
- ---sF5 - Makes a dumplist of all the sound files in your $mp3dir
- -Cant remember what else i did... heh
- v5.4.0
- -Added timestamps
- -Added F'key support
- -- sF6 - Toggles CTCP for msplay on and off
- -Bug Fixes
- --Fixed double send bug
- --Fixed no file bug
- --Fixed bugs concerning new sound alias
- v5.4.3
- -Added some shit but cant remember (sux)
- -Bug Fixes
- --Fixed number issue with $msvar
- v5.4.6
- -Changed $2 to $2- in Sound to take in consideration of filename with spaces.
- v5.5.0
- -Complete overhaul on msplay/easyfs/sound commands
- v5.5.2
- - Scorp pointed out to me a huge flaw in the system. It is fixed now! hopefully
- v552 Pre 1.0 Remake Beta
- -Prepairing script for dialog system for configuration only.
- -Changed script from 5.5.2 to a PreBeta
- --Did this because basiclly i redid the script to make it more user
- friendly instead of having it me friendly.
- -$easyfs
- --$easyfs is a new version of my first $easyfs so the easyfs in this
- script is actually version 2.0 which is used in conjunction with mschk
- --- Features of $easyfs
- ----easyfs can be used with the %msdir variable to scan a multiple of
- directories instead of just one. Usage $easyfs(file,#). the number
- 0 returns the number of matches and then 1+ works the same way as
- $findfile to return the directory in which the file exist.
- -$mschk
- --Just checks to see if the file extension is a media type supported by
- mIRC.
- -msplay - msound
- -- changed these so they would no longer conflict with mIRC's default
- /sound system.
- -Extra Notes
- --This version will go from a Prebeta to a full beta once the dialog
- for configuration is integrated into the script.
- v553
- - Integrated dialog configuration into script for a more user friendly configuration.
- v555
- - Integrated beta work on dialog control for silent playing.
- - Integrated beta work on dialog control of allowing sound interruption.
- - Attempted to fix filerecieve renaming once a file is sent.
- - Need to find a way to allow for multiple file download renaming correctly.
- -A way to keep track of which file belongs to which rename.
- v556 and v557
- -Why the editor didnt add this i dont know. So i wont know what was done
- to these two original versions
- v558
- -Added $msxml which renames files from xml to the file format it was so it plays.
- v559
- -Removed $msxml because an xml file isn't a sound file.
- v560
- -Added to options dialog "Enable Function Keys" to toggle the use of the F keys.
- -Added Mute MSplay toggle to F1 and popup menu. Allows the user to quickly
- mute the incoming sounds playing but still be able to see which sound was played.
- v561
- - Fixed file recieve renameing. File is only renamed if the filename requires _' be taken out.
- v562
- - Adding options to include ogg, midi, wma directories.
- - Redid the way duplicate internal sound directories are checked when adding to %msdir automaticly.
- - Fixed "Function Key" enable and disable function in dialog options.
- v563
- - Reorganized the configuration dialog into tabs.
- - Added user the ability to control which Function button does what.
- v564
- - Changed text strings in menu and config dialog.
- - Dialog rearranged a few things and minor changes.
- v565
- - Added "Play Search String" option to Function Key control dialog.
- Users, can specify the text "*blah*" and it will search for the random match and play it.
- v566
- - Added checks to msplay so if something is being played, and then another file
- format is loaded, the current sound stops and the new sound is played.
- v567
- - Readded the xml thing cause i got tired of searching 100 times for a song
- THAT DOES EXIST
- v568
- - Fixed a small dialog number problem for the last 2 Function buttons.
- - Added an option to dialog (for now) to only request sound file if the filesize
- is above the entered byte size.
- v570.-1
- - Building a new addition to the script that will ignore sounds over a set
- filesize.
- v571
- - In previous versions if multiple files were being recieved, only 1 was named correctly. So...
- Fixed the renaming part of the script when a sound file is recieved. File md5 & filename information
- is sent to a hash table on the client's side. Once recieved the hash table is checked for a md5
- match, if found renames accordingly.
- v572
- - added basic support for drag and drop must add *.*:/msdad $1- to the drag and drop
- menu under options - mouse - drag drop. this is a beta release and is buggy and
- only works with files in the %msdir
- v573
- - added %ms_chkply so the script would stop any sounds unless the user wanted it to
- v574
- - Finished option for accepting a file only if it's filesize is below the users input limit.
- Adding "On new msplay stop current playing sound" to the options dialog to be used with %ms_chkply.
- If a new sound is played and a current sound is playing, it will stop the current first. Not to be confused
- with same type stopping, as same types get stopped automaticly by mirc.
- v575
- - Fixed some srequest errors I (scorpwanna) created while adding to 574.
- v576
- - Added a replay/random switch to msplay so if %msrp is true it will redo the msplay command again after the sound is finished playing
- until the timer is deleted
- v577
- - Adding MSOUND action playing. Option to play either using original CTCP method or as an action.
- v578
- - Added Display File Info, when playing a sound file the information is shown over chat (only when played as an action).
- v579
- - Added toggleing for Action/CTCP to Function Keys.
- v580
- - I think I fixed a problem I created while adding the file info. Seems when a sound was requested it requested the file and info as the filename.
- That wasn't good, so using the power of regex I divided it correctly. Should work now.
- v581
- - Fixed a problem I created while adding the file info. Filenames with .'s in them were ignored and a default file played in it's place while displaying
- the correct file.
- v582
- -Misc. tweaks to the on action section.
- v583
- - Made it so when MSOUND actions are played and you have allow incoming turned off, it still shows the action but does not show the CTCP event.
- Moved the Mute Incoming menu option under MSplay. Cleaned up some echoing. Created an alias to shorten the filesize of all the writeini's used.
- v584
- - Since mIRC fails to deliever on the ! and $null meaning, I had to change the on load if statements for settings.
- Apparently (!$msound(setting)) is not the same as ($msound(setting) == $null) if $msound(setting) returns 0.
- v585
- - Fixed a bug having to do with the Include sound directories. Was not adding all selected and ignoring accidental duplications.
- v586
- - Fixed a random glitch in $easyfs. For some odd reason it was adding 2 more found entries when they didn't exist.
- Minor config dialog tweaks.
- v587
- - Adjusted the privmsging for the actions to not display the path of the file for those without this script.
- v588
- - Upon taking out the file path (so it wouldn't bother those without the script, the md5 lookup didn't have the
- file path needed to search so a change up of SREQUEST was needed.
- v589
- - Playlist function added, but the playlist mode is still in it's testing phase. Added dialog for Adding, Deleteing and Editing Msplay created .m3u playlists.
- The playlist editor does not work well with .m3u's created by outside programs such as Winamp and Windows Media Player.
- If a file isn't found in a playlist it will go to the next one, this may cause a problem later if each file can't be found it may cause an unstable loop.
- v590
- - Fixed Deleting a file listed in a playlist. Added a halt to the "is empty list" error so it doesn't just loop forever. Added a 3 non-exist limit to playing files in
- a list. If 3 files fail to play, in a list, in a row, pops up a warning rather than get crazy with looping.
- v591
- - Fixed problem while trying to apply settings in the options dialog. Problem has been there since the beginning, I just forgot to add to write the settings for the
- Function keys to defaults of 1. Something had to be selected in the dropdown ID box. Thanks Guyver for finding it so I could fix it.
- v592
- - Misc. cleaning. Removed the need for the %ms_chkply variable getting set, having the data is stored in the config file and a variable is pointless.
- Took out %msigon and various other variables that no longer served a purpose. Lesson'ed the need for some setting of %variables by making some local.
- v593
- - Minor playlist repair.
- v594
- - Cleanup. Added goto next playlist if at end of another. Added submenu playlist selection.
- v595
- - Fixed a bug where when someone would play an MSOUND and if you had the playlist option on, when the sound was done, would make the playlist start.
- v595b
- - Guyver wanted highlighting.
- v596
- - added an equation to calculate a start pos on mp3's because mIRC is stupid
- v597
- - In process of adding a "MSPLAY for dummies" dialog for those who are too lazy to type in /msplay and would rather waste time having to click buttons.
- v598
- - Changed up the options dialog. naki wanted a minimize button in the "MSPLAY for dummies" dialog so I gave it one, which in turn puts it on the desktop of windows.
- Reorganized "MSPLAY for dummies and added a scrollbar.
- v599
- - Options dialog straightening. Prefixes "@%+" will now be shown if checked "on" in the mirc options. Fixed own msplay coloring. That's right color not colour.
- v600
- - Adding the use of an external player.
- */
- alias msplayversion { return 600 }
- alias msplay {
- unset %playlistmodeused %msplay_playlistline
- if ($msoundcfg(enableplaylist) == 1) {
- var %curplaylist = $iif($msoundcfg(curplaylist) == $null,$msoundcfg(playlist),$msoundcfg(curplaylist))
- var %playlist = $+(",$msoundcfg(playlistdir) $+ $gettok(%curplaylist,2,58),")
- set %playlistmodeused $true
- if ($exists(%playlist)) {
- if (($1 isnum) || ($1 == $null)) {
- var %lines = $lines(%playlist), %playfile = $read(%playlist,$1)
- if (%lines) {
- if (%playfile) { set %msplay_playlistline $1 }
- else { %playfile = $read(%playlist,1) | set %msplay_playlistline 1 }
- }
- else { var %dumbass = $input(Playlist is empty dumbass!.,wo,MSPLAY ERROR) | halt }
- }
- else {
- var %lines = $lines(%playlist), %i = 1, %foundonline, %playfile
- while (%lines > 0) {
- var %file = $nopath($read(%playlist, %i))
- if ($1- isin %file) { %foundonline = $readn | goto continue }
- dec %lines | inc %i
- }
- :continue
- if (%foundonline) { %playfile = $read(%playlist,%foundonline) | set %msplay_playlistline %foundonline }
- else { %playfile = $read(%playlist,1) | set %msplay_playlistline 1 }
- }
- echo -ag %playfile $exists(%playfile)
- if ($exists(%playfile)) {
- if (%msplaylistnullcount) { unset %msplaylistnullcount }
- msound $file(%playfile).size %playfile
- }
- if (!$exists(%playfile)) {
- if (%msplaylistnullcount == $null) { set %msplaylistnullcount 1 }
- if (%msplaylistnullcount) {
- inc %msplaylistnullcount
- if (%msplaylistnullcount >= 4) {
- unset %msplaylistnullcount
- var %nads = %msplay_playlistline
- var %range = : $+ $calc(%nads -2) $+ : $+ $calc(%nads -1) $+ : $+ %nads $+ :
- var %lines = : $+ $lines(%playlist) $+ :
- var %dumbass = $input(3 files in the playlist have failed to play in a row. Do you wish to continue playing the list?,wy,MSPLAY ERROR)
- if (%dumbass == $false) { halt }
- if ((%lines isin %range) || (-1 isin %range)) {
- if ($msoundcfg(stopplaylist) == 1) { halt }
- if ($msoundcfg(gotonextplaylist) == 1) {
- unset %msplay_playlistline
- gotonextplaylist
- }
- }
- }
- }
- if ($msoundcfg(notfoundwarning) == 1) { var %dumbass = $input(The file in the playlist you are trying to play does not exist anymore or has been moved. Do you want to continue playing? $crlf %playfile,wy,MSPLAY ERROR) }
- if ((%dumbass) || ($msoundcfg(notfoundwarning) != 1)) { .timer 1 0 msplay $calc(%msplay_playlistline +1) }
- }
- }
- else { var %dumbass = $input(The selected playlist does not exist. Check your settings dumbass!.,wo,MSPLAY ERROR) }
- halt
- }
- :start
- if ($msoundcfg(stopcurrent) == 1) {
- if (($insong) || ($inwave) || ($inmidi)) { splay stop }
- }
- var %msfn, %msrpv
- if ($1 == $null) { %msfn = $easyfs(*,$rand(1,$easyfs(*,0))) }
- if ($left($1,1) == $chr(35)) {
- set %mschan $1
- %msrpv = $2
- if ($3) { %msfn = $easyfs($2,$3) | goto sound }
- elseif (($2) && (!$3)) { %msfn = $easyfs($2,$rand(1,$easyfs($2,0))) }
- goto sound
- }
- elseif ($1 isnum) { %msfn = $easyfs(*,$1) | goto sound }
- else {
- if ($2) { %msfn = $easyfs($1,$2) | %msrpv = $1 | goto sound }
- elseif (($1) && (!$2)) { %msfn = $easyfs($1,$rand(1,$easyfs($1,0))) | %msrpv = $1 | goto sound }
- }
- :sound
- var %msdumb = $msext(%msfn)
- if ((%msfn == $null) || (%msfn isnum)) { halt }
- ;if ($gettok(%msfn,-1,46) == xml) { goto start }
- elseif (!%msdumb) { msre | halt }
- else {
- msound $file(%msfn).size %msfn
- if (%msrp) { .timerms -m 1 $calc($sound2(%msfn).length + 1000) msre %msrpv }
- }
- }
- alias msre { msplay $1- }
- ;on 1:join:#null:{ if (($nick == $me) || ($nick == scorpwanna)) { msplay $chan rb-incominggame.mp3 } }
- #functionkeys on
- alias F1 { funckeycore F1 }
- alias F2 { funckeycore F2 }
- alias F3 { funckeycore F3 }
- alias F4 { funckeycore F4 }
- alias F5 { funckeycore F5 }
- alias F6 { funckeycore F6 }
- alias F7 { funckeycore F7 }
- alias F8 { funckeycore F8 }
- alias F9 { funckeycore F9 }
- alias F10 { funckeycore F10 }
- alias F11 { funckeycore F11 }
- alias F12 { funckeycore F12 }
- #functionkeys end
- ;Begin Function Key Core
- alias -l funckeycore {
- var %func = $gettok($msoundcfg($1),1,44)
- if (%func == 1) { msplay }
- if ((%func == 2) || (%func == 8)) { msplay $gettok($msoundcfg($1),2,44) }
- if (%func == 3) { var %selectfile = $sfile(*.wav,Select Sound File,Play) | if (%selectfile) { msplay $nopath(%selectfile) } }
- if (%func == 4) { writeini -n $msoundcfgfile settings acceptsrequest $iif($msoundcfg(acceptsrequest) == 0,1,0) | echo $colour(notice) -a $timestamp * The ability to hear incoming sounds has been turned $iif($msoundcfg(acceptsrequest) == 0,Off,On) }
- if (%func == 5) { writeini -n $msoundcfgfile settings mutemsplay $iif($msoundcfg(mutemsplay) == 0,1,0) | echo $colour(notice) -a $timestamp * $iif($msoundcfg(mutemsplay) == 0,Unmuted,Muted) MSplay }
- if (%func == 6) { writeini -n $msoundcfgfile settings soundinterrupt $iif($msoundcfg(soundinterrupt) == 0,1,0) | echo $colour(notice) -a $timestamp * Sound Interruptions are now $iif($msoundcfg(soundinterrupt) == 0,Not Allowed,Allowed) }
- if (%func == 7) { writeini -n $msoundcfgfile settings enablesmode $iif($msoundcfg(enablesmode) == 0,1,0) | echo $colour(notice) -a $timestamp * Silent Mode is now $iif($msoundcfg(enablesmode) == 0,Disabled,Enabled) }
- if (%func == 9) { writeini -n $msoundcfgfile settings stopcurrent $iif($msoundcfg(stopcurrent) == 0,1,0) | echo $colour(notice) -a $timestamp * Stopping Current sound on new sound has been turned $iif($msoundcfg(stopcurrent) == 0,Off,On) }
- if (%func == 10) { writeini -n $msoundcfgfile settings ctcpactionplay $iif($msoundcfg(ctcpactionplay) == 0,1,0) | echo $colour(notice) -a $timestamp * MSound will now play sounds as $iif($msoundcfg(ctcpactionplay) == 0, an ACTION, a CTCP) }
- if (%func == 11) { writeini -n $msoundcfgfile settings enableplaylist $iif($msoundcfg(enableplaylist) == 0,1,0) | echo $colour(notice) -a $timestamp * Playlist Mode is now $iif($msoundcfg(enableplaylist) == 0,Disabled,Enabled) }
- }
- ;End Function Key Core
- alias easyfs {
- var %msnumtok = $gettok(%msdir,0,44), %msgtk, %msisgood, %mschorn, %msnaki, %msscorp, %msomg
- %msgtk = 1
- unset %mssfile_*
- while (%msgtk <= %msnumtok) {
- if ($2 == 0) { set %mssfile_ $+ [ %msgtk ] $findfile($gettok(%msdir,%msgtk,44) , * $+ $1 $+ * ,$2) }
- if ($2 >= 1) {
- %msomg = $2
- %msisgood = $findfile($gettok(%msdir,%msgtk,44),* $+ $1 $+ * , $mschk($2,%msgtk,$1))
- if (%msisgood) {
- return %msisgood
- }
- }
- inc %msgtk 1
- }
- if ($2 == 0) {
- %msnaki = $var(mssfile_*,0)
- %msscorp = 1
- while (%msscorp <= %msnaki) {
- %mschorn = $calc( [ %mssfile_ [ $+ [ %msscorp ] ] ] + %mschorn)
- inc %msscorp 1
- }
- return %mschorn
- }
- }
- alias mschk {
- var %msf
- if ($2 == 1) { return $1 }
- elseif ($2 >= 2) {
- var %msa = 1
- while (%msa <= $2) {
- set %msb_ [ $+ [ $calc($2 - %msa) ] ] $findfile($gettok(%msdir,$calc($2 - %msa),44), * $+ $3 $+ *,0))
- inc %msa 1
- }
- unset %msb_0
- var %msc = 1, %msd
- while (%msc <= $var(msb_*)) {
- %msd = $calc( %msb_ [ $+ [ %msc ] ] + %msd )
- inc %msc 1
- }
- set %mse $calc($easyfs($3,0) - %msd)
- %msf = $calc($1 - %msd)
- }
- unset %msb_* %mse
- return %msf
- }
- alias usvar { unset %msvar | unset %mschan | unset %msf2 | unset %msf3 | unset %msff | unset %msout }
- alias msound {
- var %fileinfo
- if (($msoundcfg(ctcpactionplay) == 0) && ($msoundcfg(displayfileinfo) == 1)) {
- ;Get file info
- var %filetype, %length, %bitrate, %sample, %mode
- %filetype = $right($2-,3)
- if (%filetype == mp3) {
- %length = $sound($2-).length
- var %length2 = $int($calc(%length * 0.001))
- var %lengthmin = $int($calc(%length2 /60))
- var %lengthsec = $calc(%length2 - $calc(%lengthmin *60))
- %lengthsec = $iif($len(%lengthsec) = 1,0 $+ %lengthsec,%lengthsec)
- %bitrate = $sound($2-).bitrate $+ kbps
- %sample = $sound($2-).sample $+ khz
- %mode = $sound($2-).mode
- %length = %lengthmin $+ : $+ %lengthsec
- }
- %fileinfo = %bitrate %sample %mode %length
- }
- var %caplay = $msoundcfg(ctcpactionplay)
- var %ensmode = $iif($msoundcfg(enablesmode) == 1,SPLAY,SOUND)
- var %prefix = $gettok($readini(mirc.ini,options,n2),30,44)
- %prefix = $iif(%prefix == 1,$iif($me isop #,@))
- echo $colour($iif(%caplay = 1,ctcp,own)) -al $timestamp $iif(%caplay = 1,[M $+ %ensmode,* %prefix $+ $me M $+ %ensmode) $nopath($2-) $+ $iif(%caplay = 1,]) %fileinfo
- if ($msoundcfg(enablesmode) == 0) { PRIVMSG $active $iif(%caplay = 1,MSOUND,ACTION MSOUND) $1 $nopath($2-) %fileinfo $+ }
- var %runexternal = false
- if (($gettok($msoundcfg(useexprogram),1,44) == 1) && ($gettok($msoundcfg(useexprogram),2,44) != $null)) { %runexternal = true }
- if (%runexternal == true) { run -n $+(",$gettok($msoundcfg(useexprogram),2,44),") $+(",$2-,") }
- if (%runexternal == false) { splay $+(",$2-,") $int($calc(0.003416 * $mp3($2-).length)) }
- if ($dialog(msplayfordummies)) {
- var %insong = $nopath($insong.fname)
- var %i = 1, %lines = $did(msplayfordummies,1).lines
- while (%i <= %lines) {
- var %line = $did(msplayfordummies,1,%i)
- if (%line == %insong) { did -c msplayfordummies 1 %i | break }
- inc %i
- }
- }
- }
- on ^1:ACTION:MSOUND*:#: {
- if ($msoundcfg(acceptsrequest) == 1) {
- if ($msoundcfg(enableplaylist) == 1) { set %msincomingplayonce true }
- haltdef
- var %fileinfo
- var %reqfile = $regex(file,$3-,/((?:[^*])+\.(?:mp3|wav|ogg|mid|wma)(?:[^\s]*))/ig)
- if (%reqfile) {
- %fileinfo = $remove($3-,$regml(file,1))
- tokenize 32 $1 $2 $regml(file,1)
- }
- var %acceptfile = $acceptrejectfile($2)
- var %prefix = $gettok($readini(mirc.ini,options,n2),30,44)
- %prefix = $iif(%prefix == 1,$iif($nick isop #,@))
- echo $colour(action) -l $chan $timestamp * %prefix $+ $nick MSOUND $nopath($3-) %fileinfo
- if ($easyfs($nopath($3-),1)) {
- if ($msoundcfg(soundinterrupt) == 0) {
- if (($inwave) || ($inmidi) || ($insong)) { halt }
- else {
- if ($msoundcfg(mutemsplay) == 0) { splay $easyfs($nopath($3-),1) }
- }
- }
- else {
- if ($msoundcfg(mutemsplay) == 0) { splay $easyfs($nopath($3-),1) }
- }
- }
- else {
- if ($msoundcfg(enablesrequest) == 1) {
- if ($gettok($msoundcfg(requestfilesize),1,44) == 1) {
- if (%acceptfile == true) { ctcp $nick SREQUEST $setvar($3-) }
- }
- else { ctcp $nick SREQUEST $setvar($3-) }
- }
- }
- }
- if ($msoundcfg(acceptsrequest) == 0) {
- haltdef
- echo $colour(action) -lhttp://www.scifix.com/images/temp/msplay_beta_v598.mrc $chan $timestamp * $nick MSOUND $nopath($3-)
- }
- halt
- }
- CTCP 1:MSOUND:*: {
- if ($msoundcfg(acceptsrequest) == 1) {
- if ($msoundcfg(enableplaylist) == 1) { set %msincomingplayonce true }
- var %reqfile = $regex(file,$3-,/((?:[^*])+\.(?:mp3|wav|ogg|mid|wma)(?:[^\s]*))/ig)
- if (%reqfile) { tokenize 32 $1 $2 $regml(file,1) }
- var %acceptfile = $acceptrejectfile($2)
- echo $colour(ctcp) -a $timestamp $chr(91) $+ $nick MSOUND $nopath($3-) $+ $chr(93)
- if ($easyfs($nopath($3-),1)) {
- if ($msoundcfg(soundinterrupt) == 0) {
- if (($inwave) || ($inmidi) || ($insong)) { halt }
- else {
- if ($msoundcfg(mutemsplay) == 0) { splay $easyfs($nopath($3-),1) }
- }
- }
- else {
- if ($msoundcfg(mutemsplay) == 0) { splay $easyfs($nopath($3-),1) }
- }
- }
- else {
- if ($msoundcfg(enablesrequest) == 1) {
- if ($gettok($msoundcfg(requestfilesize),1,44) == 1) {
- if (%acceptfile == true) { ctcp $nick SREQUEST $setvar($3-) }
- }
- else { ctcp $nick SREQUEST $setvar($3-) }
- }
- }
- }
- halt
- }
- alias setvar { return $1- }
- ctcp 1:SREQUEST:*:{
- if ($msoundcfg(srequestlisten) == 1) {
- var %file = $easyfs($2-,1)
- var %filehash = $md5(%file,2)
- ;echo -ag %filehash $2-
- ctcp $nick SREQUESTINFO %filehash $nopath(%file)
- dcc send $iif($msoundcfg(closegetsend) == 1,-c) $nick " $+ %file $+ "
- }
- }
- ctcp 1:SREQUESTINFO:*: {
- var %searchhashtable = $hget(msplaygetfile,$2)
- if (!%searchhashtable) {
- hadd -sm msplaygetfile $2 $3-
- }
- }
- alias -l acceptrejectfile {
- var %incomingfilesize = $1
- var %acceptsize = $gettok($msoundcfg(requestfilesize),2,44)
- var %acceptsuf = $gettok($msoundcfg(requestfilesize),4,44)
- if (%acceptsuf == KB) { %acceptsize = $calc(%acceptsize *1024) }
- if (%acceptsuf == MB) { %acceptsize = $calc($calc(%acceptsize *1024) *1024) }
- if (%acceptsuf == GB) { %acceptsize = $calc($calc($calc(%acceptsize *1024) *1024) *1024) }
- return $iif(%incomingfilesize <= %acceptsize,true,false)
- }
- on 1:FILERCVD:*: {
- var %filercvdhash = $md5($filename,2)
- var %gethashinfo = $hget(msplaygetfile,%filercvdhash)
- if (%gethashinfo) {
- var %getpath = $nofile($filename)
- var %renamefrom = $filename
- var %renameto %getpath $+ %gethashinfo
- rename $+(",%renamefrom,") $+(",%renameto,")
- hdel -s msplaygetfile %filercvdhash
- if (($window(Get $nick $nopath($filename))) && ($msoundcfg(closegetsent) == 1)) {
- ;echo -ag (experimental only) %renameto is done from $nick close this window only
- var %i = 1
- var %winid = $get(-1).hwnd
- while (%winid) {
- if (%winid == $get($nick,%i).hwnd) { close -g $+ %i $nick | return }
- inc %i
- }
- }
- }
- }
- alias msext {
- var %msext = $gettok($1-,-1,46)
- if (%msext isin mp3 wma ogg mid wav) { return $1- }
- else { return $null }
- }
- alias msdad {
- msplay $replace($nopath($2-),$chr(32),$chr(42))
- }
- alias -l writemsoundcfg { writeini -n $msoundcfgfile settings $1- }
- on 1:load: {
- if ($exists($msoundcfgfile)) {
- ;Had to use == $null because the damn !not didn't want to work right if $msound(something) returned 0
- if ($msoundcfg(acceptsrequest) == $null) { writemsoundcfg acceptsrequest 0 }
- if ($msoundcfg(enablesmode) == $null) { writemsoundcfg enablesmode 0 }
- if ($msoundcfg(stopcurrent) == $null) { writemsoundcfg stopcurrent 0 }
- if ($msoundcfg(soundinterrupt) == $null) { writemsoundcfg soundinterrupt 0 }
- if ($msoundcfg(enablesrequest) == $null) { writemsoundcfg enablesrequest 1 }
- if ($msoundcfg(srequestlisten) == $null) { writemsoundcfg srequestlisten 1 }
- if ($msoundcfg(includewavedir) == $null) { writemsoundcfg includewavedir 1 }
- if ($msoundcfg(includemp3dir) == $null) { writemsoundcfg includemp3dir 1 }
- if ($msoundcfg(includeoggdir) == $null) { writemsoundcfg includeoggdir 0 }
- if ($msoundcfg(includemididir) == $null) { writemsoundcfg includemididir 0 }
- if ($msoundcfg(includewmadir) == $null) { writemsoundcfg includewmadir 0 }
- if ($msoundcfg(mutemsplay) == $null) { writemsoundcfg mutemsplay 0 }
- if ($msoundcfg(ctcpactionplay) == $null) { writemsoundcfg ctcpactionplay 1 }
- if ($msoundcfg(displayfileinfo) == $null) { writemsoundcfg displayfileinfo 0 }
- if ($msoundcfg(playlistdir) == $null) { writemsoundcfg playlistdir $mp3dir }
- if ($msoundcfg(stopplaylist) == $null) { writemsoundcfg stopplaylist 1 }
- if ($msoundcfg(F1) == $null) { writemsoundcfg F1 1 }
- if ($msoundcfg(F2) == $null) { writemsoundcfg F2 1 }
- if ($msoundcfg(F3) == $null) { writemsoundcfg F3 1 }
- if ($msoundcfg(F4) == $null) { writemsoundcfg F4 1 }
- if ($msoundcfg(F5) == $null) { writemsoundcfg F5 1 }
- if ($msoundcfg(F6) == $null) { writemsoundcfg F6 1 }
- if ($msoundcfg(F7) == $null) { writemsoundcfg F7 1 }
- if ($msoundcfg(F8) == $null) { writemsoundcfg F8 1 }
- if ($msoundcfg(F9) == $null) { writemsoundcfg F9 1 }
- if ($msoundcfg(F10) == $null) { writemsoundcfg F10 1 }
- if ($msoundcfg(F11) == $null) { writemsoundcfg F11 1 }
- if ($msoundcfg(F12) == $null) { writemsoundcfg F12 1 }
- }
- if (!$exists($msoundcfgfile)) {
- writemsoundcfg acceptsrequest 0
- writemsoundcfg enablesmode 0
- writemsoundcfg soundinterrupt 0
- writemsoundcfg enablesrequest 1
- writemsoundcfg srequestlisten 1
- writemsoundcfg includewavedir 1
- writemsoundcfg includemp3dir 1
- writemsoundcfg includeoggdir 0
- writemsoundcfg includemididir 0
- writemsoundcfg includewmadir 0
- writemsoundcfg mutemsplay 0
- writemsoundcfg ctcpactionplay 1
- writemsoundcfg displayfileinfo 0
- writemsoundcfg playlistdir $mp3dir
- writemsoundcfg stopplaylist 1
- writemsoundcfg F1 1
- writemsoundcfg F2 1
- writemsoundcfg F3 1
- writemsoundcfg F4 1
- writemsoundcfg F5 1
- writemsoundcfg F6 1
- writemsoundcfg F7 1
- writemsoundcfg F8 1
- writemsoundcfg F9 1
- writemsoundcfg F10 1
- writemsoundcfg F11 1
- writemsoundcfg F12 1
- }
- if (!%msdir) { set %msdir $addintsnddirs }
- }
- alias -l msoundcfgfile { return $+(", $scriptdirmsoundcfg.ini,") }
- alias -l msoundcfg { return $readini($msoundcfgfile,settings,$1) }
- alias -l oggdir { return $sound(ogg) }
- alias -l wmadir { return $sound(wma) }
- menu Nicklist,Channel,Status,Query {
- Scriptbusters
- .MSound
- ..MSound Config Dialog:msoundconfigdialog
- ..MSound Config File:run notepad $msoundcfgfile
- ..-
- ..$iif($msoundcfg(mutemsplay) == 1,$style(1)) Mute Incoming MSplay:writemsoundcfg mutemsplay $iif($msoundcfg(mutemsplay) == 1,0,1)
- ..$iif($msoundcfg(enableplaylist) != 1,$style(2)) Select Playlist: {
- var %playlist = $sfile($msoundcfg(playlistdir) $+ *.m3u,Select Playlist,Ok)
- if ($exists(%playlist)) {
- var %i = 1, %e = $findfile($msoundcfg(playlistdir),*.m3u,0)
- while (%i <= %e) {
- if ($findfile($msoundcfg(playlistdir),*.m3u,%i) == %playlist) {
- writemsoundcfg curplaylist %i $+ : $+ $nopath(%playlist)
- break
- }
- inc %i
- }
- }
- }
- ..$iif($msoundcfg(msplayfordummies) != 1,$style(2)) MSPLAY for Dummies:msplayfordummies
- }
- alias -l msoundconfigdialog { dialog -mocka mscfgdlg mscfgdlg }
- dialog mscfgdlg {
- title "My Sound Configuration"
- size -1 -1 234 200
- option dbu
- text "Category:", 91, 3 7 30 8
- list 90, 2 15 52 174, vsbar
- tab "Options", 7, -25 -25 1 1, disable hide
- check "Allow incoming sounds (CTCP MSOUNDS will not be viewable)", 12, 60 15 166 10, tab 7
- check "Enable Silent Mode (Play to Self)", 8, 60 25 88 10, tab 7
- check "On new msplay stop current playing sound", 70, 60 35 112 10, tab 7
- check "Allow incoming sound interruption", 9, 60 45 90 10, tab 7
- check "Request sound if doesn't exist", 10, 60 55 88 10, tab 7
- check "Only request sound if filesize is below:", 67, 60 65 102 10, tab 7
- edit "", 68, 163 65 20 11, tab 7
- combo 69, 184 65 20 11, drop, tab 7
- check "Listen for DCC sound requests", 11, 60 75 88 10, tab 7
- text "Play file", 71, 60 87 88 10, tab 7
- radio "over CTCP", 72, 80 85 38 10, tab 7
- radio "as an action", 73, 120 85 38 10, tab 7
- check "Display file info when playing as action", 74, 60 95 108 10, tab 7
- check "Enable MSPLAY for dummies", 75, 60 105 170 10, tab 7
- tab "Sound Directories", 1, disable hide
- ;text "mIRC's $wavedir and $mp3dir added by default.", 5, 60 9 120 10
- check "Include mIRC .wav directory", 5, 60 15 80 10, tab 1
- check "Include mIRC .mp3 directory", 6, 60 25 80 10, tab 1
- check "Include mIRC .ogg directory", 14, 60 35 80 10, tab 1
- check "Include mIRC .mid directory", 15, 145 15 80 10, tab 1
- check "Include mIRC .wma directory", 16, 145 25 80 10, tab 1
- ;list 6, 155 17 170 24
- button "Add Directory", 2, 60 47 40 11, tab 1
- button "Del Selected Directory", 3, 103 47 60 11, tab 1
- list 4, 60 61 170 60, vsbar hsbar, tab 1
- check "Use External Player:", 92, 60 120 60 10, tab 1
- button "", 93, 120 120 110 11, tab 1
- tab "Function Keys", 17, disable hide
- check "Enable Function Keys", 13, 60 15 74 10, tab 17
- text "Designate Function Keys", 18, 60 24 170 10, center tab 17
- text "F1", 19, 60 34 20 10, tab 17
- combo 20, 70 33 67 40, drop, tab 17
- edit "" 21, 138 33 78 11, read, tab 17
- button "..." 22, 218 33 12 11, tab 17
- text "F2", 23, 60 46 20 10, tab 17
- combo 24, 70 45 67 40, drop, tab 17
- edit "" 25, 138 45 78 11, read, tab 17
- button "..." 26, 218 45 12 11, tab 17
- text "F3", 27, 60 58 20 10, tab 17
- combo 28, 70 57 67 40, drop, tab 17
- edit "" 29, 138 57 78 11, read, tab 17
- button "..." 30, 218 57 12 11, tab 17
- text "F4", 31, 60 70 20 10, tab 17
- combo 32, 70 69 67 40, drop, tab 17
- edit "" 33, 138 69 78 11, read, tab 17
- button "..." 34, 218 69 12 11, tab 17
- text "F5", 35, 60 82 20 10, tab 17
- combo 36, 70 81 67 40, drop, tab 17
- edit "" 37, 138 81 78 11, read, tab 17
- button "..." 38, 218 81 12 11, tab 17
- text "F6", 39, 60 94 20 10, tab 17
- combo 40, 70 93 67 40, drop, tab 17
- edit "" 41, 138 93 78 11, read, tab 17
- button "..." 42, 218 93 12 11, tab 17
- text "F7", 43, 60 106 20 10, tab 17
- combo 44, 70 105 67 40, drop, tab 17
- edit "" 45, 138 105 78 11, read, tab 17
- button "..." 46, 218 105 12 11, tab 17
- text "F8", 47, 60 118 20 10, tab 17
- combo 48, 70 117 67 40, drop, tab 17
- edit "" 49, 138 117 78 11, read, tab 17
- button "..." 50, 218 117 12 11, tab 17
- text "F9", 51, 60 130 20 10, tab 17
- combo 52, 70 129 67 40, drop, tab 17
- edit "" 53, 138 129 78 11, read, tab 17
- button "..." 54, 218 129 12 11, tab 17
- text "F10", 55, 60 142 20 10, tab 17
- combo 56, 70 141 67 40, drop, tab 17
- edit "" 57, 138 141 78 11, read, tab 17
- button "..." 58, 218 141 12 11, tab 17
- text "F11", 59, 60 154 20 10, tab 17
- combo 60, 70 153 67 40, drop, tab 17
- edit "" 61, 138 153 78 11, read, tab 17
- button "..." 62, 218 153 12 11, tab 17
- text "F12", 63, 60 166 20 10, tab 17
- combo 64, 70 165 67 40, drop, tab 17
- edit "" 65, 138 165 78 11, read, tab 17
- button "..." 66, 218 165 12 11, tab 17
- tab "Play Lists", 76, disable hide
- text "Play List Manager", 77, 124 15 50 8, tab 76
- list 78, 59 24 124 80, size, tab 76
- button "ADD Playlist", 79, 190 24 36 12, tab 76
- button "DEL Playlist", 80, 190 36 36 12, tab 76
- button "EDIT Playlist", 81, 190 48 36 12, tab 76
- text "Play List Directory:", 82, 60 108 50 8, tab 76
- button "", 83, 109 106 104 12, tab 76
- check "Enable Playlist Mode", 84, 60 120 108 10, tab 76
- radio "Stop at end of playlist",89, 60 130 160 10, tab 76
- radio "Repeat Playlist if end of list", 85, 60 140 100 10, tab 76
- radio "Goto next playlist at end of current playlist",87, 60 150 160 10, tab 76
- text "Playlist selected in list at left will be default.", 88, 188 70 40 30, tab 76
- check "Display warning if file in playlist does not exist on play.", 86, 60 160 160 10, tab 76
- button "Apply", 100, 82 187 30 11
- button "Close", 101, 115 187 30 11
- }
- on 1:dialog:mscfgdlg:init:*: { did -b mscfgdlg 100 | refreshmscfgdlg }
- on 1:dialog:mscfgdlg:sclick:*: {
- if ($did = 2) {
- var %sdir = $sdir(*,Select Sound Directory)
- if (%sdir) {
- did -e mscfgdlg 100
- did -a mscfgdlg 4 %sdir
- }
- }
- if ($did = 3) {
- did -e mscfgdlg 100
- var %dsel = $did(mscfgdlg,4).sel
- if (%dsel) { did -d mscfgdlg 4 %dsel }
- }
- if (($did = 5) || ($did = 6) || ($did = 8) || ($did = 9) || ($did = 11) || ($did = 12) || ($did = 14) || ($did = 15) || ($did = 16) || ($did = 70)) { did -e mscfgdlg 100 }
- if ($did = 10) {
- did -e mscfgdlg 100
- did $iif($did(mscfgdlg,10).state == 1,-e,-b) mscfgdlg 67,68,69
- }
- if ($did = 13) {
- did -e mscfgdlg 100
- did $iif($did(mscfgdlg,13).state == 1,-e,-b) mscfgdlg 20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
- if ($did(mscfgdlg,13).state == 1) {
- var %Fs = 1
- var %Fe = 12
- var %startonID 22
- while (%Fs <= %Fe) {
- did $iif($gettok($msoundcfg(F $+ %Fs),1,44) == 2,-e,-b) mscfgdlg %startonID
- inc %Fs | inc %startonID 4
- }
- }
- }
- if ($did = 20) {
- did -e mscfgdlg 100
- did $iif($did(mscfgdlg,20).sel == 2,-e,-b) mscfgdlg 21,22
- did $iif($did(mscfgdlg,20).sel == 8,-en,-bm) mscfgdlg 21
- }
- if ($did = 22) {
- var %selectfile = $sfile(*.wav,Select Sound File,Select)
- if (%selectfile) { did -e mscfgdlg 100 | did -a mscfgdlg 21 $nopath(%selectfile) }
- }
- if ($did = 24) {
- did -e mscfgdlg 100
- did $iif($did(mscfgdlg,24).sel == 2,-e,-b) mscfgdlg 25,26
- did $iif($did(mscfgdlg,24).sel == 8,-en,-bm) mscfgdlg 25
- }
- if ($did = 26) {
- var %selectfile = $sfile(*.wav,Select Sound File,Select)
- if (%selectfile) { did -e mscfgdlg 100 | did -a mscfgdlg 25 $nopath(%selectfile) }
- }
- if ($did = 28) {
- did -e mscfgdlg 100
- did $iif($did(mscfgdlg,28).sel == 2,-e,-b) mscfgdlg 29,30
- did $iif($did(mscfgdlg,28).sel == 8,-en,-bm) mscfgdlg 29
- }
- if ($did = 30) {
- var %selectfile = $sfile(*.wav,Select Sound File,Select)
- if (%selectfile) { did -e mscfgdlg 100 | did -a mscfgdlg 29 $nopath(%selectfile) }
- }
- if ($did = 32) {
- did -e mscfgdlg 100
- did $iif($did(mscfgdlg,32).sel == 2,-e,-b) mscfgdlg 33,34
- did $iif($did(mscfgdlg,32).sel == 8,-en,-bm) mscfgdlg 33
- }
- if ($did = 34) {
- var %selectfile = $sfile(*.wav,Select Sound File,Select)
- if (%selectfile) { did -e mscfgdlg 100 | did -a mscfgdlg 33 $nopath(%selectfile) }
- }
- if ($did = 36) {
- did -e mscfgdlg 100
- did $iif($did(mscfgdlg,36).sel == 2,-e,-b) mscfgdlg 37,38
- did $iif($did(mscfgdlg,36).sel == 8,-en,-bm) mscfgdlg 37
- }
- if ($did = 38) {
- var %selectfile = $sfile(*.wav,Select Sound File,Select)
- if (%selectfile) { did -e mscfgdlg 100 | did -a mscfgdlg 37 $nopath(%selectfile) }
- }
- if ($did = 40) {
- did -e mscfgdlg 100
- did $iif($did(mscfgdlg,40).sel == 2,-e,-b) mscfgdlg 41,42
- did $iif($did(mscfgdlg,40).sel == 8,-en,-bm) mscfgdlg 41
- }
- if ($did = 42) {
- var %selectfile = $sfile(*.wav,Select Sound File,Select)
- if (%selectfile) { did -e mscfgdlg 100 | did -a mscfgdlg 41 $nopath(%selectfile) }
- }
- if ($did = 44) {
- did -e mscfgdlg 100
- did $iif($did(mscfgdlg,44).sel == 2,-e,-b) mscfgdlg 45,46
- did $iif($did(mscfgdlg,44).sel == 8,-en,-bm) mscfgdlg 45
- }
- if ($did = 46) {
- var %selectfile = $sfile(*.wav,Select Sound File,Select)
- if (%selectfile) { did -e mscfgdlg 100 | did -a mscfgdlg 45 $nopath(%selectfile) }
- }
- if ($did = 48) {
- did -e mscfgdlg 100
- did $iif($did(mscfgdlg,48).sel == 2,-e,-b) mscfgdlg 49,50
- did $iif($did(mscfgdlg,48).sel == 8,-en,-bm) mscfgdlg 49
- }
- if ($did = 50) {
- var %selectfile = $sfile(*.wav,Select Sound File,Select)
- if (%selectfile) { did -e mscfgdlg 100 | did -a mscfgdlg 49 $nopath(%selectfile) }
- }
- if ($did = 52) {
- did -e mscfgdlg 100
- did $iif($did(mscfgdlg,52).sel == 2,-e,-b) mscfgdlg 53,54
- did $iif($did(mscfgdlg,52).sel == 8,-en,-bm) mscfgdlg 53
- }
- if ($did = 54) {
- var %selectfile = $sfile(*.wav,Select Sound File,Select)
- if (%selectfile) { did -e mscfgdlg 100 | did -a mscfgdlg 53 $nopath(%selectfile) }
- }
- if ($did = 56) {
- did -e mscfgdlg 100
- did $iif($did(mscfgdlg,56).sel == 2,-e,-b) mscfgdlg 57,58
- did $iif($did(mscfgdlg,56).sel == 8,-en,-bm) mscfgdlg 57
- }
- if ($did = 58) {
- var %selectfile = $sfile(*.wav,Select Sound File,Select)
- if (%selectfile) { did -e mscfgdlg 100 | did -a mscfgdlg 57 $nopath(%selectfile) }
- }
- if ($did = 60) {
- did -e mscfgdlg 100
- did $iif($did(mscfgdlg,60).sel == 2,-e,-b) mscfgdlg 61,62
- did $iif($did(mscfgdlg,60).sel == 8,-en,-bm) mscfgdlg 61
- }
- if ($did = 62) {
- var %selectfile = $sfile(*.wav,Select Sound File,Select)
- if (%selectfile) { did -e mscfgdlg 100 | did -a mscfgdlg 61 $nopath(%selectfile) }
- }
- if ($did = 64) {
- did -e mscfgdlg 100
- did $iif($did(mscfgdlg,64).sel == 2,-e,-b) mscfgdlg 65,66
- did $iif($did(mscfgdlg,64).sel == 8,-en,-bm) mscfgdlg 65
- }
- if ($did = 66) {
- var %selectfile = $sfile(*.wav,Select Sound File,Select)
- if (%selectfile) { did -e mscfgdlg 100 | did -a mscfgdlg 65 $nopath(%selectfile) }
- }
- if (($did = 67) || ($did = 68) || ($did = 69) || ($did = 74) || ($did = 75) || ($did = 84) || ($did = 85) || ($did = 86) || ($did = 87) || ($did = 89) || ($did = 92)) {
- did -e mscfgdlg 100
- }
- if (($did = 72) || ($did = 73)) { did -e mscfgdlg 100 | did $iif($did(mscfgdlg,72).state = 1,-b,-e) mscfgdlg 74 }
- if ($did = 78) {
- did -e mscfgdlg 100
- }
- if ($did = 79) {
- dialog -n mscfgdlg
- :start
- var %newplaylist = $input(Type in a name for your new playlist.,ae,Create Playlist,New Playlist)
- if (($chr(92) isin %newplaylist) || ($chr(47) isin %newplaylist) || ($chr(58) isin %newplaylist) || ($chr(42) isin %newplaylist) || ($chr(63) isin %newplaylist) || ($chr(34) isin %newplaylist) || ($chr(60) isin %newplaylist) || ($chr(62) isin %newplaylist) || ($chr(124) isin %newplaylist)) {
- var %uhoh! = $input(A file name cannot contain any of the following characters: $crlf \ / : * ? " < > |,w,MSPLAY WARNING)
- goto start
- }
- if (%newplaylist) {
- %newplaylist = $+(",$msoundcfg(playlistdir) $+ %newplaylist $+ .m3u,")
- write %newplaylist
- if ($exists(%newplaylist)) { refreshoptionsplaylist }
- }
- else { var %fuck = $input(Playlist Not Created,w,MSPLAY ERROR) }
- dialog -o mscfgdlg
- }
- if ($did = 80) {
- dialog -n mscfgdlg
- var %delplaylist = $did(mscfgdlg,78).seltext
- if (%delplaylist) {
- var %confirmdel = $input(Are you sure you want to delete? $crlf %delplaylist,qy,Confirm Deletion)
- if (%confirmdel) {
- %delplaylist = $+(",$msoundcfg(playlistdir) $+ %delplaylist,")
- if ($exists(%delplaylist)) { .remove -b %delplaylist | refreshoptionsplaylist }
- else { var %fuck = $input(Unable to delete playlist!,w,MSPLAY WARNING) }
- }
- }
- else { var %fuck = $input(No Playlist Selected,w,MSPLAY WARNING) }
- dialog -o mscfgdlg
- }
- if ($did = 81) {
- dialog -n mscfgdlg
- var %editplaylist = $did(mscfgdlg,78).seltext
- if (%editplaylist) {
- set %mspedlgplaylist %editplaylist
- if (!$dialog(mspedlg)) { msoundplaylisteditordialog }
- }
- else { var %fuck = $input(No Playlist Selected,w,MSPLAY WARNING) }
- dialog -o mscfgdlg
- }
- if ($did = 83) {
- var %playlistdir = $sdir(this,Select Playlist Directory)
- if (%playlistdir) { writemsoundcfg playlistdir %playlistdir | refreshmscfgdlg }
- }
- if ($did = 90) {
- writemsoundcfg optionslinenum $did(mscfgdlg,90).sel
- writemsoundcfg optionsselected $did(mscfgdlg,90).seltext
- msplayoptionsselected
- }
- if ($did = 93) {
- var %externalplayer = $sfile(*.exe,Select External Player Program,Use Program)
- if (%externalplayer) { did -e mscfgdlg 100 | did -ca mscfgdlg 93 %externalplayer }
- }
- if ($did = 100) { applymscfgdlg }
- if ($did = 101) {
- if ($did(mscfgdlg,100).enabled == $true) {
- dialog -n mscfgdlg
- var %yayornay = $input(There are unsaved changes. Would you like to save the changes?,awy,MSPLAY WARNING)
- if (%yayornay == $true) { applymscfgdlg }
- }
- dialog -x mscfgdlg
- }
- }
- on 1:dialog:mscfgdlg:edit:*: { did -e mscfgdlg 100 }
- alias -l applymscfgdlg {
- writemsoundcfg acceptsrequest $did(mscfgdlg,12).state
- writemsoundcfg enablesmode $did(mscfgdlg,8).state
- writemsoundcfg stopcurrent $did(mscfgdlg,70).state
- writemsoundcfg soundinterrupt $did(mscfgdlg,9).state
- writemsoundcfg enablesrequest $did(mscfgdlg,10).state
- writemsoundcfg requestfilesize $did(mscfgdlg,67).state $+ $chr(44) $+ $did(mscfgdlg,68) $+ $chr(44) $+ $did(mscfgdlg,69).sel $+ $chr(44) $+ $did(mscfgdlg,69)
- writemsoundcfg srequestlisten $did(mscfgdlg,11).state
- writemsoundcfg ctcpactionplay $iif($did(mscfgdlg,72).state == 1,1,0)
- writemsoundcfg displayfileinfo $did(mscfgdlg,74).state
- writemsoundcfg msplayfordummies $did(mscfgdlg,75).state
- writemsoundcfg enableplaylist $did(mscfgdlg,84).state
- writemsoundcfg repeatplaylist $did(mscfgdlg,85).state
- writemsoundcfg notfoundwarning $did(mscfgdlg,86).state
- writemsoundcfg gotonextplaylist $did(mscfgdlg,87).state
- writemsoundcfg stopplaylist $did(mscfgdlg,89).state
- writemsoundcfg includewavedir $did(mscfgdlg,5).state
- writemsoundcfg includemp3dir $did(mscfgdlg,6).state
- writemsoundcfg includeoggdir $did(mscfgdlg,14).state
- writemsoundcfg includemididir $did(mscfgdlg,15).state
- writemsoundcfg includewmadir $did(mscfgdlg,16).state
- writemsoundcfg enablefunkeys $did(mscfgdlg,13).state
- if ($did(mscfgdlg,78).seltext) { writemsoundcfg playlist $did(mscfgdlg,78).sel $+ : $+ $did(mscfgdlg,78).seltext }
- writemsoundcfg useexprogram $did(mscfgdlg,92).state $+ $chr(44) $+ $did(mscfgdlg,93)
- var %dirlines = $did(mscfgdlg,4).lines
- remini $msoundcfgfile settings msdirs
- var %msdirtmp
- if (%dirlines > 0) {
- var %i = 1
- while (%i <= %dirlines) {
- %msdirtmp = %msdirtmp $+ $iif(%i != 1,$chr(44)) $+ $did(mscfgdlg,4,%i).text
- inc %i
- }
- writemsoundcfg msdirs %msdirtmp
- }
- set %msdir $addintsnddirs
- $iif($did(mscfgdlg,13).state == 1,.enable,.disable) #functionkeys
- writemsoundcfg F1 $did(mscfgdlg,20).sel $+ $iif($did(mscfgdlg,20).sel == 2 || $did(mscfgdlg,20).sel == 8,$chr(44) $+ $did(mscfgdlg,21))
- writemsoundcfg F2 $did(mscfgdlg,24).sel $+ $iif($did(mscfgdlg,24).sel == 2 || $did(mscfgdlg,24).sel == 8,$chr(44) $+ $did(mscfgdlg,25))
- writemsoundcfg F3 $did(mscfgdlg,28).sel $+ $iif($did(mscfgdlg,28).sel == 2 || $did(mscfgdlg,28).sel == 8,$chr(44) $+ $did(mscfgdlg,29))
- writemsoundcfg F4 $did(mscfgdlg,32).sel $+ $iif($did(mscfgdlg,32).sel == 2 || $did(mscfgdlg,32).sel == 8,$chr(44) $+ $did(mscfgdlg,33))
- writemsoundcfg F5 $did(mscfgdlg,36).sel $+ $iif($did(mscfgdlg,36).sel == 2 || $did(mscfgdlg,36).sel == 8,$chr(44) $+ $did(mscfgdlg,37))
- writemsoundcfg F6 $did(mscfgdlg,40).sel $+ $iif($did(mscfgdlg,40).sel == 2 || $did(mscfgdlg,40).sel == 8,$chr(44) $+ $did(mscfgdlg,41))
- writemsoundcfg F7 $did(mscfgdlg,44).sel $+ $iif($did(mscfgdlg,44).sel == 2 || $did(mscfgdlg,44).sel == 8,$chr(44) $+ $did(mscfgdlg,45))
- writemsoundcfg F8 $did(mscfgdlg,48).sel $+ $iif($did(mscfgdlg,48).sel == 2 || $did(mscfgdlg,48).sel == 8,$chr(44) $+ $did(mscfgdlg,49))
- writemsoundcfg F9 $did(mscfgdlg,52).sel $+ $iif($did(mscfgdlg,52).sel == 2 || $did(mscfgdlg,52).sel == 8,$chr(44) $+ $did(mscfgdlg,53))
- writemsoundcfg F10 $did(mscfgdlg,56).sel $+ $iif($did(mscfgdlg,56).sel == 2 || $did(mscfgdlg,56).sel == 8,$chr(44) $+ $did(mscfgdlg,57))
- writemsoundcfg F11 $did(mscfgdlg,60).sel $+ $iif($did(mscfgdlg,60).sel == 2 || $did(mscfgdlg,60).sel == 8,$chr(44) $+ $did(mscfgdlg,61))
- writemsoundcfg F12 $did(mscfgdlg,64).sel $+ $iif($did(mscfgdlg,64).sel == 2 || $did(mscfgdlg,64).sel == 8,$chr(44) $+ $did(mscfgdlg,65))
- did -b mscfgdlg 100
- }
- alias -l addintsnddirs {
- var %tmpsounddirs, %sounddirs, %dircount, %curdir, %ifalreadyexists
- if (($msoundcfg(includewavedir) == 1) || ($msoundcfg(includemp3dir) == 1) || ($msoundcfg(includeoggdir) == 1) || ($msoundcfg(includemididir) == 1) || ($msoundcfg(includewmadir) == 1)) {
- %tmpsounddirs = $iif($msoundcfg(includewavedir) == 1,$wavedir $+ $chr(44)) $+ $iif($msoundcfg(includemp3dir) == 1,$mp3dir $+ $chr(44)) $+ $iif($msoundcfg(includemididir) == 1,$mididir $+ $chr(44)) $+ $iif($msoundcfg(includeoggdir) == 1,$oggdir $+ $chr(44)) $+ $iif($msoundcfg(includewmadir) == 1,$wmadir $+ $chr(44)) $+ $msoundcfg(msdirs)
- %dircount = $gettok(%tmpsounddirs,0,44)
- var %i = 1
- while (%i <= %dircount) {
- %curdir = $gettok(%tmpsounddirs,%i,44)
- if (%i == 1) { %sounddirs = %curdir $+ $iif(%dircount > 1,$chr(44)) }
- if (%i > 1) {
- if (%curdir !isin %sounddirs) { %sounddirs = %sounddirs $+ %curdir $+ , }
- }
- inc %i
- }
- }
- return %sounddirs
- }
- alias -l refreshmscfgdlg {
- if ($msoundcfg(Options) == $null) { writemsoundcfg Options 0 }
- msplaydlgoptionslist
- did $iif($msoundcfg(acceptsrequest) == 1,-c,-u) mscfgdlg 12
- did $iif($msoundcfg(enablesmode) == 1,-c,-u) mscfgdlg 8
- did $iif($msoundcfg(stopcurrent) == 1,-c,-u) mscfgdlg 70
- did $iif($msoundcfg(soundinterrupt) == 1,-c,-u) mscfgdlg 9
- did $iif($msoundcfg(enablesrequest) == 1,-c,-u) mscfgdlg 10
- did $iif($msoundcfg(enablesrequest) == 1,-e,-b) mscfgdlg 67,68,69
- did $iif($gettok($msoundcfg(requestfilesize),1,44) == 1,-c,-u) mscfgdlg 67
- did -ca mscfgdlg 68 $gettok($msoundcfg(requestfilesize),2,44)
- did -a mscfgdlg 69 KB
- did -a mscfgdlg 69 MB
- did -a mscfgdlg 69 GB
- did -c mscfgdlg 69 $gettok($msoundcfg(requestfilesize),3,44)
- did -c mscfgdlg $iif($msoundcfg(ctcpactionplay) == 1,72,73)
- did $iif($msoundcfg(ctcpactionplay) = 1,-b,-e) mscfgdlg 74
- did $iif($msoundcfg(displayfileinfo) == 1,-c,-u) mscfgdlg 74
- did $iif($msoundcfg(msplayfordummies) == 1,-c,-u) mscfgdlg 75
- .timer 1 0 did -c mscfgdlg 78 $gettok($msoundcfg(playlist),1,58)
- did $iif($msoundcfg(enableplaylist) == 1,-c,-u) mscfgdlg 84
- did $iif($msoundcfg(notfoundwarning) == 1,-c,-u) mscfgdlg 86
- did $iif($msoundcfg(stopplaylist) == 1,-c,-u) mscfgdlg 89
- did $iif($msoundcfg(repeatplaylist) == 1,-c,-u) mscfgdlg 85
- did $iif($msoundcfg(gotonextplaylist) == 1,-c,-u) mscfgdlg 87
- did $iif($msoundcfg(srequestlisten) == 1,-c,-u) mscfgdlg 11
- did $iif($msoundcfg(includewavedir) == 1,-c,-u) mscfgdlg 5
- did $iif($msoundcfg(includemp3dir) == 1,-c,-u) mscfgdlg 6
- did $iif($msoundcfg(includeoggdir) == 1,-c,-u) mscfgdlg 14
- did $iif($msoundcfg(includemididir) == 1,-c,-u) mscfgdlg 15
- did $iif($msoundcfg(includewmadir) == 1,-c,-u) mscfgdlg 16
- did $iif($group(#functionkeys) == off,-u,-c) mscfgdlg 13
- did -ra mscfgdlg 83 $iif($msoundcfg(playlistdir),$msoundcfg(playlistdir),$mp3dir)
- did $iif($gettok($msoundcfg(useexprogram),1,44) == 1,-c,-u) mscfgdlg 92
- did -ca mscfgdlg 93 $gettok($msoundcfg(useexprogram),2,44)
- did -a mscfgdlg 20,24,28,32,36,40,44,48,52,56,60,64 Play Random Sound
- did -a mscfgdlg 20,24,28,32,36,40,44,48,52,56,60,64 Play Specified Sound
- did -a mscfgdlg 20,24,28,32,36,40,44,48,52,56,60,64 Prompt for Play Sound
- did -a mscfgdlg 20,24,28,32,36,40,44,48,52,56,60,64 Toggle Incoming Sounds
- did -a mscfgdlg 20,24,28,32,36,40,44,48,52,56,60,64 Toggle Mute
- did -a mscfgdlg 20,24,28,32,36,40,44,48,52,56,60,64 Toggle Sound Interruption
- did -a mscfgdlg 20,24,28,32,36,40,44,48,52,56,60,64 Toggle Silent Mode
- did -a mscfgdlg 20,24,28,32,36,40,44,48,52,56,60,64 Play Search String
- did -a mscfgdlg 20,24,28,32,36,40,44,48,52,56,60,64 Toggle Stop Current
- did -a mscfgdlg 20,24,28,32,36,40,44,48,52,56,60,64 Toggle CTCP/ACTION Play
- did -a mscfgdlg 20,24,28,32,36,40,44,48,52,56,60,64 Toggle Playlist Mode
- did -c mscfgdlg 20 $gettok($msoundcfg(F1),1,44) | did -a mscfgdlg 21 $gettok($msoundcfg(F1),2,44) | did $iif($gettok($msoundcfg(F1),1,44) == 2,-e,-b) mscfgdlg 21,22 | did $iif($gettok($msoundcfg(F1),1,44) == 8,-en,-bm) mscfgdlg 21
- did -c mscfgdlg 24 $gettok($msoundcfg(F2),1,44) | did -a mscfgdlg 25 $gettok($msoundcfg(F2),2,44) | did $iif($gettok($msoundcfg(F2),1,44) == 2,-e,-b) mscfgdlg 25,26 | did $iif($gettok($msoundcfg(F2),1,44) == 8,-en,-bm) mscfgdlg 25
- did -c mscfgdlg 28 $gettok($msoundcfg(F3),1,44) | did -a mscfgdlg 29 $gettok($msoundcfg(F3),2,44) | did $iif($gettok($msoundcfg(F3),1,44) == 2,-e,-b) mscfgdlg 29,30 | did $iif($gettok($msoundcfg(F3),1,44) == 8,-en,-bm) mscfgdlg 29
- did -c mscfgdlg 32 $gettok($msoundcfg(F4),1,44) | did -a mscfgdlg 33 $gettok($msoundcfg(F4),2,44) | did $iif($gettok($msoundcfg(F4),1,44) == 2,-e,-b) mscfgdlg 33,34 | did $iif($gettok($msoundcfg(F4),1,44) == 8,-en,-bm) mscfgdlg 33
- did -c mscfgdlg 36 $gettok($msoundcfg(F5),1,44) | did -a mscfgdlg 37 $gettok($msoundcfg(F5),2,44) | did $iif($gettok($msoundcfg(F5),1,44) == 2,-e,-b) mscfgdlg 37,38 | did $iif($gettok($msoundcfg(F5),1,44) == 8,-en,-bm) mscfgdlg 37
- did -c mscfgdlg 40 $gettok($msoundcfg(F6),1,44) | did -a mscfgdlg 41 $gettok($msoundcfg(F6),2,44) | did $iif($gettok($msoundcfg(F6),1,44) == 2,-e,-b) mscfgdlg 41,42 | did $iif($gettok($msoundcfg(F6),1,44) == 8,-en,-bm) mscfgdlg 41
- did -c mscfgdlg 44 $gettok($msoundcfg(F7),1,44) | did -a mscfgdlg 45 $gettok($msoundcfg(F7),2,44) | did $iif($gettok($msoundcfg(F7),1,44) == 2,-e,-b) mscfgdlg 45,46 | did $iif($gettok($msoundcfg(F7),1,44) == 8,-en,-bm) mscfgdlg 45
- did -c mscfgdlg 48 $gettok($msoundcfg(F8),1,44) | did -a mscfgdlg 49 $gettok($msoundcfg(F8),2,44) | did $iif($gettok($msoundcfg(F8),1,44) == 2,-e,-b) mscfgdlg 49,50 | did $iif($gettok($msoundcfg(F8),1,44) == 8,-en,-bm) mscfgdlg 49
- did -c mscfgdlg 52 $gettok($msoundcfg(F9),1,44) | did -a mscfgdlg 53 $gettok($msoundcfg(F9),2,44) | did $iif($gettok($msoundcfg(F9),1,44) == 2,-e,-b) mscfgdlg 53,54 | did $iif($gettok($msoundcfg(F9),1,44) == 8,-en,-bm) mscfgdlg 53
- did -c mscfgdlg 56 $gettok($msoundcfg(F10),1,44) | did -a mscfgdlg 57 $gettok($msoundcfg(F10),2,44) | did $iif($gettok($msoundcfg(F10),1,44) == 2,-e,-b) mscfgdlg 57,58 | did $iif($gettok($msoundcfg(F10),1,44) == 8,-en,-bm) mscfgdlg 57
- did -c mscfgdlg 60 $gettok($msoundcfg(F11),1,44) | did -a mscfgdlg 61 $gettok($msoundcfg(F11),2,44) | did $iif($gettok($msoundcfg(F11),1,44) == 2,-e,-b) mscfgdlg 61,62 | did $iif($gettok($msoundcfg(F11),1,44) == 8,-en,-bm) mscfgdlg 61
- did -c mscfgdlg 64 $gettok($msoundcfg(F12),1,44) | did -a mscfgdlg 65 $gettok($msoundcfg(F12),2,44) | did $iif($gettok($msoundcfg(F12),1,44) == 2,-e,-b) mscfgdlg 65,66 | did $iif($gettok($msoundcfg(F12),1,44) == 8,-en,-bm) mscfgdlg 65
- did $iif($group(#functionkeys) == on,-e,-b) mscfgdlg 20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
- if ($group(#functionkeys) == on) {
- var %Fs = 1
- var %Fe = 12
- var %startonID 22
- while (%Fs <= %Fe) {
- did $iif($gettok($msoundcfg(F $+ %Fs),1,44) == 2,-e,-b) mscfgdlg %startonID
- inc %Fs | inc %startonID 4
- }
- }
- refreshmscfgdlgdirlist
- refreshoptionsplaylist
- .timermsplayoptionsinit 1 0 { msplayoptionsselected }
- }
- alias -l msplayoptionsselected {
- if ($msoundcfg(optionsselected) == $chr(160)) {
- writemsoundcfg optionslinenum $calc($msoundcfg(optionslinenum) + 1)
- did -c mscfgdlg 90 $msoundcfg(optionslinenum)
- writemsoundcfg mscfgdlg $did(mp3pleroptions,90).seltext
- }
- did -c mscfgdlg 90 $msoundcfg(optionslinenum)
- if ($msoundcfg(optionsselected) == [+] Options) { did -ec mscfgdlg 7 }
- if ($msoundcfg(optionsselected) == [--] Options) { did -ec mscfgdlg 7 }
- if ($msoundcfg(optionsselected) == -Directories) { did -ec mscfgdlg 1 }
- if ($msoundcfg(optionsselected) == -Function Keys) { did -ec mscfgdlg 17 }
- if ($msoundcfg(optionsselected) == -Playlists) { did -ec mscfgdlg 76 }
- }
- alias -l expandOptions {
- did -a mscfgdlg 90 [--] Options
- did -a mscfgdlg 90 -Directories
- did -a mscfgdlg 90 -Function Keys
- did -a mscfgdlg 90 -Playlists
- ;did -a mscfgdlg 90
- }
- alias -l collapseOptions { did -a mscfgdlg 90 [+] Options }
- alias -l msplaydlgoptionslist {
- did -r mscfgdlg 90
- if ($msoundcfg(Options) == 0) { collapseOptions }
- if ($msoundcfg(Options) == 1) { expandOptions }
- did -c mscfgdlg 90 $msoundcfg(optionslinenum)
- }
- alias -l refreshmscfgdlgdirlist {
- var %msdirs = $msoundcfg(msdirs)
- if (%msdirs) {
- did -r mscfgdlg 4
- var %i = 1
- var %dnums = $gettok(%msdirs,0,44)
- while (%i <= %dnums) {
- did -a mscfgdlg 4 $gettok(%msdirs,%i,44)
- inc %i
- }
- }
- }
- on *:dialog:mscfgdlg:dclick:*: {
- if ($did = 90) {
- var %seloptions = $did(mscfgdlg,90).seltext
- if ((%seloptions == [+] Options) || (%seloptions == [--] Options)) { writemsoundcfg Options $iif($msoundcfg(Options) == 1,0,1) | msplaydlgoptionslist }
- did -c mscfgdlg 90 $msoundcfg(optionslinenum)
- }
- }
- on *:MIDIEND: {
- if (($msoundcfg(enableplaylist) == 1) && (%playlistmodeused)) {
- if (%msincomingplayonce) { unset %msincomingplayonce | halt }
- inc %msplay_playlistline
- :start
- var %playlist = $+(",$msoundcfg(playlistdir) $+ $gettok($msoundcfg(curplaylist),2,58),"), %repeatplaylist = $msoundcfg(repeatplaylist)
- if ((%repeatplaylist == 1) && ($lines(%playlist) < %msplay_playlistline)) { %msplay_playlistline = 1 }
- if ((%repeatplaylist == 0) && (%msplay_playlistline > $lines(%playlist))) {
- if ($msoundcfg(gotonextplaylist) == 1) {
- gotonextplaylist
- if ($dialog(msplayfordummies) { msplaydummiesplaylist }
- %msplay_playlistline = 1
- goto start
- }
- else { halt }
- }
- msplay %msplay_playlistline
- }
- }
- on *:MP3END: {
- if ($timer(msscrolling)) { .timermsscrolling off }
- if ($dialog(msplayfordummies)) {
- if (%ms-scrolling) { unset %ms-scrolling }
- did -c msplayfordummies 12 1
- did -z msplayfordummies 12 0 0
- }
- if (($msoundcfg(enableplaylist) == 1) && (%playlistmodeused)) {
- if (%msincomingplayonce) { unset %msincomingplayonce | halt }
- inc %msplay_playlistline
- :start
- var %playlist = $+(",$msoundcfg(playlistdir) $+ $gettok($msoundcfg(curplaylist),2,58),"), %repeatplaylist = $msoundcfg(repeatplaylist)
- if ((%repeatplaylist == 1) && ($lines(%playlist) < %msplay_playlistline)) { %msplay_playlistline = 1 }
- if ((%repeatplaylist == 0) && (%msplay_playlistline > $lines(%playlist))) {
- if ($msoundcfg(gotonextplaylist) == 1) {
- gotonextplaylist
- if ($dialog(msplayfordummies)) {
- msplaydummiesplaylist
- }
- %msplay_playlistline = 1
- goto start
- }
- else { halt }
- }
- .timer 1 1 scrollplay
- msplay %msplay_playlistline
- }
- }
- on *:WAVEEND: {
- if (($msoundcfg(enableplaylist) == 1) && (%playlistmodeused)) {
- if (%msincomingplayonce) { unset %msincomingplayonce | halt }
- inc %msplay_playlistline
- :start
- var %playlist = $+(",$msoundcfg(playlistdir) $+ $gettok($msoundcfg(curplaylist),2,58),"), %repeatplaylist = $msoundcfg(repeatplaylist)
- if ((%repeatplaylist == 1) && ($lines(%playlist) < %msplay_playlistline)) { %msplay_playlistline = 1 }
- if ((%repeatplaylist == 0) && (%msplay_playlistline > $lines(%playlist))) {
- if ($msoundcfg(gotonextplaylist) == 1) {
- gotonextplaylist
- if ($dialog(msplayfordummies) { msplaydummiesplaylist }
- %msplay_playlistline = 1
- goto start
- }
- else { halt }
- }
- msplay %msplay_playlistline
- }
- }
- ;Playlist Editor Dialog
- alias -l msoundplaylisteditordialog { dialog -mocka mspedlg mspedlg }
- dialog mspedlg {
- title "MSplay Playlist Editor"
- size -1 -1 300 200
- option dbu
- list 1, 1 18 298 180, vsbar hsbar multsel
- button "Add Audio Files", 2, 2 4 44 12
- button "Del Selected Files", 3, 48 4 50 12
- button "Save Playlist", 4, 100 4 40 12
- text "Editing:", 5, 150 6 20 8
- text "test", 6, 170 6 140 8
- }
- on *:dialog:mspedlg:init:mspedlg: {
- did -a mspedlg 6 %mspedlgplaylist
- refreshplaylisteditor %mspedlgplaylist
- unset %mspedlgplaylist
- }
- on *:dialog:mspedlg:sclick:*: {
- if ($did = 2) {
- var %addfiles = $msfile($gettok(%msdir,1,44) $+ *.mp3,Select Audio Files,Add)
- if (%addfiles = -1) {
- dialog -n mscfgdlg
- dialog -n mspedlg
- var %fuck = $input(Too many files selected.,aow,MSPLAY WARNING)
- dialog -o mscfgdlg
- dialog -o mspedlg
- halt
- }
- if (%addfiles) {
- var %i = 1, %t = %addfiles
- while (%i <= %t) {
- did -a mspedlg 1 $msfile(%i)
- inc %i
- }
- did -z mspedlg 1
- }
- }
- if ($did = 3) {
- var %i = 1, %e = $did(mspedlg,1,0).lines, %s = $did(mspedlg,1,0).sel, %selected
- while (%i <= %s) {
- %selected = %selected $+ : $+ $did(mspedlg,1,%i).sel $+ :
- inc %i
- }
- %i = 1
- hmake msplaytmpplaylistdel 100
- while (%i <= %e) {
- var %cursel = : $+ %i $+ :
- if (%cursel !isin %selected) { hadd msplaytmpplaylistdel %i $did(mspedlg,1,%i) }
- inc %i
- }
- if ($hget(msplaytmpplaylistdel)) {
- did -r mspedlg 1
- %i = 1
- while (%i <= %e) {
- var %curhget = $hget(msplaytmpplaylistdel,%i)
- if (%curhget) { did -a mspedlg 1 %curhget }
- inc %i
- }
- hfree msplaytmpplaylistdel
- }
- did -z mspedlg 1
- }
- if ($did = 4) {
- var %playlist = $+(",$msoundcfg(playlistdir) $+ $did(mspedlg,6),")
- var %playlistfsize = $file(%playlist).size
- write -c %playlist
- var %i = 1, %e = $did(mspedlg,1).lines
- while (%i <= %e) {
- write %playlist $did(mspedlg,1,%i)
- inc %i
- }
- if (%playlistfsize != $file(%playlist).size) {
- dialog -n mscfgdlg
- dialog -n mspedlg
- var %fuck = $input(Updated playlist: $crlf $nopath(%playlist),awo,MSPLAY)
- dialog -o mscfgdlg
- dialog -o mspedlg
- }
- }
- }
- alias -l refreshplaylisteditor {
- var %playlist = $+(",$msoundcfg(playlistdir) $+ $1-,")
- if ($exists(%playlist)) {
- var %i = 1, %e = $lines(%playlist)
- while (%i <= %e) {
- var %line = $read(%playlist, %i)
- did -z mspedlg 1
- ;if ($left(%line,1) != $chr(35)) {
- did -a mspedlg 1 %line
- ;}
- inc %i
- }
- }
- }
- alias refreshoptionsplaylist {
- did -r mscfgdlg 78
- var %playlistdir = $msoundcfg(playlistdir)
- var %i = 1, %e = $findfile(%playlistdir,*.m3u,0)
- while (%i <= %e) {
- var %playlist = $findfile(%playlistdir,*.m3u,%i)
- did -a mscfgdlg 78 $nopath(%playlist)
- inc %i
- }
- }
- alias gotoprevplaylist {
- var %curplaylist = $msoundcfg(curplaylist), %onplaylist, %nextplaylist
- if (%curplaylist == $null) { writemsoundcfg curplaylist $msoundcfg(playlist) | %curplaylist = $msoundcfg(playlist) }
- if (%curplaylist) {
- var %i = 1, %e = $findfile($msoundcfg(playlistdir),*.m3u,0)
- while (%i <= %e) {
- %onplaylist = %i $+ : $+ $nopath($findfile($msoundcfg(playlistdir),*.m3u,%i))
- if ($gettok(%curplaylist,1,58) == %i) {
- var %i2 = $calc(%i -1)
- if (%i2 > %e) { %i2 = 1 }
- if (%i2 == 0) { %i2 = %e }
- %nextplaylist = $findfile($msoundcfg(playlistdir),*.m3u,%i2)
- if ($exists(%nextplaylist)) {
- %nextplaylist = %i2 $+ : $+ $nopath(%nextplaylist)
- writemsoundcfg curplaylist %nextplaylist
- break
- }
- }
- inc %i
- }
- }
- if ($dialog(msplayfordummies)) { did -ar msplayfordummies 11 $gettok($msoundcfg(curplaylist),2,58) }
- }
- alias gotonextplaylist {
- var %curplaylist = $msoundcfg(curplaylist), %onplaylist, %nextplaylist
- if (%curplaylist == $null) { writemsoundcfg curplaylist $msoundcfg(playlist) | %curplaylist = $msoundcfg(playlist) }
- if (%curplaylist) {
- var %i = 1, %e = $findfile($msoundcfg(playlistdir),*.m3u,0)
- while (%i <= %e) {
- %onplaylist = %i $+ : $+ $nopath($findfile($msoundcfg(playlistdir),*.m3u,%i))
- if ($gettok(%curplaylist,1,58) == %i) {
- var %i2 = $calc(%i +1)
- if (%i2 > %e) { %i2 = 1 }
- %nextplaylist = $findfile($msoundcfg(playlistdir),*.m3u,%i2)
- if ($exists(%nextplaylist)) {
- %nextplaylist = %i2 $+ : $+ $nopath(%nextplaylist)
- writemsoundcfg curplaylist %nextplaylist
- break
- }
- }
- inc %i
- }
- }
- if ($dialog(msplayfordummies)) { did -ar msplayfordummies 11 $gettok($msoundcfg(curplaylist),2,58) }
- }
- alias -l msplayfordummies { dialog -dm msplayfordummies msplayfordummies }
- dialog msplayfordummies {
- title "MSPLAY for Dummies"
- size -1 -1 200 105
- option dbu
- list 1, 0 13 200 70, size hsbar vsbar
- button "Search For", 2, 1 1 34 10
- edit "", 3, 38 1 80 11
- button "Play", 4, 1 94 20 10
- button "Play Random", 5, 45 94 40 10
- button "List Playlist", 6, 1 1 34 10
- button "<-", 7, 38 1 9 10
- button "->", 8, 47 1 9 10
- button "Stop", 9, 179 94 20 10
- text "Current Playlist:", 10, 60 3 40 8
- text "", 11, 102 3 110 8
- scroll "", 12, 23 82 153 10, horizontal range 0 0
- }
- on *:dialog:msplayfordummies:scroll:12: { if ($insong) { splay -p seek $did(msplayfordummies,12).sel $+ 000 } }
- on *:dialog:msplayfordummies:init:*: {
- if ($msoundcfg(enableplaylist) == 1) { did -bh $dname 2,3,5 }
- if ($msoundcfg(enableplaylist) == 0) { did -bh $dname 6,7,8,10,11 }
- ;did -b $dname 4
- did -t $dname 2
- did -a $dname 11 $gettok($msoundcfg(curplaylist),2,58)
- if ($msoundcfg(enableplaylist) == 1) { msplaydummiesplaylist }
- if (($insong) || ($inwave) || ($inmidi)) { did -c $dname 1 %msplay_playlistline | .timermsscrolling 0 1 scrollplay }
- }
- on *:dialog:msplayfordummies:close:*: { if (%ms-scrolling) { unset %ms-scrolling } }
- on *:dialog:msplayfordummies:sclick:*: {
- if ($msoundcfg(enableplaylist) == 1) { did -bh $dname 2,3,5 | did -ev $dname 6,7,8,10,11 }
- if ($msoundcfg(enableplaylist) == 0) { did -bh $dname 6,7,8,10,11 | did -ev $dname 2,3,5 }
- if ($did = 1) {
- if ($did($dname,1).seltext) { did -e $dname 4,5 }
- }
- if (($did = 2) && ($did($dname,3))) {
- if ($msoundcfg(enableplaylist) == 1) {
- ;did -bh $dname 2,3,5
- ;did -ev $dname 6,7,8,10,11
- msplaydummiesplaylist
- halt
- }
- var %searchfor = $replace($did($dname,3),$chr(32),$chr(42))
- if (%searchfor) {
- did -r $dname 1
- var %i = 1, %e = $easyfs(%searchfor,0)
- while (%i <= %e) {
- did -a $dname 1 $nopath($easyfs(%searchfor,%i))
- inc %i
- }
- did -z $dname 1
- }
- }
- if ($did = 4) {
- splay stop
- if ($timer(msscrolling)) { .timermsscrolling off }
- if (%ms-scrolling) { unset %ms-scrolling }
- did -c $dname 12 1
- did -z $dname 12 0 0
- .timer 1 1 scrollplay
- if ($msoundcfg(enableplaylist) == 1) { msplay $did($dname,1).sel }
- else { msplay $replace($did($dname,1).seltext,$chr(32),$chr(42)) }
- }
- if ($did = 5) { msplay }
- if ($did = 6) {
- if ($msoundcfg(enableplaylist) == 0) {
- did -bh $dname 6,7,8
- did -ev $dname 2,3,5
- }
- msplaydummiesplaylist
- }
- if ($did = 7) { did -r $dname 1 | gotoprevplaylist | msplaydummiesplaylist }
- if ($did = 8) { did -r $dname 1 | gotonextplaylist | msplaydummiesplaylist }
- if ($did = 9) {
- splay stop
- if ($timer(msscrolling)) { .timermsscrolling off }
- if (%ms-scrolling) { unset %ms-scrolling }
- did -c $dname 12 1
- did -z $dname 12 0 0
- }
- }
- on *:dialog:msplayfordummies:dclick:*: {
- if ($did = 1) {
- splay stop
- if ($timer(msscrolling)) { .timermsscrolling off }
- if (%ms-scrolling) { unset %ms-scrolling }
- did -c $dname 12 1
- did -z $dname 12 0 0
- .timer 1 1 scrollplay
- if ($msoundcfg(enableplaylist) == 1) { msplay $did($dname,1).sel }
- else { msplay $replace($did($dname,1).seltext,$chr(32),$chr(42)) }
- }
- }
- alias -l msplaydummiesplaylist {
- var %playlist = $msoundcfg(playlistdir) $+ $gettok($msoundcfg(curplaylist),2,58)
- var %i = 1, %e = $lines(%playlist)
- did -r msplayfordummies 1
- while (%i <= %e) {
- did -a msplayfordummies 1 $nopath($read(%playlist,%i))
- inc %i
- }
- }
- alias -l scrollplay {
- if ($dialog(msplayfordummies)) {
- if (($inmidi) || ($insong) || ($inwave)) {
- var %length, %pos, %seconds, %secpos
- if ($inmidi) { var %length = $inmidi.length, %pos = $inmidi.pos, %seconds = $int($calc($inmidi.length *0.001))), %secpos = $int($calc($inmidi.pos *0.001)) }
- if ($insong) { var %length = $insong.length, %pos = $insong.pos, %seconds = $int($calc($insong.length *0.001))), %secpos = $int($calc($insong.pos *0.001)) }
- if ($inwave) { var %length = $inwave.length, %pos = $inwave.pos, %seconds = $int($calc($inwave.length *0.001))), %secpos = $int($calc($inwave.pos *0.001)) }
- if (%ms-scrolling == $null) {
- set %ms-scrolling $true
- did -z msplayfordummies 12 1 %seconds
- did -c msplayfordummies 12 1
- .timermsscrolling 0 1 scrollplay
- }
- did -c msplayfordummies 12 %secpos
- if (%secpos >= $calc(%seconds -1)) { unset %ms-scrolling | .timermsscrollreset 1 1 did -z msplayfordummies 12 0 0 }
- }
- }
- }
- /*
- %msrsnd
- %msctcpig
- %msvar
- *\
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement