EXPORT_C CFSMailMessagePart* CBasePlugin::MessagePartL(
    const TFSMailMsgId& aMailBoxId,
    const TFSMailMsgId& /*aParentFolderId*/,
    const TFSMailMsgId& aMessageId,
    const TFSMailMsgId& aMessagePartId )
    
    {
    CMailboxInfo& mailBox = GetMailboxInfoL( aMailBoxId.Id() );

    CMsgStoreMessage* message = mailBox().FetchMessageL(
        aMessageId.Id(), KMsgStoreInvalidId );
    CleanupStack::PushL( message );

    CMsgStoreMessagePart* part = message->ChildPartL( aMessagePartId.Id(), ETrue );
    CleanupStack::PushL( part );

    TFSMailMsgId msgPartId( GetPluginId(), part->Id() );    
    CFSMailMessagePart* result = CFSMailMessagePart::NewLC( aMessageId, msgPartId );
    TranslateMsgStorePropsL( aMailBoxId, *part, *result );
    result->SetMailBoxId( aMailBoxId );

    CleanupStack::Pop( result );
    CleanupStack::PopAndDestroy( part );
    CleanupStack::PopAndDestroy( message );
    
    return result;
    }
Example #2
0
PChromiumCDMParent*
GMPContentParent::AllocPChromiumCDMParent()
{
  ChromiumCDMParent* parent = new ChromiumCDMParent(this, GetPluginId());
  NS_ADDREF(parent);
  return parent;
}
Example #3
0
File: axGain.cpp Project: EQ4/axLib
//******************************************************************************
// AGain.
//******************************************************************************
AGain::AGain(audioMasterCallback audioMaster):
axVst(audioMaster, 2)
{
    AGain::AGainMutex.lock();
    AddParameter(axParameterInfo("Gain", "dB", 1.0));
    AddParameter(axParameterInfo("Filter", "Hz", 5000.0));
    
    // Default program name
    vst_strncpy(programName, "axTB303", kVstMaxProgNameLen);
    
    double c5 = 220.0 * pow(ST_RATIO, 3);
    c0 = c5 * pow(0.5, 5);
    

    axEventManager* evtManager = axEventManager::GetInstance();
    
//    evtManager->AddConnection(10000000 + getProgram(),
//                              0,
//                              GetOnVstParameterValueChange());
    
    evtManager->AddConnection(10000000 + GetPluginId(),
                              0,
                              GetOnVstParameterValueChange());
    
    AGain::AGainMutex.unlock();
}
EXPORT_C void CBasePlugin::ChildPartsL(
    const TFSMailMsgId& aMailBoxId,
    const TFSMailMsgId& /*aParentFolderId*/,
	const TFSMailMsgId& aMessageId,
	const TFSMailMsgId& aParentId,
	RPointerArray<CFSMailMessagePart>& aParts )

    {
    __LOG_ENTER( "ChildPartsL" )
    
    GetCachedMsgL( aMailBoxId.Id(), aMessageId.Id() );
    RPointerArray<CMsgStoreMessagePart>* parts;
    if ( aParentId.IsNullId() )
        {
        parts = &GetCachedMsgChildrenL();
        }
    else
        {
        __LOG_WRITE_INFO( "Looking for the child parts of a part." )
        GetCachedBodyL( aParentId.Id() );
        parts = &GetCachedBodyChildrenL();
        }

    __LOG_WRITE8_FORMAT1_INFO( "No of child parts : %d.", parts->Count() );
    
    TFSMailMsgId fsId( GetPluginId(), 0 );
    TInt count = parts->Count();
    for ( TInt i = 0; i < count; i++ )
        {
        CMsgStoreMessagePart& thePart = *((*parts)[i]); 
        fsId.SetId( thePart.Id() );

        CFSMailMessagePart* fsPart = CFSMailMessagePart::NewLC( aMessageId, fsId );
        TranslateMsgStorePropsL( aMailBoxId, thePart, *fsPart );
        fsPart->SetMailBoxId( aMailBoxId );

        aParts.AppendL( fsPart );
        CleanupStack::Pop( fsPart );
        }
    
    __LOG_EXIT
    }
