TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Adesu on January 29, 2007, 10:04:40 PM

Title: Play winamp with Autolisp
Post by: Adesu on January 29, 2007, 10:04:40 PM
Hi Alls,
I'm not sure to play winamp with autolisp,because my ability not yet enough for it,is it possible to play winamp from autolisp?.
I would imagine if I 'm working cad and sometime bore it,then type "play" at command prompt,my Favourites song heard in my earphone.
Title: Re: Play winamp with Autolisp
Post by: daron on January 29, 2007, 10:17:26 PM
If keith can do it (http://www.theswamp.org/index.php?topic=1177.msg160676#msg160676) in vba, I'm sure you can create it in lisp.
Title: Re: Play winamp with Autolisp
Post by: JohnK on January 29, 2007, 10:32:16 PM
Use Mplayer(or Mark might be able to point out Mpg321), it would be easier.
Title: Re: Play winamp with Autolisp
Post by: Adesu on January 29, 2007, 11:03:38 PM
Hi daron,
it's nice and good code,thanks for your share.

If keith can do it (http://www.theswamp.org/index.php?topic=1177.msg160676#msg160676) in vba, I'm sure you can create it in lisp.
Title: Re: Play winamp with Autolisp
Post by: daron on January 29, 2007, 11:31:19 PM
Don't thank me. Keith coded it. It's all him.
Title: Re: Play winamp with Autolisp
Post by: Adesu on January 30, 2007, 12:25:30 AM
Oops,sorry ,thanks for your code Keith.

Title: Re: Play winamp with Autolisp
Post by: Kerry on January 30, 2007, 01:46:36 AM
hmmm .. I thought Mike Malone wrote CADAmp .... oh, well, old memories may not be precise.

Title: Re: Play winamp with Autolisp
Post by: Keith™ on January 30, 2007, 08:36:40 AM
hmmm .. I thought Mike Malone wrote CADAmp .... oh, well, old memories may not be precise.



I wrote the entire code from scratch. If you do a search around the swamp you will see that I also did an example of how you can utilize sounds in your lisp programs. The main problem with playing music with lisp is that while the lisp is active, the drawing cannot be worked on. In VBA you can subclass and execute the commands needed while you are working on the drawing.
Title: Re: Play winamp with Autolisp
Post by: daron on January 30, 2007, 09:35:05 AM
Good point. Adesu, I'd stick with what Keith has written and if possible improve upon it. That is the idea of having the source, isn't it?
Title: Re: Play winamp with Autolisp
Post by: Adesu on January 30, 2007, 06:44:25 PM
Hi Keith™ ,
It's good info,many thanks for your sharing.
Title: Re: Play winamp with Autolisp
Post by: Adesu on February 07, 2007, 03:20:18 AM
Hi Keith™ ,
Aha....I got with lisp,here that code
Code: [Select]
; pwva is stand for Play Winamp Via Autolisp
;        Design by  : Adesu <Ade Suharna>
;        Email      : mteybid@yuasabattery.co.id
;        Homepage   : http://www.yuasa-battery.co.id
;        Create     : 07 February 2007
;        Program no.: 0527/02/2007
;        Edit by    :

(defun c:pwva (/ file path fn winamp)
  (setq file "D:/YBI/General/Music/Dangdut")
  (if
    (setq path (getfiled "Select a Song File Name " file "mp3" 0))
    (progn
      (setq fn (vl-string-translate "\\" "/" path))
      (setq winamp "C:/Program Files/Winamp/winamp.exe")
      (startapp winamp fn)
      )                    ; progn
    (alert "\nInvalid,there is not selected file")
    )                      ; if
  (princ)
  )  

Quote
The main problem with playing music with lisp is that while the lisp is active, the drawing cannot be worked on.
Title: Re: Play winamp with Autolisp
Post by: Adesu on February 07, 2007, 04:23:49 AM
Hi Alls,
Sorry last time only contained one file,here more file
Code: [Select]
; pwva is stand for Play Winamp Via Autolisp
;        Design by  : Adesu <Ade Suharna>
;        Email      : mteybid@yuasabattery.co.id
;        Homepage   : http://www.yuasa-battery.co.id
;        Create     : 07 February 2007
;        Program no.: 0527/02/2007
;        Edit by    :

(defun c:pwva (/ file all_file_name file_name fn winamp)
  (setq file "D:/YBI/General/Music/Dangdut/")
  (if
    (setq all_file_name (cddr (vl-directory-files file)))
    (progn
      (foreach x all_file_name
(setq file_name (strcat file x))
(setq fn (append fn (list file_name)))
)
      (setq fn (vl-string-trim "()" (vl-princ-to-string fn)))
      (setq winamp "C:/Program Files/Winamp/winamp.exe")
      (startapp winamp fn)
      )                    ; progn
    (alert "\nInvalid,there is not selected file")
    )                      ; if
  (princ)
  )
Title: Re: Play winamp with Autolisp
Post by: Keith™ on February 07, 2007, 08:18:53 AM
I see .. basically you wanted to start an application, namely WinAmp, with lisp ... if I had understood that, I would have been able to provide it for you ... but I am glad you got it working
Title: Re: Play winamp with Autolisp
Post by: Crank on February 07, 2007, 02:19:00 PM
If the MP3 extension points to winamp, you can use the routine I posted here (http://www.theswamp.org/index.php?topic=14920.msg180567#msg180567) to. (change PDF to MP3 ;) )
Title: Re: Play winamp with Autolisp
Post by: Adesu on February 07, 2007, 07:06:23 PM
Hi Keith™,
Thanks for your support.

I see .. basically you wanted to start an application, namely WinAmp, with lisp ... if I had understood that, I would have been able to provide it for you ... but I am glad you got it working
Title: Re: Play winamp with Autolisp
Post by: Adesu on February 07, 2007, 08:11:24 PM
Hi Crank,
Your code is great,I like that,many thanks for your share.
Code: [Select]
; by Crank
(defun WinAmp (filename / shell bestand)
  (vl-load-com)
  (setq file "D:/YBI/General/Music/Dangdut/")
  (setq bestand (findfile (strcat file filename))) 
  (if
    bestand
    (progn
      (setq shell (vla-getinterfaceobject (vlax-get-acad-object) "Shell.Application"))
      (vlax-invoke-method shell 'Open bestand)
      (vlax-release-object shell)
      )
    (alert "MP3-file not found !")
    )
  (princ)
  )

(WinAmp "Sesungguhnya.mp3")



If the MP3 extension points to winamp, you can use the routine I posted here (http://www.theswamp.org/index.php?topic=14920.msg180567#msg180567) to. (change PDF to MP3 ;) )
Title: Re: Play winamp with Autolisp
Post by: JohnK on February 07, 2007, 08:42:47 PM
Winamp whoops the Llamas butt, but like i stated before, if you use the command line version of Mplayer (http://www.mplayerhq.hu/design7/info.html) you can do tons more. Like for instance, build a play list from a dir of files (movies, mp3, etc.) and play them all in one shot! (the GUI version only sends commands to the command line version based on your input.)

Another thing is that Mplayer uses config files that are just plain text so you could append or alter those config files per your needs. ...You can also stream internet radio from Mplayer. ...You could theoretically, build your very own AutoLisp GUI version of a movie, music player. Now that would be cool!
Title: Re: Play winamp with Autolisp
Post by: Keith™ on February 07, 2007, 10:52:51 PM
Winamp whoops the Llamas butt,

Lots of things do .. but CadAMP whoops Mplayer and WinAMP ... no stinking GUI at all ... just pure raw code acessing windows APIs to play all kinds of audio files ... and it uses less than 1/10th of the resources of either of the other programs.