Ejemplo n.º 1
0
NS_IMETHODIMP nsDBFolderInfo::SetSortType(nsMsgViewSortTypeValue aSortType)
{
  return SetUint32Property("sortType", aSortType);
}
Ejemplo n.º 2
0
NS_IMETHODIMP nsDBFolderInfo::SetViewFlags(nsMsgViewFlagsTypeValue aViewFlags)
{
  return SetUint32Property("viewFlags", aViewFlags);
}
Ejemplo n.º 3
0
NS_IMETHODIMP nsDBFolderInfo::SetViewType(nsMsgViewTypeValue aViewType)
{
  return SetUint32Property("viewType", aViewType);
}
Ejemplo n.º 4
0
NS_IMETHODIMP nsDBFolderInfo::SetCharacterSetOverride(bool characterSetOverride)
{
  m_charSetOverride = characterSetOverride;
  return SetUint32Property(kCharacterSetOverrideColumnName, characterSetOverride);
}
Ejemplo n.º 5
0
NS_IMETHODIMP nsDBFolderInfo::SetSortOrder(nsMsgViewSortOrderValue aSortOrder)
{
    return SetUint32Property("sortOrder", aSortOrder);
}
Ejemplo n.º 6
0
MediaFoundationTransform::MediaFoundationTransform(IMFActivate *activationObj, WmaEncodingFormat encodingFormat)
{
	UINT32 nameLen;

	// Transform name is an MFActivate object property, so get that first

	activationObj->GetString(MFT_FRIENDLY_NAME_Attribute, _transformName, sizeof(_transformName), &nameLen);

	HRESULT hr = activationObj->ActivateObject(IID_PPV_ARGS(&_mfEncoder));

	hr = _mfEncoder->QueryInterface(IID_PPV_ARGS(&_propertyStore));

	// Configure the tranform to perform the requested compression format

	switch (encodingFormat)
	{
	case WmaEncodingFormat::Lossless:
		SetBooleanProperty(MFPKEY_VBRENABLED, true);
		SetBooleanProperty(MFPKEY_CONSTRAIN_ENUMERATED_VBRQUALITY, true);
		SetUint32Property(MFPKEY_DESIRED_VBRQUALITY, 100);
		break;

	case WmaEncodingFormat::Quality_10:
		SetBooleanProperty(MFPKEY_VBRENABLED, true);
		SetBooleanProperty(MFPKEY_CONSTRAIN_ENUMERATED_VBRQUALITY, true);
		SetUint32Property(MFPKEY_DESIRED_VBRQUALITY, 10);
		break;

	case WmaEncodingFormat::Quality_25:
		SetBooleanProperty(MFPKEY_VBRENABLED, true);
		SetBooleanProperty(MFPKEY_CONSTRAIN_ENUMERATED_VBRQUALITY, true);
		SetUint32Property(MFPKEY_DESIRED_VBRQUALITY, 25);
		break;

	case WmaEncodingFormat::Quality_50:
		SetBooleanProperty(MFPKEY_VBRENABLED, true);
		SetBooleanProperty(MFPKEY_CONSTRAIN_ENUMERATED_VBRQUALITY, true);
		SetUint32Property(MFPKEY_DESIRED_VBRQUALITY, 50);
		break;

	case WmaEncodingFormat::Quality_75:
		SetBooleanProperty(MFPKEY_VBRENABLED, true);
		SetBooleanProperty(MFPKEY_CONSTRAIN_ENUMERATED_VBRQUALITY, true);
		SetUint32Property(MFPKEY_DESIRED_VBRQUALITY, 75);
		break;

	case WmaEncodingFormat::Quality_90:
		SetBooleanProperty(MFPKEY_VBRENABLED, true);
		SetBooleanProperty(MFPKEY_CONSTRAIN_ENUMERATED_VBRQUALITY, true);
		SetUint32Property(MFPKEY_DESIRED_VBRQUALITY, 90);
		break;

	case WmaEncodingFormat::Quality_98:
		SetBooleanProperty(MFPKEY_VBRENABLED, true);
		SetBooleanProperty(MFPKEY_CONSTRAIN_ENUMERATED_VBRQUALITY, true);
		SetUint32Property(MFPKEY_DESIRED_VBRQUALITY, 98);
		break;

	}

	hr = _propertyStore->Commit();

	// enumerate output types and try to find the appropriate one for our purposes

	DWORD index = 0;

	while (true)
	{
		IMFMediaType *mediaType;

		hr = _mfEncoder->GetOutputAvailableType(0, index++, &mediaType);

		if (hr == MF_E_NO_MORE_TYPES)
			break;

		// Get the AM_MEDIA_TYPE structure from the media type, in case we want to need
		// to differentiate between Standard and Pro WMA codecs in the future...

		AM_MEDIA_TYPE *amMediaType;
	    mediaType->GetRepresentation(AM_MEDIA_TYPE_REPRESENTATION, (LPVOID *) &amMediaType);
	    WAVEFORMATEX *waveFormat = (WAVEFORMATEX *) amMediaType->pbFormat;

		// there's only a few things we're interested in with the output type, so only bother grabbing those values

		UINT32 channelCount;
		UINT32 samplesPerSecond;
		UINT32 bitsPerSample;

		hr = mediaType->GetUINT32(MF_MT_AUDIO_NUM_CHANNELS, &channelCount);
		hr = mediaType->GetUINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, &samplesPerSecond);
		hr = mediaType->GetUINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, &bitsPerSample);

		if ((channelCount == 2) && (bitsPerSample == 16) && (samplesPerSecond == 44100))
		{
			_mfMediaType = mediaType;

//			IMFActivate *areYouFuckingSerious;
//			activationObj->ShutdownObject();
	//		_mfEncoder->Release();

//			hr = MFCreateWMAEncoderActivate(mediaType, _propertyStore, &areYouFuckingSerious);

		
	//		hr = areYouFuckingSerious->ActivateObject(IID_PPV_ARGS(&_mfEncoder));

			break;
		}
	}

  index = 0;
}