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

CLibrary Class Reference

#include <Library.h>

Inheritance diagram for CLibrary:

CComObject List of all members.

Public Member Functions

 CLibrary ()
virtual ~CLibrary ()
 BOOL (WINAPI *m_pfnGFAEW)(LPCWSTR
 BOOL (WINAPI *m_pfnGFAEA)(LPCSTR
void Update ()
void Inhibit (BOOL bInhibit)
CLibraryFileLookupFile (DWORD nIndex, BOOL bSharedOnly=FALSE, BOOL bAvailableOnly=FALSE)
CAlbumFolderGetAlbumRoot ()
CPtrList * Search (CQuerySearch *pSearch, int nMaximum=0, BOOL bLocal=FALSE)
void Clear ()
BOOL Load ()
void Save ()
void StartThread ()
void StopThread ()

Public Attributes

CMutex m_pSection
DWORD m_nUpdateCookie
DWORD m_nScanCount
HINSTANCE m_hKernel
 GET_FILEEX_INFO_LEVELS
 LPVOID

Protected Member Functions

void AddFile (CLibraryFile *pFile)
void RemoveFile (CLibraryFile *pFile)
void OnFileDelete (CLibraryFile *pFile)
void Serialize (CArchive &ar)

Protected Attributes

DWORD m_nScanCookie
DWORD m_nUpdateSaved
int m_nFileSwitch
DWORD m_nInhibit
HANDLE m_hThread
BOOL m_bThread
CEvent m_pWakeup
STDMETHOD( get_Application )(IApplication FAR *FAR *ppApplication)
STDMETHOD( get_Library )(ILibrary FAR *FAR *ppLibrary)
STDMETHOD( get_Folders )(ILibraryFolders FAR *FAR *ppFolders)
STDMETHOD( get_Albums )(IUnknown FAR *FAR *ppAlbums)
STDMETHOD( get_Files )(ILibraryFiles FAR *FAR *ppFiles)
STDMETHOD( FindByName )(BSTR sName, ILibraryFile FAR *FAR *ppFile)
STDMETHOD( FindByPath )(BSTR sPath, ILibraryFile FAR *FAR *ppFile)
STDMETHOD( FindByURN )(BSTR sURN, ILibraryFile FAR *FAR *ppFile)
STDMETHOD( FindByIndex )(LONG nIndex, ILibraryFile FAR *FAR *ppFile)

Private Member Functions

void OnRun ()
BOOL ThreadScan ()

Static Private Member Functions

static UINT ThreadStart (LPVOID pParam)

Friends

class CLibraryFolder
class CLibraryFile
class CLibraryBuilder

Constructor & Destructor Documentation

CLibrary::CLibrary  ) 
 

Definition at line 59 of file Library.cpp.

References CComObject::EnableDispatch(), and NULL.

CLibrary::~CLibrary  )  [virtual]
 

Definition at line 84 of file Library.cpp.

References m_hKernel, and NULL.


Member Function Documentation

void CLibrary::AddFile CLibraryFile pFile  )  [protected]
 

Definition at line 113 of file Library.cpp.

References CLibraryBuilder::Add(), CLibraryDictionary::Add(), GetAlbumRoot(), CLibraryFile::IsAvailable(), LibraryBuilder, LibraryDictionary, LibraryHistory, LibraryMaps, CLibraryFile::m_bSHA1, CLibraryMaps::OnFileAdd(), and CLibraryHistory::Submit().

Referenced by CLibraryFile::GetED2K(), CLibraryFile::GetTigerTree(), CLibraryFile::Ghost(), CLibraryBuilder::HashFile(), CLibraryFile::Rebuild(), CLibraryFile::Serialize(), CLibraryFile::SetMetadata(), CLibraryBuilder::SubmitMetadata(), and CLibraryFile::ThreadScan().

CLibrary::BOOL WINAPI *  m_pfnGFAEA  ) 
 

CLibrary::BOOL WINAPI *  m_pfnGFAEW  ) 
 

Referenced by Load(), and ThreadScan().

void CLibrary::Clear  ) 
 

Definition at line 179 of file Library.cpp.

