MetadataHandlerWMA.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 __METADATA_HANDLER_WMA_H__
33 #define __METADATA_HANDLER_WMA_H__
34 
35 // INCLUDES ===================================================================
36 #include <nsCOMPtr.h>
37 #include <nsStringGlue.h>
38 
39 #include "sbIMetadataHandler.h"
40 #include "sbIMetadataHandlerWMA.h"
41 #include "sbIMetadataChannel.h"
42 
43 // DEFINES ====================================================================
44 #define SONGBIRD_METADATAHANDLERWMA_CONTRACTID "@songbirdnest.com/Songbird/MetadataHandler/WMA;1"
45 #define SONGBIRD_METADATAHANDLERWMA_CLASSNAME "Songbird WMA Metadata Handler Interface"
46 
47 // {2D42C52D-3B4E-4085-99F6-53DB14C5996C}
48 #define SONGBIRD_METADATAHANDLERWMA_CID { 0x2d42c52d, 0x3b4e, 0x4085, { 0x99, 0xf6, 0x53, 0xdb, 0x14, 0xc5, 0x99, 0x6c } }
49 
50 // FUNCTIONS ==================================================================
51 
52 // CLASSES ====================================================================
53 
54 class nsIChannel;
55 struct IWMHeaderInfo3;
56 struct IWMPMedia3;
57 
60 {
62  NS_DECL_SBIMETADATAHANDLER
63  NS_DECL_SBIMETADATAHANDLERWMA
64 
66 
67 protected:
69 
70  nsCOMPtr<sbIMutablePropertyArray> m_PropertyArray;
71  nsCOMPtr<sbIMetadataChannel> m_ChannelHandler;
72  nsCOMPtr<nsIChannel> m_Channel;
73  nsString m_FilePath;
74  PRBool m_Completed;
75 
83  nsString ReadHeaderValue(IWMHeaderInfo3 *aHeaderInfo, const nsAString &aKey);
84 
92  NS_METHOD CreateWMPMediaItem(const nsAString& aFilePath, IWMPMedia3** aMedia);
93 
100  NS_METHOD ReadMetadataWMFSDK(const nsAString& aFilePath, PRInt32* _retval);
107  NS_METHOD ReadMetadataWMP(const nsAString& aFilePath, PRInt32* _retval);
108 
116  NS_METHOD ReadAlbumArtWMFSDK(const nsAString &aFilePath,
117  nsACString &aMimeType,
118  PRUint32 *aDataLen,
119  PRUint8 **aData);
127  NS_METHOD ReadAlbumArtWMP(const nsAString &aFilePath,
128  nsACString &aMimeType,
129  PRUint32 *aDataLen,
130  PRUint8 **aData);
131 
142  NS_METHOD SetImageDataInternal(PRInt32 aType,
143  const nsAString &aURL,
144  IWMHeaderInfo3 *aHeader,
145  PRBool &aSuccess);
146 
147 };
148 
149 #endif // __METADATA_HANDLER_WMA_H__
nsCOMPtr< nsIChannel > m_Channel
NS_METHOD ReadAlbumArtWMFSDK(const nsAString &aFilePath, nsACString &aMimeType, PRUint32 *aDataLen, PRUint8 **aData)
NS_METHOD SetImageDataInternal(PRInt32 aType, const nsAString &aURL, IWMHeaderInfo3 *aHeader, PRBool &aSuccess)
nsString ReadHeaderValue(IWMHeaderInfo3 *aHeaderInfo, const nsAString &aKey)
NS_METHOD ReadMetadataWMP(const nsAString &aFilePath, PRInt32 *_retval)
const nsIChannel
An object capable of manipulating the metadata tags for a media file.
NS_METHOD ReadAlbumArtWMP(const nsAString &aFilePath, nsACString &aMimeType, PRUint32 *aDataLen, PRUint8 **aData)
WMA metadata handler.
NS_METHOD CreateWMPMediaItem(const nsAString &aFilePath, IWMPMedia3 **aMedia)
nsCOMPtr< sbIMetadataChannel > m_ChannelHandler
nsCOMPtr< sbIMutablePropertyArray > m_PropertyArray
NS_METHOD ReadMetadataWMFSDK(const nsAString &aFilePath, PRInt32 *_retval)
_updateTextAndScrollDataForFrame aData