Пример использования библиотеки MediaInfo
В данном исходнике показывается как можно с помощью библиотеки получить информацию о медиафайле. Используется собранная разработчиками DLL, взять саму библиотеку можно здесь .
Код
Dim pDll As Any Ptr
Dim As ZString Ptr sFile = StrPtr("D:\1.mp4")
Dim As ZString Ptr pTemp
Dim As Any Ptr handle
Dim MediaInfoA_New As Function() as any Ptr
Dim MediaInfoA_Open As Function(byval Handle as any ptr, byval File as const zstring ptr) as UInteger
Dim MediaInfoA_Close As Sub(byval Handle as any ptr)
Dim MediaInfoA_Delete As Sub(byval Handle as any ptr)
Dim MediaInfoA_Inform As Function(byval Handle as any ptr, byval Reserved as uinteger) as ZString Ptr
pDll=DylibLoad("MediaInfo.dll")
If pDll=0 Then End
MediaInfoA_New = DylibSymbol(pDll,"MediaInfoA_New"): If MediaInfoA_New = 0 Then End
MediaInfoA_Open = DylibSymbol(pDll,"MediaInfoA_Open"): If MediaInfoA_Open = 0 Then End
MediaInfoA_Close = DylibSymbol(pDll,"MediaInfoA_Close"): If MediaInfoA_Close = 0 Then End
MediaInfoA_Delete = DylibSymbol(pDll,"MediaInfoA_Delete"): If MediaInfoA_Delete = 0 Then End
MediaInfoA_Inform = DylibSymbol(pDll,"MediaInfoA_Inform"): If MediaInfoA_Inform = 0 Then End
'---------------------------
handle = MediaInfoA_New()
If handle = 0 Then Print "Error": Sleep : End
MediaInfoA_Open(handle, sFile)
pTemp = MediaInfoA_Inform(Handle, 0)
? *pTemp
Sleep
MediaInfoA_Close(Handle)
MediaInfoA_Delete(Handle)
DylibFree pDll