📄 ftkernelapi.pas
字号:
function FTK_Downloader_IsOnlyCheckFile(hDownloader: HDownloader): boolean; stdcall; external FTKernelAPI_Library;
//是否已经完成了下载(判断选择文件下载)
//Is all selected files finished?
function FTK_Downloader_IsFinished(hDownloader: HDownloader): boolean; stdcall; external FTKernelAPI_Library;
//是否已经完成了下载(全部下载)
//Is all files finished?
function FTK_Downloader_IsAllFinished(hDownloader: HDownloader): boolean; stdcall; external FTKernelAPI_Library;
//连接指定的Peer
//Add external source peer
procedure FTK_Downloader_AddSource(hDownloader: HDownloader; const pchIP: PChar; nPort: Word; const pPeerID: PByte = nil; nTunnel: Byte = 0); stdcall; external FTKernelAPI_Library;
//连接指定的User
//Add external source peer(socket handle)
procedure FTK_Downloader_AddSourceExt(hDownloader: HDownloader; nSocket: UINT); stdcall; external FTKernelAPI_Library;
//外部动态增加辅助的Announce
//Add external announce
procedure FTK_Downloader_AddExtAnnounce(hDownloader: HDownloader; lpszAnnounce: LPCTSTR); stdcall; external FTKernelAPI_Library;
//手动控制Announce马上进行连接
//Reannounce manually
procedure FTK_Downloader_ReannounceAll(hDownloader: HDownloader); stdcall; external FTKernelAPI_Library;
//按照块的先后顺序进行下载(适用于边下载边播放的情况)
//Tell kernel to sequential download piece
procedure FTK_Downloader_SetSeqPicker(hDownloader: HDownloader; bSeq: Boolean = False; nSEQFileIndex: Integer = 0); stdcall; external FTKernelAPI_Library;
//设置下载文件的优先级别
// -2:不下载, -1: 低, 0: 一般, 1:高
//Set priority of file
//-2: no download, -1: low, 0: middle, 1: high
procedure FTK_Downloader_SetFilePriority(hDownloader: HDownloader; nIndex: Integer; chPriority: Byte = 0; bDoPriority: boolean = TRUE); stdcall; external FTKernelAPI_Library;
//强制立刻重新将文件的优先级赋值给Piece
//Force to set priority of all piece immediately
procedure FTK_Downloader_ForceFilePriority(hDownloader: HDownloader); stdcall; external FTKernelAPI_Library;
//外部调用, 手动设置最大的下载率限制(0.0表示没有限制)
//Set fixed max download rate
procedure FTK_Downloader_SetFixMaxDownloadRate(hDownloader: HDownloader; fMaxDownloadRate: Double = 0.0); stdcall; external FTKernelAPI_Library;
//外部调用, 获取手动设置最大的下载率限制(0.0表示没有限制)
//Get fixed max download rate
function FTK_Downloader_GetFixMaxDownloadRate(hDownloader: HDownloader): Double; stdcall; external FTKernelAPI_Library;
//外部调用, 手动设置最大的上传率限制(0.0表示没有限制)
//Set fixed max upload rate
procedure FTK_Downloader_SetFixMaxUploadRate(hDownloader: HDownloader; fMaxUploadRate: Double = 0.0); stdcall; external FTKernelAPI_Library;
//外部调用, 获取手动设置最大的上传率限制(0.0表示没有限制)
//Get fixed max upload rate
function FTK_Downloader_GetFixMaxUploadRate(hDownloader: HDownloader): Double; stdcall; external FTKernelAPI_Library;
//主动限制某些特定的种子服务器(SEED), 给自己的最大的上传率(0表示没有限制, 注意单位是: KB)
//Set fixed max upload rate of SOME CERTAIN SEED to me, 0 means no limit, UNIT is KB
procedure FTK_Downloader_SetSeedMaxUPSpeed(hDownloader: HDownloader; nSpeed: UINT = 0); stdcall; external FTKernelAPI_Library;
//多少秒中内,禁止某个IP的连接, 只在当前任务存在期间有效
//Ban IP for X seconds, ONLY for the current active HDownloader
procedure FTK_Downloader_BanPeerIP(hDownloader: HDownloader; lpszIP: LPCTSTR; nBannedSeconds: UINT); stdcall; external FTKernelAPI_Library;
//外部设置内网连接通知回调函数的指针
//Set the callback function pointer for Nat PEER notification
procedure FTK_Downloader_SetNatPeerCB(hDownloader: HDownloader; fnNatPeerCB: FTK_NAT_PEER_CALLBACK); stdcall; external FTKernelAPI_Library;
//获取线程的ID
//Get thread ID
function FTK_Downloader_GetThreadID(hDownloader: HDownloader): DWord; stdcall; external FTKernelAPI_Library;
//////////////////////////////////////////////////////////////////////////
//全局参数设置
//Global settings
//将某个Torrent文件的SHA1值加入队列
//Add torrent into SHA1 list
procedure FTK_GlobalVar_AddTorrentSHA1(lpszSHA: LPCTSTR; hDownloader: HDownloader); stdcall; external FTKernelAPI_Library;
//将某个Torrent文件的SHA1值从队列中删除
//Remove torrent from SHA1 list
procedure FTK_GlobalVar_RemoveTorrentSHA1(lpszSHA: LPCTSTR); stdcall; external FTKernelAPI_Library;
//////////////////////////////////////////////////////////////////////////
//代理服务器函数列表
//Proxy interface
//设置仅在连接Tracker时使用代理服务器
//Only tracker using proxy settings
procedure FTK_Proxy_SetOnlyTracker(bOnlyTracker: boolean = FALSE); stdcall; external FTKernelAPI_Library;
//清空当前的代理信息(仅用于PROXYTYPE_NOPROXY)
//Only PROXYTYPE_NOPROXY
procedure FTK_Proxy_SetType(nProxyType: Integer); stdcall; external FTKernelAPI_Library;
//设置代理(不能是PROXYTYPE_NOPROXY)
//May not be PROXYTYPE_NOPROXY
procedure FTK_Proxy_SetProxy(nProxyType: Integer; const pProxyHost: PChar; ProxyPort: Integer); stdcall; external FTKernelAPI_Library;
//设置SOCKS5和HTTP1.1需要认证信息的代理
//Only SOCKS5 and HTTP1.1 proxies
procedure FTK_Proxy_SetAuthProxy(nProxyType: Integer; const pProxyHost: PChar; ProxyPort: Integer; const pProxyUser: PChar; const pProxyPass: PChar); stdcall; external FTKernelAPI_Library;
//获取代理的类型
//Return proxy type
function FTK_Proxy_GetProxyType(): Integer; stdcall; external FTKernelAPI_Library;
//////////////////////////////////////////////////////////////////////////
//Downloader statistic information interface
//获取总共已经下载(验证成功)的数据
//Get the size of having received data for all file
function FTK_Stat_GetTotalFileHaveSize(hDownloader: HDownloader): QWORD; stdcall; external FTKernelAPI_Library;
//获取选择已经下载(验证成功)的数据
//Get the size of having received data for a file
function FTK_Stat_GetSelectedFileHaveSize(hDownloader: HDownloader): QWORD; stdcall; external FTKernelAPI_Library;
//获取已经顺序下载的目前可以从头开始播放的数据长度
//Get the size of sequential piece from file front
function FTK_Stat_GetStartSeqFileSize(hDownloader: HDownloader): QWORD; stdcall; external FTKernelAPI_Library;
//获取最近一次下载的字节数
//Get the size of lasted receiving data
function FTK_Stat_GetLastDataSize(hDownloader: HDownloader): DWord; stdcall; external FTKernelAPI_Library;
//获取总共丢弃的字节数
//Get the size of bad data
function FTK_Stat_GetBadDataSize(hDownloader: HDownloader): QWORD; stdcall; external FTKernelAPI_Library;
//当前总共的连接的个数
//Get the number of total peer
function FTK_Stat_GetTotalPeerCount(hDownloader: HDownloader): Integer; stdcall; external FTKernelAPI_Library;
//当前主动连接的个数
//Get the number of active peer
function FTK_Stat_GetActivePeerCount(hDownloader: HDownloader): Integer; stdcall; external FTKernelAPI_Library;
//当前的被动连接的个数
//Get the number of passive peer
function FTK_Stat_GetPassivePeerCount(hDownloader: HDownloader): Integer; stdcall; external FTKernelAPI_Library;
//当前正在连接中的个数
//Get number of connecting peer
function FTK_Stat_GetConnectingPeerCount(hDownloader: HDownloader): Integer; stdcall; external FTKernelAPI_Library;
//获取已经连接的种子的个数
//Get number of seed
function FTK_Stat_GetSeedCount(hDownloader: HDownloader): Integer; stdcall; external FTKernelAPI_Library;
//获取正在上传的连接的个数
//Get the number of uploading peer
function FTK_Stat_GetUploadPeerCount(hDownloader: HDownloader): Integer; stdcall; external FTKernelAPI_Library;
//获取正在下载的连接的个数
//Get the number of downloading peer
function FTK_Stat_GetDownloadPeerCount(hDownloader: HDownloader): Integer; stdcall; external FTKernelAPI_Library;
//获取总共可以获取的Seed的个数
//Get the number of total available seed
function FTK_Stat_GetTotalAvailSeedCount(hDownloader: HDownloader): Integer; stdcall; external FTKernelAPI_Library;
//获取总共可以获取的Peer的个数
//Get the number of peer
function FTK_Stat_GetTotalAvailPeerCount(hDownloader: HDownloader): Integer; stdcall; external FTKernelAPI_Library;
//旧的种子的个数
//Get old seed number
function FTK_Stat_GetOldSeedPeerCount(hDownloader: HDownloader): Integer; stdcall; external FTKernelAPI_Library;
//获取是否至少已经有一个Tracker连接成功
//Is any tracker successfull?
function FTK_Stat_IsAnyTrackerOK(hDownloader: HDownloader): Boolean; stdcall; external FTKernelAPI_Library;
//本次运行已经下载的数据长度
//Get downloaded bytes
function FTK_Stat_GetDownloaded(hDownloader: HDownloader): QWORD; stdcall; external FTKernelAPI_Library;
//本次运行已经上传的数据长度
//Get uploaded bytes
function FTK_Stat_GetUploaded(hDownloader: HDownloader): QWORD; stdcall; external FTKernelAPI_Library;
//本次已经运行时间(运行时间不同与下载时间)
//Get total running time
function FTK_Stat_GetRunningTime(hDownloader: HDownloader): Double; stdcall; external FTKernelAPI_Library;
//本次下载的时间(如果是做种, 则下载时间永远为0)
//Get total downloaded time
function FTK_Stat_GetDownloadTime(hDownloader: HDownloader): Double; stdcall; external FTKernelAPI_Library;
//本次下载剩余的时间, 根据下载率计算
//Get the left time to download
function FTK_Stat_GetLeftTime(hDownloader: HDownloader): Double; stdcall; external FTKernelAPI_Library;
//获取当前的上传率
//Get upload rate
function FTK_Stat_GetUploadRate(hDownloader: HDownloader): Double; stdcall; external FTKernelAPI_Library;
//获取当前的下载率
//Get downloading rate
function FTK_Stat_GetDownloadRate(hDownloader: HDownloader): Double; stdcall; external FTKernelAPI_Library;
//获取指定的Piece的下载进度
//Get the progress of a piece
procedure FTK_Stat_GetPieceState(hDownloader: HDownloader; pPiece: PByte; nCount: Integer); stdcall; external FTKernelAPI_Library;
//获取检查文件的进度
//Get the progress of cheching piece
function FTK_Stat_GetCheckPieceSize(hDownloader: HDownloader): QWORD; stdcall; external FTKernelAPI_Library;
//获取检查的Piece的个数
//Get number of checked piece
function FTK_Stat_GetCheckPieceCount(hDownloader: HDownloader): DWord; stdcall; external FTKernelAPI_Library;
//获取已经分配空间的大小
//Get the size of allocated file
function FTK_Stat_GetAllocSpaceSize(hDownloader: HDownloader): QWORD; stdcall; external FTKernelAPI_Library;
//获取当前的健康率
//Get healthy rate
function FTK_Stat_GetHealthRate(hDownloader: HDownloader): Double; stdcall; external FTKernelAPI_Library;
//获取当前的最大缓存大小
//Get the size of max cache
function FTK_Stat_GetMaxCacheSize(hDownloader: HDownloader): DWord; stdcall; external FTKernelAPI_Library;
//获取已经使用的缓存大小
//Get the size of used cache
function FTK_Stat_GetUseCacheSize(hDownloader: HDownloader): DWord; stdcall; external FTKernelAPI_Library;
//获取本次写硬盘的总的次数
//Get writed disk count
function FTK_Stat_GetWriteDiskCount(hDownloader: HDownloader): QWORD; stdcall; external FTKernelAPI_Library;
//获取本次真正写硬盘的次数
//Get really writed disk count
function FTK_Stat_GetRealWriteDiskCount(hDownloader: HDownloader): QWORD; stdcall; external FTKernelAPI_Library;
//获取本次读硬盘的总的次数
//Get readed disk count
function FTK_Stat_GetReadDiskCount(hDownloader: HDownloader): QWORD; stdcall; external FTKernelAPI_Library;
//获取本次真正读硬盘的次数
//Get really readed disk count
function FTK_Stat_GetRealReadDiskCount(hDownloader: HDownloader): QWORD; stdcall; external FTKernelAPI_Library;
//获取写硬盘的频率(次/秒)
//Get writing disk frenqence(number/second)
function FTK_Stat_GetWriteDiskFrenq(hDownloader: HDownloader): Double; stdcall; external FTKernelAPI_Library;
//获取真正写硬盘的频率(次/秒)
//Get really writing disk frenqence(number/second)
function FTK_Stat_GetRealWriteDiskFrenq(hDownloader: HDownloader): Double; stdcall; external FTKernelAPI_Library;
//获取读硬盘的频率(次/秒)
//Get reading disk frenqence(number/second)
function FTK_Stat_GetReadDiskFrenq(hDownloader: HDownloader): Double; stdcall; external FTKernelAPI_Library;
//获取真正读硬盘的频率(次/秒)
//Get really reading disk frenqence(number/second)
function FTK_Stat_GetRealReadDiskFrenq(hDownloader: HDownloader): Double; stdcall; external FTKernelAPI_Library;
//获取当前日志文件的路径+名称
//Get log file name
procedure FTK_Stat_GetLogPathFileName(hDownloader: HDownloader; lpszFileName: PChar); stdcall; external FTKernelAPI_Library;
//获取指定的文件的进度
//Get the progress of a file
function FTK_Stat_GetFileHaveSize(hDownloader: HDownloader; nIndex: Integer): QWORD; stdcall; external FTKernelAPI_Library;
//获取当前用户状态信息的列表
//Get the peers information
procedure FTK_Stat_GetPeerData(hDownloader: HDownloader; pData: ArrayPeerData; nRetCount: PInteger; nMaxCount: Integer); stdcall; external FTKernelAPI_Library;
//获取当前部分用户状态信息的列表
//Get the some peers information
procedure FTK_Stat_GetPeerRangeData(hDownloader: HDownloader; pData: ArrayPeerData; nFrom: Integer; nTo: Integer; var nRetCount: Integer; nMaxCount: Integer; bExtInfo: Boolean = False); stdcall; external FTKernelAPI_Library;
//获取当前用户状态信息的列表(只获取IP和端口)
//Get the peers information(only IP and port)
procedure FTK_Stat_GetMiniPeerData(hDownloader: HDownloader; pData: ArrayMiniPeerData; nRetCount: PInteger; nMaxCount: Integer); stdcall; external FTKernelAPI_Library;
//获取当前Announce状态信息的列表
//Get the status of announces
procedure FTK_Stat_GetAnnounceData(hDownloader: HDownloader; pData: ArrayAnnounceData; nRetCount: PInteger; nMaxCount: Integer); stdcall; external FTKernelAPI_Library;
//获取当前任务的调试信息
//Get the debug information of downloader
function FTK_Stat_GetBTDownloaderInfo(hDownloader: HDownloader): LPCTSTR; stdcall; external FTKernelAPI_Library;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -