/* */ #include "TorrentConsoleDownloadEngine.h" #include "Util.h" TorrentConsoleDownloadEngine::TorrentConsoleDownloadEngine() {} TorrentConsoleDownloadEngine::~TorrentConsoleDownloadEngine() {} void TorrentConsoleDownloadEngine::onSelectiveDownloadingCompletes() { printf("\nDownload of selected files has completed.\n"); fflush(stdout); } void TorrentConsoleDownloadEngine::sendStatistics() { printf("\r "); printf("\r"); if(torrentMan->downloadComplete()) { printf("Download Completed "); } else { printf("%s/%sB %d%% %s D:%.2f", Util::llitos(downloadLength, true).c_str(), Util::llitos(totalLength, true).c_str(), (totalLength == 0 ? 0 : (int)((downloadLength*100)/totalLength)), avgSpeed == 0 ? "-" : Util::secfmt(eta).c_str(), downloadSpeed/1024.0); } printf(" U:%.2f(%s) %d peers", uploadSpeed/1024.0, Util::llitos(torrentMan->getUploadLength(), true).c_str(), torrentMan->connections); fflush(stdout); }