CLAMP - Command Line Winamp

CLAMP - Command Line Winamp

Purpose

The purpose of this tiny program is to drive Winamp through command line in a simple way.

PROS


> This program is standalone :
- no external piece of software required (DLL, Winamp Plug-in etc.)
- no install procedure : just download it and run

> This program is safe :
- does not write to disk (except /PLSAVE option which purpose *is* to create a file),
- does not modify registry
- does not access network (local or Internet),
- does not interact with other programs running (except Winamp of course...)
so no special privileges are required to use it.

> This program does not contain any spyware :
- it does not record anything,

> This program requires very small amount of resources.

> This is freeware.

CONS


> No cute user-friendly install,
> No uninstall procedure,
> Many features still to be developped,
> It is still beta, it might not work as expected under unexpected circomstances, (feedback to author welcome !)

Licence


CLAMP is freeware.

Usage


CLAMP {Options}

It is possible perform more than one task at a time by adding multiple options on the same line.
Each option must be preceeded by /

Upon success, program will quit with an exit code of 0.
Upon failure, exit code will be set to 1.

Program Control

STARTStart Winamp
QUITExit Winamp
RESTARTRestart Winamp
TOFRONTBring Winamp window to front New

Note : any following option will automatically start winamp if necessary - No need to use /START as first option.


General Control

PLAYPlay (current file) - Quits Stopped or Pause mode
STOPStop playing
STOPFADEStop playing with fadout
STOPAFTERStop playing after current track (returns now, stops later)
PAUSEToggle pause mode
PAUSE ON|OFFSets pause mode
PLAYPAUSESame as PAUSE
NEXTPlay next song
PREVPlay previous song
FWDForward 5 seconds
FORWARDSame as above
REWRewind 5 seconds
REWINDSame as above
RESTARTRestart current track from beginning (not working with Winamp 2)
JUMP <time>Seek to <time> (in millisecs)
QUITAFTERClose winamp upon completion of current track - CLAmp will not return immediately

Winamp Modes

REPEATToggle Repeat mode
SWREPEATSame as above
REPEAT ONSet Repeat mode ON
REPEAT=1Same as above
REPEAT OFFSet Repeat mode OFF
REPEAT=0Same as above
REPEAT STATUSQuery REPEAT status (ON, OFF)
GETREPEATSame as above
RANDOMToggle Random mode
RANDOM ONSet Random mode ON
RANDOM=1Same as above
RANDOM OFFSet Random mode OFF
RANDOM=0Same as above
RANDOM STATUSQuery RANDOM status (ON, OFF)
GETSHUFFLESame as above

PlayList Control

PLADD <file>Add file(s) to end of playlist (like drag-n-drop)
LOAD <file>Same as above
PLCLEARClear Playlist
CLEARSame as above
PLShow/Hide Winamp Playlist window
PLWINSame as above
PLPOSQuery Playlist position (requires Winamp 2.05+)
PLFIRSTPlay first item of playlist
PLLASTPlay last item of playlist
PLSET <num>Set current playlist item
(note this does not interfere with curring playing, if needed, use /PLAY after to go to this item)
PLSET RANDOMSet current playlist item to a random item within playlist
SETPLPOSSame as PLSET
LOADNEW <file>Same as /PLCLEAR /PLADD <file>
LOADPLAY <file>Shortcut for /PLCLEAR /PLADD <file> /PLAY
PLSAVE <file>Saves current playlist to <file> (as a M3U file)

Winamp Volume Control

VOLUP [X]Volume up
VOLDN [X]Volume down
VOLSET <value>Volume set (scale 0-255)
VOL=<value>Volume set (scale 0-100)
VOLMAXVolume max
VOLMINVolume min (no sound)

Windows Volume Control

Syntax: CLAMP /WAV <command> <args>
This set of commands will *not* start Winamp if not already running (no need to do so)

WAV MUTE ONMutes speaker
WAV MUTE OFFUnmutes speaker
WAV VOLGETPrints current Windows volume as two figures (left speaker, right speaker)
WAV VOLSET <value>Sets volume (for both speakers) on a 0-65535 scale
WAV VOLSET MINSets volume to zero (for both speakers)
WAV VOLSET MAXSets volume to maximum (for both speakers)

Examples
CLAMP /WAV MUTE ON
CLAMP /WAV MUTE OFF
CLAMP /WAV VOLGET
CLAMP /WAV VOLSET 32768

Infos

POSQuery current position in file and track length
PATHNAMEDisplay pathname of current track
POSITIONQuery current position in file only
STATEQuery current state (PLAYING;PAUSED;STOPPED;NOT RUNNING)
STATUSSynonym for STATE
TITLEQuery current track title (Note that, as string is returned by Winamp, it uses a Windows charset - special characters might be corrupted in a DOS window)
VERQuery Winamp version
TRACKINFO <INFO>Info on current track
Bullet POS = current position (MM:SS)
Bullet LENGTH = track length (MM:SS)
Bullet BITRATE = bitrate in KBPS
Bullet SAMPLERATE = Sample rate in KHz
Bullet CHANNELS
If no track current being played, result is zero (0 or 00:00)
PLINFO <INFO>Info on playlist
Bullet POS = current position
Bullet LENGTH = playlist length
Note that even if play list is empty (Length = 0), pos is still 1.

