The Winamp Remote Control suite
a remote control client and plugin for Winamp 2.x, 5.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
waint.cpp File Reference
#include <stdio.h>
#include <windows.h>
#include <iostream>
#include "waint.h"

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, WAPlaybackStatus status)
std::ostream & operator<< (std::ostream &os, WinampCommand command)
void LocalExecuteCommand (HWND HWinamp, WinampCommand Command)
void LocalExecuteStringCommand (HWND HWinamp, const char *CommandString, WinampCommand Command)
int LocalQueryInt (HWND HWinamp, WinampCommand Command, int Data)
char * LocalQueryString (HWND HWinamp, WinampCommand Command, int Data)
static char * StandardVersion (int version)
const char * WinampVersionString (int version)
const char * LocalGetWinampVersion (HWND HWinamp)
const char * WinampCommandDesc (int Command)

Variables

const int WM_WA_IPC = WM_USER
static const char * WAPlaybackStatusDesc [WA_PAUSED+1]
static char winampver [80]

Function Documentation

void LocalExecuteCommand ( HWND  HWinamp,
WinampCommand  MessageToExecute 
)

Executes the Winamp API message on the current target handle

Parameters:
HWinampwindow handle of the winamp instance
MessageToExecutewinamp command ID returns nothing

Definition at line 71 of file waint.cpp.

Referenced by WinampRemote::Server::WinampServer::ExecuteCommand().

void LocalExecuteStringCommand ( HWND  HWinamp,
const char *  CommandString,
WinampCommand  Command 
)

Executes the Winamp string based API command on the current target handle.

Parameters:
HWinampwindow handle of the winamp instance
CommandString- input parameter
Command- the winamp API command returns nothing

Definition at line 77 of file waint.cpp.

Referenced by WinampRemote::Server::WinampServer::ExecuteStringCommand().

const char* LocalGetWinampVersion ( HWND  HWinamp)

Utility function that returns the winamp version description string, according to the known formatting rules. Caters for new standard format Winamp versions and no version.

Parameters:
HWinampwindow handle of the winamp instance
Returns:
the string for the Winamp version

Definition at line 170 of file waint.cpp.

int LocalQueryInt ( HWND  HWinamp,
WinampCommand  Command,
int  Data 
)

Queries the Winamp API for an integer value.

Parameters:
HWinampwindow handle of the winamp instance
Command
Data- the winamp API command
Returns:
the result of the query

Definition at line 88 of file waint.cpp.

Referenced by LocalGetWinampVersion(), and WinampRemote::Server::WinampServer::QueryInt().

char* LocalQueryString ( HWND  HWinamp,
WinampCommand  Command,
int  Data 
)

Queries the Winamp API for a string value.

Parameters:
HWinampwindow handle of the winamp instance
Command
Data- the winamp API command
Returns:
in-process the pointer to the char data for the the result

Definition at line 94 of file waint.cpp.

Referenced by WinampRemote::Server::WinampServer::QueryString().

std::ostream& operator<< ( std::ostream &  os,
WAPlaybackStatus  status 
)
Parameters:
osthe output stream
statusthe playback status
Returns:
streams out the string representation

Definition at line 37 of file waint.cpp.

std::ostream& operator<< ( std::ostream &  os,
WinampCommand  command 
)
Parameters:
osthe output stream
commandthe command
Returns:
streams out the string representation

Definition at line 55 of file waint.cpp.

static char* StandardVersion ( int  version)
static

Returns the formatted standard Winamp version

Parameters:
version
Returns:

Definition at line 110 of file waint.cpp.

Referenced by WinampVersionString().

const char* WinampCommandDesc ( int  Command)

Utility function to name the Winamp commands.

Parameters:
Command
Returns:
the Winamp API command description constant

Definition at line 177 of file waint.cpp.

Referenced by operator<<().

const char* WinampVersionString ( int  version)

Utility function to name the Winamp version from the version number.

Parameters:
version
Returns:
the string for the Winamp version

Definition at line 122 of file waint.cpp.

Referenced by LocalGetWinampVersion(), main(), ServerTester::testServer(), and WinampRemote::Server::WinampServer::WinampVersion().


Variable Documentation

const char* WAPlaybackStatusDesc[WA_PAUSED+1]
static
Initial value:
{"not playing", "playing", "unused", "paused"}

Definition at line 34 of file waint.cpp.

Referenced by operator<<().

char winampver[80]
static

static buffer for the winamp version

Definition at line 103 of file waint.cpp.

Referenced by StandardVersion(), and WinampVersionString().

const int WM_WA_IPC = WM_USER

Winamp user Message number

Definition at line 31 of file waint.cpp.

Referenced by LocalQueryInt(), and LocalQueryString().