Advertisement
Guest User

Untitled

a guest
Jan 19th, 2011
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 20.66 KB | None | 0 0
  1. // Translated by Vitaliy Diatlov
  2. // AIMP2: SDK (02.07.2009), v2.60
  3.  
  4. #ifndef AIMP2_SDK_H
  5. #define AIMP2_SDK_H
  6.  
  7. #include <windows.h>
  8. #include <unknwn.h>
  9.  
  10. const char  AIMP2_RemoteClass[] = "AIMP2_RemoteInfo";
  11. const int  AIMP2_RemoteFileSize = 2048;
  12.  
  13. const int  WM_AIMP_COMMAND = WM_USER + 0x75; // WParam = One of Command, LPARAM - Parameter
  14.  
  15. const int  WM_AIMP_STATUS_GET = 1;
  16. const int  WM_AIMP_STATUS_SET = 2;//HiWord of LParam - Command, LoWord of LParam - Parameter
  17. const int  WM_AIMP_CALLFUNC = 3;// LPARAM - Func ID (see below Func ID for Addons)
  18. const int  WM_AIMP_GET_VERSION = 4;
  19. const int  WM_AIMP_STATUS_CHANGE = 5;
  20.  
  21. const int  WM_LANG = WM_USER + 101;
  22.  
  23.   // CallBack types
  24. const int  AIMP_STATUS_CHANGE     = 1;
  25. const int  AIMP_PLAY_FILE         = 2;
  26. const int  AIMP_INFO_UPDATE       = 5;  // Update Info for current track
  27. const int  AIMP_PLAYER_STATE      = 11; // Play/Pause/Stop
  28. const int  AIMP_EFFECT_CHANGED    = 12; // Balance, Speed, Tempo, Pitch, Flanger and etc.
  29. const int  AIMP_EQ_CHANGED        = 13; // Sliders changed
  30. const int  AIMP_TRACK_POS_CHANGED = 14;
  31.  
  32.   // AIMP_Status_Set / AIMP_Status_Get
  33. const int  AIMP_STS_VOLUME      = 1;
  34. const int  AIMP_STS_BALANCE     = 2;
  35. const int  AIMP_STS_SPEED       = 3;
  36. const int  AIMP_STS_Player      = 4;
  37. const int  AIMP_STS_MUTE        = 5;
  38. const int  AIMP_STS_REVERB      = 6;
  39. const int  AIMP_STS_ECHO        = 7;
  40. const int  AIMP_STS_CHORUS      = 8;
  41. const int  AIMP_STS_Flanger     = 9;
  42.  
  43. const int  AIMP_STS_EQ_STS      = 10;
  44. const int  AIMP_STS_EQ_SLDR01   = 11;
  45. const int  AIMP_STS_EQ_SLDR02   = 12;
  46. const int  AIMP_STS_EQ_SLDR03   = 13;
  47. const int  AIMP_STS_EQ_SLDR04   = 14;
  48. const int  AIMP_STS_EQ_SLDR05   = 15;
  49. const int  AIMP_STS_EQ_SLDR06   = 16;
  50. const int  AIMP_STS_EQ_SLDR07   = 17;
  51. const int  AIMP_STS_EQ_SLDR08   = 18;
  52. const int  AIMP_STS_EQ_SLDR09   = 19;
  53. const int  AIMP_STS_EQ_SLDR10   = 20;
  54. const int  AIMP_STS_EQ_SLDR11   = 21;
  55. const int  AIMP_STS_EQ_SLDR12   = 22;
  56. const int  AIMP_STS_EQ_SLDR13   = 23;
  57. const int  AIMP_STS_EQ_SLDR14   = 24;
  58. const int  AIMP_STS_EQ_SLDR15   = 25;
  59. const int  AIMP_STS_EQ_SLDR16   = 26;
  60. const int  AIMP_STS_EQ_SLDR17   = 27;
  61. const int  AIMP_STS_EQ_SLDR18   = 28;
  62.  
  63. const int  AIMP_STS_REPEAT      = 29;
  64. const int  AIMP_STS_ON_STOP     = 30;
  65. const int  AIMP_STS_POS         = 31;
  66. const int  AIMP_STS_LENGTH      = 32;
  67. const int  AIMP_STS_REPEATPLS   = 33;
  68. const int  AIMP_STS_REP_PLS_1   = 34;
  69. const int  AIMP_STS_KBPS        = 35;
  70. const int  AIMP_STS_KHZ         = 36;
  71. const int  AIMP_STS_MODE        = 37;
  72. const int  AIMP_STS_RADIO       = 38;
  73. const int  AIMP_STS_STREAM_TYPE = 39; // Music / CDA / Radio
  74. const int  AIMP_STS_TIMER       = 40; // Reverse / Normal
  75. const int  AIMP_STS_SHUFFLE     = 41;
  76.  
  77. const int  AIMP_STS_MAIN_HWND   = 42;
  78. const int  AIMP_STS_TC_HWND     = 43;
  79. const int  AIMP_STS_APP_HWND    = 44;
  80. const int  AIMP_STS_PL_HWND     = 45;
  81. const int  AIMP_STS_EQ_HWND     = 46;
  82.  
  83. const int  AIMP_STS_TRAY        = 47;
  84.  
  85.   // Support Exts Flags
  86. const int  AIMP_PLS_EXTS    = 1;
  87. const int  AIMP_AUDIO_EXTS  = 2;
  88.  
  89.   // Menu IDs
  90. const int  AIMP_MAIN_MENU_OPN   = 0;
  91. const int  AIMP_MAIN_MENU_UTILS = 1;
  92. const int  AIMP_MAIN_MENU_FNC   = 2;
  93. const int  AIMP_MAIN_MENU_CFG   = 3;
  94. const int  AIMP_UTILS_MENU      = 4;
  95. const int  AIMP_PLS_MENU_ADD    = 5;
  96. const int  AIMP_PLS_MENU_JUMP   = 6;
  97. const int  AIMP_PLS_MENU_FNC    = 7;
  98. const int  AIMP_PLS_MENU_SEND   = 8;
  99. const int  AIMP_PLS_MENU_DEL    = 9;
  100. const int  AIMP_ADD_MENU        = 10;
  101. const int  AIMP_DEL_MENU        = 11;
  102. const int  AIMP_FND_MENU        = 12;
  103. const int  AIMP_SRT_MENU        = 13;
  104. const int  AIMP_MSC_MENU        = 14;
  105. const int  AIMP_PLS_MENU        = 15;
  106. const int  AIMP_TRAY_UTILS      = 16;
  107. const int  AIMP_TRAY            = 17;
  108. const int  AIMP_EQ_LIB          = 18;
  109. // use AIMP_UTILS_MENU overthis:
  110. // + AIMP_MAIN_MENU_UTILS = 1;
  111. // + AIMP_TRAY_UTILS      = 16;
  112.  
  113.   // AIMP_CallFunction
  114. const int  AIMP_OPEN_FILES      = 0;
  115. const int  AIMP_OPEN_DIR        = 1;
  116. const int  AIMP_ABOUT           = 2;
  117. const int  AIMP_SLEEP_TIMER     = 3;
  118. const int  AIMP_UTILS_AC        = 4;
  119. const int  AIMP_UTILS_SR        = 5;
  120. const int  AIMP_UTILS_TE        = 6;
  121. const int  AIMP_UTILS_CDB       = 7;
  122. const int  AIMP_OPTIONS         = 8;
  123. const int  AIMP_PLUGINS         = 9;
  124. const int  AIMP_QUIT            = 10;
  125. const int  AIMP_NEXT_VIS        = 11;
  126. const int  AIMP_PREV_VIS        = 12;
  127. const int AIMP_EQ_ANALOG       = 13;
  128. const int  AIMP_TO_TRAY         = 14;
  129. const int  AIMP_PLAY            = 15;
  130. const int  AIMP_PAUSE           = 16;
  131. const int  AIMP_STOP            = 17;
  132. const int  AIMP_NEXT            = 18;
  133. const int  AIMP_PREV            = 19;
  134. const int  AIMP_ADD_FILES       = 20;
  135. const int  AIMP_ADD_DIR         = 21;
  136. const int  AIMP_ADD_PLS         = 22;
  137. const int  AIMP_ADD_URL         = 23;
  138. const int  AIMP_DEL_FILES       = 24;
  139. const int  AIMP_DEL_BAD         = 25;
  140. const int  AIMP_DEL_FROMHDD     = 26;
  141. const int  AIMP_DEL_OFF         = 27;
  142. const int  AIMP_DEL_OFF_HDD     = 28;
  143. const int  AIMP_RESCAN_PLS      = 29;
  144. const int  AIMP_SHOW_CURFILE    = 30;
  145. const int  AIMP_SORT_INVERT     = 31;
  146. const int  AIMP_SORT_RANDOM     = 32;
  147. const int  AIMP_SORT_TITLE      = 33;
  148. const int  AIMP_SORT_ARTIST     = 34;
  149. const int  AIMP_SORT_FOLDER     = 35;
  150. const int  AIMP_SORT_LENGTH     = 36;
  151. const int  AIMP_SORT_RATING     = 37;
  152. const int  AIMP_SEARCH          = 38;
  153. const int  AIMP_OPEN_PLS        = 39;
  154. const int  AIMP_SAVE_PLS        = 40;
  155. const int  AIMP_PLAY_LAST       = 41;
  156. const int  AIMP_OFF_SELECTED    = 42;
  157. const int  AIMP_ON_SELECTED     = 43;
  158. const int  AIMP_ADD2BOOKMARK    = 44;
  159. const int  AIMP_EDITBOOKMARK    = 45;
  160.  
  161.  
  162.   // For AIMP_GetPath
  163. const int  AIMP_CFG_DATA     = 0;
  164. const int  AIMP_CFG_PLS      = 1;
  165. const int  AIMP_CFG_LNG      = 2;
  166. const int  AIMP_CFG_SKINS    = 3;
  167. const int  AIMP_CFG_PLUGINS  = 4;
  168. const int  AIMP_CFG_ICONS    = 5;
  169. const int  AIMP_CFG_ML       = 6;
  170.  
  171.  
  172.   // For AIMP_QueryObject
  173. const int  IAIMP2PlayerID           = 0x0001;
  174. const int  IAIMP2PlaylistManagerID  = 0x0003;
  175. const int  IAIMP2ExtendedID         = 0x0004;
  176. const int  IAIMP2CoverArtManagerID  = 0x0005;
  177. const int  IAIMP2PlaylistManager2ID = 0x0006;
  178. const int  IAIMPConfigFileID        = 0x0010;
  179. const int  IAIMPLanguageFileID      = 0x0011;
  180.  
  181.  
  182.  
  183.   // For AIMP_ObjectClass
  184. const int  AIMP_EXT_LC_MESSAGE = 100;
  185. const int  AIMP_EXT_ML_MESSAGE = 101;
  186.  
  187.  
  188.   // Option Frame Position Flags
  189. const int  AIMP_FRAME_POS_PLAY     = 1;
  190. const int  AIMP_FRAME_POS_PLAYLIST = 2;
  191. const int  AIMP_FRAME_POS_PLAYER   = 3;
  192. const int  AIMP_FRAME_POS_TEMPLATE = 4;
  193. const int  AIMP_FRAME_POS_SYSTEM   = 5;
  194. const int  AIMP_FRAME_POS_SKINS    = 6;
  195. const int  AIMP_FRAME_POS_LANGS    = 7;
  196.  
  197.   // AIMP_PLS_SORT_TYPE_XXX
  198. const int  AIMP_PLS_SORT_TYPE_TITLE      = 1;
  199. const int  AIMP_PLS_SORT_TYPE_FILENAME   = 2;
  200. const int  AIMP_PLS_SORT_TYPE_DURATION   = 3;
  201. const int  AIMP_PLS_SORT_TYPE_ARTIST     = 4;
  202. const int  AIMP_PLS_SORT_TYPE_INVERSE    = 5;
  203. const int  AIMP_PLS_SORT_TYPE_RANDOMIZE  = 6;
  204.  
  205. #pragma pack(push, 1)
  206. struct AIMP2FileInfo
  207. {
  208.     DWORD cbSizeOf;
  209.     //
  210.     BOOL nActive;
  211.     DWORD nBitRate;
  212.     DWORD nChannels;
  213.     DWORD nDuration;
  214.     INT64 nFileSize;
  215.     DWORD nRating;
  216.     DWORD nSampleRate;
  217.     DWORD nTrackID;
  218.     //
  219.     DWORD nAlbumLen;
  220.     DWORD nArtistLen;
  221.     DWORD nDateLen;
  222.     DWORD nFileNameLen;
  223.     DWORD nGenreLen;
  224.     DWORD nTitleLen;
  225.     //
  226.     PWCHAR sAlbum;
  227.     PWCHAR sArtist;
  228.     PWCHAR sDate;
  229.     PWCHAR sFileName;
  230.     PWCHAR sGenre;
  231.     PWCHAR sTitle;
  232. };
  233. #pragma pack(pop)
  234. typedef boolean (WINAPI *AIMPPlaylistDeleteProc)(AIMP2FileInfo AFileInfo, DWORD AUserData);
  235. typedef int (WINAPI *AIMPPlaylistSortProc)(AIMP2FileInfo AFileInfo1, AIMP2FileInfo AFileInfo2, DWORD AUserData);
  236.  
  237. typedef void (WINAPI *AIMPMenuProc)(DWORD User, void *Handle);
  238.  
  239. typedef void (WINAPI *AIMPStatusChange)(DWORD User, DWORD CallBackType);
  240.  
  241. typedef void (WINAPI *CallBackFunc)(DWORD User, DWORD dwCBType);
  242.  
  243. #pragma pack(push, 1)
  244. struct PLSInfo
  245. {
  246.     PCHAR PLSName;
  247.     DWORD FileCount;
  248.     DWORD PLSDuration;
  249.     INT64 PLSSize;
  250.     int PlaylistID;
  251. };
  252. #pragma pack(pop)
  253.  
  254. #pragma pack(push, 1)
  255. struct AIMPMenuInfo
  256. {
  257.     boolean Checkbox;
  258.     boolean RadioItem;
  259.     boolean Checked;
  260.     boolean Enabled;
  261.     int ProcPtr; // TAIMPMenuProc;
  262.     HBITMAP Bitmap; // 0 - no bmp
  263.     PWCHAR Caption;
  264.     DWORD User;
  265. };
  266. #pragma pack(pop)
  267.  
  268. class IPLSStrings
  269.     : public IUnknown
  270. {
  271. public:
  272.     virtual boolean WINAPI AddFile(
  273.         PWCHAR FileName,
  274.         AIMP2FileInfo *FileInfo
  275.         );
  276.     virtual boolean WINAPI DelFile(
  277.         int ID
  278.         );
  279.     virtual PWCHAR WINAPI GetFileName(
  280.         int ID
  281.         );
  282.     virtual boolean WINAPI GetFileInfo(
  283.         int ID,
  284.         AIMP2FileInfo *FileInfo
  285.         );
  286.     virtual DWORD WINAPI GetFileObj(
  287.         int ID
  288.         );
  289.     virtual int WINAPI GetCount();
  290. };
  291.  
  292. class IAIMP2Controller
  293.     :public IUnknown
  294. {
  295. public:
  296.     virtual boolean WINAPI IsUnicodeVersion();
  297.     virtual boolean WINAPI AIMP_CallBack_Set(
  298.         DWORD dwCBType,
  299.         CallBackFunc CallBackFuncPtr,
  300.         DWORD User
  301.         );
  302.     virtual boolean WINAPI AIMP_CallBack_Remove(
  303.         DWORD dwCBType,
  304.         int ProcPtr
  305.         );
  306.     // Status
  307.     virtual DWORD WINAPI AIMP_Status_Get(
  308.         DWORD StatusType
  309.         );
  310.     virtual boolean WINAPI AIMP_Status_Set(
  311.         DWORD StatusType,
  312.         DWORD Value
  313.         );
  314.     // Playlist
  315.     virtual boolean WINAPI AIMP_PLS_Clear(
  316.         int ID
  317.         );
  318.     virtual boolean WINAPI AIMP_PLS_Delete(
  319.         int ID
  320.         );
  321.     virtual boolean WINAPI AIMP_PLS_New(
  322.         PWCHAR Name
  323.         ); 
  324.     virtual boolean WINAPI AIMP_PLS_Info(
  325.         int Index,
  326.         PLSInfo *info
  327.         );
  328.     virtual short WINAPI AIMP_PLS_Count();
  329.     virtual boolean WINAPI AIMP_PLS_GetFiles(
  330.         int ID,
  331.         IPLSStrings **Strings
  332.         );
  333.     virtual boolean WINAPI AIMP_PLS_GetSelFiles(
  334.         int ID,
  335.         IPLSStrings **Strings
  336.         );
  337.     virtual boolean WINAPI AIMP_PLS_AddFiles(
  338.         int ID,
  339.         IPLSStrings *Strings
  340.         );
  341.     virtual boolean WINAPI AIMP_PLS_SetPLS(
  342.         int ID
  343.         ); 
  344.     // System
  345.     virtual boolean WINAPI AIMP_NewStrings(
  346.         IPLSStrings **Strings
  347.         );
  348.     virtual boolean WINAPI AIMP_GetCurrentTrack(
  349.         AIMP2FileInfo *AInfo
  350.         );
  351.     virtual boolean WINAPI AIMP_QueryInfo(
  352.         PWCHAR Filename,
  353.         AIMP2FileInfo *AInfo
  354.         );
  355.     virtual DWORD WINAPI AIMP_GetSystemVersion();
  356.     virtual boolean WINAPI AIMP_CallFunction(
  357.         DWORD FuncID
  358.         );
  359.     virtual int WINAPI AIMP_GetLanguage(
  360.         PWCHAR Str,
  361.         int ACount
  362.         );
  363.     virtual int WINAPI AIMP_GetCfgPath(
  364.         PWCHAR Str,
  365.         int ACount
  366.         );
  367.     virtual int WINAPI AIMP_GetSupportExts(
  368.         DWORD Flags,
  369.         PWCHAR Str,
  370.         int BufSize
  371.         );
  372.     // Menu
  373.     virtual DWORD WINAPI AIMP_GetSupportExts(
  374.         DWORD Parent,
  375.         AIMPMenuInfo *MenuInfo
  376.         );
  377.     virtual DWORD WINAPI AIMP_Menu_Create(
  378.         DWORD MenuID,
  379.         AIMPMenuInfo *MenuInfo
  380.         );
  381.     virtual boolean WINAPI AIMP_Menu_Update(
  382.         int Handle,
  383.         AIMPMenuInfo *MenuInfo
  384.         );
  385.     virtual boolean WINAPI AIMP_Menu_Remove(
  386.         int Handle
  387.         );
  388.    // extention  
  389.     virtual boolean WINAPI AIMP_QueryObject(
  390.         DWORD ObjectID,
  391.         void *Obj
  392.         );
  393. };
  394.  
  395. class IAIMPAddonHeader
  396.     :public IUnknown
  397. {
  398. public:
  399.     virtual BOOL WINAPI GetHasSettingsDialog() = 0;
  400.     virtual PWCHAR WINAPI GetPluginAuthor() = 0;
  401.     virtual PWCHAR WINAPI GetPluginName() = 0;
  402.     virtual void WINAPI Finalize() = 0;
  403.     virtual void WINAPI Initialize(IAIMP2Controller *AController) = 0;
  404.     virtual void WINAPI ShowSettingsDialog(HWND AParentWindow) = 0;
  405. };
  406.  
  407. typedef IAIMPAddonHeader *(WINAPI *AddonProc)();
  408.  
  409. typedef BOOL (WINAPI *AIMPAddonHeaderProc)(IAIMPAddonHeader *AHeader);
  410. // Export function name: AIMP_QueryAddonEx
  411.  
  412. //==============================================================================
  413. // Old Style Addon struct - don't use for new plugins
  414. //==============================================================================
  415.  
  416. typedef PCHAR (WINAPI *GetPlgNameFunc)();
  417. typedef PCHAR (WINAPI *GetAutorFunc)();
  418. typedef void (WINAPI *InitFunc)(IAIMP2Controller *AIMP);
  419. typedef void (WINAPI *ConfigFunc)(DWORD Handle, DWORD Win);
  420. typedef void (WINAPI *FreeFunc)();
  421.  
  422. #pragma pack(push, 1)
  423. struct AIMPAddonHeader
  424. {
  425.     DWORD version;
  426.     DWORD DllInstance;
  427.     GetPlgNameFunc PlgNameFuncPtr;
  428.     GetAutorFunc AutorFuncPtr;
  429.     InitFunc InitFuncPtr;
  430.     ConfigFunc ConfigFuncPtr;
  431.     FreeFunc FreeFuncPtr;
  432. };
  433. #pragma pack(pop)
  434.  
  435. //==============================================================================
  436.  
  437. class IAIMP2OptionFrame
  438.     :public IUnknown
  439. {
  440. public:
  441.     virtual HWND WINAPI FrameCreate(
  442.         HWND AParent
  443.         );
  444.     virtual void *WINAPI FrameData(    
  445.         );  // reserved    
  446.     virtual int WINAPI FrameFlags(     
  447.         );  // See FramePositionFlags
  448.     virtual PWCHAR WINAPI FrameName(       
  449.         );    
  450.     virtual HWND WINAPI FrameFree(
  451.         HWND AWindow
  452.         );    
  453.     virtual void WINAPI FrameLoadConfigNotify(     
  454.         );
  455.     virtual void WINAPI FrameSaveConfigNotify(     
  456.         );
  457. };
  458.  
  459. class IAIMP2Player
  460.     : public IUnknown
  461. {
  462. public:
  463.     virtual int WINAPI Version();
  464.     virtual boolean WINAPI PlayTrack(
  465.         int ID,
  466.         int ATrackIndex
  467.         );
  468.     virtual void WINAPI PlayOrResume();
  469.     virtual void WINAPI Pause();
  470.     virtual void WINAPI Stop();
  471.     virtual void WINAPI NextTrack();
  472.     virtual void WINAPI PrevTrack();
  473. };
  474.  
  475. class IAIMP2PlaylistManager
  476.     : public IUnknown
  477. {
  478. public:
  479.     virtual int WINAPI AIMP_PLS_CreateFromFile(
  480.         PWCHAR AFile,
  481.         boolean AActivate,
  482.         boolean AStartPlay
  483.         );
  484.     virtual int WINAPI AIMP_PLS_ID_ActiveGet();
  485.     virtual boolean WINAPI AIMP_PLS_ID_ActiveSet(
  486.         int ID
  487.         );
  488.     virtual int WINAPI AIMP_PLS_ID_PlayingGet();   
  489.     virtual int WINAPI AIMP_PLS_ID_PlayingGetTrackIndex(
  490.         int ID
  491.         );
  492.     virtual int WINAPI AIMP_PLS_NewEx(
  493.         PWCHAR AName,
  494.         boolean AActivate
  495.         );
  496.     virtual boolean WINAPI AIMP_PLS_PlayFile(
  497.         PWCHAR AFileName,
  498.         boolean AFailIfNotExists
  499.         );
  500.     // Playlist Processing
  501.     virtual boolean WINAPI AIMP_PLS_DeleteByFilter(
  502.         int ID,
  503.         DWORD AFilterProc,
  504.         DWORD AUserData
  505.         );
  506.     virtual boolean WINAPI AIMP_PLS_SortByFilter(
  507.         int ID,
  508.         DWORD AFilterProc,
  509.         DWORD AUserData
  510.         );
  511.     // Entries
  512.     virtual boolean WINAPI AIMP_PLS_Entry_Delete(
  513.         int ID,
  514.         int AEntryIndex
  515.         );
  516.     virtual boolean WINAPI AIMP_PLS_Entry_DeleteAll(
  517.         int ID
  518.         );
  519.     virtual boolean WINAPI AIMP_PLS_Entry_FileNameGet(
  520.         int ID,
  521.         int AEntryIndex,
  522.         PWCHAR PBuf,
  523.         DWORD ABufLen
  524.         );
  525.     virtual boolean WINAPI AIMP_PLS_Entry_FileNameSet(
  526.         int ID,
  527.         int AEntryIndex,
  528.         PWCHAR PBuf
  529.         );
  530.     virtual int WINAPI AIMP_PLS_Entry_FocusedGet(
  531.         int ID
  532.         );
  533.     virtual boolean WINAPI AIMP_PLS_Entry_FocusedSet(
  534.         int ID,
  535.         int AEntryIndex
  536.         );
  537.     virtual boolean WINAPI AIMP_PLS_Entry_InfoGet(
  538.         int ID,
  539.         int AEntryIndex,
  540.         AIMP2FileInfo *PFileInfo
  541.         );
  542.     virtual boolean WINAPI AIMP_PLS_Entry_InfoSet(
  543.         int ID,
  544.         int AEntryIndex,
  545.         AIMP2FileInfo *PFileInfo
  546.         );
  547.     virtual boolean WINAPI AIMP_PLS_Entry_PlayingSwitchGet(
  548.         int ID,
  549.         int AEntryIndex
  550.         );
  551.     virtual boolean WINAPI AIMP_PLS_Entry_PlayingSwitchSet(
  552.         int ID,
  553.         int AEntryIndex,
  554.         boolean ASwitch
  555.         );
  556.     virtual boolean WINAPI AIMP_PLS_Entry_ReloadInfo(
  557.         int ID,
  558.         int AEntryIndex
  559.         );
  560.     // Load/Save Playlists
  561.     virtual boolean WINAPI AIMP_PM_DestroyStream(
  562.         DWORD AHandle
  563.         );
  564.     virtual DWORD WINAPI AIMP_PM_ReadItem(
  565.         DWORD AHandle,
  566.         AIMP2FileInfo *PItem
  567.         );
  568.     virtual DWORD WINAPI AIMP_PM_ReadStream(
  569.         PWCHAR AFileName,
  570.         int *Count
  571.         );
  572.     virtual DWORD WINAPI AIMP_PM_SaveStream(
  573.         PWCHAR AFileName
  574.         );
  575.     virtual DWORD WINAPI AIMP_PM_WriteItem(
  576.         DWORD AHandle,
  577.         AIMP2FileInfo *PItem
  578.         );
  579.     // added in 2.50 B295
  580.     virtual boolean WINAPI AIMP_PLS_ID_PlayingSetTrackIndex(
  581.         int ID,
  582.         int AEntryIndex
  583.         );
  584. };
  585.  
  586. class IAIMP2PlaylistManager2
  587.     : public IAIMP2PlaylistManager
  588. {
  589. public:
  590.     // Count of loaded playlists
  591.     virtual unsigned short WINAPI AIMP_PLS_Count();
  592.     // Return = -1 - ID is not valid, otherthis - count of files in playlist
  593.     virtual int WINAPI AIMP_PLS_GetFilesCount(int ID);
  594.     virtual HRESULT WINAPI AIMP_PLS_GetInfo(int ID, INT64 *ADuration, INT64 *ASize);
  595.     virtual HRESULT WINAPI AIMP_PLS_GetName(int ID, PWCHAR ABuffer, int ABufferSizeInChars);
  596.     // Custom Sorting, see AIMP_PLS_SORT_TYPE_XXX
  597.     virtual HRESULT WINAPI AIMP_PLS_Sort(int ID, int ASortType);
  598.     virtual HRESULT WINAPI AIMP_PLS_SortByTemplate(int ID, PWCHAR ABuffer, int ABufferSizeInChars);
  599.     // if Index = -1 returned ID of current playlist.
  600.     virtual HRESULT WINAPI AIMP_PLS_ID_By_Index(int Index, int *ID);
  601.     // Get Formated title for Entry
  602.     virtual HRESULT WINAPI AIMP_PLS_Entry_GetTitle(int ID, int AEntryIndex,
  603.       PWCHAR ABuffer, int ABufferSizeInChars);
  604.     // Set Entry to playback queue
  605.     virtual HRESULT WINAPI AIMP_PLS_Entry_QueueRemove(int ID, int AEntryIndex);
  606.     virtual HRESULT WINAPI AIMP_PLS_Entry_QueueSet(int ID, int AEntryIndex, BOOL AInsertAtQueueBegining);
  607.     // Moving Entry
  608.     virtual HRESULT WINAPI AIMP_PLS_Entry_SetPosition(int ID, int AEntryIndex, int ANewEntryIndex);
  609. };
  610.  
  611. // See IAIMP2ExtendedID
  612. class IAIMP2Extended
  613.     :public IUnknown
  614. {
  615. public:
  616.     virtual int WINAPI AIMP_GetPath(
  617.         int ID,
  618.         PWCHAR buffer,
  619.         int bufSize
  620.         );
  621.     virtual boolean WINAPI AIMP_ObjectClass(
  622.         int ID,
  623.         void *AData,
  624.         boolean ARegister
  625.         );
  626.     // User Option Dialogs
  627.     virtual DWORD WINAPI AIMP_Options_FrameAdd(
  628.         IAIMP2OptionFrame *AFrame
  629.         );
  630.     virtual DWORD WINAPI AIMP_Options_FrameRemove(
  631.         IAIMP2OptionFrame *AFrame
  632.         );
  633.     virtual DWORD WINAPI AIMP_Options_ModifiedChanged(
  634.         IAIMP2OptionFrame *AFrame
  635.         );
  636. };
  637.  
  638. class IAIMP2CoverArtManager
  639.     :public IUnknown
  640. {
  641. public:
  642.     // Return picture will be proportional stretched to ADisplaySize value
  643.     virtual HBITMAP WINAPI GetCoverArtForFile(PWCHAR AFile, const SIZE *ADisplaySize);
  644.     // Draw CoverArt of playing file, Return - cover art drawing successfuly
  645.     // CoverArt will be proportional stretched to R value
  646.     virtual HRESULT WINAPI CurrentCoverArtDraw(HDC DC, const RECT *R);
  647.     // Return <> S_OK, CoverArt is empty or file are not playing
  648.     virtual HRESULT WINAPI CurrentCoverArtGetSize(SIZE *ASize);
  649.     // W, H - destination display sizes, function will correct sizes for proportional drawing
  650.     // Return <> S_OK, CoverArt is empty or file are not playing
  651.     virtual HRESULT WINAPI CurrentCoverArtCorrectSizes(int *W, int *H);
  652. };
  653.  
  654.   // See IAIMPLanguageFileID
  655. class IAIMPLanguageFile
  656.     :public IUnknown
  657. {
  658. public:
  659.     virtual int AIMP_Lang_Version();
  660.     virtual int AIMP_Lang_CurrentFile(PWCHAR ABuffer, int ABufferSizeInChars);
  661.     virtual HRESULT AIMP_Lang_IsSectionExists(PWCHAR ASectionName, int ASectionNameSizeInChars);
  662.     virtual HRESULT AIMP_Lang_ReadString(PWCHAR ASectionName, PWCHAR AItemName, PWCHAR AValueBuffer,
  663.       int ASectionNameSizeInChars, int AItemNameSizeInChars, int AValueBufferSizeInChars);
  664.     // When Language changed AIMP will send to window handle "WM_LANG" message
  665.     virtual HRESULT AIMP_Lang_Notification(HWND AWndHandle, BOOL ARegister);
  666. };
  667.  
  668. // See IAIMPConfigFileID
  669. class IAIMPConfigFile
  670.     :public IUnknown
  671. {
  672.     // functions return null value, if value don't exists in configuration file
  673.     virtual HRESULT AIMP_Config_ReadString(PWCHAR ASectionName, PWCHAR AItemName, PWCHAR AValueBuffer,
  674.         int ASectionNameSizeInChars, int AItemNameSizeInChars, int AValueBufferSizeInChars);
  675.     virtual HRESULT AIMP_Config_ReadInteger(PWCHAR ASectionName, PWCHAR AItemName,
  676.         int ASectionNameSizeInChars, int AItemNameSizeInChars, int * AValue);
  677.     //
  678.     virtual HRESULT AIMP_Config_WriteString(PWCHAR ASectionName, PWCHAR AItemName, PWCHAR AValueBuffer,
  679.       int ASectionNameSizeInChars, int AItemNameSizeInChars, int AValueBufferSizeInChars);
  680.     virtual HRESULT AIMP_Config_WriteInteger(PWCHAR ASectionName, PWCHAR AItemName,
  681.       int ASectionNameSizeInChars, int AItemNameSizeInChars, int AValue);
  682.     //
  683.     virtual HRESULT AIMP_Config_IsSectionExists(PWCHAR ASectionName, int ASectionNameSizeInChars);
  684.     virtual HRESULT AIMP_Config_RemoveSection(PWCHAR ASectionName, int ASectionNameSizeInChars);
  685. };
  686.  
  687. //==============================================================================
  688. // V I S U A L S
  689. //==============================================================================
  690.  
  691. const int  VIS_RQD_DATA_WAVE       = 1;
  692. const int  VIS_RQD_DATA_SPECTRUM   = 2;
  693. const int  VIS_RQD_NOT_SUSPEND     = 4;
  694.  
  695. typedef short WaveForm[2][512];
  696. typedef short Spectrum[2][256];
  697.  
  698. struct AIMPVisualData
  699. {
  700.     int LevelR;
  701.     int LevelL;
  702.     Spectrum spectrum;
  703.     WaveForm waveForm;
  704. };
  705.  
  706. typedef AIMPVisualData *PAIMPVisualData;
  707.  
  708. class IAIMP2VisualPlugin
  709.     :public IUnknown
  710. {
  711. public:
  712.     virtual PWCHAR WINAPI AuthorName();
  713.     virtual PWCHAR WINAPI PluginName();
  714.     virtual PWCHAR WINAPI PluginInfo();
  715.     virtual DWORD WINAPI PluginFlags();
  716.     virtual BOOL WINAPI Initialize();
  717.     virtual void WINAPI Deinitialize();
  718.     virtual void WINAPI DisplayClick(int X, int Y);
  719.     virtual void WINAPI DisplayRender(HDC DC, PAIMPVisualData AData);
  720.     virtual void WINAPI DisplayResize(int AWidth, int AHeight);
  721. };
  722.  
  723. // Export function name: AIMP_QueryVisual
  724. typedef IAIMP2VisualPlugin *(WINAPI *AIMPVisualProc)();
  725.  
  726. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement