Menu
Home
Blog
Add-ons
Forum
Wiki
Developers
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
components
mediacore
metadata
manager
src
sbBackgroundThreadMetadataProcessor.h
Go to the documentation of this file.
1
/*
2
//
3
// BEGIN SONGBIRD GPL
4
//
5
// This file is part of the Songbird web player.
6
//
7
// Copyright(c) 2005-2008 POTI, Inc.
8
// http://songbirdnest.com
9
//
10
// This file may be licensed under the terms of of the
11
// GNU General Public License Version 2 (the "GPL").
12
//
13
// Software distributed under the License is distributed
14
// on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15
// express or implied. See the GPL for the specific language
16
// governing rights and limitations.
17
//
18
// You should have received a copy of the GPL along with this
19
// program. If not, go to http://www.gnu.org/licenses/gpl.html
20
// or write to the Free Software Foundation, Inc.,
21
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
//
23
// END SONGBIRD GPL
24
//
25
*/
26
32
#ifndef SBBACKGROUNDTHREADMETADATAPROCESSOR_H_
33
#define SBBACKGROUNDTHREADMETADATAPROCESSOR_H_
34
35
// INCLUDES ===================================================================
36
#include <nspr.h>
37
#include <nscore.h>
38
#include <nsISupports.h>
39
#include <nsIRunnable.h>
40
#include <nsCOMPtr.h>
41
#include <nsAutoPtr.h>
42
#include <nsTArray.h>
43
44
// CLASSES ====================================================================
45
46
class
sbFileMetadataService
;
47
class
sbMetadataJobItem
;
48
54
class
sbBackgroundThreadMetadataProcessor
:
public
nsIRunnable
55
{
56
public
:
57
NS_DECL_ISUPPORTS
58
NS_DECL_NSIRUNNABLE
59
60
sbBackgroundThreadMetadataProcessor
(
sbFileMetadataService
* aManager);
61
virtual
~sbBackgroundThreadMetadataProcessor
();
62
69
nsresult
Start
();
70
75
nsresult
Stop
();
76
77
protected
:
78
79
// The job manager that owns this processor
80
nsRefPtr<sbFileMetadataService>
mJobManager
;
81
82
// Thread to call nsIRunnable.Run()
83
nsCOMPtr<nsIThread>
mThread
;
84
85
// Flag to indicate that the thread should stop processing
86
PRBool
mShouldShutdown
;
87
88
// Monitor used to wake up the thread when more items
89
// are added, or when it is time to shut down
90
PRMonitor*
mMonitor
;
91
};
92
93
#endif // SBBACKGROUNDTHREADMETADATAPROCESSOR_H_
sbBackgroundThreadMetadataProcessor::mMonitor
PRMonitor * mMonitor
Definition:
sbBackgroundThreadMetadataProcessor.h:90
sbBackgroundThreadMetadataProcessor
Definition:
sbBackgroundThreadMetadataProcessor.h:54
sbBackgroundThreadMetadataProcessor::~sbBackgroundThreadMetadataProcessor
virtual ~sbBackgroundThreadMetadataProcessor()
Definition:
sbBackgroundThreadMetadataProcessor.cpp:74
sbBackgroundThreadMetadataProcessor::mShouldShutdown
PRBool mShouldShutdown
Definition:
sbBackgroundThreadMetadataProcessor.h:86
sbMetadataJobItem
Definition:
sbMetadataJobItem.h:61
sbFileMetadataService
Manages reading and writing metadata to and from sbIMediaItem objects and media files.
Definition:
sbFileMetadataService.h:127
NS_DECL_ISUPPORTS
NS_DECL_ISUPPORTS
Definition:
sbPlaylistCommandsHelper.cpp:49
sbBackgroundThreadMetadataProcessor::Start
nsresult Start()
Definition:
sbBackgroundThreadMetadataProcessor.cpp:86
sbBackgroundThreadMetadataProcessor::sbBackgroundThreadMetadataProcessor
NS_DECL_ISUPPORTS NS_DECL_NSIRUNNABLE sbBackgroundThreadMetadataProcessor(sbFileMetadataService *aManager)
Definition:
sbBackgroundThreadMetadataProcessor.cpp:61
sbBackgroundThreadMetadataProcessor::mJobManager
nsRefPtr< sbFileMetadataService > mJobManager
Definition:
sbBackgroundThreadMetadataProcessor.h:80
sbBackgroundThreadMetadataProcessor::mThread
nsCOMPtr< nsIThread > mThread
Definition:
sbBackgroundThreadMetadataProcessor.h:83
sbBackgroundThreadMetadataProcessor::Stop
nsresult Stop()
Definition:
sbBackgroundThreadMetadataProcessor.cpp:115