wa_ipc.h 114 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172
  1. /*
  2. ** Copyright (C) 1997-2014 Winamp SA
  3. **
  4. ** This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held
  5. ** liable for any damages arising from the use of this software.
  6. **
  7. ** Permission is granted to anyone to use this software for any purpose, including commercial applications, and to
  8. ** alter it and redistribute it freely, subject to the following restrictions:
  9. **
  10. ** 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
  11. ** If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  12. **
  13. ** 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  14. **
  15. ** 3. This notice may not be removed or altered from any source distribution.
  16. **
  17. */
  18. #ifndef _WA_IPC_H_
  19. #define _WA_IPC_H_
  20. #include <windows.h>
  21. #include <stddef.h>
  22. #if (_MSC_VER <= 1200)
  23. typedef int intptr_t;
  24. #endif
  25. /*
  26. ** This is the modern replacement for the classic 'frontend.h'. Most of these
  27. ** updates are designed for in-process use, i.e. from a plugin.
  28. **
  29. */
  30. /* Most of the IPC_* messages involve sending the message in the form of:
  31. ** result = SendMessageW(hwnd_winamp,WM_WA_IPC,(parameter),IPC_*);
  32. ** Where different then this is specified (typically with WM_COPYDATA variants)
  33. **
  34. ** When you use SendMessageW(hwnd_winamp,WM_WA_IPC,(parameter),IPC_*) and specify a IPC_*
  35. ** which is not currently implemented/supported by the Winamp version being used then it
  36. ** will return 1 for 'result'. This is a good way of helping to check if an api being
  37. ** used which returns a function pointer, etc is even going to be valid.
  38. */
  39. #define WM_WA_IPC WM_USER
  40. /* but some of them use WM_COPYDATA. be afraid.
  41. */
  42. #define WINAMP_VERSION_MAJOR(winampVersion) ((winampVersion & 0x0000FF00) >> 12)
  43. #define WINAMP_VERSION_MINOR(winampVersion) (winampVersion & 0x000000FF) // returns, i.e. 0x12 for 5.12 and 0x10 for 5.1...
  44. #define IPC_GETVERSION 0
  45. /* int version = SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION);
  46. **
  47. ** The version returned will be 0x20yx for Winamp 2.yx.
  48. ** Versions previous to Winamp 2.0 typically (but not always) use 0x1zyx for 1.zx.
  49. ** Just a bit weird but that's the way it goes.
  50. **
  51. ** For Winamp 5.x it uses the format 0x50yx for Winamp 5.yx
  52. ** e.g. 5.01 -> 0x5001
  53. ** 5.09 -> 0x5009
  54. ** 5.1 -> 0x5010
  55. **
  56. ** Notes: For 5.02 this api will return the same value as for a 5.01 build.
  57. ** For 5.07 this api will return the same value as for a 5.06 build.
  58. */
  59. #define IPC_GETVERSIONSTRING 1
  60. #define IPC_GETREGISTEREDVERSION 770
  61. /* (requires Winamp 5.0+)
  62. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETREGISTEREDVERSION);
  63. **
  64. ** This will open the Winamp Preferences and show the Winamp Pro page.
  65. */
  66. #define IPC_IS_SAFEMODE 999
  67. /* (requires Winamp 5.64+)
  68. ** int res = SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_IS_SAFEMODE);
  69. **
  70. ** This will indicate if running in safe mode or not (only applies to native plugins).
  71. ** This returns:
  72. ** 0 if in safe mode
  73. ** 1 if in normal mode
  74. ** 2 if in safe mode and media library plug-ins are to be disabled
  75. **
  76. ** Safe mode is used to disable 3rd party plugins to determine if they are the cause
  77. ** of stability issues and crashes for users experiencing issues without having to
  78. ** first remove plug-in dlls which is often found 'too hard' to do properly most times.
  79. */
  80. typedef struct {
  81. const char *filename;
  82. const char *title;
  83. const char *ext;
  84. int length;
  85. } enqueueFileWithMetaStruct; // send this to a IPC_PLAYFILE in a non WM_COPYDATA,
  86. // and you get the nice desired result. if title is NULL, it is treated as a "thing",
  87. // otherwise it's assumed to be a file (for speed)
  88. typedef struct {
  89. const wchar_t *filename;
  90. const wchar_t *title;
  91. const wchar_t *ext;
  92. int length;
  93. } enqueueFileWithMetaStructW;
  94. #define IPC_PLAYFILE 100 // dont be fooled, this is really the same as enqueufile
  95. #define IPC_ENQUEUEFILE 100
  96. #define IPC_PLAYFILEW 1100
  97. #define IPC_ENQUEUEFILEW 1100
  98. /* This is sent as a WM_COPYDATA with IPC_PLAYFILE as the dwData member and the string
  99. ** of the file / playlist to be enqueued into the playlist editor as the lpData member.
  100. ** This will just enqueue the file or files since you can use this to enqueue a playlist.
  101. ** It will not clear the current playlist or change the playback state.
  102. **
  103. ** COPYDATASTRUCT cds = {0};
  104. ** cds.dwData = IPC_ENQUEUEFILE;
  105. ** cds.lpData = (void*)"c:\\test\\folder\\test.mp3";
  106. ** cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
  107. ** SendMessageW(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
  108. **
  109. **
  110. ** With 2.9+ and all of the 5.x versions you can send this as a normal WM_WA_IPC
  111. ** (non WM_COPYDATA) with an enqueueFileWithMetaStruct as the param.
  112. ** If the title member is null then it is treated as a "thing" otherwise it will be
  113. ** assumed to be a file (for speed).
  114. **
  115. ** enqueueFileWithMetaStruct eFWMS = {0};
  116. ** eFWMS.filename = "c:\\test\\folder\\test.mp3";
  117. ** eFWMS.title = "Whipping Good";
  118. ** eFWMS.length = 300; // this is the number of seconds for the track
  119. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)&eFWMS,IPC_ENQUEUEFILE);
  120. */
  121. #define IPC_DELETE 101
  122. #define IPC_DELETE_INT 1101
  123. /* SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_DELETE);
  124. ** Use this api to clear Winamp's internal playlist.
  125. ** You should not need to use IPC_DELETE_INT since it is used internally by Winamp when
  126. ** it is dealing with some lame Windows Explorer issues (hard to believe that!).
  127. */
  128. #define IPC_STARTPLAY 102
  129. #define IPC_STARTPLAY_INT 1102
  130. /* SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_STARTPLAY);
  131. ** Sending this will start playback and is almost the same as hitting the play button.
  132. ** The IPC_STARTPLAY_INT version is used internally and you should not need to use it
  133. ** since it won't be any fun.
  134. */
  135. #define IPC_CHDIR 103
  136. /* This is sent as a WM_COPYDATA type message with IPC_CHDIR as the dwData value and the
  137. ** directory you want to change to as the lpData member.
  138. **
  139. ** COPYDATASTRUCT cds = {0};
  140. ** cds.dwData = IPC_CHDIR;
  141. ** cds.lpData = (void*)"c:\\download";
  142. ** cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
  143. ** SendMessageW(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
  144. **
  145. ** The above example will make Winamp change to the directory 'C:\download'.
  146. */
  147. #define IPC_ISPLAYING 104
  148. /* int res = SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING);
  149. ** This is sent to retrieve the current playback state of Winamp.
  150. ** If it returns 1, Winamp is playing.
  151. ** If it returns 3, Winamp is paused.
  152. ** If it returns 0, Winamp is not playing.
  153. */
  154. #define IPC_GETOUTPUTTIME 105
  155. /* int res = SendMessageW(hwnd_winamp,WM_WA_IPC,mode,IPC_GETOUTPUTTIME);
  156. ** This api can return two different sets of information about current playback status.
  157. **
  158. ** If mode = 0 then it will return the position (in ms) of the currently playing track.
  159. ** Will return -1 if Winamp is not playing.
  160. **
  161. ** If mode = 1 then it will return the current track length (in seconds).
  162. ** Will return -1 if there are no tracks (or possibly if Winamp cannot get the length).
  163. **
  164. ** If mode = 2 then it will return the current track length (in milliseconds).
  165. ** Will return -1 if there are no tracks (or possibly if Winamp cannot get the length).
  166. */
  167. #define IPC_JUMPTOTIME 106
  168. /* (requires Winamp 1.60+)
  169. ** SendMessageW(hwnd_winamp,WM_WA_IPC,ms,IPC_JUMPTOTIME);
  170. ** This api sets the current position (in milliseconds) for the currently playing song.
  171. ** The resulting playback position may only be an approximate time since some playback
  172. ** formats do not provide exact seeking e.g. mp3
  173. ** This returns -1 if Winamp is not playing, 1 on end of file, or 0 if it was successful.
  174. */
  175. #define IPC_GETMODULENAME 109
  176. #define IPC_EX_ISRIGHTEXE 666
  177. /* usually shouldnt bother using these, but here goes:
  178. ** send a WM_COPYDATA with IPC_GETMODULENAME, and an internal
  179. ** flag gets set, which if you send a normal WM_WA_IPC message with
  180. ** IPC_EX_ISRIGHTEXE, it returns whether or not that filename
  181. ** matches. lame, I know.
  182. */
  183. #define IPC_WRITEPLAYLIST 120
  184. /* (requires Winamp 1.666+)
  185. ** int cur = SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_WRITEPLAYLIST);
  186. **
  187. ** IPC_WRITEPLAYLIST will write the current playlist to winamp.m3u and on unicode clients
  188. ** it will also write the current playlist to winamp.m3u8. This will also return the
  189. ** current playlist position (see IPC_GETLISTPOS).
  190. **
  191. ** Where the playlist(s) are saved to depends on the Winamp client version used though it
  192. ** is simple to find the path using the correct location (when working in-process):
  193. **
  194. ** Pre 2.90 -> '<winampdir>\\Winamp.m3u'
  195. ** From 2.90 to 5.1 -> Use IPC_GETINIDIRECTORY
  196. ** From 5.11 -> Use IPC_GETM3UDIRECTORY
  197. **
  198. ** If working from an external program then it is possible to work out the location of the
  199. ** playlist by reading relevant values out of paths.ini (if found) otherwise the pre 2.90
  200. ** behaviour is what will be attempted to be used (as Winamp does if there is any failure).
  201. **
  202. ** This is kinda obsoleted by some of the newer 2.x api items but it still is good for
  203. ** use with a front-end program (instead of a plug-in) and you want to see what is in the
  204. ** current playlist.
  205. **
  206. ** This api will only save out extended file information in the #EXTINF entry if Winamp
  207. ** has already read the data such as if the file was played of scrolled into view. If
  208. ** Winamp has not read the data then you will only find the file with its filepath entry
  209. ** (as is the base requirements for a m3u playlist).
  210. */
  211. #define IPC_SETPLAYLISTPOS 121
  212. /* (requires Winamp 2.0+)
  213. ** SendMessageW(hwnd_winamp,WM_WA_IPC,position,IPC_SETPLAYLISTPOS)
  214. ** IPC_SETPLAYLISTPOS sets the playlist position to the specified 'position'.
  215. ** It will not change playback status or anything else. It will just set the current
  216. ** position in the playlist and will update the playlist view if necessary.
  217. **
  218. ** If you use SendMessageW(hwnd_winamp,WM_COMMAND,MAKEWPARAM(WINAMP_BUTTON2,0),0);
  219. ** after using IPC_SETPLAYLISTPOS then Winamp will start playing the file at 'position'.
  220. */
  221. #define IPC_SETVOLUME 122
  222. /* (requires Winamp 2.0+)
  223. ** SendMessageW(hwnd_winamp,WM_WA_IPC,volume,IPC_SETVOLUME);
  224. ** IPC_SETVOLUME sets the volume of Winamp (between the range of 0 to 255).
  225. **
  226. ** If you pass 'volume' as -666 then the message will return the current volume.
  227. ** int curvol = SendMessageW(hwnd_winamp,WM_WA_IPC,-666,IPC_SETVOLUME);
  228. */
  229. #define IPC_GETVOLUME(hwnd_winamp) SendMessageW(hwnd_winamp,WM_WA_IPC,-666,IPC_SETVOLUME)
  230. /* (requires Winamp 2.0+)
  231. ** int curvol = IPC_GETVOLUME(hwnd_winamp);
  232. ** This will return the current volume of Winamp (between the range of 0 to 255).
  233. */
  234. #define IPC_SETPANNING 123
  235. #define IPC_SETBALANCE 123
  236. /* (requires Winamp 2.0+)
  237. ** SendMessageW(hwnd_winamp,WM_WA_IPC,panning,IPC_SETPANNING);
  238. ** IPC_SETPANNING sets the panning of Winamp from 0 (left) to 255 (right).
  239. **
  240. ** At least in 5.x+ this works from -127 (left) to 127 (right).
  241. **
  242. ** If you pass 'panning' as -666 to this api then it will return the current panning.
  243. ** int curpan = SendMessageW(hwnd_winamp,WM_WA_IPC,-666,IPC_SETPANNING);
  244. */
  245. #define IPC_GETPANNING(hwnd_winamp) SendMessageW(hwnd_winamp,WM_WA_IPC,-666,IPC_SETPANNING)
  246. #define IPC_GETBALANCE(hwnd_winamp) SendMessageW(hwnd_winamp,WM_WA_IPC,-666,IPC_SETBALANCE)
  247. /* (requires Winamp 2.0+)
  248. ** int curpan = IPC_GETPANNING(hwnd_winamp);
  249. ** This will return the current panning level of Winamp (5.x) from -127 (left) to 127 (right)
  250. ** or from 0 (left) to 255 (right) on older client versions.
  251. */
  252. #define IPC_GETLISTLENGTH 124
  253. /* (requires Winamp 2.0+)
  254. ** int length = SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTLENGTH);
  255. ** IPC_GETLISTLENGTH returns the length of the current playlist as the number of tracks.
  256. */
  257. #define IPC_GETLISTPOS 125
  258. /* (requires Winamp 2.05+)
  259. ** int pos=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS);
  260. ** IPC_GETLISTPOS returns the current playlist position (which is shown in the playlist
  261. ** editor as a differently coloured text entry e.g is yellow for the classic skin).
  262. **
  263. ** This api is a lot like IPC_WRITEPLAYLIST but a lot faster since it does not have to
  264. ** write out the whole of the current playlist first.
  265. */
  266. #define IPC_GETNEXTLISTPOS 136
  267. /* (requires Winamp 5.61+)
  268. ** int pos=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETNEXTLISTPOS);
  269. ** IPC_GETNEXTLISTPOS returns the next playlist position expected to be played from the
  270. ** current playlist and allows for determining the next playlist item to be played even
  271. ** if shuffle mode (see IPC_GET_SHUFFLE) is enabled at the time of using this api.
  272. **
  273. ** If there is no known next playlist item then this will return -1 i.e. if there's only
  274. ** one playlist item or at the end of the current playlist and repeat is disabled.
  275. **
  276. ** Notes: If a plug-in (like the JTFE plug-in) uses IPC_GET_NEXT_PLITEM to override the
  277. ** playlist order then you will need to query the plug-in directly (via api_queue
  278. ** for the JTFE plug-in) to get the correct next playlist item to be played.
  279. **
  280. ** If a change is made to the internal shuffle table, the value returned by prior
  281. ** use of this api is likely to be different and so will need to be re-queried.
  282. **
  283. ** The returned playlist item position is zero-based.
  284. */
  285. #define IPC_GETINFO 126
  286. /* (requires Winamp 2.05+)
  287. ** int inf=SendMessageW(hwnd_winamp,WM_WA_IPC,mode,IPC_GETINFO);
  288. ** IPC_GETINFO returns info about the current playing song. The value
  289. ** it returns depends on the value of 'mode'.
  290. ** Mode Meaning
  291. ** ------------------
  292. ** 0 Samplerate, in kilohertz (i.e. 44)
  293. ** 1 Bitrate (i.e. 128)
  294. ** 2 Channels (i.e. 2)
  295. ** 3 (5+) Video LOWORD=w HIWORD=h
  296. ** 4 (5+) > 65536, string (video description)
  297. ** 5 (5.25+) Samplerate, in hertz (i.e. 44100)
  298. */
  299. #define IPC_GETEQDATA 127
  300. /* (requires Winamp 2.05+)
  301. ** int data=SendMessageW(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA);
  302. ** IPC_GETEQDATA queries the status of the EQ.
  303. ** The value returned depends on what 'pos' is set to:
  304. ** Value Meaning
  305. ** ------------------
  306. ** 0-9 The 10 bands of EQ data. 0-63 (+20db - -20db)
  307. ** 10 The preamp value. 0-63 (+20db - -20db)
  308. ** 11 Enabled. zero if disabled, nonzero if enabled.
  309. ** 12 Autoload. zero if disabled, nonzero if enabled.
  310. */
  311. #define IPC_SETEQDATA 128
  312. /* (requires Winamp 2.05+)
  313. ** SendMessageW(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA);
  314. ** SendMessageW(hwnd_winamp,WM_WA_IPC,value,IPC_SETEQDATA);
  315. ** IPC_SETEQDATA sets the value of the last position retrieved
  316. ** by IPC_GETEQDATA. This is pretty lame, and we should provide
  317. ** an extended version that lets you do a MAKELPARAM(pos,value).
  318. ** someday...
  319. new (2.92+):
  320. if the high byte is set to 0xDB, then the third byte specifies
  321. which band, and the bottom word specifies the value.
  322. */
  323. #define IPC_ADDBOOKMARK 129
  324. #define IPC_ADDBOOKMARKW 131
  325. /* (requires Winamp 2.4+)
  326. ** This is sent as a WM_COPYDATA using IPC_ADDBOOKMARK as the dwData value and the
  327. ** directory you want to change to as the lpData member. This will add the specified
  328. ** file / url to the Winamp bookmark list.
  329. **
  330. ** COPYDATASTRUCT cds = {0};
  331. ** cds.dwData = IPC_ADDBOOKMARK;
  332. ** cds.lpData = (void*)"http://www.blah.com/listen.pls";
  333. ** cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
  334. ** SendMessageW(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
  335. **
  336. **
  337. ** In Winamp 5.0+ we use this as a normal WM_WA_IPC and the string is null separated as
  338. ** the filename and then the title of the entry.
  339. **
  340. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(char*)"filename\0title\0",IPC_ADDBOOKMARK);
  341. **
  342. ** This will notify the library / bookmark editor that a bookmark was added.
  343. ** Note that using this message in this context does not actually add the bookmark.
  344. ** Do not use, it is essentially just a notification type message :)
  345. **
  346. ** Additional Notes:
  347. **
  348. ** If IPC_ADDBOOKMARK is called with wParam as zero then it returns the bookmark filepath
  349. ** as an ansi string.
  350. **
  351. ** As of 5.58+, calling IPC_ADDBOOKMARKW with wParam as zero will return the bookmark
  352. ** filepath as a unicode string and IPC_ADDBOOKMARK will behave as prior to 5.58.
  353. ** Passing wParam as 666 will return the winamp.bm8 filepath and is valid for both apis.
  354. */
  355. #define IPC_INSTALLPLUGIN 130
  356. /* This is not implemented (and is very unlikely to be done due to safety concerns).
  357. ** If it was then you could do a WM_COPYDATA with a path to a .wpz and it would then
  358. ** install the plugin for you.
  359. **
  360. ** COPYDATASTRUCT cds = {0};
  361. ** cds.dwData = IPC_INSTALLPLUGIN;
  362. ** cds.lpData = (void*)"c:\\path\\to\\file.wpz";
  363. ** cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
  364. ** SendMessageW(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
  365. */
  366. #define IPC_RESTARTWINAMP 135
  367. /* (requires Winamp 2.2+)
  368. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_RESTARTWINAMP);
  369. ** IPC_RESTARTWINAMP will restart Winamp (isn't that obvious ? :) )
  370. ** If this fails to make Winamp start after closing then there is a good chance one (or
  371. ** more) of the currently installed plugins caused Winamp to crash on exit (either as a
  372. ** silent crash or a full crash log report before it could call itself start again.
  373. */
  374. #define IPC_RESTARTSAFEWINAMP 1135
  375. /* (requires Winamp 5.64+)
  376. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_RESTARTSAFEWINAMP);
  377. ** IPC_RESTARTSAFEWINAMP will restart Winamp (isn't that obvious ? :) ) in safe mode.
  378. ** If this fails to make Winamp start after closing then there is a good chance one (or
  379. ** more) of the currently installed plugins caused Winamp to crash on exit (either as a
  380. ** silent crash or a full crash log report before it could call itself start again.
  381. */
  382. #define IPC_ISFULLSTOP 400
  383. /* (requires winamp 2.7+ I think)
  384. ** int ret=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_ISFULLSTOP);
  385. ** This is useful for when you're an output plugin and you want to see if the stop/close
  386. ** happening is a full stop or if you are just between tracks. This returns zero if it is
  387. ** a full stop (such as the user pressing stop) or non-zero if it is just the end of a
  388. ** file or other internal events.
  389. */
  390. #define IPC_INETAVAILABLE 242
  391. /* (requires Winamp 2.05+)
  392. ** int val=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_INETAVAILABLE);
  393. ** IPC_INETAVAILABLE will return 1 if an Internet connection is available for Winamp and
  394. ** relates to the internet connection type setting on the main general preferences page
  395. ** in the Winamp preferences.
  396. */
  397. #define IPC_UPDTITLE 243
  398. /* (requires Winamp 2.2+)
  399. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_UPDTITLE);
  400. ** IPC_UPDTITLE will ask Winamp to update the information about the current title and
  401. ** causes GetFileInfo(..) in the input plugin associated with the current playlist entry
  402. ** to be called. This can be called such as when an input plugin is buffering a file so
  403. ** that it can cause the buffer percentage to appear in the playlist.
  404. */
  405. #define IPC_REFRESHPLCACHE 247
  406. /* (requires Winamp 2.2+)
  407. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_REFRESHPLCACHE);
  408. ** IPC_REFRESHPLCACHE will flush the playlist cache buffer and you send this if you want
  409. ** Winamp to go refetch the titles for all of the entries in the current playlist.
  410. **
  411. ** 5.3+:
  412. ** If you pass a wchar_t * string in wParam then it will be be found using strnicmp() and
  413. ** the cache for that entry only will be cleared unlike passing nothing which clears all.
  414. */
  415. #define IPC_GET_SHUFFLE 250
  416. /* (requires Winamp 2.4+)
  417. ** int val=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_SHUFFLE);
  418. ** IPC_GET_SHUFFLE returns the status of the shuffle option.
  419. ** If set then it will return 1 and if not set then it will return 0.
  420. */
  421. #define IPC_GET_REPEAT 251
  422. /* (requires Winamp 2.4+)
  423. ** int val=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_REPEAT);
  424. ** IPC_GET_REPEAT returns the status of the repeat option.
  425. ** If set then it will return 1 and if not set then it will return 0.
  426. */
  427. #define IPC_SET_SHUFFLE 252
  428. /* (requires Winamp 2.4+)
  429. ** SendMessageW(hwnd_winamp,WM_WA_IPC,value,IPC_SET_SHUFFLE);
  430. ** IPC_SET_SHUFFLE sets the status of the shuffle option.
  431. ** If 'value' is 1 then shuffle is turned on.
  432. ** If 'value' is 0 then shuffle is turned off.
  433. */
  434. #define IPC_SET_REPEAT 253
  435. /* (requires Winamp 2.4+)
  436. ** SendMessageW(hwnd_winamp,WM_WA_IPC,value,IPC_SET_REPEAT);
  437. ** IPC_SET_REPEAT sets the status of the repeat option.
  438. ** If 'value' is 1 then shuffle is turned on.
  439. ** If 'value' is 0 then shuffle is turned off.
  440. */
  441. #define IPC_ENABLEDISABLE_ALL_WINDOWS 259 // 0xdeadbeef to disable
  442. /* (requires Winamp 2.9+)
  443. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(enable?0:0xdeadbeef),IPC_ENABLEDISABLE_ALL_WINDOWS);
  444. ** Sending this message with 0xdeadbeef as the param will disable all winamp windows and
  445. ** any other values will enable all of the Winamp windows again. When disabled you won't
  446. ** get any response on clicking or trying to do anything to the Winamp windows. If the
  447. ** taskbar icon is shown then you may still have control ;)
  448. */
  449. #define IPC_GETWND 260
  450. /* (requires Winamp 2.9+)
  451. ** HWND h=SendMessageW(hwnd_winamp,WM_WA_IPC,IPC_GETWND_xxx,IPC_GETWND);
  452. ** returns the HWND of the window specified.
  453. */
  454. #define IPC_GETWND_EQ 0 // use one of these for the param
  455. #define IPC_GETWND_PE 1
  456. #define IPC_GETWND_MB 2
  457. #define IPC_GETWND_VIDEO 3
  458. #define IPC_ISWNDVISIBLE 261 // same param as IPC_GETWND
  459. /************************************************************************
  460. ***************** in-process only (WE LOVE PLUGINS)
  461. ************************************************************************/
  462. #define IPC_SETSKINW 199
  463. #define IPC_SETSKIN 200
  464. /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
  465. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)"skinname",IPC_SETSKIN);
  466. ** IPC_SETSKIN sets the current skin to "skinname". Note that skinname
  467. ** can be the name of a skin, a skin .zip file, with or without path.
  468. ** If path isn't specified, the default search path is the winamp skins
  469. ** directory.
  470. */
  471. #define IPC_GETSKIN 201
  472. #define IPC_GETSKINW 1201
  473. /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
  474. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)skinname_buffer,IPC_GETSKIN);
  475. ** IPC_GETSKIN puts the directory where skin bitmaps can be found
  476. ** into skinname_buffer.
  477. ** skinname_buffer must be MAX_PATH characters in length.
  478. ** When using a .zip'd skin file, it'll return a temporary directory
  479. ** where the ZIP was decompressed.
  480. */
  481. #define IPC_EXECPLUG 202
  482. /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
  483. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)"vis_file.dll",IPC_EXECPLUG);
  484. ** IPC_EXECPLUG executes a visualization plug-in pointed to by WPARAM.
  485. ** the format of this string can be:
  486. ** "vis_whatever.dll"
  487. ** "vis_whatever.dll,0" // (first mod, file in winamp plug-in dir)
  488. ** "C:\\dir\\vis_whatever.dll,1"
  489. */
  490. #define IPC_GETPLAYLISTFILE 211
  491. #define IPC_GETPLAYLISTFILEW 214
  492. /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
  493. ** char *name=SendMessageW(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTFILE);
  494. ** IPC_GETPLAYLISTFILE gets the filename of the playlist entry [index].
  495. ** returns a pointer to it. returns NULL on error.
  496. */
  497. #define IPC_GETPLAYLISTTITLE 212
  498. #define IPC_GETPLAYLISTTITLEW 213
  499. /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
  500. ** char *name=SendMessageW(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTTITLE);
  501. **
  502. ** IPC_GETPLAYLISTTITLE gets the title of the playlist entry [index].
  503. ** returns a pointer to it. returns NULL on error.
  504. */
  505. #define IPC_GETHTTPGETTER 240
  506. /* retrieves a function pointer to a HTTP retrieval function.
  507. ** if this is unsupported, returns 1 or 0.
  508. ** the function should be:
  509. ** int (*httpRetrieveFile)(HWND hwnd, char *url, char *file, char *dlgtitle);
  510. ** if you call this function, with a parent window, a URL, an output file, and a dialog title,
  511. ** it will return 0 on successful download, 1 on error.
  512. */
  513. #define IPC_GETHTTPGETTERW 1240
  514. /* int (*httpRetrieveFileW)(HWND hwnd, char *url, wchar_t *file, wchar_t *dlgtitle); */
  515. #define IPC_MBOPEN 241
  516. /* (requires Winamp 2.05+)
  517. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_MBOPEN);
  518. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPEN);
  519. ** IPC_MBOPEN will open a new URL in the minibrowser. if url is NULL, it will open the Minibrowser window.
  520. */
  521. #define IPC_CHANGECURRENTFILE 245
  522. /* (requires Winamp 2.05+)
  523. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_CHANGECURRENTFILE);
  524. ** IPC_CHANGECURRENTFILE will set the current playlist item.
  525. */
  526. #define IPC_CHANGECURRENTFILEW 1245
  527. /* (requires Winamp 5.3+)
  528. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_CHANGECURRENTFILEW);
  529. ** IPC_CHANGECURRENTFILEW will set the current playlist item.
  530. */
  531. #define IPC_GETMBURL 246
  532. /* (requires Winamp 2.2+)
  533. ** char buffer[4096]; // Urls can be VERY long
  534. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)buffer,IPC_GETMBURL);
  535. ** IPC_GETMBURL will retrieve the current Minibrowser URL into buffer.
  536. ** buffer must be at least 4096 bytes long.
  537. */
  538. #define IPC_MBBLOCK 248
  539. /* (requires Winamp 2.4+)
  540. ** SendMessageW(hwnd_winamp,WM_WA_IPC,value,IPC_MBBLOCK);
  541. **
  542. ** IPC_MBBLOCK will block the Minibrowser from updates if value is set to 1
  543. */
  544. #define IPC_MBOPENREAL 249
  545. /* (requires Winamp 2.4+)
  546. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPENREAL);
  547. **
  548. ** IPC_MBOPENREAL works the same as IPC_MBOPEN except that it will works even if
  549. ** IPC_MBBLOCK has been set to 1
  550. */
  551. #define IPC_ADJUST_OPTIONSMENUPOS 280
  552. /* (requires Winamp 2.9+)
  553. ** int newpos=SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)adjust_offset,IPC_ADJUST_OPTIONSMENUPOS);
  554. ** This moves where Winamp expects the Options menu to be in the main menu.
  555. ** This is useful if you wish to insert a menu item above the options/skins/vis menus for a window.
  556. ** If you pass adjust_offset as zero then it will return the current offset without adjusting it.
  557. */
  558. #define IPC_GET_HMENU 281
  559. /* (requires Winamp 2.9+)
  560. ** HMENU hMenu=SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)0,IPC_GET_HMENU);
  561. **
  562. ** For 2.9x installs the following values are valid:
  563. ** 0 : main popup menu (mapped to -1 in 5.x installs)
  564. ** 1 : main menubar file menu
  565. ** 2 : main menubar options menu
  566. ** 3 : main menubar windows menu
  567. ** 4 : main menubar help menu
  568. **
  569. ** For 5.x client versions the following values are valid (changed due to Modern skin support):
  570. ** -1 : the main winamp menu resource (same as doing LoadMenu(winamp_module_or_lng_file,101)
  571. ** 0 : main popup menu
  572. ** 1 : main menubar file menu
  573. ** 2 : main menubar play menu
  574. ** 3 : main menubar options menu
  575. ** 4 : main menubar windows menu
  576. ** 5 : main menubar windows help
  577. ** 6 : playlist editor menubar file menu
  578. ** 7 : playlist editor menubar playlist menu
  579. ** 8 : playlist editor menubar sort menu
  580. ** 9 : media library menubar file menu
  581. ** 10 : media library menubar view menu
  582. **
  583. ** In all client versions, unsupported values will return NULL.
  584. **
  585. ** e.g. (psuedo code to add an item to the end of the main window 'view' menu)
  586. ** HMENU windows_menu = (HMENU)SendMessageW(hwnd_winamp,WM_WA_IPC,4,IPC_GET_HMENU);
  587. ** if(windows_menu)
  588. ** {
  589. ** // WA_MENUITEM_ID is obtained from IPC_REGISTER_WINAMP_IPCMESSAGE or a predefined
  590. ** // value if that api is not supported on the client version you are working with.
  591. **
  592. ** int window_visible = 1; // this would be updated as needed for the window view state
  593. ** MENUITEMINFO i = {sizeof(i), MIIM_ID | MIIM_STATE | MIIM_TYPE, MFT_STRING,
  594. ** window_visible ? MFS_CHECKED : 0, WA_MENUITEM_ID};
  595. ** i.dwTypeData = "My Menu Item";
  596. ** InsertMenuItem(windows_menu, GetMenuItemCount(windows_menu), TRUE, &i);
  597. ** }
  598. */
  599. #define IPC_GET_EXTENDED_FILE_INFO 290 //pass a pointer to the following struct in wParam
  600. #define IPC_GET_EXTENDED_FILE_INFO_HOOKABLE 296
  601. /* (requires Winamp 2.9+)
  602. ** to use, create an extendedFileInfoStruct, point the values filename and metadata to the
  603. ** filename and metadata field you wish to query, and ret to a buffer, with retlen to the
  604. ** length of that buffer, and then SendMessageW(hwnd_winamp,WM_WA_IPC,&struct,IPC_GET_EXTENDED_FILE_INFO);
  605. ** the results should be in the buffer pointed to by ret.
  606. ** returns 1 if the decoder supports a getExtendedFileInfo method
  607. */
  608. typedef struct {
  609. const char *filename;
  610. const char *metadata;
  611. char *ret;
  612. size_t retlen;
  613. } extendedFileInfoStruct;
  614. #define IPC_GET_BASIC_FILE_INFO 291 //pass a pointer to the following struct in wParam
  615. typedef struct {
  616. const char *filename;
  617. int quickCheck; // set to 0 to always get, 1 for quick, 2 for default (if 2, quickCheck will be set to 0 if quick wasnot used)
  618. // filled in by winamp
  619. int length;
  620. char *title;
  621. int titlelen;
  622. } basicFileInfoStruct;
  623. #define IPC_GET_BASIC_FILE_INFOW 1291 //pass a pointer to the following struct in wParam
  624. typedef struct {
  625. const wchar_t *filename;
  626. int quickCheck; // set to 0 to always get, 1 for quick, 2 for default (if 2, quickCheck will be set to 0 if quick wasnot used)
  627. // filled in by winamp
  628. int length;
  629. wchar_t *title;
  630. int titlelen;
  631. } basicFileInfoStructW;
  632. #define IPC_GET_EXTLIST 292
  633. #define IPC_GET_EXTLISTW 1292
  634. /* (requires Winamp 5.0+)
  635. ** char* ext_list = (char*)SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)mode,IPC_GET_EXTLIST);
  636. ** wchar_t* ext_list = (wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)mode,IPC_GET_EXTLISTW);
  637. ** These return a double null delimited string based on the mode passed.
  638. ** Ensure you GlobalFree() the result when done.
  639. **
  640. ** mode = 0 - returns raw extlist of all loadable formats
  641. ** mode = 1 - returns something suitable for getopenfilename of all loadable formats
  642. **
  643. ** update 5.66+
  644. ** these now de-duplicate file extensions reported by the input plug-ins as well as capitalising.
  645. */
  646. #define IPC_GET_PLAYLIST_EXTLISTW 282
  647. /* (requires Winamp 5.66+)
  648. ** wchar_t* pl_ext_list = (wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)mode,IPC_GET_PLAYLIST_EXTLISTW);
  649. ** These just return playlist extensions / file types instead of all
  650. ** extensions / file types like the prior IPC_GET_EXTLIST(W) methods.
  651. ** There is no need to GlobalFree() the result unlike the IPC_GET_EXTLIST(W) behaviour.
  652. **
  653. ** mode = 0 - returns raw extlist of loadable playlist formats
  654. ** mode = 1 - returns something suitable for getopenfilename of loadable playlist formats
  655. ** mode = 2 - returns raw extlist of writeable playlist formats
  656. ** mode = 3 - returns something suitable for getopenfilename of writeable playlist formats
  657. */
  658. typedef struct {
  659. HWND parent;
  660. char *filename;
  661. } infoBoxParam;
  662. #define IPC_INFOBOX 293
  663. /* (requires Winamp 5.0+)
  664. ** infoBoxParam infoBox = {parent_hwnd,"c:\\test\\folder\\test.mp3"};
  665. ** int ret_val = SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)&infoBox,IPC_INFOBOX);
  666. **
  667. ** ret_val is 0 if OK was pressed and is 1 if CANCEL was pressed
  668. ** The standard behaviour is to abort any loops used with this api if a cancel occurs.
  669. */
  670. typedef struct {
  671. HWND parent;
  672. const wchar_t *filename;
  673. } infoBoxParamW;
  674. #define IPC_INFOBOXW 1293
  675. /* (requires Winamp 5.3+)
  676. ** infoBoxParamW infoBoxW = {parent_hwnd,L"c:\\test\\folder\\test.mp3"};
  677. ** int ret_val = SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)&infoBoxW,IPC_INFOBOXW);
  678. **
  679. ** ret_val is 0 if OK was pressed and is 1 if CANCEL was pressed
  680. ** The standard behaviour is to abort any loops used with this api if a cancel occurs.
  681. */
  682. #define IPC_SET_EXTENDED_FILE_INFO 294 //pass a pointer to the a extendedFileInfoStruct in wParam
  683. /* (requires Winamp 2.9+)
  684. ** to use, create an extendedFileInfoStruct, point the values filename and metadata to the
  685. ** filename and metadata field you wish to write in ret. (retlen is not used). and then
  686. ** SendMessageW(hwnd_winamp,WM_WA_IPC,&struct,IPC_SET_EXTENDED_FILE_INFO);
  687. ** returns 1 if the metadata is supported
  688. ** Call IPC_WRITE_EXTENDED_FILE_INFO once you're done setting all the metadata you want to update
  689. */
  690. #define IPC_WRITE_EXTENDED_FILE_INFO 295
  691. /* (requires Winamp 2.9+)
  692. ** writes all the metadata set thru IPC_SET_EXTENDED_FILE_INFO to the file
  693. ** returns 1 if the file has been successfully updated, 0 if error
  694. */
  695. #define IPC_FORMAT_TITLE 297
  696. typedef struct
  697. {
  698. char *spec; // NULL=default winamp spec
  699. void *p;
  700. char *out;
  701. int out_len;
  702. char * (*TAGFUNC)(const char * tag, void * p); //return 0 if not found
  703. void (*TAGFREEFUNC)(char * tag,void * p);
  704. } waFormatTitle;
  705. #define IPC_FORMAT_TITLE_EXTENDED 298 // similiar to IPC_FORMAT_TITLE, but falls back to Winamp's %tags% if your passed tag function doesn't handle it
  706. typedef struct
  707. {
  708. const wchar_t *filename;
  709. int useExtendedInfo; // set to 1 if you want the Title Formatter to query the input plugins for any tags that your tag function fails on
  710. const wchar_t *spec; // NULL=default winamp spec
  711. void *p;
  712. wchar_t *out;
  713. int out_len;
  714. wchar_t * (*TAGFUNC)(const wchar_t * tag, void * p); //return 0 if not found, -1 for empty tag
  715. void (*TAGFREEFUNC)(wchar_t *tag, void *p);
  716. } waFormatTitleExtended;
  717. #define IPC_COPY_EXTENDED_FILE_INFO 299
  718. typedef struct
  719. {
  720. const char *source;
  721. const char *dest;
  722. } copyFileInfoStruct;
  723. #define IPC_COPY_EXTENDED_FILE_INFOW 1299
  724. typedef struct
  725. {
  726. const wchar_t *source;
  727. const wchar_t *dest;
  728. } copyFileInfoStructW;
  729. typedef struct {
  730. int (*inflateReset)(void *strm);
  731. int (*inflateInit_)(void *strm,const char *version, int stream_size);
  732. int (*inflate)(void *strm, int flush);
  733. int (*inflateEnd)(void *strm);
  734. unsigned long (*crc32)(unsigned long crc, const unsigned char *buf, unsigned int len);
  735. } wa_inflate_struct;
  736. #define IPC_GETUNCOMPRESSINTERFACE 331
  737. /* returns a function pointer to uncompress().
  738. ** int (*uncompress)(unsigned char *dest, unsigned long *destLen, const unsigned char *source, unsigned long sourceLen);
  739. ** right out of zlib, useful for decompressing zlibbed data.
  740. ** if you pass the parm of 0x10100000, it will return a wa_inflate_struct * to an inflate API.
  741. */
  742. typedef struct _prefsDlgRec {
  743. HINSTANCE hInst; // dll instance containing the dialog resource
  744. int dlgID; // resource identifier of the dialog
  745. void *proc; // window proceedure for handling the dialog defined as
  746. // LRESULT CALLBACK PrefsPage(HWND,UINT,WPARAM,LPARAM)
  747. char *name; // name shown for the prefs page in the treelist
  748. intptr_t where; // section in the treelist the prefs page is to be added to
  749. // 0 for General Preferences
  750. // 1 for Plugins
  751. // 2 for Skins
  752. // 3 for Bookmarks (no longer in the 5.0+ prefs)
  753. // 4 for Prefs (the old 'Setup' section - no longer in 5.0+)
  754. // 6 for Media Library
  755. intptr_t _id;
  756. struct _prefsDlgRec *next; // no longer implemented as a linked list, now used by Winamp for other means
  757. } prefsDlgRec;
  758. typedef struct _prefsDlgRecW {
  759. HINSTANCE hInst; // dll instance containing the dialog resource
  760. int dlgID; // resource identifier of the dialog
  761. void *proc; // window proceedure for handling the dialog defined as
  762. // LRESULT CALLBACK PrefsPage(HWND,UINT,WPARAM,LPARAM)
  763. wchar_t *name; // name shown for the prefs page in the treelist
  764. intptr_t where; // section in the treelist the prefs page is to be added to
  765. // 0 for General Preferences
  766. // 1 for Plugins
  767. // 2 for Skins
  768. // 3 for Bookmarks (no longer in the 5.0+ prefs)
  769. // 4 for Prefs (the old 'Setup' section - no longer in 5.0+)
  770. // 6 for Media Library
  771. intptr_t _id;
  772. struct _prefsDlgRec *next; // no longer implemented as a linked list, now used by Winamp for other means
  773. } prefsDlgRecW;
  774. #define IPC_ADD_PREFS_DLG 332
  775. #define IPC_ADD_PREFS_DLGW 1332
  776. #define IPC_REMOVE_PREFS_DLG 333
  777. #define IPC_UPDATE_PREFS_DLG 342
  778. #define IPC_UPDATE_PREFS_DLGW 1342
  779. /* (requires Winamp 2.9+)
  780. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_ADD_PREFS_DLG);
  781. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_REMOVE_PREFS_DLG);
  782. **
  783. ** IPC_ADD_PREFS_DLG:
  784. ** To use this you need to allocate a prefsDlgRec structure (either on the heap or with
  785. ** some global data but NOT on the stack) and then initialise the members of the structure
  786. ** (see the definition of the prefsDlgRec structure above).
  787. **
  788. ** hInst - dll instance of where the dialog resource is located.
  789. ** dlgID - id of the dialog resource.
  790. ** proc - dialog window procedure for the prefs dialog.
  791. ** name - name of the prefs page as shown in the preferences list.
  792. ** where - see above for the valid locations the page can be added.
  793. **
  794. ** Then you do SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_ADD_PREFS_DLG);
  795. **
  796. ** example:
  797. **
  798. ** prefsDlgRec* prefsRec = 0;
  799. ** prefsRec = GlobalAlloc(GPTR,sizeof(prefsDlgRec));
  800. ** prefsRec->hInst = hInst;
  801. ** prefsRec->dlgID = IDD_PREFDIALOG;
  802. ** prefsRec->name = "Pref Page";
  803. ** prefsRec->where = 0;
  804. ** prefsRec->proc = PrefsPage;
  805. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_ADD_PREFS_DLG);
  806. **
  807. **
  808. ** IPC_REMOVE_PREFS_DLG:
  809. ** To use you pass the address of the same prefsRec you used when adding the prefs page
  810. ** though you shouldn't really ever have to do this but it's good to clean up after you
  811. ** when you're plugin is being unloaded.
  812. **
  813. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_REMOVE_PREFS_DLG);
  814. **
  815. ** IPC_ADD_PREFS_DLGW
  816. ** requires Winamp 5.53+
  817. **
  818. ** IPC_UPDATE_PREFS_DLG
  819. ** IPC_UPDATE_PREFS_DLGW
  820. ** requires Winamp 5.64+
  821. */
  822. #define IPC_OPENPREFSTOPAGE 380
  823. /* SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_OPENPREFSTOPAGE);
  824. **
  825. ** There are two ways of opening a preferences page.
  826. **
  827. ** The first is to pass an id of a builtin preferences page (see below for ids) or a
  828. ** &prefsDlgRec of the preferences page to open and this is normally done if you are
  829. ** opening a prefs page you added yourself.
  830. **
  831. ** If the page id does not or the &prefsRec is not valid then the prefs dialog will be
  832. ** opened to the first page available (usually the Winamp Pro page).
  833. **
  834. ** (requires Winamp 5.04+)
  835. ** Passing -1 for param will open the preferences dialog to the last page viewed.
  836. **
  837. ** Note: v5.0 to 5.03 had a bug in this api
  838. **
  839. ** On the first call then the correct prefs page would be opened to but on the next call
  840. ** the prefs dialog would be brought to the front but the page would not be changed to the
  841. ** specified.
  842. ** In 5.04+ it will change to the prefs page specified if the prefs dialog is already open.
  843. */
  844. /* Builtin Preference page ids (valid for 5.0+)
  845. ** (stored in the lParam member of the TVITEM structure from the tree item)
  846. **
  847. ** These can be useful if you want to detect a specific prefs page and add things to it
  848. ** yourself or something like that ;)
  849. **
  850. ** Winamp Pro 20
  851. ** General Preferences 0
  852. ** File Types 1
  853. ** Playlist 23
  854. ** Titles 21
  855. ** Playback 42 (added in 5.25)
  856. ** Station Info 41 (added in 5.11 & removed in 5.5)
  857. ** Video 24
  858. ** Localization 25 (added in 5.5)
  859. ** Skins 40
  860. ** Classic Skins 22
  861. ** Plugins 30
  862. ** Input 31
  863. ** Output 32
  864. ** Visualisation 33
  865. ** DSP/Effect 34
  866. ** General Purpose 35
  867. **
  868. ** Note:
  869. ** Custom page ids begin from 60
  870. ** The value of the normal custom pages (Global Hotkeys, Jump To File, etc) is not
  871. ** guaranteed since it depends on the order in which the plugins are loaded which can
  872. ** change on different systems.
  873. **
  874. ** Global Hotkeys, Jump To File, Media Library (under General Preferences and child pages),
  875. ** Media Library (under Plugins), Portables, CD Ripping and Modern Skins are custom pages
  876. ** created by the plugins shipped with Winamp.
  877. */
  878. #define IPC_GETINIFILE 334
  879. /* (requires Winamp 2.9+)
  880. ** char *ini=(char*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETINIFILE);
  881. ** This returns a pointer to the full file path of winamp.ini.
  882. **
  883. ** char ini_path[MAX_PATH] = {0};
  884. **
  885. ** void GetIniFilePath(HWND hwnd){
  886. ** if(SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION) >= 0x2900){
  887. ** // this gets the string of the full ini file path
  888. ** lstrcpynA(ini_path,(char*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETINIFILE),sizeof(ini_path)/sizeof(char));
  889. ** }
  890. ** else{
  891. ** char* p = ini_path;
  892. ** p += GetModuleFileNameA(0,ini_path,sizeof(ini_path)/sizeof(char)) - 1;
  893. ** while(p && *p != '.' && p != ini_path){p = CharPrevA(ini_path,p);}
  894. ** lstrcpynA(p+1,"ini",sizeof(ini_path)/sizeof(char));
  895. ** }
  896. ** }
  897. */
  898. #define IPC_GETINIFILEW 1334
  899. /* (requires Winamp 5.58+)
  900. ** wchar_t *ini=(wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETINIFILEW);
  901. ** This returns a pointer to the full file path of winamp.ini.
  902. **
  903. ** wchar_t ini_path[MAX_PATH] = {0};
  904. **
  905. ** void GetIniFilePath(HWND hwnd){
  906. ** if(SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION) >= 0x5058){
  907. ** // this gets the string of the full ini file path
  908. ** lstrcpynW(ini_path,(wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETINIFILEW),sizeof(ini_path)/sizeof(wchar_t));
  909. ** }
  910. ** else{
  911. ** wchar_t* p = ini_path;
  912. ** p += GetModuleFileNameW(0,ini_path,sizeof(ini_path)/sizeof(wchar_t)) - 1;
  913. ** while(p && *p != '.' && p != ini_path){p = CharPrevW(ini_path,p);}
  914. ** lstrcpynW(p+1,L"ini",sizeof(ini_path)/sizeof(wchar_t));
  915. ** }
  916. ** }
  917. **
  918. ** IPC_GETINIFILEW requires 5.58+
  919. */
  920. #define IPC_GETINIDIRECTORY 335
  921. /* (requires Winamp 2.9+)
  922. ** char *dir=(char*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETINIDIRECTORY);
  923. ** This returns a pointer to the directory where winamp.ini can be found and is
  924. ** useful if you want store config files but you don't want to use winamp.ini.
  925. */
  926. #define IPC_GETINIDIRECTORYW 1335
  927. /* (requires Winamp 5.58+)
  928. ** wchar_t *dir=(wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETINIDIRECTORYW);
  929. ** This returns a pointer to the directory where winamp.ini can be found and is
  930. ** useful if you want store config files but you don't want to use winamp.ini.
  931. */
  932. #define IPC_GETPLUGINDIRECTORY 336
  933. /* (requires Winamp 5.11+)
  934. ** char *plugdir=(char*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETPLUGINDIRECTORY);
  935. ** This returns a pointer to the directory where Winamp has its plugins stored and is
  936. ** useful if you want store config files in plugins.ini in the plugins folder or for
  937. ** accessing any local files in the plugins folder.
  938. */
  939. #define IPC_GETPLUGINDIRECTORYW 1336
  940. /* (requires Winamp 5.58+)
  941. ** wchar_t *plugdir=(wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETPLUGINDIRECTORYW);
  942. ** This returns a pointer to the directory where Winamp has its plugins stored and is
  943. ** useful if you want store config files in plugins.ini in the plugins folder or for
  944. ** accessing any local files in the plugins folder.
  945. */
  946. #define IPC_GETM3UDIRECTORY 337
  947. /* (requires Winamp 5.11+)
  948. ** char *m3udir=(char*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETM3UDIRECTORY);
  949. ** This returns a pointer to the directory where winamp.m3u (and winamp.m3u8 if supported) is stored in.
  950. */
  951. #define IPC_GETM3UDIRECTORYW 338
  952. /* (requires Winamp 5.3+)
  953. ** wchar_t *m3udirW=(wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETM3UDIRECTORYW);
  954. ** This returns a pointer to the directory where winamp.m3u (and winamp.m3u8 if supported) is stored in.
  955. */
  956. #define IPC_GETVISDIRECTORYW 339
  957. /* (requires Winamp 5.58+)
  958. ** wchar_t *visdir=(wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETVISDIRECTORYW);
  959. ** This returns a pointer to the directory set to load/store visualization plugins from.
  960. **
  961. ** This can otherwise be obtained by reading the "VISDir" entry in the winamp section of
  962. ** winamp.ini which if null then you need to assume <winampdir>\plugins
  963. */
  964. #define IPC_GETSKINDIRECTORYW 340
  965. /* (requires Winamp 5.58+)
  966. ** wchar_t *skindir=(wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETSKINDIRECTORYW);
  967. ** This returns a pointer to the directory set to load/store installed skins from.
  968. **
  969. ** This can otherwise be obtained by reading the "SkinDir" entry in the winamp section of
  970. ** winamp.ini which if null then you need to assume <winampdir>\skins
  971. */
  972. #define IPC_GETDSPDIRECTORYW 341
  973. /* (requires Winamp 5.58+)
  974. ** wchar_t *dspdir=(wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETDSPDIRECTORYW);
  975. ** This returns a pointer to the directory set to load/store installed DSP/effect plugins from.
  976. **
  977. ** This can otherwise be obtained by reading the "DSPDir" entry in the winamp section of
  978. ** winamp.ini which if null then you need to assume <winampdir>\plugins
  979. */
  980. #define IPC_GETMLINIFILE 343
  981. #define IPC_GETMLINIFILEW 1343
  982. /* (requires Winamp 5.66+)
  983. ** wchar_t *ml_ini=(wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETMLINIFILEW);
  984. ** This returns a pointer to the full file path of gen_ml.ini.
  985. */
  986. #define IPC_GETSHAREDDLLDIRECTORYW 1344
  987. /* (requires Winamp 5.8+)
  988. ** wchar_t *shareddir=(wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETSHAREDDLLDIRECTORYW);
  989. ** This returns a pointer to the directory set to load/store installed DSP/effect plugins from.
  990. */
  991. #define IPC_SPAWNBUTTONPOPUP 361 // param =
  992. // 0 = eject
  993. // 1 = previous
  994. // 2 = next
  995. // 3 = pause
  996. // 4 = play
  997. // 5 = stop
  998. #define IPC_OPENURLBOX 360
  999. /* (requires Winamp 5.0+)
  1000. ** HGLOBAL hglobal = (HGLOBAL)SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)parent,IPC_OPENURLBOX);
  1001. ** You pass a hwnd for the dialog to be parented to (which modern skin support uses).
  1002. ** This will return a HGLOBAL that needs to be freed with GlobalFree() if this worked.
  1003. */
  1004. #define IPC_OPENFILEBOX 362
  1005. /* (requires Winamp 5.0+)
  1006. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)parent,IPC_OPENFILEBOX);
  1007. ** You pass a hwnd for the dialog to be parented to (which modern skin support uses).
  1008. */
  1009. #define IPC_OPENDIRBOX 363
  1010. /* (requires Winamp 5.0+)
  1011. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)parent,IPC_OPENDIRBOX);
  1012. ** You pass a hwnd for the dialog to be parented to (which modern skin support uses).
  1013. */
  1014. #define IPC_SETDIALOGBOXPARENT 364
  1015. /* (requires Winamp 5.0+)
  1016. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)parent,IPC_SETDIALOGBOXPARENT);
  1017. ** Pass 'parent' as the window which will be used as the parent for a number of the built
  1018. ** in Winamp dialogs and is useful when you are taking over the whole of the UI so that
  1019. ** the dialogs will not appear at the bottom right of the screen since the main winamp
  1020. ** window is located at 3000x3000 by gen_ff when this is used. Call this again with
  1021. ** parent = null to reset the parent back to the orginal Winamp window.
  1022. */
  1023. #define IPC_GETDIALOGBOXPARENT 365
  1024. /* (requires Winamp 5.51+)
  1025. ** HWND hwndParent = SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)0,IPC_GETDIALOGBOXPARENT);
  1026. ** hwndParent can / must be passed to all modal dialogs/MessageBoxes when using Winamp as a parent.
  1027. */
  1028. #define IPC_UPDATEDIALOGBOXPARENT 366
  1029. /* (requires Winamp 5.53+)
  1030. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)parent,IPC_UPDATEDIALOGBOXPARENT);
  1031. ** If you previously called IPC_SETDIALOGBOXPARENT then call this every time your window resizes.
  1032. */
  1033. #define IPC_DRO_MIN 401 // reserved for DrO
  1034. #define IPC_SET_JTF_COMPARATOR 409
  1035. /* (requires Winamp 5.2+)
  1036. /* pass me an int (__cdecl *)(const char *, const char *) in wParam
  1037. ** If this is not set or if it is cleared then Winamp reverts to it's own comparator.
  1038. ** It is not until Winamp 5.33+ that passing wParam=0 or another function will allow
  1039. ** for it to be changed from what was set on the first calling of this api.
  1040. */
  1041. #define IPC_SET_JTF_COMPARATOR_W 410
  1042. /* (requires Winamp 5.55+)
  1043. ** pass me an int (__cdecl *)(const wchar_t *, const wchar_t *) in wParam
  1044. ** If this is not set or if it is cleared then Winamp will revert to the
  1045. ** IPC_SET_JTF_COMPARATOR handler or the native search function if not set.
  1046. */
  1047. #define IPC_SET_JTF_DRAWTEXT 416
  1048. #define IPC_SET_JTF_LOAD_MODE 426
  1049. /* (requires Winamp 5.66+)
  1050. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)mode,IPC_SET_JTF_LOAD_MODE);
  1051. ** Pass 'mode' to alter the loading mode of the JTF window (default is mode = 0).
  1052. ** If 'value' is 1 then disable loading of the full playlist results if no search.
  1053. ** If 'value' is 0 then enable loading of the full playlist results if no search.
  1054. **
  1055. ** If you pass 'value' as -666 to this api then it will return the current mode.
  1056. ** int mode = SendMessageW(hwnd_winamp,WM_WA_IPC,-666,IPC_SET_JTF_LOAD_MODE);
  1057. */
  1058. #define IPC_GET_JTF_LOAD_MODE(hwnd_winamp) SendMessageW(hwnd_winamp,WM_WA_IPC,-666,IPC_SET_JTF_LOAD_MODE)
  1059. /* (requires Winamp 5.66+)
  1060. ** int curpan = IPC_GETPANNING(hwnd_winamp);
  1061. ** This will return the current loading mode of the JTF window.
  1062. */
  1063. #define IPC_DRO_MAX 499
  1064. // pass 0 for a copy of the skin HBITMAP
  1065. // pass 1 for name of font to use for playlist editor likeness
  1066. // pass 2 for font charset
  1067. // pass 3 for font size
  1068. #define IPC_GET_GENSKINBITMAP 503
  1069. #ifdef __cplusplus
  1070. class ifc_window;
  1071. #endif
  1072. typedef struct embedWindowState embedWindowState;
  1073. #define FFC_CREATEEMBED 0 // param = (LPARAM)(ifc_window*)windowParent; return 1 to terminate creation.
  1074. #define FFC_DESTROYEMBED 1
  1075. typedef int (CALLBACK *FFCALLBACK)(embedWindowState* /*windowState*/, INT /*eventId*/, LPARAM /*param*/);
  1076. typedef struct embedWindowState
  1077. {
  1078. HWND me; //hwnd of the window
  1079. #define EMBED_FLAGS_NORESIZE 0x1
  1080. // set this bit to keep window from being resizable
  1081. #define EMBED_FLAGS_NOTRANSPARENCY 0x2
  1082. // set this bit to make gen_ff turn transparency off for this window
  1083. #define EMBED_FLAGS_NOWINDOWMENU 0x4
  1084. // set this bit to prevent gen_ff from automatically adding your window to the right-click menu
  1085. #define EMBED_FLAGS_GUID 0x8
  1086. // (5.31+) call SET_EMBED_GUID(yourEmbedWindowStateStruct, GUID) to define a GUID for this window
  1087. #define EMBED_FLAGS_FFCALLBACK 0x10
  1088. // 5.55+
  1089. #define EMBED_FLAGS_LEGACY_WND 0x20
  1090. // 5.66+ set this bit to prevent gen_ff from adding a modern skin frame to the window
  1091. // when using the legacy api methods for allowing old plug-ins to be dockable
  1092. #define SET_EMBED_GUID(windowState, windowGUID) { windowState->flags |= EMBED_FLAGS_GUID; *((GUID *)&windowState->extra_data[4])=windowGUID; }
  1093. #define GET_EMBED_GUID(windowState) (*((GUID *)&windowState->extra_data[4]))
  1094. int flags; // see above
  1095. RECT r;
  1096. void *user_ptr; // for application use
  1097. union
  1098. {
  1099. #pragma warning(push)
  1100. #pragma warning(disable:4201)
  1101. #pragma pack(push, 1)
  1102. struct
  1103. {
  1104. struct embedWindowState *link;
  1105. intptr_t attached;
  1106. intptr_t padding1[2]; //2-3
  1107. GUID guid; // 4-7
  1108. #ifdef _WIN64
  1109. intptr_t guidpadding;
  1110. #endif
  1111. FFCALLBACK callback; // MAKSIM UPDATE HERE
  1112. intptr_t padding2[52]; // 9-60
  1113. intptr_t hostcount; // 61
  1114. intptr_t reparenting; // 62
  1115. #ifdef __cplusplus
  1116. ifc_window *wasabi_window;
  1117. #else
  1118. void *wasabi_window; // ifc_window *
  1119. #endif
  1120. };
  1121. #pragma warning(pop)
  1122. #pragma pack(pop)
  1123. intptr_t extra_data[64]; // for internal winamp use
  1124. };
  1125. } embedWindowState;
  1126. #define IPC_GET_EMBEDIF 505
  1127. /* (requires Winamp 2.9+)
  1128. ** HWND myframe = (HWND)SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)&wa_wnd,IPC_GET_EMBEDIF);
  1129. **
  1130. ** or
  1131. **
  1132. ** HWND myframe = 0;
  1133. ** HWND (*embed)(embedWindowState *params)=0;
  1134. ** *(void**)&embed = (void*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_EMBEDIF);
  1135. ** myframe = embed(&wa_wnd);
  1136. **
  1137. ** You pass an embedWindowState* and it will return a hwnd for the frame window or if you
  1138. ** pass wParam as null then it will return a HWND embedWindow(embedWindowState *);
  1139. **
  1140. ** Embed window can send notification to the first child.
  1141. ** Notifications will come in form of WM_NOTIFY.
  1142. ** Notifications:
  1143. */
  1144. #define EWN_FIRST (0)
  1145. typedef struct __EMBEDSHOW
  1146. {
  1147. NMHDR hdr;
  1148. BOOL fShow;
  1149. UINT nStatus;
  1150. } EMBEDSHOW;
  1151. #define EWN_SHOWWINDOW (EWN_FIRST + 0) // lParam = (LPARAM)(EMBEDSHOW*)pnmh. This is preffered way to show hide your chold window
  1152. #define IPC_SKINWINDOW 534
  1153. #define SWF_NORESIZE EMBED_FLAGS_NORESIZE
  1154. #define SWF_NOTRANSPARENCY EMBED_FLAGS_NOTRANSPARENCY
  1155. #define SWF_NOWINDOWMENU EMBED_FLAGS_NOWINDOWMENU
  1156. typedef struct __SKINWINDOWPARAM
  1157. {
  1158. INT cbSize; // sizeof(SKINWINDOWPARAM)
  1159. HWND hwndToSkin;
  1160. GUID windowGuid;
  1161. UINT flagsEx;
  1162. FFCALLBACK callbackFF;
  1163. } SKINWINDOWPARAM;
  1164. typedef struct embedEnumStruct
  1165. {
  1166. int (*enumProc)(embedWindowState *ws, struct embedEnumStruct *param); // return 1 to abort
  1167. int user_data; // or more :)
  1168. } embedEnumStruct; // pass
  1169. #define IPC_EMBED_ENUM 532
  1170. /* (requires Winamp 2.9+)
  1171. */
  1172. #define IPC_EMBED_ISVALID 533
  1173. /* (requires Winamp 2.9+)
  1174. ** int valid = SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)embedhwnd,IPC_EMBED_ISVALID);
  1175. ** Pass a hwnd in the wParam to this to check if the hwnd is a valid embed window or not.
  1176. */
  1177. #define IPC_EMBED_ADD_LEGACY 535
  1178. /* (requires Winamp 5.66+)
  1179. ** int done = SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(embedWindowState*)ws,IPC_EMBED_ADD_LEGACY);
  1180. ** You pass an embedWindowState* filled with any appropriate details and ensure you add
  1181. ** EMBED_FLAGS_LEGACY_WND to the 'flags' member to ensure it will be handled correctly.
  1182. ** Returns 1 if the request was able to be processed.
  1183. */
  1184. #define IPC_EMBED_REMOVE_LEGACY 536
  1185. /* (requires Winamp 5.66+)
  1186. ** int done = SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(embedWindowState*)ws,IPC_EMBED_REMOVE_LEGACY);
  1187. ** You pass an embedWindowState* filled with any appropriate details and ensure you add
  1188. ** EMBED_FLAGS_LEGACY_WND to the 'flags' member to ensure it will be handled correctly.
  1189. ** Returns 1 if the request was able to be processed.
  1190. */
  1191. #define IPC_EMBED_UPDATE_LEGACY_POS 537
  1192. /* (requires Winamp 5.66+)
  1193. ** int done = SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(embedWindowState*)ws,IPC_EMBED_UPDATE_LEGACY_POS);
  1194. ** You pass an embedWindowState* filled with an updated position of the window by filling
  1195. ** int the 'r' member so Winamp will know the correct position of the window after moving.
  1196. ** Returns 1 if the request was able to be processed.
  1197. **
  1198. ** Not sending this (ideally at the end of the window being moved) will likely cause issues
  1199. ** with the placement and docking of the legacy window when Winamp's naitve and any embedded
  1200. ** windows are then moved.
  1201. */
  1202. #define IPC_GET_EMBED_SNAPFUNC 538
  1203. /* (requires Winamp 5.66+)
  1204. ** SnapToScreen is used to adjust the rect passed so as to keep the window no the screen
  1205. ** RECT r;
  1206. ** BOOL (*SnapToScreen)(LPRECT outrc)=0;
  1207. ** *(void**)&SnapToScreen = (void*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_EMBED_SNAPFUNC);
  1208. ** SnapToScreen(&r);
  1209. **
  1210. ** or
  1211. **
  1212. ** SnapWindowToAllWindows is used to allow the window to natively dock to other Winamp windows
  1213. ** RECT r;
  1214. ** HWND myWnd = 0;
  1215. ** void (*SnapWindowToAllWindows)(LPRECT outrc, HWND hwndNoSnap)=0;
  1216. ** *(void**)&SnapWindowToAllWindows = (void*)SendMessageW(hwnd_winamp,WM_WA_IPC,1,IPC_GET_EMBED_SNAPFUNC);
  1217. ** SnapWindowToAllWindows(&r, myWnd);
  1218. */
  1219. #define IPC_CONVERTFILE 506
  1220. /* (requires Winamp 2.92+)
  1221. ** Converts a given file to a different format (PCM, MP3, etc...)
  1222. ** To use, pass a pointer to a waFileConvertStruct struct
  1223. ** This struct can be either on the heap or some global
  1224. ** data, but NOT on the stack. At least, until the conversion is done.
  1225. **
  1226. ** eg: SendMessageW(hwnd_winamp,WM_WA_IPC,&myConvertStruct,IPC_CONVERTFILE);
  1227. **
  1228. ** Return value:
  1229. ** 0: Can't start the conversion. Look at myConvertStruct->error for details.
  1230. ** 1: Conversion started. Status messages will be sent to the specified callbackhwnd.
  1231. ** Be sure to call IPC_CONVERTFILE_END when your callback window receives the
  1232. ** IPC_CB_CONVERT_DONE message.
  1233. */
  1234. #ifdef __cplusplus
  1235. class ifc_audiostream;
  1236. class AudioCoder;
  1237. #else
  1238. typedef void *ifc_audiostream;
  1239. typedef void *AudioCoder;
  1240. #endif
  1241. typedef struct
  1242. {
  1243. char *sourcefile; // "c:\\source.mp3"
  1244. char *destfile; // "c:\\dest.pcm"
  1245. intptr_t destformat[8]; // like 'PCM ',srate,nch,bps.
  1246. //hack alert! you can set destformat[6]=mmioFOURCC('I','N','I',' '); and destformat[7]=(int)my_ini_file; (where my_ini_file is a char*)
  1247. HWND callbackhwnd; // window that will receive the IPC_CB_CONVERT notification messages
  1248. //filled in by winamp.exe
  1249. char *error; //if IPC_CONVERTFILE returns 0, the reason will be here
  1250. int bytes_done; //you can look at both of these values for speed statistics
  1251. int bytes_total;
  1252. int bytes_out;
  1253. int killswitch; // don't set it manually, use IPC_CONVERTFILE_END
  1254. /* everything below is for internal use */
  1255. ifc_audiostream *decoder; // for internal winamp use
  1256. HANDLE convert_thread;
  1257. HANDLE file_handle;
  1258. AudioCoder *audio_coder;
  1259. HMODULE encoder_mod;
  1260. int bps;
  1261. int channels;
  1262. int sample_rate;
  1263. intptr_t extra_data[56]; // for future use
  1264. } convertFileStruct;
  1265. #define IPC_CONVERTFILEW 515
  1266. // (requires Winamp 5.36+)
  1267. typedef struct
  1268. {
  1269. wchar_t *sourcefile; // "c:\\source.mp3"
  1270. wchar_t *destfile; // "c:\\dest.pcm"
  1271. intptr_t destformat[8]; // like 'PCM ',srate,nch,bps.
  1272. //hack alert! you can set destformat[6]=mmioFOURCC('I','N','I',' '); and destformat[7]=(int)my_ini_file; (where my_ini_file is a char*)
  1273. HWND callbackhwnd; // window that will receive the IPC_CB_CONVERT notification messages
  1274. //filled in by winamp.exe
  1275. wchar_t *error; //if IPC_CONVERTFILE returns 0, the reason will be here
  1276. int bytes_done; //you can look at both of these values for speed statistics
  1277. int bytes_total;
  1278. int bytes_out;
  1279. int killswitch; // don't set it manually, use IPC_CONVERTFILE_END
  1280. /* everything below is for internal use */
  1281. ifc_audiostream *decoder; // for internal winamp use
  1282. HANDLE convert_thread;
  1283. HANDLE file_handle;
  1284. AudioCoder *audio_coder;
  1285. HMODULE encoder_mod;
  1286. int bps;
  1287. int channels;
  1288. int sample_rate;
  1289. intptr_t extra_data[56]; // for future use
  1290. } convertFileStructW;
  1291. #define IPC_CONVERTFILE_END 507
  1292. /* (requires Winamp 2.92+)
  1293. ** Stop/ends a convert process started from IPC_CONVERTFILE
  1294. ** You need to call this when you receive the IPC_CB_CONVERTDONE message or when you
  1295. ** want to abort a conversion process
  1296. **
  1297. ** eg: SendMessageW(hwnd_winamp,WM_WA_IPC,&myConvertStruct,IPC_CONVERTFILE_END);
  1298. **
  1299. ** No return value
  1300. */
  1301. #define IPC_CONVERTFILEW_END 516
  1302. // (requires Winamp 5.36+)
  1303. typedef struct {
  1304. HWND hwndParent;
  1305. int format;
  1306. //filled in by winamp.exe
  1307. HWND hwndConfig;
  1308. int extra_data[8];
  1309. //hack alert! you can set extra_data[6]=mmioFOURCC('I','N','I',' '); and extra_data[7]=(int)my_ini_file; (where my_ini_file is a char*)
  1310. } convertConfigStruct;
  1311. #define IPC_CONVERT_CONFIG 508
  1312. #define IPC_CONVERT_CONFIG_END 509
  1313. typedef struct
  1314. {
  1315. void (*enumProc)(intptr_t user_data, const char *desc, int fourcc);
  1316. intptr_t user_data;
  1317. } converterEnumFmtStruct;
  1318. #define IPC_CONVERT_CONFIG_ENUMFMTS 510
  1319. /* (requires Winamp 2.92+)
  1320. */
  1321. typedef struct
  1322. {
  1323. char cdletter;
  1324. char *playlist_file;
  1325. HWND callback_hwnd;
  1326. //filled in by winamp.exe
  1327. char *error;
  1328. } burnCDStruct;
  1329. #define IPC_BURN_CD 511
  1330. /* (requires Winamp 5.0+)
  1331. */
  1332. typedef struct
  1333. {
  1334. convertFileStruct *cfs;
  1335. int priority;
  1336. } convertSetPriority;
  1337. #define IPC_CONVERT_SET_PRIORITY 512
  1338. typedef struct
  1339. {
  1340. convertFileStructW *cfs;
  1341. int priority;
  1342. } convertSetPriorityW;
  1343. #define IPC_CONVERT_SET_PRIORITYW 517
  1344. // (requires Winamp 5.36+)
  1345. #define IPC_CONVERT_TEST 518
  1346. /* requires Winamp 5.55+
  1347. * pass a convertFileStructW and it will verify that you are able to transcode
  1348. * checks:
  1349. * - valid input file
  1350. * - valid destination format / encoder type (including winamp pro authorization for mp3)
  1351. * - valid destination file (not that as a side-effect, this function will create a 0 byte destination file!)
  1352. */
  1353. typedef struct
  1354. {
  1355. unsigned int format; //fourcc value
  1356. char *item; // config item, eg "bitrate"
  1357. char *data; // buffer to recieve, or buffer that contains the data
  1358. int len; // length of the data buffer (only used when getting a config item)
  1359. char *configfile; // config file to read from
  1360. } convertConfigItem;
  1361. #define IPC_CONVERT_CONFIG_SET_ITEM 513 // returns TRUE if successful
  1362. #define IPC_CONVERT_CONFIG_GET_ITEM 514 // returns TRUE if successful
  1363. typedef struct
  1364. {
  1365. const char *filename;
  1366. char *title; // 2048 bytes
  1367. int length;
  1368. int force_useformatting; // can set this to 1 if you want to force a url to use title formatting shit
  1369. } waHookTitleStruct;
  1370. #define IPC_HOOK_TITLES 850
  1371. /* (requires Winamp 5.0+)
  1372. ** If you hook this message and modify the information then make sure to return TRUE.
  1373. ** If you don't hook the message then make sure you pass it on through the subclass chain.
  1374. **
  1375. ** LRESULT CALLBACK WinampWndProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
  1376. ** {
  1377. ** LRESULT ret = CallWindowProc((WNDPROC)WinampProc,hwnd,umsg,wParam,lParam);
  1378. **
  1379. ** if(message==WM_WA_IPC && lParam==IPC_HOOK_TITLES)
  1380. ** {
  1381. ** waHookTitleStruct *ht = (waHookTitleStruct *) wParam;
  1382. ** // Doing ATF stuff with ht->title, whatever...
  1383. ** return TRUE;
  1384. ** }
  1385. ** return ret;
  1386. ** }
  1387. */
  1388. typedef struct
  1389. {
  1390. const wchar_t *filename;
  1391. wchar_t *title; // 2048 characters
  1392. int length;
  1393. int force_useformatting; // can set this to 1 if you want to force a url to use title formatting shit
  1394. } waHookTitleStructW;
  1395. #define IPC_HOOK_TITLESW 851
  1396. /* (requires Winamp 5.3+)
  1397. ** See information on IPC_HOOK_TITLES for how to process this.
  1398. */
  1399. #define IPC_GETSADATAFUNC 800
  1400. /* (requires Winamp 5.0+)
  1401. ** <returned_function_pointer> = SendMessageW(hwnd_winamp,WM_WA_IPC,param,IPC_GETSADATAFUNC);
  1402. ** where param can be 0 , 1 or 2. A param == 2 is meant to replace param == 0 as of 5.5+
  1403. **
  1404. ** void (*export_sa_setreq)(int want);
  1405. ** *(void **)&export_sa_setreq=(void *)SendMessageW(hwnd_winamp,WM_WA_IPC,1,IPC_GETSADATAFUNC);
  1406. ** This can called as either want = 0 -> use user setting (ie classic skin mode)
  1407. ** or want = 1 -> just obtain data (ie modern skin mode)
  1408. **
  1409. ** (replaces passing wParam == 0 and if not present then this call will return a null function pointer)
  1410. ** char * (*export_sa_get)(char data[75*2 + 8]);
  1411. ** *(void **)&export_sa_get=(void*)SendMessageW(hwnd_winamp,WM_WA_IPC,2,IPC_GETSADATAFUNC);
  1412. **
  1413. ** When called this will fill the passed buffer with 150 bytes of data and return a pointer to it.
  1414. ** char data[75*2 + 8];
  1415. ** char *p = export_sa_get(data);
  1416. **
  1417. **
  1418. ** (deprecated as of at least 5.5+ but should still work)
  1419. ** char * (*export_sa_get_deprecated)();
  1420. ** *(void **)&export_sa_get_deprecated=(void*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETSADATAFUNC);
  1421. **
  1422. ** When called this will return 150 bytes of data as a static buffer inside Winamp.
  1423. ** char *data = export_sa_get_deprecated();
  1424. */
  1425. #define IPC_GETVUDATAFUNC 801
  1426. /* (requires Winamp 5.0+)
  1427. **
  1428. ** int (*export_vu_get)(int channel);
  1429. ** *(void **)&export_vu_get=(void*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETVUDATAFUNC);
  1430. **
  1431. **
  1432. ** This returns a function pointer of int export_vu_get(int channel) and when called it
  1433. ** will return values between 0 - 255 or or it will return -1 for a bad channel / value.
  1434. **
  1435. ** Calling export_vu_get(0) will return the left channel.
  1436. ** Calling export_vu_get(1) will return the right channel.
  1437. */
  1438. #define IPC_ISMAINWNDVISIBLE 900
  1439. /* (requires Winamp 5.0+)
  1440. ** int visible=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_ISMAINWNDVISIBLE);
  1441. ** You send this to Winamp to query if the main window is visible or not such as by
  1442. ** unchecking the option in the main right-click menu. If the main window is visible then
  1443. ** this will return 1 otherwise it returns 0.
  1444. */
  1445. typedef struct
  1446. {
  1447. int numElems;
  1448. int *elems;
  1449. HBITMAP bm; // set if you want to override
  1450. } waSetPlColorsStruct;
  1451. #define IPC_SETPLEDITCOLORS 920
  1452. /* (requires Winamp 5.0+)
  1453. ** This is sent by gen_ff when a modern skin is being loaded to set the colour scheme for
  1454. ** the playlist editor. When sent numElems is usually 6 and matches with the 6 possible
  1455. ** colours which are provided be pledit.txt from the classic skins. The elems array is
  1456. ** defined as follows:
  1457. **
  1458. ** elems = 0 => normal text
  1459. ** elems = 1 => current text
  1460. ** elems = 2 => normal background
  1461. ** elems = 3 => selected background
  1462. ** elems = 4 => minibroswer foreground
  1463. ** elems = 5 => minibroswer background
  1464. **
  1465. ** if(uMsg == WM_WA_IPC && lParam == IPC_SETPLEDITCOLORS)
  1466. ** {
  1467. ** waSetPlColorsStruct* colStr = (waSetPlColorsStruct*)wp;
  1468. ** if(colStr)
  1469. ** {
  1470. ** // set or inspect the colours being used (basically for gen_ff's benefit)
  1471. ** }
  1472. ** }
  1473. */
  1474. typedef struct
  1475. {
  1476. HWND wnd;
  1477. int xpos; // in screen coordinates
  1478. int ypos;
  1479. } waSpawnMenuParms;
  1480. // waSpawnMenuParms2 is used by the menubar submenus
  1481. typedef struct
  1482. {
  1483. HWND wnd;
  1484. int xpos; // in screen coordinates
  1485. int ypos;
  1486. int width;
  1487. int height;
  1488. } waSpawnMenuParms2;
  1489. // the following IPC use waSpawnMenuParms as parameter
  1490. #define IPC_SPAWNEQPRESETMENU 933
  1491. #define IPC_SPAWNFILEMENU 934 //menubar
  1492. #define IPC_SPAWNOPTIONSMENU 935 //menubar
  1493. #define IPC_SPAWNWINDOWSMENU 936 //menubar
  1494. #define IPC_SPAWNHELPMENU 937 //menubar
  1495. #define IPC_SPAWNPLAYMENU 938 //menubar
  1496. #define IPC_SPAWNPEFILEMENU 939 //menubar
  1497. #define IPC_SPAWNPEPLAYLISTMENU 940 //menubar
  1498. #define IPC_SPAWNPESORTMENU 941 //menubar
  1499. #define IPC_SPAWNPEHELPMENU 942 //menubar
  1500. #define IPC_SPAWNMLFILEMENU 943 //menubar
  1501. #define IPC_SPAWNMLVIEWMENU 944 //menubar
  1502. #define IPC_SPAWNMLHELPMENU 945 //menubar
  1503. #define IPC_SPAWNPELISTOFPLAYLISTS 946
  1504. #define WM_WA_SYSTRAY WM_USER+1
  1505. /* This is sent by the system tray when an event happens (you might want to simulate it).
  1506. **
  1507. ** if(uMsg == WM_WA_SYSTRAY)
  1508. ** {
  1509. ** switch(lParam)
  1510. ** {
  1511. ** // process the messages sent from the tray
  1512. ** }
  1513. ** }
  1514. */
  1515. #define WM_WA_MPEG_EOF WM_USER+2
  1516. /* Input plugins send this when they are done playing back the current file to inform
  1517. ** Winamp or anyother installed plugins that the current
  1518. **
  1519. ** if(uMsg == WM_WA_MPEG_EOF)
  1520. ** {
  1521. ** // do what is needed here
  1522. ** }
  1523. */
  1524. //// video stuff
  1525. #define IPC_IS_PLAYING_VIDEO 501 // returns >1 if playing, 0 if not, 1 if old version (so who knows):)
  1526. #define IPC_GET_IVIDEOOUTPUT 500 // see below for IVideoOutput interface
  1527. #define VIDEO_MAKETYPE(A,B,C,D) ((A) | ((B)<<8) | ((C)<<16) | ((D)<<24))
  1528. #define VIDUSER_SET_INFOSTRING 0x1000
  1529. #define VIDUSER_GET_VIDEOHWND 0x1001
  1530. #define VIDUSER_SET_VFLIP 0x1002
  1531. #define VIDUSER_SET_TRACKSELINTERFACE 0x1003 // give your ITrackSelector interface as param2
  1532. #define VIDUSER_OPENVIDEORENDERER 0x1004
  1533. #define VIDUSER_CLOSEVIDEORENDERER 0x1005
  1534. #define VIDUSER_GETPOPUPMENU 0x1006
  1535. #define VIDUSER_SET_INFOSTRINGW 0x1007
  1536. #define VIDUSER_SET_THREAD_SAFE 0x1008 // set param2 = 1 if open(), draw() and close() will be called on the same thread
  1537. #define VIDUSER_SET_PALETTE 0x1010
  1538. #define IPC_HAS_VIDEO_SUPPORT 502
  1539. /* (requires Winamp 5.666+)
  1540. ** int has_video_support=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_HAS_VIDEO_SUPPORT);
  1541. ** indicates if video support is enabled or not
  1542. ** This returns 0 if video support is disabled (no compatible input plug-ins or via
  1543. ** the no_video=1 winamp.ini configuration option) and 1 if enabled (so will return
  1544. ** 1 on all older Winamp clients where this API method is not available).
  1545. */
  1546. typedef struct
  1547. {
  1548. int w;
  1549. int h;
  1550. int vflip;
  1551. double aspectratio;
  1552. unsigned int fmt;
  1553. } VideoOpenStruct;
  1554. #ifndef NO_IVIDEO_DECLARE
  1555. #ifdef __cplusplus
  1556. class VideoOutput;
  1557. class SubsItem;
  1558. #ifndef _NSV_DEC_IF_H_
  1559. struct YV12_PLANE {
  1560. unsigned char* baseAddr;
  1561. long rowBytes;
  1562. } ;
  1563. struct YV12_PLANES {
  1564. YV12_PLANE y;
  1565. YV12_PLANE u;
  1566. YV12_PLANE v;
  1567. };
  1568. #endif
  1569. class IVideoOutput
  1570. {
  1571. public:
  1572. virtual ~IVideoOutput() { }
  1573. virtual int open(int w, int h, int vflip, double aspectratio, unsigned int fmt)=0;
  1574. virtual void setcallback(LRESULT (*msgcallback)(void *token, HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam), void *token) { (void)token; (void)msgcallback; /* to eliminate warning C4100 */ }
  1575. virtual void close()=0;
  1576. virtual void draw(void *frame)=0;
  1577. virtual void drawSubtitle(SubsItem *item) {UNREFERENCED_PARAMETER(item); }
  1578. virtual void showStatusMsg(const char *text) {UNREFERENCED_PARAMETER(text); }
  1579. virtual int get_latency() { return 0; }
  1580. virtual void notifyBufferState(int bufferstate) { UNREFERENCED_PARAMETER(bufferstate); } /* 0-255*/
  1581. virtual INT_PTR extended(INT_PTR param1, INT_PTR param2, INT_PTR param3) { UNREFERENCED_PARAMETER(param1); UNREFERENCED_PARAMETER(param2); UNREFERENCED_PARAMETER(param3); return 0; } // Dispatchable, eat this!
  1582. };
  1583. class ITrackSelector
  1584. {
  1585. public:
  1586. virtual int getNumAudioTracks()=0;
  1587. virtual void enumAudioTrackName(int n, char *buf, int size)=0;
  1588. virtual int getCurAudioTrack()=0;
  1589. virtual int getNumVideoTracks()=0;
  1590. virtual void enumVideoTrackName(int n, char *buf, int size)=0;
  1591. virtual int getCurVideoTrack()=0;
  1592. virtual void setAudioTrack(int n)=0;
  1593. virtual void setVideoTrack(int n)=0;
  1594. };
  1595. #endif //cplusplus
  1596. #endif//NO_IVIDEO_DECLARE
  1597. // these messages are callbacks that you can grab by subclassing the winamp window
  1598. // wParam =
  1599. #define IPC_CB_WND_EQ 0 // use one of these for the param
  1600. #define IPC_CB_WND_PE 1
  1601. #define IPC_CB_WND_MB 2
  1602. #define IPC_CB_WND_VIDEO 3
  1603. #define IPC_CB_WND_MAIN 4
  1604. #define IPC_CB_ONSHOWWND 600
  1605. #define IPC_CB_ONHIDEWND 601
  1606. #define IPC_CB_GETTOOLTIP 602
  1607. #define IPC_CB_GETTOOLTIPW 1602
  1608. #define IPC_CB_MISC 603
  1609. #define IPC_CB_MISC_TITLE 0 // start of playing/stop/pause
  1610. #define IPC_CB_MISC_VOLUME 1 // volume/pan
  1611. #define IPC_CB_MISC_STATUS 2 // start playing/stop/pause/ffwd/rwd
  1612. #define IPC_CB_MISC_EQ 3
  1613. #define IPC_CB_MISC_INFO 4
  1614. #define IPC_CB_MISC_VIDEOINFO 5
  1615. #define IPC_CB_MISC_TITLE_RATING 6 // (5.5+ for when the rating is changed via the songticker menu on current file)
  1616. #define IPC_CB_MISC_PAUSE 7 // 5.65+
  1617. #define IPC_CB_MISC_UNPAUSE 8 // 5.65+
  1618. /* Example of using IPC_CB_MISC_STATUS to detect the start of track playback with 5.x
  1619. **
  1620. ** if(lParam == IPC_CB_MISC && wParam == IPC_CB_MISC_STATUS)
  1621. ** {
  1622. ** if(SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING) == 1 &&
  1623. ** !SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETOUTPUTTIME))
  1624. ** {
  1625. ** char* file = (char*)SendMessageW(hwnd_winamp,WM_WA_IPC,
  1626. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS),IPC_GETPLAYLISTFILE);
  1627. ** // only output if a valid file was found
  1628. ** if(file)
  1629. ** {
  1630. ** MessageBox(hwnd_winamp,file,"starting",0);
  1631. ** // or do something else that you need to do
  1632. ** }
  1633. ** }
  1634. ** }
  1635. */
  1636. #define IPC_CB_CONVERT_STATUS 604 // param value goes from 0 to 100 (percent)
  1637. #define IPC_CB_CONVERT_DONE 605
  1638. #define IPC_ADJUST_FFWINDOWSMENUPOS 606
  1639. /* (requires Winamp 2.9+)
  1640. ** int newpos=SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)adjust_offset,IPC_ADJUST_FFWINDOWSMENUPOS);
  1641. ** This will move where Winamp expects the freeform windows in the menubar windows main
  1642. ** menu. This is useful if you wish to insert a menu item above extra freeform windows.
  1643. */
  1644. #define IPC_ISDOUBLESIZE 608
  1645. /* (requires Winamp 5.0+)
  1646. ** int dsize=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_ISDOUBLESIZE);
  1647. ** You send this to Winamp to query if the double size mode is enabled or not.
  1648. ** If it is on then this will return 1 otherwise it will return 0.
  1649. */
  1650. #define IPC_ADJUST_FFOPTIONSMENUPOS 609
  1651. /* (requires Winamp 2.9+)
  1652. ** int newpos=SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)adjust_offset,IPC_ADJUST_FFOPTIONSMENUPOS);
  1653. ** moves where winamp expects the freeform preferences item in the menubar windows main
  1654. ** menu. This is useful if you wish to insert a menu item above the preferences item.
  1655. ** If you pass adjust_offset as zero then it will return the current offset without adjusting it.
  1656. **
  1657. ** Note: This setting was ignored by gen_ff until it was fixed in 5.1
  1658. ** gen_ff would assume that the menu position was 11 in all cases and so when you
  1659. ** had two plugins attempting to add entries into the main right click menu it
  1660. ** would cause the 'colour themes' submenu to either be incorrectly duplicated or
  1661. ** to just disappear instead.
  1662. */
  1663. #define IPC_GETTIMEDISPLAYMODE 610
  1664. /* (requires Winamp 5.0+)
  1665. ** int mode=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETTIMEDISPLAYMODE);
  1666. ** This will return the status of the time display i.e. shows time elapsed or remaining.
  1667. ** This returns 0 if Winamp is displaying time elapsed or 1 for the time remaining.
  1668. */
  1669. #define IPC_SETVISWND 611
  1670. /* (requires Winamp 5.0+)
  1671. ** int viswnd=(HWND)SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)viswnd,IPC_SETVISWND);
  1672. ** This allows you to set a window to receive the following message commands (which are
  1673. ** used as part of the modern skin integration).
  1674. ** When you have finished or your visualisation is closed then send wParam as zero to
  1675. ** ensure that things are correctly tidied up.
  1676. */
  1677. /* The following messages are received as the LOWORD(wParam) of the WM_COMMAND message.
  1678. ** See %SDK%\winamp\wa5vis.txt for more info about visualisation integration in Winamp.
  1679. */
  1680. #define ID_VIS_NEXT 40382
  1681. #define ID_VIS_PREV 40383
  1682. #define ID_VIS_RANDOM 40384
  1683. #define ID_VIS_FS 40389
  1684. #define ID_VIS_CFG 40390
  1685. #define ID_VIS_MENU 40391
  1686. #define IPC_GETVISWND 612
  1687. /* (requires Winamp 5.0+)
  1688. ** int viswnd=(HWND)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETVISWND);
  1689. ** This returns a HWND to the visualisation command handler window if set by IPC_SETVISWND.
  1690. */
  1691. #define IPC_ISVISRUNNING 613
  1692. /* (requires Winamp 5.0+)
  1693. ** int visrunning=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_ISVISRUNNING);
  1694. ** This will return 1 if a visualisation is currently running and 0 if one is not running.
  1695. */
  1696. #define IPC_CB_VISRANDOM 628 // param is status of random
  1697. #define IPC_SETIDEALVIDEOSIZE 614
  1698. /* (requires Winamp 5.0+)
  1699. ** This is sent by Winamp back to itself so it can be trapped and adjusted as needed with
  1700. ** the desired width in HIWORD(wParam) and the desired height in LOWORD(wParam).
  1701. **
  1702. ** if(uMsg == WM_WA_IPC){
  1703. ** if(lParam == IPC_SETIDEALVIDEOSIZE){
  1704. ** wParam = MAKEWPARAM(height,width);
  1705. ** }
  1706. ** }
  1707. */
  1708. #define IPC_GETSTOPONVIDEOCLOSE 615
  1709. /* (requires Winamp 5.0+)
  1710. ** int sovc=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETSTOPONVIDEOCLOSE);
  1711. ** This will return 1 if 'stop on video close' is enabled and 0 if it is disabled.
  1712. */
  1713. #define IPC_SETSTOPONVIDEOCLOSE 616
  1714. /* (requires Winamp 5.0+)
  1715. ** int sovc=SendMessageW(hwnd_winamp,WM_WA_IPC,enabled,IPC_SETSTOPONVIDEOCLOSE);
  1716. ** Set enabled to 1 to enable and 0 to disable the 'stop on video close' option.
  1717. */
  1718. typedef struct {
  1719. HWND hwnd;
  1720. int uMsg;
  1721. WPARAM wParam;
  1722. LPARAM lParam;
  1723. } transAccelStruct;
  1724. #define IPC_TRANSLATEACCELERATOR 617
  1725. /* (requires Winamp 5.0+)
  1726. ** (deprecated as of 5.53x+)
  1727. */
  1728. typedef struct {
  1729. int cmd;
  1730. int x;
  1731. int y;
  1732. int align;
  1733. } windowCommand; // send this as param to an IPC_PLCMD, IPC_MBCMD, IPC_VIDCMD
  1734. #define IPC_CB_ONTOGGLEAOT 618
  1735. #define IPC_GETPREFSWND 619
  1736. /* (requires Winamp 5.0+)
  1737. ** HWND prefs = (HWND)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETPREFSWND);
  1738. ** This will return a handle to the preferences dialog if it is open otherwise it will
  1739. ** return zero. A simple check with the OS api IsWindow(..) is a good test if it's valid.
  1740. **
  1741. ** e.g. this will open (or close if already open) the preferences dialog and show if we
  1742. ** managed to get a valid
  1743. ** SendMessageW(hwnd_winamp,WM_COMMAND,MAKEWPARAM(WINAMP_OPTIONS_PREFS,0),0);
  1744. ** MessageBox(hwnd_winamp,(IsWindow((HWND)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETPREFSWND))?"Valid":"Not Open"),0,MB_OK);
  1745. */
  1746. #define IPC_SET_PE_WIDTHHEIGHT 620
  1747. /* (requires Winamp 5.0+)
  1748. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)&point,IPC_SET_PE_WIDTHHEIGHT);
  1749. ** You pass a pointer to a POINT structure which holds the width and height and Winamp
  1750. ** will set the playlist editor to that size (this is used by gen_ff on skin changes).
  1751. ** There does not appear to be any bounds limiting with this so it is possible to create
  1752. ** a zero size playlist editor window (which is a pretty silly thing to do).
  1753. */
  1754. #define IPC_GETLANGUAGEPACKINSTANCE 621
  1755. /* (requires Winamp 5.0+)
  1756. ** HINSTANCE hInst = (HINSTANCE)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETLANGUAGEPACKINSTANCE);
  1757. ** This will return the HINSTANCE to the currently used language pack file for winamp.exe
  1758. **
  1759. ** (5.5+)
  1760. ** If you pass 1 in wParam then you will have zero returned if a language pack is in use.
  1761. ** if(!SendMessageW(hwnd_winamp,WM_WA_IPC,1,IPC_GETLANGUAGEPACKINSTANCE)){
  1762. ** // winamp is currently using a language pack
  1763. ** }
  1764. **
  1765. ** If you pass 2 in wParam then you will get the path to the language pack folder.
  1766. ** wchar_t* lngpackfolder = (wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,2,IPC_GETLANGUAGEPACKINSTANCE);
  1767. **
  1768. ** If you pass 3 in wParam then you will get the path to the currently extracted language pack.
  1769. ** wchar_t* lngpack = (wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,3,IPC_GETLANGUAGEPACKINSTANCE);
  1770. **
  1771. ** If you pass 4 in wParam then you will get the name of the currently used language pack.
  1772. ** wchar_t* lngname = (char*)SendMessageW(hwnd_winamp,WM_WA_IPC,4,IPC_GETLANGUAGEPACKINSTANCE);
  1773. */
  1774. #define LANG_IDENT_STR 0
  1775. #define LANG_LANG_CODE 1
  1776. #define LANG_COUNTRY_CODE 2
  1777. /*
  1778. ** (5.51+)
  1779. ** If you pass 5 in LOWORD(wParam) then you will get the ident string/code string
  1780. ** (based on the param passed in the HIWORD(wParam) of the currently used language pack.
  1781. ** The string returned with LANG_IDENT_STR is used to represent the language that the
  1782. ** language pack is intended for following ISO naming conventions for consistancy.
  1783. **
  1784. ** wchar_t* ident_str = (wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,MAKEWPARAM(5,LANG_XXX),IPC_GETLANGUAGEPACKINSTANCE);
  1785. **
  1786. ** e.g.
  1787. ** For the default language it will return the following for the different LANG_XXX codes
  1788. ** LANG_IDENT_STR -> "en-US" (max buffer size of this is 9 wchar_t)
  1789. ** LANG_LANG_CODE -> "en" (language code)
  1790. ** LANG_COUNTRY_CODE -> "US" (country code)
  1791. **
  1792. ** On pre 5.51 installs you can get LANG_IDENT_STR using the following method
  1793. ** (you'll have to custom process the string returned if you want the langugage or country but that's easy ;) )
  1794. **
  1795. ** #define LANG_PACK_LANG_ID 65534 (if you don't have lang.h)
  1796. ** HINSTANCE hInst = (HINSTANCE)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETLANGUAGEPACKINSTANCE);
  1797. ** wchar_t buffer[9] = {0};
  1798. ** LoadStringW(hInst,LANG_PACK_LANG_ID,buffer,sizeof(buffer)/sizeof(wchar_t));
  1799. **
  1800. **
  1801. **
  1802. ** The following example shows how using the basic api will allow you to load the playlist
  1803. ** context menu resource from the currently loaded language pack or it will fallback to
  1804. ** the default winamp.exe instance.
  1805. **
  1806. ** HINSTANCE lang = (HINSTANCE)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETLANGUAGEPACKINSTANCE);
  1807. ** HMENU popup = GetSubMenu(GetSubMenu((LoadMenu(lang?lang:GetModuleHandle(0),MAKEINTRESOURCE(101))),2),5);
  1808. ** // do processing as needed on the menu before displaying it
  1809. ** TrackPopupMenuEx(orig,TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,rc.left,rc.bottom,hwnd_owner,0);
  1810. ** DestroyMenu(popup);
  1811. **
  1812. ** If you need a specific menu handle then look at IPC_GET_HMENU for more information.
  1813. */
  1814. #define IPC_CB_PEINFOTEXT 622 // data is a string, ie: "04:21/45:02"
  1815. #define IPC_CB_OUTPUTCHANGED 623 // output plugin was changed in config
  1816. #define IPC_GETOUTPUTPLUGIN 625
  1817. /* (requires Winamp 5.0+)
  1818. ** char* outdll = (char*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETOUTPUTPLUGIN);
  1819. ** This returns a string of the current output plugin's dll name.
  1820. ** e.g. if the directsound plugin was selected then this would return 'out_ds.dll'.
  1821. */
  1822. #define IPC_SETDRAWBORDERS 626
  1823. /* (requires Winamp 5.0+)
  1824. ** SendMessageW(hwnd_winamp,WM_WA_IPC,enabled,IPC_SETDRAWBORDERS);
  1825. ** Set enabled to 1 to enable and 0 to disable drawing of the playlist editor and winamp
  1826. ** gen class windows (used by gen_ff to allow it to draw its own window borders).
  1827. */
  1828. #define IPC_DISABLESKINCURSORS 627
  1829. /* (requires Winamp 5.0+)
  1830. ** SendMessageW(hwnd_winamp,WM_WA_IPC,enabled,IPC_DISABLESKINCURSORS);
  1831. ** Set enabled to 1 to enable and 0 to disable the use of skinned cursors.
  1832. */
  1833. #define IPC_GETSKINCURSORS 628
  1834. /* (requires Winamp 5.36+)
  1835. ** data = (WACURSOR)cursorId. (check wa_dlg.h for values)
  1836. */
  1837. #define IPC_CB_RESETFONT 629
  1838. #define IPC_IS_FULLSCREEN 630
  1839. /* (requires Winamp 5.0+)
  1840. ** int val=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_IS_FULLSCREEN);
  1841. ** This will return 1 if the video or visualisation is in fullscreen mode or 0 otherwise.
  1842. */
  1843. #define IPC_SET_VIS_FS_FLAG 631
  1844. /* (requires Winamp 5.0+)
  1845. ** A vis should send this message with 1/as param to notify winamp that it has gone to or has come back from fullscreen mode
  1846. */
  1847. #define IPC_SHOW_NOTIFICATION 632
  1848. /* (requires Winamp 5.0+ & Modern skin support - gen_ff.dll present)
  1849. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_SHOW_NOTIFICATION);
  1850. ** If a Modern skin is loaded and this message is sent/received then it will
  1851. ** trigger the Modern skin notifier to appear (subject to user settings).
  1852. */
  1853. #define IPC_GETSKININFO 633
  1854. #define IPC_GETSKININFOW 1633
  1855. /* (requires Winamp 5.0+)
  1856. ** This is a notification message sent to the main Winamp window by itself whenever it
  1857. ** needs to get information to be shown about the current skin in the 'Current skin
  1858. ** information' box on the main Skins page in the Winamp preferences.
  1859. **
  1860. ** When this notification is received and the current skin is one you are providing the
  1861. ** support for then you return a valid buffer for Winamp to be able to read from with
  1862. ** information about it such as the name of the skin file.
  1863. **
  1864. ** if(uMsg == WM_WA_IPC && lParam == IPC_GETSKININFO){
  1865. ** if(is_our_skin()){
  1866. ** return is_our_skin_name();
  1867. ** }
  1868. ** }
  1869. */
  1870. #define IPC_GET_MANUALPLADVANCE 634
  1871. /* (requires Winamp 5.03+)
  1872. ** int val=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_MANUALPLADVANCE);
  1873. ** IPC_GET_MANUALPLADVANCE returns the status of the Manual Playlist Advance.
  1874. ** If enabled this will return 1 otherwise it will return 0.
  1875. */
  1876. #define IPC_SET_MANUALPLADVANCE 635
  1877. /* (requires Winamp 5.03+)
  1878. ** SendMessageW(hwnd_winamp,WM_WA_IPC,value,IPC_SET_MANUALPLADVANCE);
  1879. ** IPC_SET_MANUALPLADVANCE sets the status of the Manual Playlist Advance option.
  1880. ** Set value = 1 to turn it on and value = 0 to turn it off.
  1881. */
  1882. #define IPC_GET_NEXT_PLITEM 636
  1883. /* (requires Winamp 5.04+)
  1884. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_NEXT_PLITEM);
  1885. **
  1886. ** Sent to Winamp's main window when an item has just finished playback or the next
  1887. ** button has been pressed and requesting the new playlist item number to go to.
  1888. **
  1889. ** Subclass this message in your application to return the new item number.
  1890. ** Return -1 for normal Winamp operation (default) or the new item number in
  1891. ** the playlist to be played instead of the originally selected next track.
  1892. */
  1893. #define IPC_GET_PREVIOUS_PLITEM 637
  1894. /* (requires Winamp 5.04+)
  1895. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_PREVIOUS_PLITEM);
  1896. **
  1897. ** Sent to Winamp's main window when the previous button has been pressed and Winamp is
  1898. ** requesting the new playlist item number to go to.
  1899. **
  1900. ** Return -1 for normal Winamp operation (default) or the new item number in
  1901. ** the playlist to be played instead of the originally selected previous track.
  1902. */
  1903. #define IPC_IS_WNDSHADE 638
  1904. /* (requires Winamp 5.04+)
  1905. ** int is_shaded=SendMessageW(hwnd_winamp,WM_WA_IPC,wnd,IPC_IS_WNDSHADE);
  1906. ** Pass 'wnd' as an id as defined for IPC_GETWND or pass -1 to query the status of the
  1907. ** main window. This returns 1 if the window is in winshade mode and 0 if it is not.
  1908. ** Make sure you only test for this on a 5.04+ install otherwise you get a false result.
  1909. ** (See the notes about unhandled WM_WA_IPC messages).
  1910. */
  1911. #define IPC_SETRATING 639
  1912. /* (requires Winamp 5.04+ with ML)
  1913. ** int rating=SendMessageW(hwnd_winamp,WM_WA_IPC,rating,IPC_SETRATING);
  1914. ** This will allow you to set the 'rating' on the current playlist entry where 'rating'
  1915. ** is an integer value from 0 (no rating) to 5 (5 stars).
  1916. **
  1917. ** The following example should correctly allow you to set the rating for any specified
  1918. ** playlist entry assuming of course that you're trying to get a valid playlist entry.
  1919. **
  1920. ** void SetPlaylistItemRating(int item_to_set, int rating_to_set){
  1921. ** int cur_pos=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS);
  1922. ** SendMessageW(hwnd_winamp,WM_WA_IPC,item_to_set,IPC_SETPLAYLISTPOS);
  1923. ** SendMessageW(hwnd_winamp,WM_WA_IPC,rating_to_set,IPC_SETRATING);
  1924. ** SendMessageW(hwnd_winamp,WM_WA_IPC,cur_pos,IPC_SETPLAYLISTPOS);
  1925. ** }
  1926. **
  1927. ** Note: Winamp 5.6+ allows you to save the rating directly into the file as long as the
  1928. ** file being rated supports the rating metadata field via a supporting input plug-in
  1929. ** to process the tag save as appropriate. If not then the rating will not be saved.
  1930. */
  1931. #define IPC_GETRATING 640
  1932. /* (requires Winamp 5.04+ with ML)
  1933. ** int rating=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETRATING);
  1934. ** This returns the current playlist entry's rating between 0 (no rating) to 5 (5 stars).
  1935. **
  1936. ** The following example should correctly allow you to get the rating for any specified
  1937. ** playlist entry assuming of course that you're trying to get a valid playlist entry.
  1938. **
  1939. ** int GetPlaylistItemRating(int item_to_get, int rating_to_set){
  1940. ** int cur_pos=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS), rating = 0;
  1941. ** SendMessageW(hwnd_winamp,WM_WA_IPC,item_to_get,IPC_SETPLAYLISTPOS);
  1942. ** rating = SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETRATING);
  1943. ** SendMessageW(hwnd_winamp,WM_WA_IPC,cur_pos,IPC_SETPLAYLISTPOS);
  1944. ** return rating;
  1945. ** }
  1946. */
  1947. #define IPC_GETNUMAUDIOTRACKS 641
  1948. /* (requires Winamp 5.04+)
  1949. ** int n = SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETNUMAUDIOTRACKS);
  1950. ** This will return the number of audio tracks available from the currently playing item.
  1951. */
  1952. #define IPC_GETNUMVIDEOTRACKS 642
  1953. /* (requires Winamp 5.04+)
  1954. ** int n = SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETNUMVIDEOTRACKS);
  1955. ** This will return the number of video tracks available from the currently playing item.
  1956. */
  1957. #define IPC_GETAUDIOTRACK 643
  1958. /* (requires Winamp 5.04+)
  1959. ** int cur = SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETAUDIOTRACK);
  1960. ** This will return the id of the current audio track for the currently playing item.
  1961. */
  1962. #define IPC_GETVIDEOTRACK 644
  1963. /* (requires Winamp 5.04+)
  1964. ** int cur = SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETVIDEOTRACK);
  1965. ** This will return the id of the current video track for the currently playing item.
  1966. */
  1967. #define IPC_SETAUDIOTRACK 645
  1968. /* (requires Winamp 5.04+)
  1969. ** SendMessageW(hwnd_winamp,WM_WA_IPC,track,IPC_SETAUDIOTRACK);
  1970. ** This allows you to switch to a new audio track (if supported) in the current playing file.
  1971. */
  1972. #define IPC_SETVIDEOTRACK 646
  1973. /* (requires Winamp 5.04+)
  1974. ** SendMessageW(hwnd_winamp,WM_WA_IPC,track,IPC_SETVIDEOTRACK);
  1975. ** This allows you to switch to a new video track (if supported) in the current playing file.
  1976. */
  1977. #define IPC_PUSH_DISABLE_EXIT 647
  1978. /* (requires Winamp 5.04+)
  1979. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_PUSH_DISABLE_EXIT);
  1980. ** This will let you disable or re-enable the UI exit functions (close button, context
  1981. ** menu, alt-f4). Remember to call IPC_POP_DISABLE_EXIT when you are done doing whatever
  1982. ** was required that needed to prevent exit otherwise you have to kill the Winamp process.
  1983. */
  1984. #define IPC_POP_DISABLE_EXIT 648
  1985. /* (requires Winamp 5.04+)
  1986. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_POP_DISABLE_EXIT);
  1987. ** See IPC_PUSH_DISABLE_EXIT
  1988. */
  1989. #define IPC_IS_EXIT_ENABLED 649
  1990. /* (requires Winamp 5.04+)
  1991. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_IS_EXIT_ENABLED);
  1992. ** This will return 0 if the 'exit' option of Winamp's menu is disabled and 1 otherwise.
  1993. */
  1994. #define IPC_IS_AOT 650
  1995. /* (requires Winamp 5.04+)
  1996. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_IS_AOT);
  1997. ** This will return the status of the always on top flag.
  1998. ** Note: This may not match the actual TOPMOST window flag while another fullscreen
  1999. ** application is focused if the user has the 'Disable always on top while fullscreen
  2000. ** applications are focused' option under the General Preferences page is checked.
  2001. */
  2002. #define IPC_USES_RECYCLEBIN 651
  2003. /* (requires Winamp 5.09+)
  2004. ** int use_bin=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_USES_RECYCLEBIN);
  2005. ** This will return 1 if the deleted file should be sent to the recycle bin or
  2006. ** 0 if deleted files should be deleted permanently (default action for < 5.09).
  2007. **
  2008. ** Note: if you use this on pre 5.09 installs of Winamp then it will return 1 which is
  2009. ** not correct but is due to the way that SendMessageW(..) handles un-processed messages.
  2010. ** Below is a quick case for checking if the returned value is correct.
  2011. **
  2012. ** if(SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_USES_RECYCLEBIN) &&
  2013. ** SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION)>=0x5009)
  2014. ** {
  2015. ** // can safely follow the option to recycle the file
  2016. ** }
  2017. ** else
  2018. * {
  2019. ** // need to do a permanent delete of the file
  2020. ** }
  2021. */
  2022. //#define IPC_FLUSHAUDITS 652
  2023. #define IPC_GETPLAYITEM_START 653
  2024. #define IPC_GETPLAYITEM_END 654
  2025. #define IPC_GETVIDEORESIZE 655
  2026. #define IPC_SETVIDEORESIZE 656
  2027. #define IPC_INITIAL_SHOW_STATE 657
  2028. /* (requires Winamp 5.36+)
  2029. ** int show_state = SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_INITIAL_SHOW_STATE);
  2030. ** returns the processed value of nCmdShow when Winamp was started
  2031. ** (see MSDN documentation the values passed to WinMain(..) for what this should be)
  2032. **
  2033. ** e.g.
  2034. ** if(SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_INITIAL_SHOW_STATE) == SW_SHOWMINIMIZED){
  2035. ** // we are starting minimised so process as needed (keep our window hidden)
  2036. ** }
  2037. **
  2038. ** Useful for seeing if winamp was run minimised on startup so you can act accordingly.
  2039. ** On pre-5.36 versions this will effectively return SW_NORMAL/SW_SHOWNORMAL due to the
  2040. ** handling of unknown apis returning 1 from Winamp.
  2041. */
  2042. #define IPC_GET_STOP_AFTER_CURRENT 658
  2043. /* (requires Winamp 5.58+)
  2044. ** int stopping=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_STOP_AFTER_CURRENT);
  2045. ** IPC_GET_STOP_AFTER_CURRENT returns the status of the Stop After Current state.
  2046. ** If enabled this will return 0 otherwise it will return 1 (see the notes about
  2047. ** SendMessageW(WM_WA_IPC) handling with unsupported apis for why this is inverted).
  2048. */
  2049. // >>>>>>>>>>> Next is 659
  2050. #define IPC_PLCMD 1000
  2051. #define PLCMD_ADD 0
  2052. #define PLCMD_REM 1
  2053. #define PLCMD_SEL 2
  2054. #define PLCMD_MISC 3
  2055. #define PLCMD_LIST 4
  2056. //#define IPC_MBCMD 1001
  2057. #define MBCMD_BACK 0
  2058. #define MBCMD_FORWARD 1
  2059. #define MBCMD_STOP 2
  2060. #define MBCMD_RELOAD 3
  2061. #define MBCMD_MISC 4
  2062. #define IPC_VIDCMD 1002
  2063. #define VIDCMD_FULLSCREEN 0
  2064. #define VIDCMD_1X 1
  2065. #define VIDCMD_2X 2
  2066. #define VIDCMD_LIB 3
  2067. #define VIDPOPUP_MISC 4
  2068. #define VIDCMD_EXIT_FS 5
  2069. //#define IPC_MBURL 1003 //sets the URL
  2070. //#define IPC_MBGETCURURL 1004 //copies the current URL into wParam (have a 4096 buffer ready)
  2071. //#define IPC_MBGETDESC 1005 //copies the current URL description into wParam (have a 4096 buffer ready)
  2072. //#define IPC_MBCHECKLOCFILE 1006 //checks that the link file is up to date (otherwise updates it). wParam=parent HWND
  2073. //#define IPC_MBREFRESH 1007 //refreshes the "now playing" view in the library
  2074. //#define IPC_MBGETDEFURL 1008 //copies the default URL into wParam (have a 4096 buffer ready)
  2075. #define IPC_STATS_LIBRARY_ITEMCNT 1300 // updates library count status
  2076. /*
  2077. ** IPC's in the message range 2000 - 3000 are reserved internally for freeform messages.
  2078. ** These messages are taken from ff_ipc.h which is part of the Modern skin integration.
  2079. */
  2080. #define IPC_FF_FIRST 2000
  2081. #define IPC_FF_COLOURTHEME_CHANGE IPC_FF_ONCOLORTHEMECHANGED
  2082. #define IPC_FF_ONCOLORTHEMECHANGED IPC_FF_FIRST + 3
  2083. /*
  2084. ** This is a notification message sent when the user changes the colour theme in a Modern
  2085. ** skin and can also be detected when the Modern skin is first loaded as the gen_ff plugin
  2086. ** applies relevant settings and styles (like the colour theme).
  2087. **
  2088. ** The value of wParam is the name of the new color theme being switched to.
  2089. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(const char*)colour_theme_name,IPC_FF_ONCOLORTHEMECHANGED);
  2090. **
  2091. ** (IPC_FF_COLOURTHEME_CHANGE is the name i (DrO) was using before getting a copy of
  2092. ** ff_ipc.h with the proper name in it).
  2093. */
  2094. #define IPC_FF_ISMAINWND IPC_FF_FIRST + 4
  2095. /*
  2096. ** int ismainwnd = (HWND)SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)test_wnd,IPC_FF_ISMAINWND);
  2097. **
  2098. ** This allows you to determine if the window handle passed to it is a modern skin main
  2099. ** window or not. If it is a main window or any of its windowshade variants then it will
  2100. ** return 1.
  2101. **
  2102. ** Because of the way modern skins are implemented, it is possible for this message to
  2103. ** return a positive test result for a number of window handles within the current Winamp
  2104. ** process. This appears to be because you can have a visible main window, a compact main
  2105. ** window and also a winshaded version.
  2106. **
  2107. ** The following code example below is one way of seeing how this api works since it will
  2108. ** enumerate all windows related to Winamp at the time and allows you to process as
  2109. ** required when a detection happens.
  2110. **
  2111. **
  2112. ** EnumThreadWindows(GetCurrentThreadId(),enumWndProc,0);
  2113. **
  2114. ** BOOL CALLBACK enumWndProc(HWND hwnd, LPARAM lParam){
  2115. **
  2116. ** if(SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)hwnd,IPC_FF_ISMAINWND)){
  2117. ** // do processing in here
  2118. ** // or continue the enum for other main windows (if they exist)
  2119. ** // and just comment out the line below
  2120. ** return 0;
  2121. ** }
  2122. ** return 1;
  2123. ** }
  2124. */
  2125. #define IPC_FF_GETCONTENTWND IPC_FF_FIRST + 5
  2126. /*
  2127. ** HWND wa2embed = (HWND)SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)test_wnd,IPC_FF_GETCONTENTWND);
  2128. **
  2129. ** This will return the Winamp 2 window that is embedded in the window's container
  2130. ** i.e. if hwnd is the playlist editor windowshade hwnd then it will return the Winamp 2
  2131. ** playlist editor hwnd.
  2132. **
  2133. ** If no content is found such as the window has nothing embedded then this will return
  2134. ** the hwnd passed to it.
  2135. */
  2136. #define IPC_FF_NOTIFYHOTKEY IPC_FF_FIRST + 6
  2137. /*
  2138. ** This is a notification message sent when the user uses a global hotkey combination
  2139. ** which had been registered with the gen_hotkeys plugin.
  2140. **
  2141. ** The value of wParam is the description of the hotkey as passed to gen_hotkeys.
  2142. ** SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(const char*)hotkey_desc,IPC_FF_NOTIFYHOTKEY);
  2143. */
  2144. #define IPC_FF_LAST 3000
  2145. /*
  2146. ** General IPC messages in Winamp
  2147. **
  2148. ** All notification messages appear in the lParam of the main window message proceedure.
  2149. */
  2150. #define IPC_GETDROPTARGET 3001
  2151. /* (requires Winamp 5.0+)
  2152. ** IDropTarget* IDrop = (IDropTarget*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GETDROPTARGET);
  2153. **
  2154. ** You call this to retrieve a copy of the IDropTarget interface which Winamp created for
  2155. ** handling external drag and drop operations on to it's Windows. This is only really
  2156. ** useful if you're providing an alternate interface and want your Windows to provide the
  2157. ** same drag and drop support as Winamp normally provides the user. Check out MSDN or
  2158. ** your prefered search facility for more information about the IDropTarget interface and
  2159. ** what's needed to handle it in your own instance.
  2160. */
  2161. #define IPC_PLAYLIST_MODIFIED 3002
  2162. /* (requires Winamp 5.0+)
  2163. ** This is a notification message sent to the main Winamp window whenever the playlist is
  2164. ** modified in any way e.g. the addition/removal of a playlist entry.
  2165. **
  2166. ** It is not a good idea to do large amounts of processing in this notification since it
  2167. ** will slow down Winamp as playlist entries are modified (especially when you're adding
  2168. ** in a large playlist).
  2169. **
  2170. ** if(uMsg == WM_WA_IPC && lParam == IPC_PLAYLIST_MODIFIED)
  2171. ** {
  2172. ** // do what you need to do here
  2173. ** }
  2174. */
  2175. #define IPC_PLAYING_FILE 3003
  2176. /* (requires Winamp 5.0+)
  2177. ** This is a notification message sent to the main Winamp window when playback begins for
  2178. ** a file. This passes the full filepath in the wParam of the message received.
  2179. **
  2180. ** if(uMsg == WM_WA_IPC && lParam == IPC_PLAYING_FILE)
  2181. ** {
  2182. ** // do what you need to do here, e.g.
  2183. ** process_file((char*)wParam);
  2184. ** }
  2185. */
  2186. #define IPC_PLAYING_FILEW 13003
  2187. /* (requires Winamp 5.3+)
  2188. ** This is a notification message sent to the main Winamp window when playback begins for
  2189. ** a file. This passes the full filepath in the wParam of the message received.
  2190. **
  2191. ** if(uMsg == WM_WA_IPC && lParam == IPC_PLAYING_FILEW)
  2192. ** {
  2193. ** // do what you need to do here, e.g.
  2194. ** process_file((wchar_t*)wParam);
  2195. ** }
  2196. */
  2197. #define IPC_FILE_TAG_MAY_UPDATEW 3046
  2198. /* (requires Winamp 5.66+)
  2199. ** This is a notification message sent to the main Winamp window when a file is about to
  2200. ** be opened in the file info editor and so may have it's tag (e.g. id3) updated.
  2201. **
  2202. ** The wParam value holds a copy of the filepath of the file which may update and this
  2203. ** can be sent without a matching IPC_FILE_TAG_MAY_HAVE_UPDATED(W) message if the user
  2204. ** does not make any changes or the file being edited does not support tagging updates.
  2205. **
  2206. ** if(uMsg == WM_WA_IPC && lParam == IPC_FILE_TAG_MAY_UPDATEW)
  2207. ** {
  2208. ** // do what you need to do here, e.g.
  2209. ** }
  2210. */
  2211. #define IPC_FILE_TAG_MAY_HAVE_UPDATED 3004
  2212. #define IPC_FILE_TAG_MAY_HAVE_UPDATEDW 3005
  2213. /* (requires Winamp 5.0+)
  2214. ** This is a notification message sent to the main Winamp window when a file's tag
  2215. ** (e.g. id3) may have been updated. This appears to be sent when the InfoBox(..) function
  2216. ** of the associated input plugin returns a 1 (which is the file information dialog/editor
  2217. ** call normally).
  2218. **
  2219. ** The wParam value holds a copy of the filepath of the file which was updated.
  2220. **
  2221. ** if(uMsg == WM_WA_IPC && lParam == IPC_FILE_TAG_MAY_HAVE_UPDATED)
  2222. ** {
  2223. ** // do what you need to do here, e.g.
  2224. ** update_info_on_file_update((char*)wParam);
  2225. ** }
  2226. */
  2227. #define IPC_ALLOW_PLAYTRACKING 3007
  2228. /* (requires Winamp 5.0+)
  2229. ** SendMessageW(hwnd_winamp,WM_WA_IPC,allow,IPC_ALLOW_PLAYTRACKING);
  2230. ** Send allow as nonzero to allow play tracking and zero to disable the mode.
  2231. ** This is useful if you're an input plugin and need to edit a tag in a file
  2232. ** whilst playing that track so this can be sent to Winamp so it appears like
  2233. ** there wasn't a stop in the playback of the file (as far as the UI display).
  2234. */
  2235. #define IPC_HOOK_OKTOQUIT 3010
  2236. /* (requires Winamp 5.0+)
  2237. ** This is a notification message sent to the main Winamp window asking if it's okay to
  2238. ** close or not. Return zero to prevent Winamp from closing or return anything non-zero
  2239. ** to allow Winamp to close.
  2240. **
  2241. ** The best implementation of this option is to let the message pass through to the
  2242. ** original window proceedure since another plugin may want to have a say in the matter
  2243. ** with regards to Winamp closing.
  2244. **
  2245. ** if(uMsg == WM_WA_IPC && lParam == IPC_HOOK_OKTOQUIT)
  2246. ** {
  2247. ** // do what you need to do here, e.g.
  2248. ** if(no_shut_down())
  2249. ** {
  2250. ** return 0;
  2251. ** }
  2252. ** }
  2253. */
  2254. #define IPC_WRITECONFIG 3011
  2255. /* (requires Winamp 5.0+)
  2256. ** SendMessageW(hwnd_winamp,WM_WA_IPC,write_type,IPC_WRITECONFIG);
  2257. **
  2258. ** Send write_type as 2 to write all config settings and the current playlist.
  2259. **
  2260. ** Send write_type as 1 to write the playlist and common settings.
  2261. ** This won't save the following ini settings::
  2262. **
  2263. ** defext, titlefmt, proxy, visplugin_name, dspplugin_name, check_ft_startup,
  2264. ** visplugin_num, pe_fontsize, visplugin_priority, visplugin_autoexec, dspplugin_num,
  2265. ** sticon, splash, taskbar, dropaotfs, ascb_new, ttips, riol, minst, whichicon,
  2266. ** whichicon2, addtolist, snap, snaplen, parent, hilite, disvis, rofiob, shownumsinpl,
  2267. ** keeponscreen, eqdsize, usecursors, fixtitles, priority, shuffle_morph_rate,
  2268. ** useexttitles, bifont, inet_mode, ospb, embedwnd_freesize, no_visseh
  2269. ** (the above was valid for 5.1)
  2270. **
  2271. ** Send write_type as 0 to write the common and less common settings and no playlist.
  2272. */
  2273. #define IPC_UPDATE_URL 3012
  2274. // pass the URL (char *) in lparam, will be free()'d on done.
  2275. #define IPC_GET_RANDFUNC 3015 // returns a function to get a random number
  2276. /* (requires Winamp 5.1+)
  2277. ** int (*randfunc)(void) = (int(*)(void))SendMessageW(plugin.hwndParent,WM_WA_IPC,0,IPC_GET_RANDFUNC);
  2278. ** if(randfunc && randfunc != 1){
  2279. ** randfunc();
  2280. ** }
  2281. **
  2282. ** This will return a positive 32-bit number (essentially 31-bit).
  2283. ** The check for a returned value of 1 is because that's the default return value from
  2284. ** SendMessageW(..) when it is not handled so is good to check for it in this situation.
  2285. */
  2286. #define IPC_METADATA_CHANGED 3017
  2287. /* (requires Winamp 5.1+)
  2288. ** int changed=SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)(char*)field,IPC_METADATA_CHANGED);
  2289. ** a plugin can SendMessageW this to winamp if internal metadata has changes.
  2290. ** wParam should be a char * of what field changed
  2291. **
  2292. ** Currently used for internal actions (and very few at that) the intent of this api is
  2293. ** to allow a plugin to call it when metadata has changed in the current playlist entry
  2294. ** e.g.a new id3v2 tag was found in a stream
  2295. **
  2296. ** The wparam value can either be NULL or a pointer to an ansi string for the metadata
  2297. ** which has changed. This can be thought of as an advanced version of IPC_UPDTITLE and
  2298. ** could be used to allow for update of the current title when a specific tag changed.
  2299. **
  2300. ** Not recommended to be used since there is not the complete handling implemented in
  2301. ** Winamp for it at the moment.
  2302. */
  2303. #define IPC_SKIN_CHANGED 3018
  2304. /* (requires Winamp 5.1+)
  2305. ** This is a notification message sent to the main Winamp window by itself whenever
  2306. ** the skin in use is changed. There is no information sent by the wParam for this.
  2307. **
  2308. ** if(message == WM_WA_IPC && lparam == IPC_SKIN_CHANGED)
  2309. ** {
  2310. ** // do what you need to do to handle skin changes, e.g. call WADlg_init(hwnd_winamp);
  2311. ** }
  2312. */
  2313. #define IPC_REGISTER_LOWORD_COMMAND 3019
  2314. /* (requires Winamp 5.1+)
  2315. ** WORD id = SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_REGISTER_LOWORD_COMMAND);
  2316. ** This will assign you a unique id for making your own commands such as for extra menu
  2317. ** entries. The starting value returned by this message will potentially change as and
  2318. ** when the main resource file of Winamp is updated with extra data so assumptions cannot
  2319. ** be made on what will be returned and plugin loading order will affect things as well.
  2320. ** 5.33+
  2321. ** If you want to reserve more than one id, you can pass the number of ids required in wParam
  2322. */
  2323. typedef struct
  2324. {
  2325. wchar_t *name; // filled in by plugin, make sure it's a unicode string!! (i.e. L"myObject" instead of "myObject).
  2326. struct IDispatch *dispatch; // filled in by plugin
  2327. DWORD id; // filled in by winamp on return
  2328. } DispatchInfo;
  2329. #define IPC_GET_DISPATCH_OBJECT 3020 // gets winamp main IDispatch * (for embedded webpages)
  2330. #define IPC_GET_UNIQUE_DISPATCH_ID 3021 // gives you a unique dispatch ID that won't conflict with anything in winamp's IDispatch *
  2331. #define IPC_ADD_DISPATCH_OBJECT 3022 // add your own dispatch object into winamp's. This lets embedded webpages access your functions
  2332. // pass a pointer to DispatchInfo (see below). Winamp makes a copy of all this data so you can safely delete it later
  2333. #define IPC_REMOVE_DISPATCH_OBJECT 3038
  2334. /* (requires Winamp 5.56+)
  2335. ** remove registered IDispatch. pass (DWORD)dispatchId ad parameter
  2336. */
  2337. // see IPC_JSAPI2_GET_DISPATCH_OBJECT for version 2 of the Dispatchable scripting interface
  2338. #define IPC_GET_PROXY_STRING 3023
  2339. /* (requires Winamp 5.11+)
  2340. ** char* proxy_string=(char*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_PROXY_STRING);
  2341. ** This will return the same string as is shown on the General Preferences page.
  2342. */
  2343. #define IPC_USE_REGISTRY 3024
  2344. /* (requires Winamp 5.11+)
  2345. ** int reg_enabled=SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_USE_REGISTRY);
  2346. ** This will return 0 if you should leave your grubby hands off the registry (i.e. for
  2347. ** lockdown mode). This is useful if Winamp is run from a USB drive and you can't alter
  2348. ** system settings, etc.
  2349. */
  2350. #define IPC_GET_API_SERVICE 3025
  2351. /* (requires Winamp 5.12+)
  2352. ** api_service* api_service = (api_service*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_API_SERVICE);
  2353. ** This api will return Winamp's api_service pointer (which is what Winamp3 used, heh).
  2354. ** If this api is not supported in the Winamp version that is being used at the time then
  2355. ** the returned value from this api will be 1 which is a good version check.
  2356. **
  2357. ** As of 5.12 there is support for .w5s plugins which reside in %WinampDir%\System and
  2358. ** are intended for common code that can be shared amongst other plugins e.g. jnetlib.w5s
  2359. ** which contains jnetlib in one instance instead of being duplicated multiple times in
  2360. ** all of the plugins which need internet access.
  2361. **
  2362. ** Details on the .w5s specifications will come at some stage (possibly).
  2363. */
  2364. typedef struct {
  2365. const wchar_t *filename;
  2366. const wchar_t *metadata;
  2367. wchar_t *ret;
  2368. size_t retlen;
  2369. } extendedFileInfoStructW;
  2370. #define IPC_GET_EXTENDED_FILE_INFOW 3026
  2371. /* (requires Winamp 5.13+)
  2372. ** Pass a pointer to the above struct in wParam
  2373. */
  2374. #define IPC_GET_EXTENDED_FILE_INFOW_HOOKABLE 3027
  2375. #define IPC_SET_EXTENDED_FILE_INFOW 3028
  2376. /* (requires Winamp 5.13+)
  2377. ** Pass a pointer to the above struct in wParam
  2378. */
  2379. #define IPC_PLAYLIST_GET_NEXT_SELECTED 3029
  2380. /* (requires 5.2+)
  2381. ** int pl_item = SendMessageW(hwnd_winamp,WM_WA_IPC,start,IPC_PLAYLIST_GET_NEXT_SELECTED);
  2382. **
  2383. ** This works just like the ListView_GetNextItem(..) macro for ListView controls.
  2384. ** 'start' is the index of the playlist item that you want to begin the search after or
  2385. ** set this as -1 for the search to begin with the first item of the current playlist.
  2386. **
  2387. ** This will return the index of the selected playlist according to the 'start' value or
  2388. ** it returns -1 if there is no selection or no more selected items according to 'start'.
  2389. **
  2390. ** Quick example:
  2391. **
  2392. ** int sel = -1;
  2393. ** // keep incrementing the start of the search so we get all of the selected entries
  2394. ** while((sel = SendMessageW(hwnd_winamp,WM_WA_IPC,sel,IPC_PLAYLIST_GET_NEXT_SELECTED))!=-1){
  2395. ** // show the playlist file entry of the selected item(s) if there were any
  2396. ** MessageBox(hwnd_winamp,(char*)SendMessageW(hwnd_winamp,WM_WA_IPC,sel,IPC_GETPLAYLISTFILE),0,0);
  2397. ** }
  2398. */
  2399. #define IPC_PLAYLIST_GET_SELECTED_COUNT 3030
  2400. /* (requires 5.2+)
  2401. ** int selcnt = SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_PLAYLIST_GET_SELECTED_COUNT);
  2402. ** This will return the number of selected playlist entries.
  2403. */
  2404. #define IPC_GET_PLAYING_FILENAME 3031
  2405. /* (requires Winamp 5.?+)
  2406. ** wchar_t* fn=(wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_PLAYING_FILENAME);
  2407. ** This will return the currently playing filename string as held by Winamp.
  2408. */
  2409. #define IPC_OPEN_URL 3032
  2410. // send either ANSI or Unicode string (it'll figure it out, but it MUST start with "h"!, so don't send ftp:// or anything funny)
  2411. // you can also send this one from another process via WM_COPYDATA (unicode only)
  2412. #define IPC_USE_UXTHEME_FUNC 3033
  2413. /* (requires Winamp 5.35+)
  2414. ** int ret = SendMessageW(hwnd_winamp,WM_WA_IPC,param,IPC_USE_UXTHEME_FUNC);
  2415. ** param can be IPC_ISWINTHEMEPRESENT or IPC_ISAEROCOMPOSITIONACTIVE or a valid hwnd.
  2416. **
  2417. ** If you pass a hwnd then it will apply EnableThemeDialogTexture(ETDT_ENABLETAB)
  2418. ** so your tabbed dialogs can use the correct theme (on supporting OSes ie XP+).
  2419. **
  2420. ** Otherwise this will return a value based on the param passed (as defined below).
  2421. ** For compatability, the return value will be zero on success (as 1 is returned
  2422. ** for unsupported ipc calls on older Winamp versions)
  2423. */
  2424. #define IPC_ISWINTHEMEPRESENT 0
  2425. /* This will return 0 if uxtheme.dll is present
  2426. ** int isthemethere = !SendMessageW(hwnd_winamp,WM_WA_IPC,IPC_ISWINTHEMEPRESENT,IPC_USE_UXTHEME_FUNC);
  2427. */
  2428. #define IPC_ISAEROCOMPOSITIONACTIVE 1
  2429. /* This will return 0 if aero composition is active
  2430. ** int isaero = !SendMessageW(hwnd_winamp,WM_WA_IPC,IPC_ISAEROCOMPOSITIONACTIVE,IPC_USE_UXTHEME_FUNC);
  2431. */
  2432. #define IPC_GET_PLAYING_TITLE 3034
  2433. /* (requires Winamp 5.5+)
  2434. ** wchar_t* title=(wchar_t*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_PLAYING_TITLE);
  2435. ** This will return the currently playing file title string as displayed in Winamp's window.
  2436. */
  2437. #define IPC_CANPLAY 3035
  2438. /* (requires Winamp 5.5+)
  2439. ** In_Module *in_mod=(In_Module*)SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)fn,IPC_CANPLAY);
  2440. ** This api will return either a In_Module* for plugin associated with the file passed or
  2441. ** it will return 0 to indicate there is not a supporting input plugin.
  2442. ** Pass a unicode (wchar_t) filepath.
  2443. **
  2444. ** In_Module *in_mod=(In_Module*)SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)fn,IPC_CANPLAY);
  2445. ** if(in_mod && (in_mod != (In_Module*)1){
  2446. ** // we got a valid In_Module *
  2447. ** }
  2448. */
  2449. typedef struct {
  2450. // fill these in...
  2451. size_t size; // init to sizeof(artFetchData)
  2452. HWND parent; // parent window of the dialogue
  2453. // fill as much of these in as you can, otherwise leave them 0
  2454. const wchar_t *artist;
  2455. const wchar_t *album;
  2456. int year, amgArtistId, amgAlbumId;
  2457. int showCancelAll; // if set to 1, this shows a "Cancel All" button on the dialogue
  2458. // winamp will fill these in if the call returns successfully:
  2459. void* imgData; // a buffer filled with compressed image data. free with WASABI_API_MEMMGR->sysFree()
  2460. int imgDataLen; // the size of the buffer
  2461. wchar_t type[10]; // eg: "jpg"
  2462. const wchar_t *gracenoteFileId; // if you know it
  2463. } artFetchData;
  2464. #define IPC_FETCH_ALBUMART 3036
  2465. /* pass an artFetchData*. This will show a dialog guiding the use through choosing art, and return when it's finished
  2466. ** return values:
  2467. ** 1: error showing dialog
  2468. ** 0: success
  2469. ** -1: cancel was pressed
  2470. ** -2: cancel all was pressed
  2471. */
  2472. #define IPC_JSAPI2_GET_DISPATCH_OBJECT 3037
  2473. /* pass your service's unique ID, as a wchar_t * string, in wParam
  2474. ** Winamp will copy the string, so don't worry about keeping it around
  2475. ** An IDispatch * object will be returned (cast the return value from SendMessageW)
  2476. ** This IDispatch can be used for scripting/automation/VB interaction
  2477. ** Pass to IE via IDocHostUIHandler::GetExternal and it will become window.external in javscript
  2478. */
  2479. // #define IPC_REMOVE_DISPATCH_OBJECT 3038 /* this id already in use */
  2480. #define IPC_HANDLE_URI 3039 /* only for use in WM_COPYDATA, passes Winamp a filename that will get handled by svc_urihandler */
  2481. #define IPC_PLAYFILEW_NDE 3040 /* just like IPC_PLAYFILEW, but the filename is an NDE reference-counted string (but not the title!!) */
  2482. #define IPC_PLAYFILEW_NDE_TITLE 3041 /* use this if the title is reference counted also */
  2483. #define IPC_OUTPUT_STARTED 3042
  2484. /* (requires Winamp 5.57+)
  2485. ** This is a notification message sent to the main Winamp window by an output plugin
  2486. ** when the pre-buffer has been filled and output has started which is useful if you
  2487. ** want to wait until playback has buffered before doing something on song transition.
  2488. **
  2489. ** It is not guaranteed that this message is implemented in all output plugins (with
  2490. ** only out_ds supporting it as of 5.57) so is recommended to wait for 5 seconds or
  2491. ** until you receive this notification message before handling the song transition.
  2492. **
  2493. ** if(message == WM_WA_IPC && lparam == IPC_OUTPUT_STARTED)
  2494. ** {
  2495. ** // do what you need to do
  2496. ** }
  2497. */
  2498. typedef struct {
  2499. int last_time;
  2500. int g_fullstop;
  2501. } stopPlayingInfoStruct;
  2502. #define IPC_STOPPLAYING 3043
  2503. /* (requires Winamp 5.57+)
  2504. ** This is a notification message sent to the main Winamp window by itself whenever
  2505. ** playback is stopped either when file playback ends or the user stops playing.
  2506. **
  2507. ** if(message == WM_WA_IPC && lparam == IPC_STOPPLAYING)
  2508. ** {
  2509. ** // do what you need to do such as logging where playback was
  2510. ** }
  2511. */
  2512. #define IPC_GET_D3DX9 3044
  2513. /* (requires Winamp 5.57+)
  2514. ** HMODULE d3dx9 = (HMODULE)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_D3DX9);
  2515. **
  2516. ** This will return the module handle of a d3dx9_*.dll based against the version
  2517. ** internally required by Winamp and it's supporting plug-ins (version can change).
  2518. **
  2519. ** HMODULE d3dx9 = (HMODULE)SendMessageW(hwnd_winamp,WM_WA_IPC, 0, IPC_GET_D3DX9);
  2520. ** if (!d3dx9 || d3dx9 == (HMODULE)1) {
  2521. ** // if here then loading failed and you'll need to manually load the library
  2522. ** }
  2523. */
  2524. #define IPC_GET_FILEREGISTRAR_OBJECT 3045
  2525. /* (requires Winamp 5.58+)
  2526. ** IFileTypeRegistrar* registrar = (IFileTypeRegistrar*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_FILEREGISTRAR_OBJECT);
  2527. **
  2528. ** You call this to retrieve a copy of a IFileTypeRegistrar object which Winamp will
  2529. ** create which provides some commonly used functions for registry and file access
  2530. ** which will be automatically elevated on Vista / Window 7 depending on the user's
  2531. ** permissions as required.
  2532. **
  2533. ** // it is best to call this everytime that the object is required as there is no
  2534. ** // guarantee it will already have been created or if it's already been released
  2535. ** IFileTypeRegistrar *registrar = (IFileTypeRegistrar*)SendMessageW(hwnd_winamp,WM_WA_IPC,0,IPC_GET_FILEREGISTRAR_OBJECT);
  2536. ** // make sure that we've got a valid object (as 1 is an unsupported api return)
  2537. ** if(registrar && (registrar != (IFileTypeRegistrar*)1)){
  2538. ** // we got a valid copy of the object (automatically elevated as required)
  2539. ** // so now we can start using the IFileTypeRegistrar object as required
  2540. **
  2541. ** // once we're done using the IFileTypeRegistrar object for the immediate moment
  2542. ** // then we should release the object so everything is kept as clean as possible
  2543. ** registrar->Release();
  2544. ** }
  2545. **
  2546. ** 5.66+:
  2547. ** If you pass 1 in wParam then it will skip trying to provide a fallback instance
  2548. ** which is helpful for batch processing and you need to know if elevation failed.
  2549. */
  2550. #define IPC_SHELL_ACTION_START 3047
  2551. #define IPC_SHELL_ACTION_END 3048
  2552. /* (requires Winamp 5.66+)
  2553. ** This is a notification message sent to the main Winamp window by itself whenever
  2554. ** there is an action generated by the Windows shell which may change the playlist.
  2555. **
  2556. ** if(message == WM_WA_IPC && lparam == IPC_SHELL_ACTION_START)
  2557. ** {
  2558. ** }
  2559. */
  2560. #define IPC_REGISTER_WINAMP_IPCMESSAGE 65536
  2561. /* (requires Winamp 5.0+)
  2562. ** DWORD id = SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)name,IPC_REGISTER_WINAMP_IPCMESSAGE);
  2563. ** e.g. DWORD id = SendMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)&"enter_a_different_string",IPC_REGISTER_WINAMP_IPCMESSAGE);
  2564. **
  2565. ** The value 'id' returned is > 65536 and is incremented on subsequent calls for unique
  2566. ** 'name' values passed to it. By using the same 'name' in different plugins will allow a
  2567. ** common runtime api to be provided for the currently running instance of Winamp
  2568. ** e.g.
  2569. ** PostMessageW(hwnd_winamp,WM_WA_IPC,(WPARAM)my_param,registered_ipc);
  2570. ** Have a look at wa_hotkeys.h for an example on how this api is used in practice for a
  2571. ** custom WM_WA_IPC message.
  2572. **
  2573. **
  2574. ** if(uMsg == WM_WA_IPC && lParam == id_from_register_winamp_ipcmessage){
  2575. ** // do things
  2576. ** }
  2577. */
  2578. /**************************************************************************/
  2579. /*
  2580. ** Finally there are some WM_COMMAND messages that you can use to send
  2581. ** Winamp misc commands.
  2582. **
  2583. ** To send these, use:
  2584. **
  2585. ** SendMessageW(hwnd_winamp, WM_COMMAND,command_name,0);
  2586. */
  2587. #ifndef _WA_IPC_LEAN_H_
  2588. #define WINAMP_OPTIONS_EQ 40036 // toggles the EQ window
  2589. #define WINAMP_OPTIONS_PLEDIT 40040 // toggles the playlist window
  2590. #define WINAMP_VOLUMEUP 40058 // turns the volume up a little
  2591. #define WINAMP_VOLUMEDOWN 40059 // turns the volume down a little
  2592. #define WINAMP_FFWD5S 40060 // fast forwards 5 seconds
  2593. #define WINAMP_REW5S 40061 // rewinds 5 seconds
  2594. // the following are the five main control buttons, with optionally shift
  2595. // or control pressed
  2596. // (for the exact functions of each, just try it out)
  2597. #define WINAMP_BUTTON1 40044
  2598. #define WINAMP_BUTTON2 40045
  2599. #define WINAMP_BUTTON3 40046
  2600. #define WINAMP_BUTTON4 40047
  2601. #define WINAMP_BUTTON5 40048
  2602. #define WINAMP_BUTTON1_SHIFT 40144
  2603. #define WINAMP_BUTTON2_SHIFT 40145
  2604. #define WINAMP_BUTTON3_SHIFT 40146
  2605. #define WINAMP_BUTTON4_SHIFT 40147
  2606. #define WINAMP_BUTTON5_SHIFT 40148
  2607. #define WINAMP_BUTTON1_CTRL 40154
  2608. #define WINAMP_BUTTON2_CTRL 40155
  2609. #define WINAMP_BUTTON3_CTRL 40156
  2610. #define WINAMP_BUTTON4_CTRL 40157
  2611. #define WINAMP_BUTTON5_CTRL 40158
  2612. #define WINAMP_FILE_PLAY 40029 // pops up the load file(s) box
  2613. #define WINAMP_FILE_DIR 40187 // pops up the load directory box
  2614. #define WINAMP_OPTIONS_PREFS 40012 // pops up the preferences
  2615. #define WINAMP_OPTIONS_AOT 40019 // toggles always on top
  2616. #define WINAMP_HELP_ABOUT 40041 // pops up the about box :)
  2617. #define ID_MAIN_PLAY_AUDIOCD1 40323 // starts playing the audio CD in the first CD reader
  2618. #define ID_MAIN_PLAY_AUDIOCD2 40324 // plays the 2nd
  2619. #define ID_MAIN_PLAY_AUDIOCD3 40325 // plays the 3rd
  2620. #define ID_MAIN_PLAY_AUDIOCD4 40326 // plays the 4th
  2621. #define ID_MAIN_PLAY_AUDIOCD_SEP 40327
  2622. // IDs 42000 to 45000 are reserved for gen_ff
  2623. // IDs from 45000 to 57000 are reserved for library
  2624. #endif
  2625. #endif//_WA_IPC_H_