Track rating

RATINGDisplay current track's rating (1 to 5, 0 = No rating)
RATING=XSet rating for current track

Winamp Interactive Windows

ABOUTDisplay Winamp About window
PREFSDisplay Winamp Preferences window
OPENDisplay Winamp Open File window
MEDIALIBRARYOpens MediaLibrary
VIDEOFULLSCREENToggles video window full screen mode - Works only if video window is open - This option has issues

Equalizer Control

EQWINToggle Eq window (Works with Classic skins only)
EQINFOQuery Eq parameters (10 bands, Preamp, Status, Autoload)
EQSET <parms>Set Eq parameters (Same format as EQINFO)
EQSTATUSToggle Eq status (ON / OFF)
EQSTATUS ONSet Eq status ON
EQSTATUS OFFSet Eq status OFF

Winamp Display

ONTOPToggle Always On Top option
MAINWINToggle Main Window (Show / Hide)
MINIMIZEMinimize Winamp

Visualization plug-in

VISUEXECToggles visualization plug-in
VISUEXEC ON|OFFSets visualization plug-in on or off New
VISUEXEC STATUSON if running, OFF if not running New

Bookmarks management

BOOKMARK <file>Add <file> to bookmarks
BOOKMARK CURRENTAdd current track to bookmarks

Skin management

SKINGETDisplay name of current skin
OPGETDisplay name of output plug-in
OUTPUTPLUGINSame as OPGET New

Winamp install

INSTALLDIRDisplay Winamp install directory, as detected by CLAmp
INSTALLDIR=...Force using this as install directory, overwriting result of default detection. Must be first option.
INIFILEDisplay Winamp ini file
INIDIRDisplay Winamp.ini directory

Winamp process

CLASS <class>Force using this class name
Parameters are handled left to right, so the following provide different results :
CLAMP /CLASS MyClass /START /PLAY
CLAMP /START /CLASS MyClass /PLAY
First line means "Start Winamp with class MyClass (same as Winamp /class=MyClass) and play it"
Second line means "Start standard instance of winamp then search for MyClass instance and play this one"
Note: if all this means nothing to you, don't worry, you probably just don't need it !
PIDShow Winamp process ID

Misc.

CDPLAYPlay CD
JUMPTOFILEOpen the "Jump to file" dialog window New

Examples


CLAMP /PLAY
CLAMP /PLCLEAR /PLADD "MySong1.mp3" /PLADD "MySong2.mp3" /PLAY

Download


Current Version (1.13)

Click here

Previous Published Versions

0.0.1
0.0.2
0.0.3
0.0.4
0.0.5
0.0.6
0.0.8
0.0.9
0.0.10
1.11
1.12

Similar programs


Bullet Clever - At winamp.com - Author's site
Bullet WACommand
Bullet AmpControl
Bullet Drive winamp from VB
Bullet Allows easy control of Winamp using COM from external programs
Bullet Active Winamp (for VB and .NET)

FAQ

#1 - How can I uninstall CLAMP ?
Just delete the executable file. No more than this has been written on your disk.

#2 - Sound control does not work properly
Of course there might be a problem but also consider that, sound is managed by Windows, not by Winamp and CLAMP drives Winamp only so changes in winamp only have no impact on other programs.
For example, turning sound off in winamp (using CLAmp or not) will not prevent your computer from issuing sounds.

#3 - Are you affiliated with NullSoft ?
No.

#4 - Can I make a donation ?
Yes ! Consider your favorite charitative organization.

#5 - If you add this function, I will translate in that language
Go to hell.
If you want to help, you're welcome. Do it freely, not to get something. I'm not asking you anything for using this program and make my best to enhance it, always for free.
There is *nothing* to trade here. If you're in that mood, that's the wrong place.

#6 - Where should the binary file be copied ?
This does not matters much if this directory is in the PATH.
This can be your WINDOWS directory for example ...


They use CLAmp...


Alarm clock for Windows by William Sun
Useless Keys - A tool to use numeric keypad as function keys - by Wrybread
WoWAMP - Interactive Music for World of Warcraft - by Ryan Black
Launchy - Open Source Keystroke Launcher for Windows
LaunchOne - Start applications and documents via keyboard

Want to add yours ? send a mail to toolscaramail.com !

Change-Log


