chxavplayerapp.cpp

来自「symbian 下的helix player源代码」· C++ 代码 · 共 131 行

CPP
131
字号
/************************************************************************
 * chxavplayerapp.cpp
 * ------------------
 *
 * Synopsis:
 * Contains the implementation of the base application for the Symbian
 * OS port of Helix.
 *
 *
 * Target:
 * Symbian OS
 *
 *
 * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
 *
 ************************************************************************/

#include "ihxpckts.h"
#include "hxstring.h"
#include "hxurl.h"
#include "hxglobalmgr_imp.h"
#include "hxglobalmgr_inst.h"
#include "platform/symbian/symbian_dll_map.h"
#include "platform/symbian/symbian_dll_map_inst.h"
#include "chxavplayerui.h"
#include "chxavplayerapp.h"
#include "player_uids.h"
#include "hxsym_debug.h"
#include "chxavplayerdoc.h"


// required by all EPOC32 DLLs
GLDEF_C TInt E32Dll(TDllReason reason)
{
    if (reason == EDllProcessDetach)
    {
	CloseSTDLIB();
    }
    return KErrNone;
}


EXPORT_C CApaApplication* NewApplication()
{
    return new CHXAvPlayerApp();
}

// for HXSymbianDLLMapInstance
void destroyDLLMap(void* pObj)
{
    SymbianDLLMapImp* pDLLMap = reinterpret_cast<SymbianDLLMapImp*>(pObj);
    delete pDLLMap;
}

/*
 * InitL
 * ---------------
 *
 */
void CHXAvPlayerApp::InitL()
{
    // for accessing global dll data; manages global pointers (including cleanup) accessed via HXGlobalPtr
    HXGlobalManager* pGM = new (ELeave) HXGlobalManagerImp();
    HXGlobalManInstance::SetInstance(pGM);

    // Install ISymbianDLLMap object. 
    // This object is used by DLLAccess to reference count each DLL. This
    // map keeps track of when a library will actually be unloaded by the OS
    // and arranges for the DLLs globals to get cleaned up before the DLL is
    // unloaded.
    HXSymbianDLLMapInstance::SetInstance(new (ELeave) SymbianDLLMapImp, &destroyDLLMap);


    //__UHEAP_MARK;

    //
    // Setup default dprintf behavior. Later, once
    // preferences are loaded, mask and sink are set
    // from config.
    //
    dbg::SetupDebug("console", SYMP_INFO);

    DPRINTF(SYMP_INFO, ("CHXAvPlayeApp(): ctor\n"));
}



/*
 * CreateDocumentL
 * ---------------
 * Create the doc. Called once per app instance.
 *
 */
CApaDocument* CHXAvPlayerApp::CreateDocumentL()
{
    InitL();
    return CHXAvPlayerDoc::NewL(*this);	
}



/*
 * AppDLLUid
 * ---------
 *
 */
TUid CHXAvPlayerApp::AppDllUid() const
{
    return CHXAvMisc::KAppUID;
}



/*
 * ~CHXAvPlayerApp
 * ---------------
 * Dtor
 *
 */
CHXAvPlayerApp::~CHXAvPlayerApp()
{
    DPRINTF(SYMP_INFO, ("CHXAvPlayerApp(): dtor\n"));

    //__UHEAP_MARKEND;

    HXGlobalManagerImp* pGM = static_cast<HXGlobalManagerImp*>( HXGlobalManInstance::GetInstance() );
    pGM->Shutdown();
    HX_DELETE(pGM);
    HXGlobalManInstance::SetInstance(0);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?