Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

LibraryBuilder.h

Go to the documentation of this file.
00001 //
00002 // LibraryBuilder.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 
00022 #if !defined(AFX_LIBRARYBUILDER_H__B2779061_437E_4C10_AC9F_1E2AC7885C40__INCLUDED_)
00023 #define AFX_LIBRARYBUILDER_H__B2779061_437E_4C10_AC9F_1E2AC7885C40__INCLUDED_
00024 
00025 #pragma once
00026 
00027 class CLibraryFile;
00028 class CXMLElement;
00029 class CLibraryBuilderInternals;
00030 class CLibraryBuilderPlugins;
00031 
00032 
00033 class CLibraryBuilder
00034 {
00035 // Construction
00036 public:
00037         CLibraryBuilder();
00038         virtual ~CLibraryBuilder();
00039 
00040 // Attributes
00041 protected:
00042         CCriticalSection        m_pSection;
00043         CPtrList                        m_pFiles;
00044         CStringList                     m_pPriority;
00045         HANDLE                          m_hThread;
00046         BOOL                            m_bThread;
00047         BOOL                            m_bPriority;
00048         DWORD                           m_nHashSleep;
00049         DWORD                           m_nIndex;
00050         CString                         m_sPath;
00051         DWORD                           m_tActive;
00052         BYTE*                           m_pBuffer;
00053 protected:
00054         CLibraryBuilderInternals*       m_pInternals;
00055         CLibraryBuilderPlugins*         m_pPlugins;
00056 
00057 // Operations
00058 public:
00059         void            Add(CLibraryFile* pFile);
00060         void            Remove(CLibraryFile* pFile);
00061         int                     GetRemaining();
00062         CString         GetCurrentFile();
00063         void            RequestPriority(LPCTSTR pszPath);
00064         void            Clear();
00065         BOOL            StartThread();
00066         void            StopThread();
00067         void            BoostPriority(BOOL bPriority);
00068         BOOL            GetBoostPriority();
00069         //BOOL          SanityCheck();
00070         void            UpdateStatus(CString* pStr, int* pRemaining );
00071 protected:
00072         static UINT     ThreadStart(LPVOID pParam);
00073         void            OnRun();
00074         BOOL            HashFile(HANDLE hFile, BOOL bPriority, SHA1* pSHA1);
00075         BOOL            SubmitMetadata(LPCTSTR pszSchemaURI, CXMLElement*& pXML);
00076         BOOL            SubmitCorrupted();
00077         BOOL            DetectVirtualFile(HANDLE hFile, QWORD& nOffset, QWORD& nLength);
00078         BOOL            DetectVirtualID3v1(HANDLE hFile, QWORD& nOffset, QWORD& nLength);
00079         BOOL            DetectVirtualID3v2(HANDLE hFile, QWORD& nOffset, QWORD& nLength);
00080 
00081         friend class CLibraryBuilderInternals;
00082         friend class CLibraryBuilderPlugins;
00083 
00084 };
00085 
00086 extern CLibraryBuilder LibraryBuilder;
00087 
00088 #endif // !defined(AFX_LIBRARYBUILDER_H__B2779061_437E_4C10_AC9F_1E2AC7885C40__INCLUDED_)

Generated on Thu Dec 15 10:39:43 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2