Version 1.13 - Aug 2008
Bullet /MEDIALIB was not working - fixed
Bullet /PLADD - directory parsing partially rewritten (code shared with /load, /loadnew, /loadplay so impacts the four of them)
Bullet /PLADD - was not working with https due to a bug
Bullet /PLADD - was considering strings starting with something different from http as a local filename, thus misleading for other protocols (rtsp://... would be considered as a filename, not as a network location).
Bullet /OUTPUTPLUGIN - new synonym for /OPGET
Bullet /PLAYPAUSE used to be an alias for /PAUSE, now they behave differently
/PAUSE remains unchanged and toggles pause - if winamp is not playing, pause toggling will do nothing
/PLAYPAUSE new behaviour : if playing, same as /PAUSE - if not playing, same as /PLAY
Bullet /JUMPTOFILE opens the "Jump to file" dialog window
Bullet /TOFRONT - new option to bring winamp window to front
Bullet /VISUEXEC - now accepts optional argument ON, OFF, STATUS

Version 1.12 - May 2007 - Internal (non published) version
Bullet /QUITAFTER - New
Bullet /VIDEOFULLSCREEN - New - Beta (not working correctly)
Bullet /PLSET now accepts RANDOM as an argument

Version 1.11 - March 2007
Bullet Changed versionning to 1.x instead of 0.0.x.
Bullet Finalized /SKINGET (now working)
Bullet Enhanced args control
Bullet /PATHNAME - New
Bullet /JUMP - New
Bullet /TITLE - changed method to something easier and more reliable, behaviour unchanged
Bullet /PAUSE - Now accepts optional arg (ON | OFF) [Der-Spunk request]
Bullet /VOL - New
Bullet /RESTART - New
Bullet /LOADPLAY <file> - Shortcut for /PLCLEAR /PLADD <file> /PLAY
Bullet /WAV - many requests were made for a real MUTE command - unfortunately, winamp does not provides external access to mute but Windows does. Added a small set of commands to drive windows sound.
This will not grow much as it outside the initial scope of CLAmp - should extensions be needed in that area, it would be outside of CLAmp

Version 0.0.10 - Feb 2007
Bullet /CLASS - New
Bullet /VISUEXEC - New
Bullet /BOOKMARK, /BOOKMARKS_EDIT - New
Bullet /PLSAVE - New
Bullet Changed EXE search within registry due to problems with some installs, new option /INSTALL to display directory found
Bullet /INSTALL and /PID added to help troubleshooting
Bullet /INSTALL= to be able to use CLAmp even if it can't find Winamp using its own algorithms (or in case of multiple installs of Winamp) [Mr 8 Ball suggestion]
Bullet /TRACKINFO has new options : BITRATE, SAMPLERATE, CHANNELS

Version 0.0.9 - Jun 2006
/LOADNEW now accepts URL [Dave suggestion]
/REPEAT, /RANDOM, /EQSTATUS accept new argument : STATUS (/REPEAT STATUS or /RANDOM STATUS) returning ON or OFF
/TRACKINFO LENGTH (0:00 if not currently playing)
/TRACKINFO POS
/PLINFO LENGTH
/PLINFO POS - Note that even if play list is empty (Length = 0), pos is still 1.

Version 0.0.8 - Apr 2006
/VOLUP and /VOLDN now accept optionnal value
New: /VOLGET
/VER: bug fix
/START: enhancement
/PLAY now plays current playlist item (played first playlist item before)
New: /PLSET <pos> sets playlist to line <pos>
New: /MEDIALIBRARY opens media library window

Version 0.0.7 - Jun 2005
Not published

Version 0.0.6
/START could not be used with any further option on same line
/START sometimes reported errors with no cause
Registry scan enhanced


Version 0.0.5
New options :
  /PLLAST, /PLFIRST (in Winamp V2, not really first, not really last (?))
  /RESTART (not working with winamp 2)
  /CDPLAY
Option /REPLAY in V 0.0.4 was /PLLAST in fact
Bug in function searching for winamp path from registry - Always returned as not found.
/PLADD option did not work if pattern contained a directory.

Version 0.0.4
- Now handling wildcards for PLADD (i.e. CLAmp /PLADD *.mp3)
- Now reads Winamp.exe path from registry.
- Added NOT RUNNING state.
- New options : /STOPFADE, /STOPAFTER, /REPLAY

Version 0.0.3
- New options : MINIMIZE, MAINWIN, all EQ opts, TITLE, VER, PLPOS, PLWIN.

Version 0.0.2
- Better handling of exit code.
- Many new options.

Version 0.0.1 - Jan 2005
First published version.

Technical facts


Development status : Beta
Operating Systems : Windows
Programming Language : Delphi 7

Any comment ?


Have a comment regarding this program ?
Suggestions for future enhancements ?
Want to provide help (translating this page in foreign languages for example...) ?

It is as simple as sending a mail to toolscaramail.com

Thanks / Credits


- The layout of this page is derivated from the Blue Robot Layout Reservoir
- Lycos Multimania hosts this site for free.
- Directory browsing uses SNIF
- "No" buttons created using Adam Kalsey Button Maker

Be/OS


I recently discovered that a program similar to Winamp for BeOS was called "CL Amp"
(please note the space between CL and Amp) written by Claes Lofqvist.
This program existed years before this one.
If you arrived here for this program, follow this link

Top  :: This page has been viewed 48920 times since January 2005 :: Last updated : Mon, 21 Feb 2005 21:50:25 GMT