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 
47 class sbMetadataJobItem;
48 
54 class sbBackgroundThreadMetadataProcessor : public nsIRunnable
55 {
56 public:
58  NS_DECL_NSIRUNNABLE
59 
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
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_
Manages reading and writing metadata to and from sbIMediaItem objects and media files.
NS_DECL_ISUPPORTS NS_DECL_NSIRUNNABLE sbBackgroundThreadMetadataProcessor(sbFileMetadataService *aManager)