Skip to content

Commit

Permalink
Add Winamp Control Centre 1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
orudge committed Jun 10, 2015
0 parents commit 8d62f5b
Show file tree
Hide file tree
Showing 37 changed files with 3,422 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.mk1
*.lk1
*.res
*.map
*.obj
*.exe
*.mk
31 changes: 31 additions & 0 deletions docs/build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
WINAMP CONTROL CENTRE
Version 1.4.2

Building Winamp Control Centre
==============================

Winamp Control Centre was originally developed with Watcom C/C++, which now
lives on as an open source product, Open Watcom. Open Watcom's home page is
http://www.openwatcom.org/, but as of June 2015 that site appears to be down.
However, an active fork of Open Watcom is available here:

https://github.com/open-watcom/open-watcom-v2

This includes lots of new features, including a 64-bit Windows hosted version
of Watcom.

To build Winamp Control Centre, simply open the src\winampcc.wpj project in
the Watcom IDE and choose Actions -> Make All.

If you prefer to use another compiler to build WinampCC, you should find it
compiles without much trouble. The source code for the 32-bit application,
WinampCC.exe, is contained within the src\win32 directory, and should build
on any standard Win32 C compiler. Microsoft Visual C++ has been tested
recently with success, although I have not include a project or makefile for
it. Feel free to contribute build scripts or project files to the WinampCC
GitHub project if desired.

The 16-bit version, if anybody is still interested in it, should again build
with any competent compiler - I believe I compiled it with Borland C++ 4.51
some years ago. I expect 16-bit versions of Visual C++ or its predecessors
should also be able to build it.
339 changes: 339 additions & 0 deletions docs/licence.txt

Large diffs are not rendered by default.

288 changes: 288 additions & 0 deletions docs/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,288 @@
WINAMP CONTROL CENTRE
Version 1.4.2

Copyright � Owen Rudge 2001-2015
================================

Thank you for downloading my Winamp Control Centre. This consists
of a collection of very small programs that you can use to control
Winamp with in a variety of scenarios. Please note that Winamp
Control Centre will only work with Winamp 2.x and 5.x (and possibly 1.x)
- it will not work with Winamp3.

The following files are included:

readme.txt You're reading it now.
winampcc.exe Main executable, which can control Winamp in almost
any desirable way, by specifying settings in
and is extendable.
winampcc.ini INI file for winampcc.exe

"winampcc.exe" is the preferred executable to use, and is described in the
"Using winampcc.exe" section below.

The following legacy applications are also included. These are all 16-bit
applications and are only useful for Windows 95/98/Me, where they arguably
execute faster than winampcc.exe:

wa_hide.exe Run this program to hide Winamp.
wa_next.exe Run this program to play the next track.
wa_pause.exe Run this program to pause/unpause Winamp.
wa_play.exe Run this program to start/restart playing.
wa_prev.exe Run this program to play the previous track.
wa_show.exe Run this program to show Winamp.
wa_stop.exe Run this program to stop playing.

These applications will be slower on Windows 2000 or later, and will not run
at all on 64-bit versions of Windows.

USING WINAMPCC.EXE
==================

If you just run "winampcc" on its own, nothing will happen (assuming
you have Winamp running - if it's not running, you'll receive an
error message). To make it do something, you need to use command-line
arguments.

The following command-line arguments are available by default:

/SHOW Shows Winamp
/HIDE Hides Winamp
/PLAY Starts/restarts playing
/PAUSE Pauses/unpauses Winamp
/STOP Stops playing
/NEXT Plays the next track
/PREV Plays the previous track
/FLIPSHOW Show Winamp if it's hidden, hide it if it's visible
/TOFRONT Brings Winamp to the front of the screen

However, WinampCC is customisable, in that you can add new actions.
This is what winampcc.ini is for. If you look at it, you'll see the
following (by default):

; Winamp Control Centre 1.4.2
; Configuration File
;
; See README.TXT for more information
;
; Overview of this file
; ---------------------
;
; [...]
;
; Please see README.TXT for information on the [Commands] section of this file.

[Configuration]
Class=Winamp v1.x
Path=C:\Program Files\Winamp\Winamp.exe
Autoload=1
WaitLength=150
HideOnLoad=1
PathOnCmdLine=1

[Commands]
PLAY=40045
PAUSE=40046
STOP=40047
NEXT=40048
PREV=40044
...etc...

If you run "winampcc pause" (without the quotation marks), you will
find that the music is paused/unpaused. Try commenting out the
PAUSE=40046 line (place a ';' before it) and save the file. Then
type "winampcc pause". It won't do anything. This is a custom
action. As an aside, WinampCC is case-insensitive, so "PAUSE", "pause"
and "PaUsE" would all be valid.

Note also that the /PLAY, /PAUSE, etc, commands listed above are
built in, and will work even if no winampcc.ini is present or if all
commands are deleted from the INI file.

With Winamp Control Centre 1.4, you can specify multiple commands at once,
with a limit of 63 arguments. For instance:

winampcc /next /next /next /play /forward_5secs

will forward 3 places in the playlist, and start playing 5 seconds into
the song.

How does 40046 refer to Pause? Well, each button Winamp has has an
internal ID which Windows sends to Winamp when you click it. 40046
is the ID for Pause. Try adding the following line to the file:

/MAKE-SOME-MUSIC=40045

Then run "winampcc /make-some-music". Winamp will (re-)start playing.
A list of extra IDs is included in winampcc.ini at the bottom. For
the full list of IDs, see the Nullsoft Developer Network at
http://dev.winamp.com/.

Adding a Default Action
-----------------------

If you want something to happen when you run "winampcc" without any
command-line parameters, add a line like:

=40046

to winampcc.ini. If you enter nothing on the command line, the music
will pause.