References CLibraryMaps::Clear(), CLibraryFolders::Clear(), CLibraryDictionary::Clear(), CLibraryHistory::Clear(), LibraryDictionary, LibraryFolders, LibraryHistory, LibraryMaps, m_nUpdateCookie, m_pSection, and StopThread().

Referenced by CShareazaApp::ExitInstance(), Load(), and Serialize().

CAlbumFolder * CLibrary::GetAlbumRoot  ) 
 

Definition at line 108 of file Library.cpp.

References CLibraryFolders::GetAlbumRoot(), and LibraryFolders.

Referenced by AddFile(), CLibraryFrame::Display(), CLibraryHeaderPanel::GetSelectedAlbum(), Load(), CLibraryTreeView::OnLibraryFolderNew(), CLibraryFrame::RunLocalSearch(), CLibraryTileView::Update(), CLibraryTreeView::UpdateVirtual(), and CLocalSearch::WriteVirtualTree().

void CLibrary::Inhibit BOOL  bInhibit  ) 
 

Definition at line 92 of file Library.cpp.

References m_nInhibit.

BOOL CLibrary::Load  ) 
 

Definition at line 196 of file Library.cpp.

References CLibraryFolders::AddFolder(), BOOL(), CLibraryBuilder::BoostPriority(), Clear(), CSettings::sDownloads::CollectionPath, CSettings::sDownloads::CompletePath, CHashDatabase::Create(), CLibraryFolders::CreateAlbumTree(), CSettings::Downloads, CSettings::General, GetAlbumRoot(), CSettings::sLibrary::HighPriorityHash, CSettings::Library, LibraryBuilder, LibraryFolders, LibraryHashDB, m_pSection, NULL, Serialize(), Settings, StartThread(), and CSettings::sGeneral::UserPath.

Referenced by CShareazaApp::InitInstance().

CLibraryFile * CLibrary::LookupFile DWORD  nIndex,
BOOL  bSharedOnly = FALSE,
BOOL  bAvailableOnly = FALSE
 

Definition at line 103 of file Library.cpp.

References LibraryMaps, and CLibraryMaps::LookupFile().

Referenced by CBitziDownloader::BuildRequest(), CLibraryDetailView::CacheItem(), CBaseMatchWnd::CheckExisting(), CLibraryTreeView::DropObjects(), CFilePropertiesPage::GetFile(), CLibraryList::GetNextFile(), CLibraryFileView::GetNextSelectedFile(), CLibraryFileView::GetSelectedFile(), CLibraryBuilder::HashFile(), CShareazaApp::InternalURI(), CLibraryDetailView::ListCompare(), CLibraryAlbumTrack::LockRating(), CLibraryHistoryPanel::OnClickFile(), CURLExportDlg::OnCopy(), CLibraryDetailView::OnEndLabelEditA(), CLibraryDetailView::OnEndLabelEditW(), CLibraryDetailView::OnFindItemA(), CLibraryDetailView::OnFindItemW(), CUploadTransferHTTP::OnHeadersComplete(), CHomeLibraryBox::OnLButtonUp(), CLibraryFileView::OnLibraryDelete(), CLibraryFileView::OnLibraryLaunch(), CMediaListCtrl::OnMouseMove(), CFilePropertiesDlg::OnOK(), CDecodeMetadataDlg::OnOK(), CLibraryTipCtrl::OnPrepare(), CLibraryBuilder::OnRun(), CFileCopyDlg::OnRun(), CLibraryThumbView::OnRun(), CURLExportDlg::OnSave(), CLibraryFileView::OnUpdateLibraryRebuildAnsi(), CUploadTransferHTTP::RequestPreview(), CLibraryRecent::Serialize(), CAlbumFolder::Serialize(), CFileExecutor::ShowBitziTicket(), CThumbCache::Store(), CLibraryBuilder::SubmitCorrupted(), CLibraryBuilder::SubmitMetadata(), CBitziDownloader::SubmitMetaData(), CFilePropertiesDlg::Update(), CLibraryThumbView::Update(), CLibraryMetaPanel::Update(), CLibraryDetailView::Update(), and CLibraryAlbumView::Update().

void CLibrary::OnFileDelete CLibraryFile pFile  )  [protected]
 

