Please login or register.

Login with username, password and session length

Author Topic: Tutorial: How to make a Winamp Remote Control from an X10 Credit Card Controller  (Read 4601 times)

billallyn

  • Newbie
  • Helpful Post Rating: 5
  • Posts: 7
    • BillAllyn.com

Tutorial: How to make a Winamp Remote Control from an X10 Credit Card Controller (KR22A)

This tutorial will create a Winamp Remote Control with the following features:
Start Playlist, Next, Pause, Play, Rewind, Forward, Volume up, and Volume down.

Rewind and Forward are adjustable in 5 second increments.  Volume up and Volume down are adjustable in 1% increments. So it can rewind a long ways or little ways depending on how you set it, or volume up in larger or small increments depending on your settings.

Note: You MUST have smart macros installed in order to do this. This is not for the faint of heart. It’s a project. Enter at your own risk. You’ve been warned.  That being said, if you have a reasonable knowledge of computers and AHP, you should be able to complete in about 2 hours.

Let's begin.

1.   Download “clamp.exe” from: http://membres.multimania.fr/clamp/binaries/1.15/CLAmp.exe
             a.  clamp.exe is a command line interface for Winamp.
             b.  For an extensive list of commands you can control, go here: http://membres.multimania.fr/clamp/
2.   Put clamp.exe in your “windows” folder. That’s all. Don’t double click it, don’t try to “install” it, just put it in your windows directory and forget about it.
3.   Create 8 batch (.bat) files (which is just a text file renamed with a .bat extension, and isn’t really all that scary) that contain and correspond to the 8 Winamp commands we’ll be using.  They will be named “load playlist.bat”, “next.bat”, “pause.bat”, “play.bat”, “rewind.bat”, “forward.bat”, “volup.bat”, and “voldn.bat”. These 8 batch files will be triggered by the X10 on/off commands of four consecutive unit codes (for instance, D1 through D4), which corresponds to the 8 buttons on your X10 Credit Card Controller (or any controller, for that matter). Create a folder and put all the batch files in one folder so that you can find them easily (you’ll need to later when we start programming smart macros within AHP).
     a.  Note: It is also possible to control Winamp with your voice, by using this basic technique, combined with Bill’s Voice Commander (http://www.wgjohns.com/bvc.htm), which is an awesome addition to anyone’s X10 arsenal, and only costs 30 dollars. There is also a free trial version that times out after 1 hour but still has full functionality.
4.    Time to start creating batch files. Later, we’ll create 8 smart macros within AHP that initiate these 8 Winamp commands.

These are the 8 batch files you’ll need to create:
----------------

1.
“load playlist.bat” will be controlled by the X10 “D1 on” command and contains the following code:

@echo off
clamp /plclear /load "path\playlist.m3u" /plset random /play

Where “path” is the full path to your Winamp playlist, and “playlist.m3u” is the full name of your playlist. It is REALLY SUPER-DUPER IMPORTANT that you get the path perfectly correct, or it will not work! I can’t tell you exactly what the path to your playlist is, because it is different on different computers. You can find the path to your playlist by clicking on the file in Windows Explorer and looking up at the address bar.

---------------

2.
“next.bat” will be controlled by the “D1 off” command and contains the following code:

@ echo off
clamp /next

---------------

3.
“pause.bat” will be controlled by the “D2 on” command and contains the following code:

@echo off
clamp /pause

--------------

4.
“play.bat” will be controlled by the “D2 off” command and contains the following code:

@echo off
clamp /play

--------------

5.
“rewind.bat” will be controlled by the “D3 on” command and contains the following code:

@echo off
clamp /rwd /rwd /rwd

Note: each “/rwd” that you add will add 5 seconds to the amount of time that it rewinds.

--------------

6.
“forward.bat” will be controlled by the “D3 off” command and contains the following code:

@echo off
clamp /fwd /fwd /fwd

Note: each “/fwd” that you add will add 5 seconds to the amount of time that it forwards. So if you want it to forward 20 seconds with a single click, use four “/fwd”s. If that makes sense. Works the same with Rewind.

--------------

7.
“voldn.bat” will be controlled by the “D4 on” command and contains the following code:

@echo off
clamp /voldn 8

---------------

8.
“volup.bat" will be controlled by the “D4 off” command and contains the following code:

@echo off
clamp /volup 8

The number after the voldn or volup command is the percentage it will raise or lower the volume. 8 works good for me. Your mileage may vary.

---------------


Ok, now we have 8 working batch files, which can be tested by double clicking on them. Now we have to program 8 smart macros within AHP that will call upon these batch files. You do have Smart Macros installed, don’t you? 

In AHP, create a room called “Winamp”. This will help keep things organized.

To Create a Macro:
Click the + sign in the Macros section and select “advanced”, if necessary.

1.   Name your new macro “Load Playlist”.
2.   Change the trigger to D1 On.
3.   Change “Macro resides in” to Winamp
4.   In the drop down list, select “Advanced Functions”
5.   Drag the “Windows Command” module into the “Drag Modules here” box.
6.   Click the grey box to the right of the command field.
7.   Navigate to the directory that contains your batch (.bat) files
8.   By default, this window is looking for .exe files, so you will need to click on the “Files of type” dropdown list and select “all files”. Then you will be able to see your batch files in the window.
9.   Select “load playlist.bat”, and click open.

You will now have a new macro named “Load Playlist” in your “Winamp” room. Check and see that it’s there. To test it, click “Run macro”, and it should bring up a DOS window, then bring up Winamp, load your playlist, and start a random song. Neato! Close Winamp for now.

Set your Credit Card Controller to House Code D and the Unit Code to 1. Then, on the controller, click “1 On”. It should bring up Winamp and start a random song. Close Winamp again.

Follow steps 1-9 in the “To Create a Macro” section above to create a macro for all 8 of your batch files, making sure to name each one correctly, place them in the Winamp room, get the house and unit codes and on/off switches properly set for each macro, and point the “Windows Command” module at the right batch file, so that your 8 buttons will control your 8 functions. Which are Start Playlist, Next, Pause, Play, Rewind, Forward, Volume up, and Volume down.

Of course, this can all be taken one step further, to voice control of Winamp, by creating a custom command within Bill’s Voice Commander for each one of the 8 necessary Winamp commands.

I hope I’ve made this as clear as possible. Let me know if you have any questions or problems, or if I’ve made any errors in my explanation.

Next tutorial: How to get free long distance with a piece of string and a couple of tin cans.  >!

--Bill Allyn

 B:( B:( B:( B:( B:(
 >*< >*< >*<
« Last Edit: May 27, 2011, 06:39:39 PM by billallyn »
Logged
My family moved alot when I was young, but I always found them.
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.