http://wiki.winamp.com/index.php?title=Media_Library_API&feed=atom&action=historyMedia Library API - Revision history2024-03-29T05:17:38ZRevision history for this page on the wikiMediaWiki 1.22.3http://wiki.winamp.com/index.php?title=Media_Library_API&diff=61412&oldid=prevCulix: Reverted edits by Iseficibuw (Talk) to last version by Culix2010-11-30T03:27:41Z<p>Reverted edits by <a href="/wiki/Special:Contributions/Iseficibuw" title="Special:Contributions/Iseficibuw">Iseficibuw</a> (<a href="/index.php?title=User_talk:Iseficibuw&action=edit&redlink=1" class="new" title="User talk:Iseficibuw (page does not exist)">Talk</a>) to last version by <a href="/wiki/User:Culix" title="User:Culix">Culix</a></p>
<a href="http://wiki.winamp.com/index.php?title=Media_Library_API&diff=61412&oldid=61362">Show changes</a>Culixhttp://wiki.winamp.com/index.php?title=Media_Library_API&diff=61362&oldid=prevIseficibuw at 05:11, 24 November 20102010-11-24T05:11:24Z<p></p>
<a href="http://wiki.winamp.com/index.php?title=Media_Library_API&diff=61362&oldid=58859">Show changes</a>Iseficibuwhttp://wiki.winamp.com/index.php?title=Media_Library_API&diff=58859&oldid=prevCulix: +cat :Category:Articles; :Category:Articles that need work2009-06-10T14:15:57Z<p>+cat <a href="/wiki/Category:Articles" title="Category:Articles">Category:Articles</a>; <a href="/wiki/Category:Articles_that_need_work" title="Category:Articles that need work">Category:Articles that need work</a></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 14:15, 10 June 2009</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 686:</td>
<td colspan="2" class="diff-lineno">Line 686:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>} file_set_ratingW;</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>} file_set_ratingW;</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div></source></div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div></source></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:Articles]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:Articles that need work]]</ins></div></td></tr>
<!-- diff cache key winamp_wiki:diff:version:1.11a:oldid:921:newid:58859 -->
</table>Culixhttp://wiki.winamp.com/index.php?title=Media_Library_API&diff=921&oldid=prevTarik: Protected "Media Library API" [edit=autoconfirmed:move=autoconfirmed]2008-09-25T13:05:23Z<p>Protected "<a href="/wiki/Media_Library_API" title="Media Library API">Media Library API</a>" [edit=autoconfirmed:move=autoconfirmed]</p>
<table class='diff diff-contentalign-left'>
<tr style='vertical-align: top;'>
<td colspan='1' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='1' style="background-color: white; color:black; text-align: center;">Revision as of 13:05, 25 September 2008</td>
</tr><tr><td colspan='2' style='text-align: center;'><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>Tarikhttp://wiki.winamp.com/index.php?title=Media_Library_API&diff=762&oldid=prevBenski at 16:06, 15 September 20082008-09-15T16:06:57Z<p></p>
<p><b>New page</b></p><div>== Messages sent to your plugin's MessageProc ==<br />
<source lang="cpp"><br />
// return values from the winampUninstallPlugin(HINSTANCE hdll, HWND parent, int param)<br />
// which determine if we can uninstall the plugin immediately or on winamp restart<br />
//<br />
// uninstall support was added from 5.0+ and uninstall now support from 5.5+<br />
// it is down to you to ensure that if uninstall now is returned that it will not cause a crash<br />
// (ie don't use if you've been subclassing the main window)<br />
#define ML_PLUGIN_UNINSTALL_NOW 0x1<br />
#define ML_PLUGIN_UNINSTALL_REBOOT 0x0<br />
<br />
// messages your plugin may receive on MessageProc()<br />
<br />
#define ML_MSG_TREE_BEGIN 0x100<br />
#define ML_MSG_TREE_ONCREATEVIEW 0x100 // param1 = param of tree item, param2 is HWND of parent. return HWND if it is us<br />
<br />
#define ML_MSG_TREE_ONCLICK 0x101 // param1 = param of tree item, param2 = action type (below), param3 = HWND of main window<br />
#define ML_ACTION_RCLICK 0 // return value should be nonzero if ours<br />
#define ML_ACTION_DBLCLICK 1<br />
#define ML_ACTION_ENTER 2<br />
#define ML_ACTION_LCLICK 3<br />
<br />
#define ML_MSG_TREE_ONDROPTARGET 0x102 // param1 = param of tree item, param2 = type of drop (ML_TYPE_*), param3 = pointer to data (or NULL if querying).<br />
// return -1 if not allowed, 1 if allowed, or 0 if not our tree item<br />
<br />
#define ML_MSG_TREE_ONDRAG 0x103 // param1 = param of tree item, param2 = POINT * to the mouse position, and param3 = (int *) to the type<br />
// set *(int*)param3 to the ML_TYPE you want and return 1, if you support drag&drop, or -1 to prevent d&d.<br />
<br />
#define ML_MSG_TREE_ONDROP 0x104 // param1 = param of tree item, param2 = POINT * to the mouse position<br />
// if you support dropping, send the appropriate ML_IPC_HANDLEDROP using SendMessage() and return 1, otherwise return -1.<br />
<br />
#define ML_MSG_TREE_ONKEYDOWN 0x105 // Send when key pressed <br />
// param1 = param of tree item;<br />
// param2 = pointer to NMTVKEYDOWN<br />
// param3 = tree hwnd<br />
// return 0 if it's not yours, 1 if it is<br />
<br />
#define ML_MSG_TREE_END 0x1FF // end of tree specific messages<br />
<br />
<br />
#define ML_MSG_ONSENDTOBUILD 0x300 // you get sent this when the sendto menu gets built<br />
// param1 = type of source, param2 param to pass as context to ML_IPC_ADDTOSENDTO<br />
// be sure to return 0 to allow other plugins to add their context menus<br />
<br />
<br />
// if your sendto item is selected, you will get this with your param3 == your user32 (preferably some<br />
// unique identifier (like your plugin message proc). See ML_IPC_ADDTOSENDTO<br />
#define ML_MSG_ONSENDTOSELECT 0x301<br />
// param1 = type of source, param2 = data, param3 = user32<br />
<br />
// return TRUE and do a config dialog using param1 as a HWND parent for this one<br />
#define ML_MSG_CONFIG 0x400<br />
<br />
</source><br />
<br />
== Messages you can send to the Media Library HWND ==<br />
<source lang="cpp"><br />
<br />
#define ML_TYPE_UNKNOWN -1<br />
#define ML_TYPE_ITEMRECORDLIST 0 // if this, cast obj to itemRecordList<br />
#define ML_TYPE_FILENAMES 1 // double NULL terminated char * to files, URLS, or playlists<br />
#define ML_TYPE_STREAMNAMES 2 // double NULL terminated char * to URLS, or playlists ( effectively the same as ML_TYPE_FILENAMES, but not for files)<br />
#define ML_TYPE_CDTRACKS 3 // if this, cast obj to itemRecordList (CD tracks) -- filenames should be cda://<drive letter>,<track index>. artist/album/title might be valid (CDDB)<br />
#define ML_TYPE_QUERYSTRING 4 // char * to a query string<br />
#define ML_TYPE_PLAYLIST 5 // mlPlaylist *<br />
#define ML_TYPE_ITEMRECORDLISTW 6 // if this, cast obj to itemRecordListW<br />
// added from 5.36+<br />
#define ML_TYPE_FILENAMESW 7 // double NULL terminated wchar_t * to files, URLS, or playlists<br />
#define ML_TYPE_STREAMNAMESW 8 // double NULL terminated wchar_t * to URLS, or playlists ( effectively the same as ML_TYPE_FILENAMESW, but not for files)<br />
#define ML_TYPE_PLAYLISTS 9 // mlPlaylist **, null terminated<br />
#define ML_TYPE_TREEITEM 69 // uhh?<br />
<br />
typedef struct<br />
{<br />
const wchar_t *filename;<br />
const wchar_t *title;<br />
// only fill in the following two if already know. don't calculate it just for the struct. <br />
// put -1 for "don't know"<br />
int numItems; <br />
int length; // in seconds. <br />
} mlPlaylist;<br />
<br />
// if you wish to put your tree items under "devices", use this constant for ML_IPC_ADDTREEITEM<br />
#define ML_TREEVIEW_ID_DEVICES 10000<br />
<br />
<br />
<br />
// children communicate back to the media library by SendMessage(plugin.hwndLibraryParent,WM_ML_IPC,param,ML_IPC_X);<br />
#define WM_ML_IPC WM_USER+0x1000<br />
<br />
<br />
#define ML_IPC_GETCURRENTVIEW 0x090 // Returns HWND to the currently selected view or NULL if nothing selected or error. (WA 5.22 and higher)<br />
<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
// Old Tree Item API (deprecated)<br />
//<br />
#define ML_IPC_ADDTREEITEM 0x0101 // pass mlAddTreeItemStruct as the param<br />
#define ML_IPC_SETTREEITEM 0x0102 // pass mlAddTreeItemStruct with id valid<br />
#define ML_IPC_DELTREEITEM 0x0103 // pass param of tree item to remove<br />
#define ML_IPC_GETCURTREEITEM 0x0104 // returns current tree item param or 0 if none<br />
#define ML_IPC_SETCURTREEITEM 0x0105 // selects the tree item passed, returns 1 if found, 0 if not<br />
#define ML_IPC_GETTREE 0x0106 // returns a HMENU with all the tree items. the caller needs to delete the returned handle! pass mlGetTreeStruct as the param<br />
<br />
/* deprecated. Use MLTREEITEM instead */<br />
typedef struct {<br />
INT_PTR parent_id; //0=root, or ML_TREEVIEW_ID_*<br />
char *title;<br />
int has_children;<br />
INT_PTR this_id; //filled in by the library on ML_IPC_ADDTREEITEM<br />
} mlAddTreeItemStruct;<br />
<br />
typedef struct {<br />
int item_start; // TREE_PLAYLISTS, TREE_DEVICES...<br />
int cmd_offset; // menu command offset if you need to make a command proxy, 0 otherwise<br />
int max_numitems; // maximum number of items you wish to insert or -1 for no limit<br />
} mlGetTreeStruct;<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
/// For Predixis, with Love<br />
/// deprecatded (never use!!!)<br />
///<br />
#define ML_IPC_ADDTREEITEM_EX 0x0111 // pass mlAddTreeItemStructEx as the param<br />
#define ML_IPC_SETTREEITEM_EX 0x0112 // pass mlAddTreeItemStructEx with this_id valid<br />
<br />
typedef struct {<br />
INT_PTR parent_id; //0=root, or ML_TREEVIEW_ID_*<br />
char *title;<br />
int has_children;<br />
INT_PTR this_id; //filled in by the library on ML_IPC_ADDTREEITEM<br />
int imageIndex; // index of the image you want to be associated with your item<br />
} mlAddTreeItemStructEx;<br />
<br />
/// deprecatded (never use!!!)<br />
#define ML_IPC_ADDTREEIMAGE 0x110 // adds tree image to the ml. Use mlAddTreeImageStruct as the param.<br />
/// end of predixis special<br />
<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
// Tree Item API (starting from 5.3)<br />
//<br />
#define ML_IPC_TREEITEM_GETHANDLE 0x120 // Gives you HANDLE to the item with specified ID in the param<br />
#define ML_IPC_TREEITEM_GETCHILD 0x121 // Returns HANDLE to the child item for the item HANDLE specified as a param. <br />
#define ML_IPC_TREEITEM_GETNEXT 0x122 // Returns HANDLE to the next item for the item HANDLE specified as a param.<br />
#define ML_IPC_TREEITEM_GETSELECTED 0x123 // Returns HANDLE to selected item.<br />
#define ML_IPC_TREEITEM_GETINFO 0x124 // Pass MLTREEITEMINFO as a param. return TRUE - if ok<br />
#define ML_IPC_TREEITEM_SETINFO 0x125 // Pass MLTREEITEMINFO as a param. return TRUE - if ok<br />
#define ML_IPC_TREEITEM_ADD 0x126 // Adds new item using MLTREEITEM passed as a param<br />
#define ML_IPC_TREEITEM_DELETE 0x127 // Deletes tree item. Pass HANDLE as a param.<br />
#define ML_IPC_TREEITEM_SELECT 0x128 // Selects tree item. Pass HANDLE as a param. <br />
#define ML_IPC_TREEITEM_GETROOT 0x129 // Gets first item.<br />
#define ML_IPC_TREEITEM_INSERT 0x130 // like ML_IPC_TREEITEM_ADD, but id becomes an "insert after" ID<br />
#define ML_IPC_TREEITEM_GETCHILD_ID 0x131 // Returns ID to the child item for the item ID specified as a param. <br />
#define ML_IPC_TREEITEM_GETNEXT_ID 0x132 // Returns ID to the next item for the item ID specified as a param.<br />
#define ML_IPC_TREEITEM_ADDW 0x133 // Adds new item using MLTREEITEMW passed as a param<br />
#define ML_IPC_TREEITEM_INSERTW 0x134 // like ML_IPC_TREEITEM_ADDW, but id becomes an "insert after" ID<br />
#define ML_IPC_TREEITEM_SETINFOW 0x135 // Pass MLTREEITEMINFOW as a param. return TRUE - if ok<br />
#define ML_IPC_TREEITEM_GETINFOW 0x136 // Pass MLTREEITEMINFO as a param. return TRUE - if ok<br />
#define MLTI_ROOT (INT_PTR)TVI_ROOT // can be used in ML_IPC_TREEITEM_GETCHILD<br />
<br />
typedef struct {<br />
size_t size; // size of this struct<br />
UINT_PTR id; // depends on contxext<br />
UINT_PTR parentId; // 0 = root, or ML_TREEVIEW_ID_*<br />
char *title; // pointer to the buffer contained item name. <br />
size_t titleLen; // used for GetInfo <br />
BOOL hasChildren; // TRUE - has children<br />
int imageIndex; // index of the associated image<br />
} MLTREEITEM;<br />
<br />
typedef struct {<br />
MLTREEITEM item; // item data<br />
UINT mask; // one or more of MLTI_* flags<br />
UINT_PTR handle; // Handle to the item. If handle is NULL item->id will be used<br />
} MLTREEITEMINFO;<br />
<br />
typedef struct {<br />
size_t size; // size of this struct<br />
UINT_PTR id; // depends on context<br />
UINT_PTR parentId; // 0 = root, or ML_TREEVIEW_ID_*<br />
wchar_t *title; // pointer to the buffer contained item name. <br />
size_t titleLen; // used for GetInfo <br />
BOOL hasChildren; // TRUE - has children<br />
int imageIndex; // index of the associated image<br />
} MLTREEITEMW;<br />
<br />
typedef struct {<br />
MLTREEITEMW item; // item data<br />
UINT mask; // one or more of MLTI_* flags<br />
UINT_PTR handle; // Handle to the item. If handle is NULL item->id will be used<br />
} MLTREEITEMINFOW;<br />
// Flags that used in the MLTREEITEMINFO struct<br />
#define MLTI_CHILDREN TVIF_CHILDREN<br />
#define MLTI_IMAGE TVIF_IMAGE<br />
#define MLTI_TEXT TVIF_TEXT<br />
#define MLTI_ID TVIF_PARAM<br />
<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
// Tree image (starting from 5.3)<br />
//<br />
<br />
#define ML_IPC_TREEIMAGE_ADD 0x140 // adds tree image to the ml. Use MLTREEIMAGE as the param.<br />
<br />
typedef struct _COLOR24<br />
{<br />
unsigned char rgbBlue;<br />
unsigned char rgbGreen;<br />
unsigned char rgbRed;<br />
}COLOR24; // color struct <br />
<br />
typedef void (*BMPFILTERPROC)(const COLOR24*, const COLOR24*, COLOR24*); // color filter procedure <br />
// you got two colors: color1 and color2 (usualy BG and FG colors) also you as a third parameter<br />
// you get a pixel color value that you need (can) modify <br />
<br />
#define FILTER_NO ((BMPFILTERPROC)NULL)<br />
#define FILTER_DEFAULT1 ((BMPFILTERPROC)1)<br />
#define FILTER_DEFAULT2 ((BMPFILTERPROC)2)<br />
<br />
#define MLTREEIMAGE_NONE 0<br />
#define MLTREEIMAGE_DEFAULT 1<br />
#define MLTREEIMAGE_BRANCH 2 // calculates at the time <br />
#define MLTREEIMAGE_BRANCH_EXPANDED 3<br />
#define MLTREEIMAGE_BRANCH_COLLAPSED 4<br />
#define MLTREEIMAGE_BRANCH_NOCHILD 5<br />
<br />
typedef struct {<br />
HINSTANCE hinst; // hInstance<br />
int resourceId; // resource id <br />
int imageIndex; // set image to specified index (specify -1 to get a new index back)<br />
BMPFILTERPROC filterProc; // pointer to the filter proc to use or one of the FILTER_*<br />
int width; // reserved<br />
int height; // reserved<br />
} MLTREEIMAGE; // basicly ml will read your reosurce when it will need to create your image<br />
<br />
#define ML_IPC_NEWPLAYLIST 0x107 // pass hwnd for dialog parent as param<br />
#define ML_IPC_IMPORTPLAYLIST 0x108 // pass hwnd for dialog parent as param<br />
#define ML_IPC_IMPORTCURRENTPLAYLIST 0x109<br />
#define ML_IPC_GETPLAYLISTWND 0x10A<br />
#define ML_IPC_SAVEPLAYLIST 0x10B // pass hwnd for dialog parent as param<br />
#define ML_IPC_OPENPREFS 0x10C<br />
<br />
#define ML_IPC_PLAY_PLAYLIST 0x010D // plays the playlist pointed to by the tree item passed, returns 1 if found, 0 if not<br />
#define ML_IPC_LOAD_PLAYLIST 0x010E // loads the playlist pointed to by the tree item passed into the playlist editor, returns 1 if found, 0 if not<br />
<br />
#define ML_IPC_REFRESH_PREFS 0x10F // this doesn't belong in here <br />
<br />
<br />
/** ------------------ <br />
** ml_playlists <br />
** ------------------ */<br />
<br />
#define PL_FLAG_SHOW 1<br />
#define PL_FLAG_SWITCH 2<br />
#define PL_FLAGS_IMPORT 4 // set to have ml_playlists make a copy (only valid for mlAddPlaylist)<br />
#define PL_FLAG_FILL_FILENAME 8 // only valid for mlMakePlaylist<br />
<br />
typedef struct <br />
{<br />
size_t size; // size of this struct<br />
const wchar_t *playlistName; // set to NULL (or empty string) to prompt the user for a name<br />
const wchar_t *filename;<br />
int flags; // see PL_FLAG_* above<br />
// the following two items can be optionally filled in (set to -1 otherwise)<br />
// if they aren't set, the playlist file will have to be opened and parsed<br />
// so prepopulating is faster (assuming if you already know the data)<br />
int numItems; // set to -1 if you don't know. <br />
int length; // in seconds, set to -1 if you don't know<br />
} mlAddPlaylist;<br />
<br />
#define ML_IPC_PLAYLIST_ADD 0x180 // call to add a new playlist file to the Playlists treeview. pass an mlAddPlaylist *<br />
<br />
typedef struct <br />
{<br />
size_t size; // size of this struct<br />
const wchar_t *playlistName; // set to NULL (or empty string) to prompt the user for a name<br />
int type; //ML_TYPE_ITEMRECORDLIST, etc<br />
void *data; // object to load<br />
int flags; // see PL_FLAG_* above<br />
wchar_t filename[MAX_PATH]; // this will get populated if PL_FLAG_FILL_NAME is set<br />
} mlMakePlaylistV2;<br />
<br />
// old structure, here to make it easy to do a sizeof() check<br />
typedef struct <br />
{<br />
size_t size; // size of this struct<br />
const wchar_t *playlistName; // set to NULL (or empty string) to prompt the user for a name<br />
int type; //ML_TYPE_ITEMRECORDLIST, etc<br />
void *data; // object to load<br />
int flags; // see PL_FLAG_* above<br />
} mlMakePlaylist;<br />
<br />
/* Call to add a new playlist to the Playlists treeview. <br />
It will be automatically created based on the data you pass<br />
type & data follow the same specifications as send-to, drag-and-drop, etc.<br />
*/<br />
#define ML_IPC_PLAYLIST_MAKE 0x181 // call to create a new playlist in the treeview based on passed information. pass an mlMakePlaylist *<br />
#define ML_IPC_PLAYLIST_COUNT 0x182<br />
#define ML_IPC_PLAYLIST_INFO 0x183 // pass in the struct below. returns "1" on success and "0" on failure<br />
<br />
typedef struct<br />
{<br />
// you fill this in<br />
size_t size; // size of this struct<br />
size_t playlistNum; // number of the playlist you want to retrieve (0 index)<br />
// ml_playlists fills these in<br />
wchar_t playlistName[128];<br />
wchar_t filename[MAX_PATH];<br />
int numItems;<br />
int length; // in seconds<br />
} mlPlaylistInfo;<br />
<br />
<br />
/** ------------------ <br />
** <br />
** ------------------ */<br />
<br />
#define ML_IPC_GETFILEINFO 0x0200 // pass it a &itemRecord with a valid filename (and all other fields NULL), and it will try to fill in the rest<br />
#define ML_IPC_FREEFILEINFO 0x0201 // pass it a &itemRecord tha twas filled by getfileinfo, it will free the strings it allocated<br />
<br />
#define ML_IPC_HANDLEDRAG 0x0300 // pass it a &mlDropItemStruct it will handle cursors etc (unless flags has the lowest bit set), and it will set result appropriately:<br />
#define ML_IPC_HANDLEDROP 0x0301 // pass it a &mlDropItemStruct with data on drop:<br />
<br />
#define ML_IPC_SENDTOWINAMP 0x302 // send with a mlSendToWinampStruct:<br />
typedef struct {<br />
int type; //ML_TYPE_ITEMRECORDLIST, etc<br />
void *data; // object to play<br />
<br />
int enqueue; // low bit set specifies enqueuing, and second bit NOT set specifies that <br />
// the media library should use its default behavior as the user configured it (if <br />
// enqueue is the default, the low bit will be flipped by the library)<br />
} mlSendToWinampStruct;<br />
<br />
<br />
typedef struct {<br />
char *desc; // str<br />
intptr_t context; // context passed by ML_MSG_ONSENDTOBUILD<br />
intptr_t user32; // use some unique ptr in memory, you will get it back in ML_MSG_ONSENDTOSELECT...<br />
} mlAddToSendToStruct;<br />
#define ML_IPC_ADDTOSENDTO 0x0400<br />
<br />
typedef struct {<br />
wchar_t *desc; // str<br />
intptr_t context; // context passed by ML_MSG_ONSENDTOBUILD<br />
intptr_t user32; // use some unique ptr in memory, you will get it back in ML_MSG_ONSENDTOSELECT...<br />
} mlAddToSendToStructW;<br />
#define ML_IPC_ADDTOSENDTOW 0x0401 // pass mlAddToSendToStructW<br />
<br />
// used to make a submenu in sendto<br />
// pass mlAddToSendToStructW, set desc to 0 to start, set valid desc to end<br />
// user32 is unused <br />
#define ML_IPC_BRANCHSENDTO 0x0402 <br />
<br />
// follow same rules as ML_IPC_ADDTOSENDTOW, but adds to branch instead of main send-to menu<br />
#define ML_IPC_ADDTOBRANCH 0x403 // pass mlAddToSendToStructW<br />
<br />
<br />
<br />
#define ML_IPC_HOOKTITLE 0x0440 // this is like winamp's IPC_HOOK_TITLES... :) param1 is waHookTitleStruct<br />
#define ML_IPC_HOOKEXTINFO 0x441 // called on IPC_GET_EXTENDED_FILE_INFO_HOOKABLE, param1 is extendedFileInfoStruct<br />
#define ML_IPC_HOOKEXTINFOW 0x442 // called on IPC_GET_EXTENDED_FILE_INFO_HOOKABLEW, param1 is extendedFileInfoStructW<br />
#define ML_IPC_HOOKTITLEW 0x0443 // this is like winamp's IPC_HOOK_TITLESW... :) param1 is waHookTitleStructW<br />
<br />
#define ML_HANDLEDRAG_FLAG_NOCURSOR 1<br />
#define ML_HANDLEDRAG_FLAG_NAME 2<br />
<br />
typedef struct {<br />
int type; //ML_TYPE_ITEMRECORDLIST, etc<br />
void *data; // NULL if just querying<br />
<br />
int result; // filled in by client: -1 if dont allow, 0 if dont know, 1 if allow.<br />
<br />
POINT p; // cursor pos in screen coordinates<br />
int flags; <br />
<br />
char *name; // only valid if ML_HANDLEDRAG_FLAG_NAME<br />
<br />
} mlDropItemStruct;<br />
<br />
<br />
#define ML_IPC_SKIN_LISTVIEW 0x0500 // pass the hwnd of your listview. returns a handle to use with ML_IPC_UNSKIN_LISTVIEW<br />
#define ML_IPC_UNSKIN_LISTVIEW 0x0501 // pass the handle you got from ML_IPC_SKIN_LISTVIEW<br />
#define ML_IPC_LISTVIEW_UPDATE 0x0502 // pass the handle you got from ML_IPC_SKIN_LISTVIEW<br />
#define ML_IPC_LISTVIEW_DISABLEHSCROLL 0x0503 // pass the handle you got from ML_IPC_SKIN_LISTVIEW<br />
#define ML_IPC_LISTVIEW_DISABLEVSCROLL 0x050A // pass the handle you got from ML_IPC_SKIN_LISTVIEW<br />
#define ML_IPC_LISTVIEW_SHOWSORT 0x0504 // use LV_SKIN_SHOWSORT<br />
#define ML_IPC_LISTVIEW_SORT 0x0505 // use LV_SKIN_SORT<br />
<br />
typedef struct <br />
{<br />
INT_PTR listView;<br />
BOOL showSort;<br />
} LV_SKIN_SHOWSORT;<br />
<br />
typedef struct<br />
{<br />
INT_PTR listView;<br />
int columnIndex;<br />
BOOL ascending;<br />
} LV_SKIN_SORT;<br />
<br />
<br />
#define ML_IPC_SKIN_COMBOBOX 0x0508 // pass the hwnd of your combobox to skin, returns a ahndle to use with ML_IPC_UNSKIN_COMBOBOX<br />
#define ML_IPC_UNSKIN_COMBOBOX 0x0509 // pass the handle from ML_IPC_SKIN_COMBOBOX<br />
<br />
#define ML_IPC_SKIN_WADLG_GETFUNC 0x0600 <br />
// 1: return int (*WADlg_getColor)(int idx); // pass this an index, returns a RGB value (passing 0 or > 3 returns NULL)<br />
// 2: return int (*WADlg_handleDialogMsgs)(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); <br />
// 3: return void (*WADlg_DrawChildWindowBorders)(HWND hwndDlg, int *tab, int tabsize); // each entry in tab would be the id | DCW_*<br />
// 32: return void (*childresize_init)(HWND hwndDlg, ChildWndResizeItem *list, int num);<br />
// 33: return void (*childresize_resize)(HWND hwndDlg, ChildWndResizeItem *list, int num);<br />
// 66: return (HFONT) font to use for dialog elements, if desired (0 otherwise)<br />
<br />
// itemRecord type for use with ML_TYPE_ITEMRECORDLIST, as well as many other functions<br />
typedef struct<br />
{<br />
char *filename;<br />
char *title;<br />
char *album;<br />
char *artist;<br />
char *comment;<br />
char *genre;<br />
int year;<br />
int track;<br />
int length;<br />
char **extended_info;<br />
// currently defined extended columns (while they are stored internally as integers<br />
// they are passed using extended_info as strings):<br />
// use getRecordExtendedItem and setRecordExtendedItem to get/set.<br />
// for your own internal use, you can set other things, but the following values<br />
// are what we use at the moment. Note that setting other things will be ignored<br />
// by ML_IPC_DB*.<br />
// <br />
//"RATING" file rating. can be 1-5, or 0 or empty for undefined<br />
//"PLAYCOUNT" number of file plays.<br />
//"LASTPLAY" last time played, in standard time_t format<br />
//"LASTUPD" last time updated in library, in standard time_t format<br />
//"FILETIME" last known file time of file, in standard time_t format<br />
//"FILESIZE" last known file size, in kilobytes.<br />
//"BITRATE" file bitrate, in kbps<br />
//"TYPE" - "0" for audio, "1" for video<br />
<br />
} itemRecord;<br />
<br />
typedef struct <br />
{<br />
itemRecord *Items;<br />
int Size;<br />
int Alloc;<br />
} itemRecordList;<br />
<br />
#include <time.h><br />
<br />
typedef struct<br />
{<br />
wchar_t *filename;<br />
wchar_t *title;<br />
wchar_t *album;<br />
wchar_t *artist;<br />
wchar_t *comment;<br />
wchar_t *genre;<br />
wchar_t *albumartist; <br />
wchar_t *replaygain_album_gain; // these are strings rather than float's to differentiate between '0 gain' and 'not defined'<br />
wchar_t *replaygain_track_gain; // these are strings rather than float's to differentiate between '0 gain' and 'not defined'<br />
wchar_t *publisher;<br />
wchar_t *composer;<br />
int year;<br />
int track;<br />
int tracks;<br />
int length;<br />
int rating; // file rating. can be 1-5, or 0 for undefined<br />
int playcount; // number of file plays.<br />
__time64_t lastplay; // last time played, in standard time_t format<br />
__time64_t lastupd; // last time updated in library, in standard time_t format<br />
__time64_t filetime; // last known file time of file, in standard time_t format<br />
int filesize; //last known file size, in kilobytes.<br />
int bitrate; // file bitrate, in kbps<br />
int type; // 0 for audio, 1 for video<br />
int disc; // disc number<br />
int discs; // number of discs<br />
int bpm;<br />
wchar_t **extended_info; <br />
// currently defined extended columns (while they are stored internally as integers<br />
// they are passed using extended_info as strings):<br />
// use getRecordExtendedItem and setRecordExtendedItem to get/set.<br />
// for your own internal use, you can set other things, but the following values<br />
// are what we use at the moment. Note that setting other things will be ignored<br />
// by ML_IPC_DB*.<br />
// <br />
<br />
} itemRecordW;<br />
<br />
typedef struct <br />
{<br />
itemRecordW *Items;<br />
int Size;<br />
int Alloc;<br />
} itemRecordListW;<br />
<br />
//<br />
// all return 1 on success, -1 on error. or 0 if not supported, maybe?<br />
<br />
// pass these a mlQueryStruct<br />
// results should be zeroed out before running a query, but if you wish you can run multiple queries and <br />
// have it concatenate the results. tho it would be more efficient to just make one query that contains both,<br />
// as running multiple queries might have duplicates etc.<br />
// in general, though, if you need to treat "results" as if they are native, you should use<br />
// copyRecordList to save a copy, then free the results using ML_IPC_DB_FREEQUERYRESULTS.<br />
// if you need to keep an exact copy that you will only read (and will not modify), then you can<br />
// use the one in the mlQueryStruct.<br />
<br />
#define ML_IPC_DB_RUNQUERY 0x0700 <br />
#define ML_IPC_DB_RUNQUERY_SEARCH 0x0701 // "query" should be interpreted as keyword search instead of query string<br />
#define ML_IPC_DB_RUNQUERY_FILENAME 0x0702 // searches for one exact filename match of "query"<br />
#define ML_IPC_DB_RUNQUERY_INDEX 0x703 // retrieves item #(int)query<br />
<br />
#define ML_IPC_DB_FREEQUERYRESULTS 0x0705 // frees memory allocated by ML_IPC_RUNQUERY (empties results)<br />
typedef struct <br />
{<br />
char *query;<br />
int max_results; // can be 0 for unlimited<br />
itemRecordList results;<br />
} mlQueryStruct;<br />
<br />
/* Unicode versions of the above */<br />
<br />
#define ML_IPC_DB_RUNQUERYW 0x1700<br />
#define ML_IPC_DB_RUNQUERY_SEARCHW 0x1701 // "query" should be interpreted as keyword search instead of query string<br />
#define ML_IPC_DB_RUNQUERY_FILENAMEW 0x1702 // searches for one exact filename match of "query"<br />
#define ML_IPC_DB_RUNQUERY_INDEXW 0x1703 // retrieves item #(int)query<br />
#define ML_IPC_DB_FREEQUERYRESULTSW 0x1705 // frees memory allocated by ML_IPC_RUNQUERYW (empties results)<br />
typedef struct <br />
{<br />
wchar_t *query;<br />
int max_results; // can be 0 for unlimited<br />
itemRecordListW results;<br />
} mlQueryStructW;<br />
<br />
/* ----------------------------- */<br />
<br />
// pass these an (itemRecord *) to add/update.<br />
// note that any NULL fields in the itemRecord won't be updated, <br />
// and year, track, or length of -1 prevents updating as well.<br />
#define ML_IPC_DB_UPDATEITEM 0x0706 // returns -2 if item not found in db<br />
#define ML_IPC_DB_ADDORUPDATEITEM 0x0707<br />
<br />
#define ML_IPC_DB_REMOVEITEM 0x0708 // pass a char * to the filename to remove. returns -2 if file not found in db.<br />
<br />
typedef struct <br />
{<br />
char* fileName; // file name to add<br />
int meta_mode; // metadata get mode (0 - don't use metadata, 1 - use metadata; -1 - read from user settings (ini file)<br />
int gues_mode; // metadata guessing mode (0 - smart, 1 - simple; 2 - no, -1 - read from user settings (ini file)<br />
} LMDB_FILE_ADD_INFO;<br />
<br />
#define ML_IPC_DB_UPDATEFILE 0x0710 // Update File in the Local Media Data Base (return -2 if file record not found)<br />
#define ML_IPC_DB_ADDORUPDATEFILE 0x0711 // Adds or Updates File in the Local Media Data Base.<br />
<br />
/* Unicode versions of the above */<br />
<br />
// pass these an (itemRecordW *) to add/update.<br />
// note that any NULL fields in the itemRecordW won't be updated, <br />
// and year, track, or length of -1 prevents updating as well.<br />
#define ML_IPC_DB_UPDATEITEMW 0x1706 // returns -2 if item not found in db<br />
#define ML_IPC_DB_ADDORUPDATEITEMW 0x1707<br />
<br />
typedef struct <br />
{<br />
wchar_t* fileName; // file name to add<br />
int meta_mode; // metadata get mode (0 - don't use metadata, 1 - use metadata; -1 - read from user settings (ini file)<br />
int gues_mode; // metadata guessing mode (0 - smart, 1 - simple; 2 - no, -1 - read from user settings (ini file)<br />
} LMDB_FILE_ADD_INFOW;<br />
<br />
#define ML_IPC_DB_UPDATEFILEW 0x1710 // Update File in the Local Media Data Base (return -2 if file record not found) NOTE that this call is broken on 5.33. Only use on 5.34+<br />
#define ML_IPC_DB_ADDORUPDATEFILEW 0x1711 // Adds or Updates File in the Local Media Data Base.<br />
<br />
/* ----------------------------- */<br />
<br />
<br />
#define ML_IPC_DB_SYNCDB 0x0709 // sync db if dirty flags are set. good to do after a batch of updates.<br />
<br />
<br />
<br />
<br />
// these return 0 if unsupported, -1 if failed, 1 if succeeded<br />
<br />
// pass a winampMediaLibraryPlugin *. Will not call plugin's init() func. <br />
// YOU MUST set winampMediaLibraryPlugin->hDllInstance to NULL, and version to MLHDR_VER<br />
// 5.25+: You can set hDllInstance to valid value. <br />
// This IPC will return -1 on failure, so a good check against old verions<br />
// is to try with hDllInstance set, if it returns -1, try again with hDllInstance=0<br />
#define ML_IPC_ADD_PLUGIN 0x0750 <br />
#define ML_IPC_REMOVE_PLUGIN 0x0751 // winampMediaLibraryPlugin * of plugin to remove. Will not call plugin's quit() func<br />
<br />
#define ML_IPC_SEND_PLUGIN_MESSAGE 0x0752 // sends message to plugins (wParam = 0, lParam = pointer to the pluginMessage struct)<br />
// pluginMessage struct<br />
typedef struct {<br />
int messageType;<br />
INT_PTR param1;<br />
INT_PTR param2;<br />
INT_PTR param3;<br />
} pluginMessage;<br />
<br />
#define ML_IPC_ENSURE_VISIBLE 0x753 // ensures that the media library is visible<br />
#define ML_IPC_IS_VISIBLE 0x754 // queries the current visibility status<br />
<br />
#define ML_IPC_GET_PARENTAL_RATING 0x755 <br />
<br />
#define ML_IPC_TOGGLE_VISIBLE 0x756<br />
<br />
// this gets sent to any child windows of the library windows, and then (if not<br />
// handled) the library window itself<br />
<br />
#define WM_ML_CHILDIPC WM_APP+0x800 // avoids conflicts with any windows controls<br />
#define ML_CHILDIPC_DROPITEM 0x100 // lParam = 100, wParam = &mlDropItemStruct<br />
<br />
// current item ratings<br />
#define ML_IPC_SETRATING 0x0900 // lParam = 0 to 5, rates current track -- inserts it in the db if it's not in it yet <br />
#define ML_IPC_GETRATING 0x0901 // return the current track's rating or 0 if not in db/no rating<br />
<br />
// playlist entry rating<br />
typedef struct {<br />
int plentry;<br />
int rating;<br />
} pl_set_rating;<br />
<br />
#define ML_IPC_PL_SETRATING 0x0902 // lParam = pointer to pl_set_rating struct<br />
#define ML_IPC_PL_GETRATING 0x0903 // lParam = playlist entry, returns the rating or 0 if not in db/no rating<br />
<br />
typedef struct {<br />
HWND dialog_parent; // Use this window as a parent for the query editor dialog<br />
const char *query; // The query to edit, or "" / null for new query<br />
} ml_editquery; <br />
<br />
#define ML_IPC_EDITQUERY 0x904 // lParam = pointer to ml_editquery struct, returns 0 if edition was canceled and 1 on success<br />
// After returning, and if ok was clicked, the struct contains a pointer to the edited query. this pointer is static : <br />
// - do *not* free it<br />
// - if you need to keep it around, strdup it, as it may be changed later by other plugins calling ML_IPC_EDITQUERY.<br />
<br />
typedef struct { <br />
HWND dialog_parent; // Use this window as a parent for the view editor dialog<br />
const char *query; // The query to edit, or "" / null for new views<br />
const char *name; // Name of the view (ignored for new views)<br />
int mode; // View mode (0=simple view, 1=artist/album view, -1=hide mode radio boxes)<br />
} ml_editview; <br />
<br />
#define ML_IPC_EDITVIEW 0x905 // lParam = pointer to ml_editview struct, returns 0 if edition was canceled and 1 on success<br />
// After returning, and if ok was clicked, the struct contains the edited values. String pointers are static: <br />
// - do *not* free them <br />
// - if you need to keep them around, strdup them, as they may be changed later by other plugins calling ML_IPC_EDITQUERY.<br />
<br />
#define ML_IPC_SET_FILE_RATING 0x0906 // lParam = 0 to 5, rates current track -- inserts it in the db if it's not in it yet <br />
#define ML_IPC_GET_FILE_RATING 0x0907 // return the current track's rating or 0 if not in db/no rating<br />
<br />
// playlist entry rating<br />
typedef struct {<br />
const char* fileName;<br />
int newRating;<br />
} file_set_rating;<br />
<br />
#define ML_IPC_SMARTVIEW_COUNT 0x0908 // returns the number of smartviews. no parameter required<br />
#define ML_IPC_SMARTVIEW_INFO 0x0909 // pass a mlSmartViewInfo*. returns 1 on success and 0 on failure<br />
#define ML_IPC_SMARTVIEW_ADD 0x0910 // pass a mlSmartViewInfo* with filled in size, name, query, mode, iconImgIndex. treeitemid gets filled in. returns 1 on success and 0 on failure<br />
<br />
typedef struct<br />
{<br />
// you fill these in<br />
size_t size; // set to sizeof(mlSmartViewInfo)<br />
size_t smartViewNum;<br />
// ml_local fills these in<br />
wchar_t smartViewName[128];<br />
wchar_t smartViewQuery[512];<br />
int mode;<br />
int iconImgIndex;<br />
int treeItemId;<br />
} mlSmartViewInfo;<br />
<br />
<br />
#define ML_IPC_SET_FILE_RATINGW 0x0911 // lParam = 0 to 5, rates current track -- inserts it in the db if it's not in it yet <br />
#define ML_IPC_GET_FILE_RATINGW 0x0912 // return the current track's rating or 0 if not in db/no rating<br />
<br />
// playlist entry rating<br />
typedef struct {<br />
const wchar_t *fileName;<br />
int newRating;<br />
} file_set_ratingW;<br />
</source></div>Benski