Definition at line 148 of file Library.cpp.

References CHashDatabase::DeleteAll(), LibraryFolders, LibraryHashDB, LibraryHistory, NULL, CLibraryHistory::OnFileDelete(), and CLibraryFolders::OnFileDelete().

Referenced by CLibraryFile::Ghost(), and CLibraryFile::OnDelete().

void CLibrary::OnRun  )  [private]
 

Definition at line 397 of file Library.cpp.

References m_bThread, m_nInhibit, m_pWakeup, and ThreadScan().

Referenced by ThreadStart().

void CLibrary::RemoveFile CLibraryFile pFile  )  [protected]
 

Definition at line 137 of file Library.cpp.

References LibraryBuilder, LibraryDictionary, LibraryMaps, CLibraryMaps::OnFileRemove(), CLibraryDictionary::Remove(), and CLibraryBuilder::Remove().

Referenced by CLibraryFile::GetED2K(), CLibraryFile::GetTigerTree(), CLibraryFile::Ghost(), CLibraryBuilder::HashFile(), CLibraryFile::Rebuild(), CLibraryFile::SetMetadata(), CLibraryBuilder::SubmitMetadata(), CLibraryFile::ThreadScan(), and CLibraryFile::~CLibraryFile().

void CLibrary::Save  ) 
 

Definition at line 287 of file Library.cpp.

References CSettings::General, m_nFileSwitch, m_pSection, Serialize(), Settings, and CSettings::sGeneral::UserPath.

Referenced by CShareazaApp::ExitInstance(), CLibraryTreeView::OnLibraryRemove(), and ThreadScan().

CPtrList * CLibrary::Search CQuerySearch pSearch,
int  nMaximum = 0,
BOOL  bLocal = FALSE
 

Definition at line 160 of file Library.cpp.

References LibraryDictionary, LibraryMaps, m_pSection, NULL, CLibraryDictionary::Search(), and CLibraryMaps::Search().

Referenced by CLocalSearch::ExecuteSharedFiles(), and CLibraryFrame::RunLocalSearch().

void CLibrary::Serialize CArchive &  ar  )  [protected]
 

Definition at line 322 of file Library.cpp.

References Clear(), LIBRARY_SER_VERSION, LibraryFolders, LibraryHistory, LibraryMaps, CLibraryHistory::Serialize(), CLibraryFolders::Serialize(), CLibraryMaps::Serialize1(), and CLibraryMaps::Serialize2().

Referenced by Load(), and Save().

void CLibrary::StartThread  ) 
 

Definition at line 346 of file Library.cpp.

References LibraryBuilder, m_bThread, m_hThread, NULL, CLibraryBuilder::StartThread(), and ThreadStart().

Referenced by CLibraryFolders::AddFolder(), Load(), and ThreadScan().

void CLibrary::StopThread  ) 
 

Definition at line 358 of file Library.cpp.

References LibraryBuilder, m_bThread, m_hThread, m_pWakeup, CShareazaApp::Message(), MSG_DEBUG, NULL, CLibraryBuilder::StopThread(), and theApp.

Referenced by Clear(), CShareazaApp::ExitInstance(), and CMainWnd::OnClose().

BOOL CLibrary::ThreadScan  )  [private]
 

Definition at line 409 of file Library.cpp.

References BOOL(), CLibraryDictionary::BuildHashTable(), LibraryDictionary, LibraryFolders, m_bThread, m_nScanCount, m_nUpdateCookie, m_nUpdateSaved, m_pSection, Save(), StartThread(), and CLibraryFolders::ThreadScan().

Referenced by OnRun().

UINT CLibrary::ThreadStart LPVOID  pParam  )  [static, private]
 

Definition at line 390 of file Library.cpp.

References OnRun().

Referenced by StartThread().

void CLibrary::Update  )  [inline]
 

Definition at line 63 of file Library.h.

References m_nUpdateCookie, and m_pSection.

