
08.03.2010, 00:02
|
|
Постоянный
Регистрация: 25.03.2008
Сообщений: 670
С нами:
9541766
Репутация:
2407
|
|
возможно ли узнать какой трек и группа проигрывается в аимп в данный момент?
если да, то как?
Да, вот простой пример родного плагина для AIMP на ассемблере (masm32):
aimp_plugin.asm:
Код:
.486 ; create 32 bit code
.model flat, stdcall ; 32 bit memory model
option casemap :none ; case sensitive
include \masm32\include\windows.inc
include \masm32\include\masm32.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\macros\macros.asm
include \masm32\macros\windows.asm
includelib \masm32\lib\masm32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
AIMP_CallBack_Set=12+4 ;(dwCBType: DWORD; Proc: Pointer; User: DWORD): Boolean; stdcall;
AIMP_CallBack_Remove=12+8 ;(dwCBType: DWORD; Proc: Pointer): Boolean; stdcall;
AIMP_Status_Get=12+12 ;(StatusType: DWORD): DWORD; stdcall;
AIMP_PLS_Info=12+32 ;(Index: Integer; out PLSInfo: TPLSInfo)
AIMP_PLS_Count=12+36 ;word
AIMP_GetCurrentTrack=12+60 ; dd ? ;(AInfo: PAIMP2FileInfo): Boolean; stdcall;
AIMP_STS_STREAM_TYPE=39
AIMP_STS_Player=4
AIMP_PLAYER_STATE=11
TAIMP2FileInfo STRUCT
cbSizeOf dd ?
nActive dd ?
nBitRate dd ?
nChannels dd ?
nDuration dd ?
nFileSize dd ?
dd ?
nRating dd ?
nSampleRate dd ?
nTrackID dd ?
nAlbumLen dd ?
nArtistLen dd ?
nDateLen dd ?
nFileNameLen dd ?
nGenreLen dd ?
nTitleLen dd ?
sAlbum dd ?
sArtist dd ?
sDate dd ?
sFileName dd ?
sGenre dd ?
sTitle dd ?
TAIMP2FileInfo ENDS
TPLSInfo STRUCT
PLSName dd ?
FileCount dd ?
PLSDuration dd ?
PLSSize dq ?
PlaylistID dd ?
TPLSInfo ENDS
GetSongName PROTO :DWORD,:DWORD,:DWORD,:DWORD
init2 proto :dword
config proto :dword, :dword
PlayFile proto :dword, :dword
TAIMPAddonHeader STRUCT
Version dd ?
DllInstance dd ?
GetPlgName dd ?
GetAuthor dd ?
Init dd ?
Config dd ?
Free dd ?
TAIMPAddonHeader ENDS
.data
plugin2 TAIMPAddonHeader {0,0,offset get_plugin_name,offset get_author,offset init2,offset config,offset quit}
plugin_name db "Test",0
plugin_author db "(c) dx",0
.data?
hInstance dd ?
FileInfo TAIMP2FileInfo {}
AIMP dd ?
PlayList TPLSInfo <>
.code
LibMain proc instance:DWORD,reason:DWORD,reserved:DWORD
.if reason == DLL_PROCESS_ATTACH
invoke GetModuleHandle,NULL
mov hInstance,eax
mov eax,1
.endif
ret
LibMain ENDP
AIMP_QueryAddon PROC
mov eax,offset plugin2
ret
AIMP_QueryAddon ENDP
get_plugin_name PROC
mov eax,offset plugin_name
ret
get_plugin_name ENDP
get_author PROC
mov eax,offset plugin_author
ret
get_author ENDP
config PROC Handle :DWORD, Win: DWORD
xor eax,eax
ret
config ENDP
init2 PROC, xAIMP :DWORD
m2m AIMP,xAIMP
push 0
push offset PlayFile
push AIMP_PLAYER_STATE
mov eax,AIMP
push eax
mov eax,[eax]
call dword ptr [eax+AIMP_CallBack_Set]
xor eax,eax
ret
init2 ENDP
PlayFile PROC User :DWORD, cType :DWORD
LOCAL stitle [512] :BYTE
LOCAL sartist [512] :BYTE
.if cType!=AIMP_PLAYER_STATE
jmp ext
.endif
push AIMP_STS_Player
mov eax,AIMP
push eax
mov eax,[eax]
call dword ptr [eax+AIMP_Status_Get]
cmp eax,1
jne ext
push AIMP_STS_STREAM_TYPE
mov eax,AIMP
push eax
mov eax,[eax]
call dword ptr [eax+AIMP_Status_Get]
test eax,eax
jne ext
invoke RtlZeroMemory,addr sartist,512
invoke RtlZeroMemory,addr stitle,512
invoke RtlZeroMemory,offset FileInfo,88
mov FileInfo.cbSizeOf,88
lea eax,stitle
mov FileInfo.sTitle,eax
mov FileInfo.nTitleLen,126
lea eax,sartist
mov FileInfo.sArtist,eax
mov FileInfo.nArtistLen,512
push offset FileInfo
mov eax,AIMP
push eax
mov eax,[eax]
call dword ptr [eax+AIMP_GetCurrentTrack]
invoke MessageBoxW,0,addr stitle,addr sartist,0
ext:
xor eax,eax
ret
PlayFile ENDP
quit PROC
xor eax,eax
ret
quit ENDP
end LibMain
aimp_plugin.def:
Код:
LIBRARY aimp_plugin
EXPORTS AIMP_QueryAddon
А вообще, в aimp sdk есть простые примеры на дельфи.
|
|
|
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|