A brief reference over PlugWrap.


Use plugwrapa.lib if you want to use the dll, and pluwrapa_static.lib if you want
PlugWrap to be linked to your program statically.
Plugwrapa.lib has only been tested with MASM so it might not work with other assemblers.



Functions:

int InitXPlug(char *plugname)
 Loads and initializes a WinAMP input-plugin.
 Returns 0 on success.
 C:
  if (InitXPlug("in_midi.dll"))
   // failed

 Asm:
  plugname db 'in_nsf.dll',0
  push offset plugname
  call InitXPlug
  or eax,eax
  jz InitOK
   ; failed
  InitOK:



void DeInitXPlug(int closeOut)
 Unloads a WinAMP input-plugin.
 If 'closeOut' is non-zero, the output-plugin ("out_wave.dll") will also be unloaded.
 C:
  DeInitXPlug(0);

 Asm:
  closeBoth dd 1
  push dword ptr closeBoth
  call DeInitXPlug



void SetXPlugParent(HWND parent)
 Set the parent window of _both_ the input & output plugin.
 Some plugins display graphical objects (like scrollbars), for
 wich they need the handle of the parent window. This worked ok
 with NoseFart (NSF plugin) but not with SidAmp..
 Only needs to be called once, unless you at some point want to change
 the parent of the plugins. 
 C:
  SetPlugParent(hWindow);

 Asm:
  push dword ptr hWindow
  call SetXPlugParent



void ConfigXPlug()
 Opens the current plugin's configuration dialog (if it has one).
 You have to give the plugin a parent before you call this routine
 (see SetXPlugParent()).
 C:
  ConfigXPlug();

 Asm:
  call ConfigXPlug


void AboutXPlug()
 Opens the current plugin's "About" monolog (if it has one).
 You have to give the plugin a parent before you call this routine
 (see SetXPlugParent()).
 C:
  AboutXPlug();

 Asm:
  call AboutXPlug


int PlayX(char *filename)
 Play the specified file. The file should obviously be relevant
 to the current input plugin.
 Returns 0 on success.
 C:
  if (PlayX("song.mid"))
   // failed

 Asm:
  songname db 'song.ra',0
  push offset songname
  call PlayX
  or eax,eax 
  jz PlayOK
   ; failed
  PlayOK:



void PauseX()
 Pauses/Unpauses playback.
 C:
  PauseX();

 Asm:
  call PauseX



void StopX()
 Stops playback.
 C:
  StopX();

 Asm:
  call StopX

 

int GetXLength()
 Returns the length of the current track in milliseconds.
 C:
  length_in_ms = GetXLength();

 Asm:
  call GetXLength
  mov length_in_ms,eax



int GetXOutputTime()
 Returns the output time (time played) in milliseconds.
 C:
  time_in_ms = GetXOutputTime();
 
 Asm:
  call GetXOutputTime
  mov time_in_ms,eax


void SetXOutputTime(int time_in_ms)
 Set the output time in milliseconds (typically used for seeking in a stream, like ffwd or rew).
 C:
  SetXOutputTime(1500);

 Asm:
  time dd 4000
  push dword ptr time
  call SetXOutputTime
  


void SetXVolume(int volume)
 Set the output volume in the range 0 (min) to 255 (max). Should 
 be called _after_ a PlayX() command (or it won't take effect).
 C:
  SetXVolume(180);
 
 Asm:
  volume dd 100
  push dword ptr volume
  call SetXVolume



void SetXPan(int pan)
 Set the speaker panning in the range -127 (all left) to 127 (all right).
 Should be called _after_ a PlayX() command (or it won't take effect).
 C:
  SetXPan(-60);

 Asm:
  pan dd 20
  push dword ptr pan
  call SetXPan


MASM users could use invoke instead of push/call, and .if/.endif instead of cmp/jxx.
 


/Mic | stabmaster_@hotmail.com