Referenced by CLibraryFolders::AddFolder(), CLibraryCollectionView::CheckAvailable(), CDeleteFileDlg::Create(), CFolderPropertiesDlg::DoApply(), CLibraryBuilder::HashFile(), CLibraryAlbumTrack::LockRating(), CLibraryDetailView::OnEndLabelEditA(), CLibraryDetailView::OnEndLabelEditW(), CLibraryFrame::OnLButtonUp(), CLibraryFileView::OnLibraryDelete(), CLibraryTreeView::OnLibraryFolderMetadata(), CLibraryFileView::OnLibraryLaunch(), CLibraryTreeView::OnLibraryRebuild(), CLibraryTreeView::OnLibraryShared(), CLibraryFileView::OnLibraryShared(), CDownloadsSettingsPage::OnOK(), CFileMetadataPage::OnOK(), CFileCommentsPage::OnOK(), CFilePropertiesDlg::OnOK(), CDownloadGroupDlg::OnOK(), CLibrarySettingsPage::OnRecentClear(), CFileSourcesPage::OnSourceNew(), CFileSourcesPage::OnSourceRemove(), CLibraryFolders::RemoveFolder(), CUploadTransferHTTP::RequestPreview(), and CLibraryBuilder::SubmitMetadata().


Friends And Related Function Documentation

friend class CLibraryBuilder [friend]
 

Definition at line 96 of file Library.h.

friend class CLibraryFile [friend]
 

Definition at line 95 of file Library.h.

friend class CLibraryFolder [friend]
 

Definition at line 94 of file Library.h.


Member Data Documentation

STDMETHOD( CLibrary::FindByIndex)(LONG nIndex, ILibraryFile FAR *FAR *ppFile) [protected]
 

STDMETHOD( CLibrary::FindByName)(BSTR sName, ILibraryFile FAR *FAR *ppFile) [protected]
 

STDMETHOD( CLibrary::FindByPath)(BSTR sPath, ILibraryFile FAR *FAR *ppFile) [protected]
 

STDMETHOD( CLibrary::FindByURN)(BSTR sURN, ILibraryFile FAR *FAR *ppFile) [protected]
 

STDMETHOD( CLibrary::get_Albums)(IUnknown FAR *FAR *ppAlbums) [protected]
 

STDMETHOD( CLibrary::get_Application)(IApplication FAR *FAR *ppApplication) [protected]
 

CLibrary::GET_FILEEX_INFO_LEVELS
 

Definition at line 59 of file Library.h.

STDMETHOD( CLibrary::get_Files)(ILibraryFiles FAR *FAR *ppFiles) [protected]
 

STDMETHOD( CLibrary::get_Folders)(ILibraryFolders FAR *FAR *ppFolders) [protected]
 

STDMETHOD( CLibrary::get_Library)(ILibrary FAR *FAR *ppLibrary) [protected]
 

CLibrary::LPVOID
 

Definition at line 59 of file Library.h.

BOOL CLibrary::m_bThread [protected]
 

Definition at line 54 of file Library.h.

Referenced by OnRun(), StartThread(), StopThread(), CLibraryFolder::ThreadScan(), and ThreadScan().

HINSTANCE CLibrary::m_hKernel
 

Definition at line 57 of file Library.h.

Referenced by ~CLibrary().

HANDLE CLibrary::m_hThread [protected]
 

Definition at line 53 of file Library.h.

Referenced by StartThread(), and StopThread().

int CLibrary::m_nFileSwitch [protected]
 

Definition at line 50 of file Library.h.

Referenced by Save().

DWORD CLibrary::m_nInhibit [protected]
 

Definition at line 51 of file Library.h.

Referenced by Inhibit(), and OnRun().

DWORD CLibrary::m_nScanCookie [protected]
 

Definition at line 48 of file Library.h.

Referenced by CLibraryFolder::ThreadScan().

DWORD CLibrary::m_nScanCount
 

Definition at line 46 of file Library.h.

Referenced by CFolderScanDlg::CFolderScanDlg(), CFolderScanDlg::OnTimer(), and ThreadScan().

DWORD CLibrary::m_nUpdateCookie
 

Definition at line 45 of file Library.h.

