home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / fairlight-files / FLTMUSIC / WINAMP55.ZIP / FRONTEND.TXT < prev    next >
Text File  |  1997-10-07  |  4KB  |  129 lines

  1. This file is only useful for people who are writing frontends for Winamp.
  2.  
  3.  
  4.  
  5.  
  6. Psuedo IPC for frontends for Winamp v1.55+ (< 2.0)
  7.  
  8.  
  9. This document is horribly [de]organized, and is pretty much just hacked
  10. together for people to use.
  11.  
  12. Winamp's window is found using:
  13. hwnd_winamp = FindWindow("Winamp v1.x",NULL);
  14.  
  15. #define WM_WA_IPC WM_USER
  16. // messages are sent to the winamp window using:
  17. result = SendMessage(hwnd_winamp,WM_WA_IPC,command_data,command);
  18.  
  19.  
  20. /* Messages available to send */
  21.  
  22. #define IPC_GETVERSION 0
  23. /*
  24.     IPC_GETVERSION is sent to the window, and the return value is the version
  25.         Version 1.55 = 0x1551
  26.     the command_data parameter is 0.
  27.     so, 
  28.     if (SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION) != 0x1551)
  29.         MessageBox(NULL,"Error, Winamp 1.55 not found","Warning",MB_OK);
  30. */
  31.  
  32.  
  33. #define IPC_PLAYFILE 100
  34. /*
  35.     IPC_PLAYFILE is sent to the window for each char of a null terminated string of a file to ADD
  36.     to the playlist (it doesn't change the playing status)
  37.     for example:
  38.         char *file = "C:\\download\\booga.mp3";
  39.         int x;
  40.         for (x = 0; x <= strlen(file); x ++)
  41.             SendMessage(hwnd_winamp,WM_WA_IPC,(LPARAM)file[x],IPC_PLAYFILE);
  42.     will add "C:\download\booga.mp3" to the end of the playlist
  43. */
  44.  
  45. #define IPC_DELETE 101
  46. /* 
  47.     IPC_DELETE deletes the internal Winamp playlist.
  48.         SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_DELETE);
  49. */
  50.  
  51. #define IPC_STARTPLAY 102
  52. /* 
  53.     IPC_STARTPLAY starts the playing.
  54.         SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_STARTPLAY);
  55. */
  56.  
  57. #define IPC_CHDIR 103
  58. /*
  59.     IPC_CHDIR is sent to the window for each char of a null terminated string of a directory to change to
  60.     for example:
  61.         char *dir = "C:\\Download";
  62.         int x;
  63.         for (x = 0; x <= strlen(file); x ++)
  64.             SendMessage(hwnd_winamp,WM_WA_IPC,(LPARAM)dir[x],IPC_PLAYFILE);
  65.     will change the winamp process to "C:\download" (useful for relative pathnames and loading playlists)
  66.  
  67. */
  68. #define IPC_ISPLAYING 104
  69. /*
  70.     IPC_ISPLAYING returns the status of playback.
  71.     If it returns 1, it is playing. if it returns 3, it is paused, if it returns 0, it is not playing.
  72.     If it returns something other than 1,3,or 0, something is screwed.
  73.     isplaying = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING);
  74. */
  75.  
  76.  
  77. #define IPC_GETOUTPUTTIME 105
  78. /*
  79.     IPC_GETOUTPUTTIME returns the position in milliseconds of the current song.
  80.     Returns -1 if not playing or error.
  81.     song_pos = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETOUTPUTTIME);
  82. */
  83.  
  84.  
  85. // THESE MIGHT CHANGE in the future :)
  86. //Also, you can send standard WM_COMMAND messages to the Winamp window (for other controls), including
  87.  
  88. // toggles the EQ window
  89. #define WINAMP_OPTIONS_EQ               40036
  90. // toggles the playlist window
  91. #define WINAMP_OPTIONS_PLEDIT           40040
  92. // turns the volume up a little
  93. #define WINAMP_VOLUMEUP                 40058
  94. // turns the volume down a little
  95. #define WINAMP_VOLUMEDOWN               40059
  96. // fast forwards 5 seconds
  97. #define WINAMP_FFWD5S                   40060
  98. // rewinds 5 seconds
  99. #define WINAMP_REW5S                    40061
  100. // the following are the five main control buttons, with optionally shift or control pressed
  101. // (for the exact functions of each, just try it out)
  102. #define WINAMP_BUTTON1                  40044
  103. #define WINAMP_BUTTON2                  40045
  104. #define WINAMP_BUTTON3                  40046
  105. #define WINAMP_BUTTON4                  40047
  106. #define WINAMP_BUTTON5                  40048
  107. #define WINAMP_BUTTON1_SHIFT            40144
  108. #define WINAMP_BUTTON2_SHIFT            40145
  109. #define WINAMP_BUTTON3_SHIFT            40146
  110. #define WINAMP_BUTTON4_SHIFT            40147
  111. #define WINAMP_BUTTON5_SHIFT            40148
  112. #define WINAMP_BUTTON1_CTRL             40154
  113. #define WINAMP_BUTTON2_CTRL             40155
  114. #define WINAMP_BUTTON3_CTRL             40156
  115. #define WINAMP_BUTTON4_CTRL             40157
  116. #define WINAMP_BUTTON5_CTRL             40158
  117. // pops up the load file(s) box
  118. #define WINAMP_FILE_PLAY                40029
  119. // pops up the preferences
  120. #define WINAMP_OPTIONS_PREFS            40012
  121. // toggles always on top
  122. #define WINAMP_OPTIONS_AOT              40019
  123. // pops up the about box :)
  124. #define WINAMP_HELP_ABOUT               40041
  125.  
  126.  
  127. // hope this helps, 
  128. // -Justin [justin@spiffy.org]
  129.