36 #include <nsComponentManagerUtils.h>
42 extern PRLogModuleInfo* gMetadataLog;
43 #define TRACE(args) PR_LOG(gMetadataLog, PR_LOG_DEBUG, args)
44 #define LOG(args) PR_LOG(gMetadataLog, PR_LOG_WARN, args)
50 #define SB_MUTABLEPROPERTYARRAY_CONTRACTID "@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1"
58 nsStringArray* aRequiredProperties,
61 mMediaItem(aMediaItem),
63 mOwningJob(aOwningJob),
64 mPropertyList(aRequiredProperties),
65 mProcessingStarted(PR_FALSE),
66 mProcessingComplete(PR_FALSE)
69 TRACE((
"sbMetadataJobItem[0x%.8x] - ctor",
this));
75 TRACE((
"sbMetadataJobItem[0x%.8x] - dtor",
this));
80 NS_ENSURE_ARG_POINTER(aHandler);
82 return NS_ERROR_NOT_AVAILABLE;
96 NS_ENSURE_ARG_POINTER(aMediaItem);
104 NS_ENSURE_ARG_POINTER(aJob);
112 NS_ENSURE_ARG_POINTER(aJobType);
119 NS_ENSURE_ARG_POINTER(aProcessingStarted);
132 NS_ENSURE_ARG_POINTER(aProcessed);
156 NS_ENSURE_ARG_POINTER(aPropertyArray);
161 nsCOMPtr<sbIMutablePropertyArray> writeProps =
163 NS_ENSURE_SUCCESS(rv, rv);
166 nsCOMPtr<sbIPropertyArray> propArray;
167 rv =
mMediaItem->GetProperties(nsnull, getter_AddRefs(propArray));
168 NS_ENSURE_SUCCESS(rv, rv);
172 nsCOMPtr<sbIProperty> property;
174 nsString propertyValue;
175 for (PRInt32 current = 0; current <
mPropertyList->Count(); ++current) {
180 rv = propArray->GetPropertyValue(propertyId, propertyValue);
181 if (rv == NS_ERROR_NOT_AVAILABLE) {
184 propertyValue = EmptyString();
185 propertyValue.SetIsVoid(PR_TRUE);
187 NS_ENSURE_SUCCESS(rv, rv);
190 rv = writeProps->AppendProperty(propertyId, propertyValue);
191 NS_ENSURE_SUCCESS(rv, rv);
194 NS_ADDREF(*aPropertyArray = writeProps);
An interface to carry around arrays of nsIProperty instances Note that implementations of the interfa...