From: aptx Date: Fri, 21 Aug 2009 11:12:51 +0000 (+0200) Subject: - New (broken) hashing infrastructure X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=fd5841d13bd9a6b7d753d5547f96bd6136822913;p=aniplayer-old.git - New (broken) hashing infrastructure --- diff --git a/.gitignore b/.gitignore index 7eaebe1..a8caa85 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,8 @@ qtc-gdbmacros # Binaries # -------- +build/aniplayer build/*.dll build/*.lib build/*.exe +build/*.so* diff --git a/lib/anidbudpclient/anidbudpclient.pro b/lib/anidbudpclient/anidbudpclient.pro index 1aabbb3..b9deb3a 100644 --- a/lib/anidbudpclient/anidbudpclient.pro +++ b/lib/anidbudpclient/anidbudpclient.pro @@ -1,7 +1,8 @@ # ------------------------------------------------- # Project created by QtCreator 2009-03-22T14:53:52 # ------------------------------------------------- -QT += network script +QT += network \ + script QT -= gui TEMPLATE = lib TARGET = anidbudpclient @@ -15,16 +16,18 @@ static { } INCLUDEPATH += $$PWD DEPENDPATH += $$PWD - DEFINES += ANIDBUDPCLIENT_LIBRARY SOURCES += client.cpp \ abstractcommand.cpp \ authcommand.cpp \ rawcommand.cpp \ - mylistaddcommand.cpp \ + mylistaddcommand.cpp \ logoutcommand.cpp \ uptimecommand.cpp \ - mylistcommand.cpp + mylistcommand.cpp \ + hash.cpp \ + hashproducer.cpp \ + hashconsumer.cpp HEADERS += client.h \ anidbudpclient_global.h \ abstractcommand.h \ @@ -33,13 +36,16 @@ HEADERS += client.h \ mylistaddcommand.h \ logoutcommand.h \ uptimecommand.h \ - mylistcommand.h - + mylistcommand.h \ + hash.h \ + hashproducer.h \ + hashconsumer.h \ + circularbuffer.h CONV_HEADERS += include/AniDBUdpClient/Client \ - include/AniDBUdpClient/AbstractCommand \ - include/AniDBUdpClient/RawCommand \ - include/AniDBUdpClient/MyListCommand \ - include/AniDBUdpClient/MyListAddCommand \ - include/AniDBUdpClient/UptimeCommand - + include/AniDBUdpClient/AbstractCommand \ + include/AniDBUdpClient/RawCommand \ + include/AniDBUdpClient/MyListCommand \ + include/AniDBUdpClient/MyListAddCommand \ + include/AniDBUdpClient/UptimeCommand \ + include/AniDBUdpClient/Hash include(../../lib/qtstatemachine/src/qtstatemachine.pri) diff --git a/lib/anidbudpclient/anidbudpclient_global.h b/lib/anidbudpclient/anidbudpclient_global.h index 2f5a1a4..e405295 100644 --- a/lib/anidbudpclient/anidbudpclient_global.h +++ b/lib/anidbudpclient/anidbudpclient_global.h @@ -40,6 +40,7 @@ namespace AniDBUdpClient { CLIENT_DESTROYED = -1, UNKNOWN_REPLY = 0, + // POSITIVE 2XX LOGIN_ACCEPTED = 200, //a LOGIN_ACCEPTED_NEW_VER = 201, //a @@ -193,6 +194,10 @@ namespace AniDBUdpClient }; Q_ENUMS(Error IdlePolicy ReplyCode State FileState); + + namespace HashPrivate { + static const qint64 ED2K_PART_SIZE = 9728000; + } } #endif // ANIDBUDPCLIENT_GLOBAL_H diff --git a/src/videowindow.cpp b/src/videowindow.cpp index 788efb0..ebcde19 100644 --- a/src/videowindow.cpp +++ b/src/videowindow.cpp @@ -23,9 +23,10 @@ #include "seekslider.h" #ifndef NO_ANIDBUDPCLIENT -# include -# include -# include +# include +# include +# include +# include #endif #include @@ -245,6 +246,10 @@ void VideoWindow::open(const QString &file, bool closeOnStop) return; } +// AniDBUdpClient::Hash *h = new AniDBUdpClient::Hash(this); +// h->hashFile(fileInfo); + + playlist->setDirectory(fileInfo.absoluteDir()); playlist->setCurrent(playlist->indexOfFile(file));