Example #5
0
File: axGain.cpp Project: EQ4/axLib
void AGain::OnVstMidiNoteOnEvent(const axVstMidiNoteMsg& msg)
{
    AGain::AGainMutex.lock();
    
    int midiNote = (int)msg.GetNote();
    double freq = c0 * pow(ST_RATIO, midiNote);
    
    _polyChannels[_polyChannelIndex]->TriggerNote(freq);
    
    std::cout << "Midi event : " << GetPluginId() << " " << _polyChannelIndex << " " << msg.GetNote() << std::endl;
    
    if(_polyChannelIndex + 1 == 10)
    {
        _polyChannelIndex = 0;
    }
    else
    {
        _polyChannelIndex++;
    }
    AGain::AGainMutex.unlock();
}
Example #6
0
PChromiumCDMParent* GMPContentParent::AllocPChromiumCDMParent() {
  GMP_LOG("GMPContentParent::AllocPChromiumCDMParent(this=%p)", this);
  ChromiumCDMParent* parent = new ChromiumCDMParent(this, GetPluginId());
  NS_ADDREF(parent);
  return parent;
}
/**
 * Helper method to avoid duplicated code
 */
CFSMailMessagePart* CBasePlugin::NewChildPartFromFilePathOrHandleL(
    const TFSMailMsgId& aMailBoxId,
    const TFSMailMsgId& /*aParentFolderId*/,
    const TFSMailMsgId& aMessageId,
    const TFSMailMsgId& aParentPartId,
	const TDesC& aContentType,
    const TDesC& aFilePath,
    TBool  aUseFileHandle, 
    RFile& aFile )
	{
    CMailboxInfo& mailBox = GetMailboxInfoL( aMailBoxId.Id() );
    
    CMsgStoreMessage* message = mailBox().FetchMessageL(
        aMessageId.Id(), KMsgStoreInvalidId );
    CleanupStack::PushL( message );

    //determine the parent part - could be the message or any of its parts.
    CMsgStoreMessagePart* parent;
    if ( aParentPartId.IsNullId() )
        {
        parent = message;
        CleanupStack::Pop( message );
        }
    else
        {
        parent = message->ChildPartL( aParentPartId.Id(), ETrue );
        CleanupStack::PopAndDestroy( message );
        }
    CleanupStack::PushL( parent );

    //msgstore's message content type.
    CMsgStorePropertyContainer* props = CMsgStorePropertyContainer::NewL();
    CleanupStack::PushL( props );
    
    if ( aContentType != KNullDesC )
        {
        props->AddOrUpdatePropertyL( KMsgStorePropertyContentType, aContentType );
        }
    
    CMsgStoreMessagePart* part = NULL;
    if ( aUseFileHandle )
    	{
    	part = parent->AddChildPartL( *props, aFile );
    	}
    else
    	{
    	part = parent->AddChildPartL( *props, aFilePath );
    	}
    CleanupStack::PopAndDestroy( props );
    CleanupStack::PushL( part );

    //update the size and the fetched size.
    TUint contentLength = part->ContentLengthL();
    if ( 0 != contentLength )
        {
        part->AddOrUpdatePropertyL(
            KMsgStorePropertySize, static_cast<TUint32>( contentLength ) );
        part->AddOrUpdatePropertyL(
            KMsgStorePropertyRetrievedSize, static_cast<TUint32>( contentLength ) );
        
        part->StorePropertiesL();
        }
    
    TFSMailMsgId fsId( GetPluginId(), part->Id() );
    CleanupStack::PopAndDestroy( part );

    //prepare the fw object.
    CFSMailMessagePart* result = CFSMailMessagePart::NewL( aMessageId, fsId );

    if ( aContentType != KNullDesC )
        {
        result->SetContentType( aContentType );
        }
    result->SetContentSize( contentLength );
    result->SetFetchedContentSize( contentLength );
    result->SetMailBoxId( aMailBoxId );

    CleanupStack::PopAndDestroy( parent );

    return result;
	} //NewChildPartFromFileNameOrHandleL