THE CONFIGURATION SECTION OF WINAMPCC.INI
=========================================

The [Configuration] section of winampcc.ini was new in Winamp Control
Centre 1.2. It is optional, and lets you control several enhanced
features that are new in this release.

Class
-----

This is the window class of the Winamp window. Usually "Winamp v1.x",
but this can be set via Winamp command line parameters - if you run
multiple instances of Winamp with different window classes, you can use
this to alter which instance to control.

Path
----

Path to Winamp. Required if Autoload is set to 1, unless PathOnCmdLine is
set to 1.

Autoload
--------

If set to 1, Winamp automatically loads when you call Winamp Control
Centre.

WaitLength
----------

The length of time to wait, in milliseconds, between starting Winamp and
sending a command. Slower computers will require a longer wait. If you
set this value too low, Winamp may load but the command you asked for may
not be picked up by Winamp.

HideOnLoad
----------

If set to 1, Winamp will be hidden after it loads.

PathOnCmdLine
-------------

If set to 1, Winamp Control Centre will look for the path to Winamp as the
first command line argument, and will ignore the Path configuration option
completely. The path must be enclosed in quotation marks if it contains
spaces. For example:

winampcc "C:\Program Files\Winamp\Winamp.exe" /play

is valid, but:

winampcc C:\Program Files\Winamp\Winamp.exe /play

will not work at all.

CREATING A WINAMP TOOLBAR
=========================

On all versions of Windows since Windows 98 (or 95/NT 4.0 with IE4),
you can create a toolbar in the task bar which controls Winamp. To do
this:

1. Create a folder somewhere and name it "Winamp".

2. Create a shortcut to "winampcc.exe /play" in here and name it "Play".
You can use the "Change Icon" option to select a Play icon from the
winampcc.exe program.

3. Repeat step 2 for "/stop", "/pause", "/prev" and "/next" command
line arguments. (If you're still running Windows 95/98/Me, you may
prefer to use the wa_play.exe, etc, executables).

4. Right-click on the taskbar, point to Toolbars and choose New
Toolbar...

5. Browse to the folder you created and click OK.

6. You should now have a Winamp toolbar in your taskbar. By default,
you have a "Winamp" title and a caption for each button. To save
space, you can turn these off by right-clicking an empty space on
the Winamp toolbar or right-clicking the little "movable band" (if
"Lock Taskbar" isn't enabled) and unchecking "Show Text" and
"Show Title".

7. Launch Winamp (if you have not enabled Autoload in winampcc.ini) and
click the Play button in the taskbar. Your music should start playing.
Test the other buttons, and enjoy!

LICENCE
=======

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

VERSION HISTORY
===============

Version 1.4.2 does not contain any new functionality, but marks the open
source release of Winamp Control Centre under the GNU General Public License.
The source code for Winamp Control Centre can be downloaded from
www.owenrudge.net/utils/winampcc, and if you wish to offer modifications,
suggestions or new features for the application, you can do so on the
GitHub site linked from the above page.

Additionally, the "previous" and "next" icons have been increased to 4-bit
colour depth (previously 1-bit) because the 1-bit icons seemed to cause issues
on Windows XP or later (randomly being replaced with other icons in Explorer or
the taskbar).

New in version 1.4.1 is a switch, /TOFRONT, which brings the Winamp window to the
front of the screen - useful if you want to open a Winamp window, but Winamp
is hidden behind another program.

New in version 1.4 was support for specifying the path to Winamp on the
command line. Winamp Control Centre can now also process multiple commands at
once. See below for details.

New in version 1.3 was an option, /FLIPSHOW, to show Winamp if it's hidden,
or hide it if it's currently shown. I have also included more switches by
default in the WINAMPCC.INI, as well as the NSDN API reference (see
below).

New in version 1.2 were several enhancements to WINAMPCC.EXE. You can
now have Winamp automatically load when you run WINAMPCC.EXE, and it
can be automatically hidden at load too.

New in version 1.1 was WINAMPCC.EXE. This is a 32-bit program that
lets you do everything the 16-bit programs could do, and more. It
will also be faster on Windows NT/2000/XP.

If you have any problems, comments or queries about this software, e-mail
me - contact details are available at www.owenrudge.net/contact.

Owen Rudge, 10th June 2015
http://www.owenrudge.net/

----------------------------------------------------------------------------------
This software was built listening to Winamp. It was compiled using Open Watcom
C/C++, which generates very small code. For information on the Winamp API,
please visit http://dev.winamp.com/.

These programs will run under Windows 3.1 or higher, although it's unlikely you'll
have Winamp itself running on any version of Windows before Windows 95 or NT
3.51. :)
----------------------------------------------------------------------------------
Binary file added src/icons/next.ico
Binary file not shown.
Binary file added src/icons/pause.ico
Binary file not shown.
Binary file added src/icons/play.ico
Binary file not shown.
Binary file added src/icons/prev.ico
Binary file not shown.
Binary file added src/icons/stop.ico
Binary file not shown.
43 changes: 43 additions & 0 deletions src/win16/common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*************************************************/
/* WinAmp Control Centre */
/* Version 1.4.2 */
/* */
/* Copyright (c) Owen Rudge 2001-2015 */
/*************************************************/

/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include <windows.h>

int PASCAL WinMain(HINSTANCE hCurInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
HWND hwndWinamp;

hwndWinamp = FindWindow("Winamp v1.x", NULL);

if (hwndWinamp == NULL)
{
MessageBox(NULL, "Winamp is not running.", "Winamp Control Centre", MB_OK);
return(0);
}
else
{
SendMessage(hwndWinamp, WM_COMMAND, COMMAND_TO_EXECUTE, NULL);
}

return(0);
}
Loading

0 comments on commit 8d62f5b

Please sign in to comment.