Referenced by CAlbumFolder::AddFile(), Clear(), CLibraryTreeView::DropObjects(), CAlbumFolder::GetCollection(), CAlbumFolder::MetaFromFile(), CAlbumFolder::MountCollection(), CAlbumFolder::OnFileDelete(), CAlbumFolder::OnFolderDelete(), CFileCopyDlg::OnInitDialog(), CFileCopyDlg::OnTimer(), CAlbumFolder::RemoveFile(), CAlbumFolder::SetCollection(), CAlbumFolder::SetMetadata(), ThreadScan(), Update(), and CLibraryFrame::Update().

DWORD CLibrary::m_nUpdateSaved [protected]
 

Definition at line 49 of file Library.h.

Referenced by ThreadScan().

CMutex CLibrary::m_pSection
 

Definition at line 44 of file Library.h.

Referenced by CMatchFile::Add(), CLibraryHistory::Add(), CMediaListCtrl::Add(), CLibraryFolders::AddFolder(), CQueryHashMaster::Build(), CBitziDownloader::BuildRequest(), CLibraryFrame::CancelDrag(), CFolderScanDlg::CFolderScanDlg(), CLibraryCollectionView::CheckAvailable(), CBaseMatchWnd::CheckExisting(), Clear(), CDeleteFileDlg::Create(), CLibraryMaps::CullDeletedFiles(), CFolderPropertiesDlg::DoApply(), CLocalSearch::ExecuteSharedFiles(), CTorrentSeedDlg::FindFile(), CFilePropertiesPage::GetFile(), CLibraryDictionary::GetHashTable(), CLibraryBuilder::HashFile(), CShareazaApp::InternalURI(), Load(), CMatchTipCtrl::LoadFromFile(), CLibraryAlbumTrack::LockRating(), CLibraryMaps::LookupFile(), CLibraryMaps::LookupFileByED2K(), CLibraryMaps::LookupFileByName(), CLibraryMaps::LookupFileByPath(), CLibraryMaps::LookupFileBySHA1(), CLibraryMaps::LookupFileByTiger(), CLibraryFolders::MountCollection(), CLibraryDetailView::OnCacheHint(), CFolderScanDlg::OnCancel(), CLibraryHistoryPanel::OnClickFile(), CLibraryWnd::OnCollection(), CURLExportDlg::OnCopy(), CTorrentSeedDlg::OnDownload(), CDownloadsWnd::OnDownloadsFileDelete(), CDownloadsWnd::OnDownloadsRate(), CLibraryDetailView::OnEndLabelEditA(), CLibraryDetailView::OnEndLabelEditW(), CEDClient::OnFileRequest(), CEDClient::OnFileStatusRequest(), CLibraryDetailView::OnFindItemA(), CLibraryDetailView::OnFindItemW(), CLibraryDetailView::OnGetDispInfoA(), CLibraryDetailView::OnGetDispInfoW(), CEDClient::OnHashsetRequest(), CUploadTransferHTTP::OnHeadersComplete(), CWizardSharePage::OnInitDialog(), CFilesProfilePage::OnInitDialog(), CFileSourcesPage::OnInitDialog(), CFileSharingPage::OnInitDialog(), CFileMetadataPage::OnInitDialog(), CFileGeneralPage::OnInitDialog(), CFileCommentsPage::OnInitDialog(), CShareManagerDlg::OnInitDialog(), CFolderPropertiesDlg::OnInitDialog(), CFilePropertiesPage::OnInitDialog(), CFileCopyDlg::OnInitDialog(), CLibraryFolderCtrl::OnItemExpanded(), CLibraryFrame::OnLButtonUp(), CHomeLibraryBox::OnLButtonUp(), CLibraryTileView::OnLibraryAlbumDelete(), CLibraryFileView::OnLibraryBitziDownload(), CLibraryFileView::OnLibraryBitziWeb(), CLibraryFileView::OnLibraryCopy(), CLibraryFileView::OnLibraryCreateTorrent(), CLibraryFileView::OnLibraryDelete(), CLibraryFileView::OnLibraryEnqueue(), CLibraryTreeView::OnLibraryExplore(), CLibraryTreeView::OnLibraryFolderDelete(), CLibraryTreeView::OnLibraryFolderEnqueue(), CLibraryTreeView::OnLibraryFolderFileProperties(), CLibraryTreeView::OnLibraryFolderMetadata(), CLibraryTreeView::OnLibraryFolderNew(), CLibraryFileView::OnLibraryLaunch(), CLibraryFileView::OnLibraryMove(), CLibraryFileView::OnLibraryProperties(), CLibraryTreeView::OnLibraryRebuild(), CLibraryFileView::OnLibraryRebuildAnsi(), CLibraryTreeView::OnLibraryRemove(), CLibraryTreeView::OnLibraryScan(), CLibraryTreeView::OnLibraryShared(), CLibraryFileView::OnLibraryShared(), CLibraryFileView::OnLibraryUnlink(), CLibraryFileView::OnLibraryURL(), CDownloadsSettingsPage::OnOK(), CFileSharingPage::OnOK(), CFileMetadataPage::OnOK(), CFileCommentsPage::OnOK(), CShareManagerDlg::OnOK(), CFilePropertiesDlg::OnOK(), CFileCopyDlg::OnOK(), CDownloadGroupDlg::OnOK(), CDecodeMetadataDlg::OnOK(), CCollectionExportDlg::OnOK(), CFolderTipCtrl::OnPrepare(), CAlbumTipCtrl::OnPrepare(), CLibraryTipCtrl::OnPrepare(), CLibrarySettingsPage::OnRecentClear(), CLibraryBuilder::OnRun(), CFileCopyDlg::OnRun(), CLibraryThumbView::OnRun(), CURLExportDlg::OnSave(), CLibraryFileView::OnSearchForAlbum(), CLibraryFileView::OnSearchForArtist(), CLibraryFileView::OnSearchForSeries(), CLibraryFileView::OnSearchForSimilar(), CLibraryFileView::OnSearchForThis(), CTorrentSeedDlg::OnSeed(), CFileSharingPage::OnShareOverride0(), CFileSourcesPage::OnSourceNew(), CFileSourcesPage::OnSourceRemove(), CFolderScanDlg::OnTimer(), CFileCopyDlg::OnTimer(), CLibraryFileView::OnUpdateLibraryEnqueue(), CLibraryTreeView::OnUpdateLibraryFolderEnqueue(), CLibraryFileView::OnUpdateLibraryRebuildAnsi(), CLibraryTreeView::OnUpdateLibraryRemove(), CLibraryTreeView::OnUpdateLibraryShared(), CLibraryFileView::OnUpdateLibraryShared(), CLibraryFileView::OnUpdateSearchForAlbum(), CLibraryFileView::OnUpdateSearchForArtist(), CLibraryFileView::OnUpdateSearchForSeries(), CLibraryFileView::OnUpdateSearchForSimilar(), CLibraryFileView::OnUpdateSearchForThis(), CURLActionDlg::OnUrlDownload(), CWizardSharePage::OnWizardNext(), CUploadTransferED2K::OpenFile(), CMediaFrame::OpenFile(), CUploadTransferHTTP::OpenFileSendHeaders(), CLibraryFolders::RemoveFolder(), CUploadTransferED2K::Request(), CUploadTransferHTTP::RequestPreview(), CLibraryFrame::RunLocalSearch(), Save(), Search(), CEDNeighbour::SendSharedFiles(), CLibraryFrame::SetView(), CFileExecutor::ShowBitziTicket(), CLibraryBuilder::SubmitCorrupted(), CLibraryBuilder::SubmitMetadata(), CBitziDownloader::SubmitMetaData(), CLibraryFolder::ThreadScan(), CLibraryFolders::ThreadScan(), ThreadScan(), Update(), CFolderScanDlg::Update(), CFilePropertiesDlg::Update(), CLibraryMetaPanel::Update(), CLibraryHomeView::Update(), CLibraryHistoryPanel::Update(), CLibraryFrame::Update(), CHomeLibraryBox::Update(), CLocalSearch::WriteVirtualTree(), and CFolderScanDlg::~CFolderScanDlg().

CEvent CLibrary::m_pWakeup [protected]
 

Definition at line 55 of file Library.h.

Referenced by OnRun(), CLibraryFolder::Scan(), and StopThread().


The documentation for this class was generated from the following files:
Generated on Thu Dec 15 10:40:08 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2