sezenspessa

HeSuVi on/off toggle tool (equalizerapo)

Oct 5th, 2018
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Racket 1.84 KB | None | 0 0
  1. #lang racket
  2.  
  3. #| the purpose of this tool to toggle HeSuVi on/off without opening the GUI
  4.    HeSuVi is a virtual surround sound tool for EqualizerAPO, utilizing dozens of HRIR files
  5.    the newest version of HeSuVi (at this time, 2.0) makes it especially annoying to toggle on/off
  6.    however, added is a new HRIR designed for speakers. haven't tried, but it's cool anyway.
  7.    if you're not a robot scanning pastebin, give it a try at their sourceforge. it's a great program
  8.    and i'll continue to shill it to everyone. |#
  9.  
  10.  
  11. ;actually writing the file thru port
  12.  
  13. (define (writefile y x)
  14.   (with-output-to-file y #:exists 'replace
  15.     (lambda () (display x))))
  16.  
  17.  
  18. ;should add folder checks but who cares its for my own use
  19.  
  20. (define eq
  21.   "C:\\Program Files\\EqualizerAPO\\config\\HeSuVi\\postlude.txt")
  22.  
  23. (define deact
  24.   "C:\\Program Files\\EqualizerAPO\\config\\HeSuVi\\deact.txt")
  25.  
  26.  
  27. ;change file
  28.  
  29. (define (off)
  30.   (writefile eq "# Include: ..\\test.txt")
  31.   (writefile deact "Eval: active=false"))
  32.  
  33. (define (on)
  34.   (writefile eq "Include: ..\\test.txt")
  35.   (writefile deact "Eval: active=true"))
  36.  
  37.  
  38. (define (fajl)
  39.   (substring (file->string deact) 13)) ;finds everything after 14th char
  40.  
  41.  
  42. (define (onoff) ; check if on
  43.   (cond
  44.     [(string=? "false" (fajl)) "[OFF]"]
  45.     [(string=? "true" (fajl)) "[ON]"]
  46.     [else "[you done fucked up somewhere]"]))
  47.  
  48. (define (retry)
  49.   (printf "\n\n\nUH OH!!!! Try again\n\n\n")
  50.   (main))
  51.  
  52.  
  53. (define (main)
  54.   (system "cls") ; cmd.exe -> cls
  55.   (printf "It is currently... ~a\n\n" (onoff))
  56.   (printf "----------------------------------\n\n")
  57.   (printf "Are you turning it ON or OFF?")
  58.   (printf "\n\n\n[1]: ON\n\n[2]: OFF\n\n\n")
  59.   (printf "Enter your selection: ")
  60.   (define ask
  61.     (read))
  62.   (cond
  63.     [(= ask 1) (on)]
  64.     [(= ask 2) (off)]
  65.     [else (retry)]))
  66.  
  67. (main) ;call main function
Add Comment
Please, Sign In to add comment