# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1263446093 -7200 # Node ID 0ce1b5ce9557af71f12bd9b78519bdfc57cf0fb8 Revision: 201001 diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/addeddevsoundcontrolcistub/BWINS/AddedDevSoundControlCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/addeddevsoundcontrolcistub/BWINS/AddedDevSoundControlCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + ??1CAddedDevSoundControlCI@@UAE@XZ @ 1 NONAME ; CAddedDevSoundControlCI::~CAddedDevSoundControlCI(void) + ?NewL@CAddedDevSoundControlCI@@SAPAV1@XZ @ 2 NONAME ; class CAddedDevSoundControlCI * CAddedDevSoundControlCI::NewL(void) + ?PauseAndFlush@CAddedDevSoundControlCI@@UAEHXZ @ 3 NONAME ; int CAddedDevSoundControlCI::PauseAndFlush(void) + ?SetHwAwareness@CAddedDevSoundControlCI@@UAEHH@Z @ 4 NONAME ; int CAddedDevSoundControlCI::SetHwAwareness(int) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/addeddevsoundcontrolcistub/EABI/AddedDevSoundControlCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/addeddevsoundcontrolcistub/EABI/AddedDevSoundControlCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,14 @@ +EXPORTS + _ZN23CAddedDevSoundControlCI13PauseAndFlushEv @ 1 NONAME + _ZN23CAddedDevSoundControlCI14SetHwAwarenessEi @ 2 NONAME + _ZN23CAddedDevSoundControlCI4NewLEv @ 3 NONAME + _ZN23CAddedDevSoundControlCID0Ev @ 4 NONAME + _ZN23CAddedDevSoundControlCID1Ev @ 5 NONAME + _ZN23CAddedDevSoundControlCID2Ev @ 6 NONAME + _ZTI23CAddedDevSoundControlCI @ 7 NONAME ; ## + _ZTV23CAddedDevSoundControlCI @ 8 NONAME ; ## + _ZThn4_N23CAddedDevSoundControlCI13PauseAndFlushEv @ 9 NONAME ; ## + _ZThn4_N23CAddedDevSoundControlCI14SetHwAwarenessEi @ 10 NONAME ; ## + _ZThn4_N23CAddedDevSoundControlCID0Ev @ 11 NONAME ; ## + _ZThn4_N23CAddedDevSoundControlCID1Ev @ 12 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/addeddevsoundcontrolcistub/Group/AddedDevSoundControlCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/addeddevsoundcontrolcistub/Group/AddedDevSoundControlCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Stub implementation for AddedDevSoundControl CI. +* +*/ + + +#include + +TARGET AddedDevSoundControlCI.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B79 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE AddedDevSoundControlCIStub.cpp + +USERINCLUDE ../inc + +OS_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/addeddevsoundcontrolcistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/addeddevsoundcontrolcistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for ??? +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +AddedDevSoundControlCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/addeddevsoundcontrolcistub/inc/AddedDevSoundControlCIStub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/addeddevsoundcontrolcistub/inc/AddedDevSoundControlCIStub.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,107 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Custom Interface for AddedDevSoundControl. +* +*/ + + +#ifndef ADDEDDEVSOUNDCONTROLCI_H +#define ADDEDDEVSOUNDCONTROLCI_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Custom Interface for AddedDevSoundControl. +* +* @lib AddedDevSoundControlCIStub.lib +* @since S60 3.2 +*/ +class CAddedDevSoundControlCI : public CBase, + public MAddedDevSoundControl + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CAddedDevSoundControlCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CAddedDevSoundControlCI(); + + public: // New functions + + public: // Functions from MAddedDevSoundControl + + /** + * Sets HW awareness for Pause. + * + * @since S60 3.2 + * @param TBool - Toggles HW awareness + * @return TInt - + */ + IMPORT_C virtual TInt SetHwAwareness(TBool aHwAware); + + /** + * Pauses audio playback and flushes buffers. + * + * @since S60 3.2 + * @return TInt - Status + */ + IMPORT_C virtual TInt PauseAndFlush(); + + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CAddedDevSoundControlCI(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + + TBool iHwAware; + + }; + +#endif // ADDEDDEVSOUNDCONTROLCI_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/addeddevsoundcontrolcistub/rom/AddedDevSoundControlCIStub.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/addeddevsoundcontrolcistub/rom/AddedDevSoundControlCIStub.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - DevSound adaptation stub. +* +*/ + + +#ifndef __ADDEDDEVSOUNDCONTROLCISTUB_IBY__ +#define __ADDEDDEVSOUNDCONTROLCISTUB_IBY__ + +file=ABI_DIR\BUILD_DIR\AddedDevSoundControlCIStub.dll SHARED_LIB_DIR\AddedDevSoundControlCI.dll + +#endif // __ADDEDDEVSOUNDCONTROLCISTUB_IBY__ diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/addeddevsoundcontrolcistub/src/AddedDevSoundControlCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/addeddevsoundcontrolcistub/src/AddedDevSoundControlCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Custom Interface stub implementation for AddedDevSoundControl. +* +*/ + + +// INCLUDE FILES +#include +#include "AddedDevSoundControlCIStub.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +/** + * CAddedDevSoundControlCI::CAddedDevSoundControlCI + * C++ default constructor can NOT contain any code, that might leave. + */ +CAddedDevSoundControlCI::CAddedDevSoundControlCI() + { + } + +/** + * CAddedDevSoundControlCI::ConstructL + * Symbian 2nd phase constructor can leave. + */ +void CAddedDevSoundControlCI::ConstructL() + { + } + +/** + * CAddedDevSoundControlCI::NewL + * Two-phased constructor. + */ +EXPORT_C CAddedDevSoundControlCI* CAddedDevSoundControlCI::NewL() + { + CAddedDevSoundControlCI* self = new (ELeave)CAddedDevSoundControlCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +/** + * Destructor + */ +EXPORT_C CAddedDevSoundControlCI::~CAddedDevSoundControlCI() + { + } + + +// From CAddedDevSoundControl + +/** + * Handles DevSound observer’s request to alter DevSound's behavior + * for Pause. Can be called after DevSound creation. Must be called + * prior to calling Pause to take effect. When value is True, the + * Pause will halt the resource and keep all buffers sent to the + * DevSound interface intact for playing upon resuming. When the value + * is False, Pause will cause buffers to be flushed and any associated + * resources freed. Should return a KErrNotSupported if the DevSound + * behavior cannot be altered. + * + * (other items defined in the header) + */ +EXPORT_C TInt CAddedDevSoundControlCI::SetHwAwareness(TBool aHwAware) + { + iHwAware = aHwAware; + +#ifdef _DEBUG + RDebug::Print(_L("CAddedDevSoundControlCI::SetHwAwareness [%d]"), iHwAware); +#endif //_DEBUG + + return KErrNone; + } + +/** + * Handles DevSound observer’s request to pause the audio resources + * and explicitly flush the buffers. Must be in the Playing state in + * order to function properly. Should return KErrNotSupported if the + * feature is not available. + * + * (other items defined in the header) + */ +EXPORT_C TInt CAddedDevSoundControlCI::PauseAndFlush() + { +#ifdef _DEBUG + RDebug::Print(_L("CAddedDevSoundControlCI::PauseAndFlush [OK]")); +#endif //_DEBUG + + return KErrNone; + } + + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/aacdecoderconfigcistub/BWINS/AacDecoderConfigCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/aacdecoderconfigcistub/BWINS/AacDecoderConfigCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,5 @@ +EXPORTS + ??1CAacDecoderConfigCI@@UAE@XZ @ 1 NONAME ; CAacDecoderConfigCI::~CAacDecoderConfigCI(void) + ?NewL@CAacDecoderConfigCI@@SAPAV1@XZ @ 2 NONAME ; class CAacDecoderConfigCI * CAacDecoderConfigCI::NewL(void) + ?SetAudioConfig@CAacDecoderConfigCI@@UAEHAAVTAudioConfig@@@Z @ 3 NONAME ; int CAacDecoderConfigCI::SetAudioConfig(class TAudioConfig &) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/aacdecoderconfigcistub/EABI/AacDecoderConfigCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/aacdecoderconfigcistub/EABI/AacDecoderConfigCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,9 @@ +EXPORTS + _ZN19CAacDecoderConfigCI14SetAudioConfigER12TAudioConfig @ 1 NONAME + _ZN19CAacDecoderConfigCI4NewLEv @ 2 NONAME + _ZN19CAacDecoderConfigCID0Ev @ 3 NONAME + _ZN19CAacDecoderConfigCID1Ev @ 4 NONAME + _ZN19CAacDecoderConfigCID2Ev @ 5 NONAME + _ZTI19CAacDecoderConfigCI @ 6 NONAME ; ## + _ZTV19CAacDecoderConfigCI @ 7 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/aacdecoderconfigcistub/group/AacDecoderConfigCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/aacdecoderconfigcistub/group/AacDecoderConfigCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* Version : %version: bh1mmcf#14 % +* +*/ + + +#include + +TARGET AacDecoderConfigCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B0C + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE AacDecoderConfigCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY AacDecoderConfigCI.lib + +LINKAS AacDecoderConfigCI.dll + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/aacdecoderconfigcistub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/aacdecoderconfigcistub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for AAC decoder config custom interface +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +AacDecoderConfigCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/aacdecoderconfigcistub/src/AacDecoderConfigCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/aacdecoderconfigcistub/src/AacDecoderConfigCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +// INCLUDE FILES +#include "AacDecoderConfigCI.h" +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CAacDecoderConfigCI::CAacDecoderConfigCI +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CAacDecoderConfigCI::CAacDecoderConfigCI() + { + + } + +// ----------------------------------------------------------------------------- +// CAacDecoderConfigCI::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CAacDecoderConfigCI::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CAacDecoderConfigCI::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CAacDecoderConfigCI* CAacDecoderConfigCI::NewL() + { + CAacDecoderConfigCI* self = new (ELeave)CAacDecoderConfigCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// Destructor +EXPORT_C CAacDecoderConfigCI::~CAacDecoderConfigCI() + { + + } + +// ----------------------------------------------------------------------------- +// CAacDecoderConfigCI::SetAudioConfig +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CAacDecoderConfigCI::SetAudioConfig(TAudioConfig& aAudioConfig) + { + TAudioConfig::TAudioObjectType audioObjectType = aAudioConfig.iAudioObjectType; + RDebug::Print(_L("CAacDecoderConfigCI::SetAudioConfig object type[%d]"), audioObjectType); + return KErrNone; + } diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/audiovibracontrolcistub/BWINS/AudioVibraControlCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/audiovibracontrolcistub/BWINS/AudioVibraControlCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + ??1CAudioVibraControlCI@@UAE@XZ @ 1 NONAME ; CAudioVibraControlCI::~CAudioVibraControlCI(void) + ?NewL@CAudioVibraControlCI@@SAPAV1@XZ @ 2 NONAME ; class CAudioVibraControlCI * CAudioVibraControlCI::NewL(void) + ?StartVibra@CAudioVibraControlCI@@UAEHXZ @ 3 NONAME ; int CAudioVibraControlCI::StartVibra(void) + ?StopVibra@CAudioVibraControlCI@@UAEHXZ @ 4 NONAME ; int CAudioVibraControlCI::StopVibra(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/audiovibracontrolcistub/EABI/AudioVibraControlCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/audiovibracontrolcistub/EABI/AudioVibraControlCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,10 @@ +EXPORTS + _ZN20CAudioVibraControlCI10StartVibraEv @ 1 NONAME + _ZN20CAudioVibraControlCI4NewLEv @ 2 NONAME + _ZN20CAudioVibraControlCI9StopVibraEv @ 3 NONAME + _ZN20CAudioVibraControlCID0Ev @ 4 NONAME + _ZN20CAudioVibraControlCID1Ev @ 5 NONAME + _ZN20CAudioVibraControlCID2Ev @ 6 NONAME + _ZTI20CAudioVibraControlCI @ 7 NONAME ; ## + _ZTV20CAudioVibraControlCI @ 8 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/audiovibracontrolcistub/group/AudioVibraControlCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/audiovibracontrolcistub/group/AudioVibraControlCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* Version : %version: bh1mmcf#12 % +* +*/ + + +#include + +TARGET AudioVibraControlCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B14 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../Src +SOURCE AudioVibraControlCIStub.cpp + +USERINCLUDE ../Inc +USERINCLUDE ../../Inc +USERINCLUDE ../../../Inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY AudioVibraControlCI.lib + +LINKAS AudioVibraControlCI.dll + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/audiovibracontrolcistub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/audiovibracontrolcistub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for audio vibra control custom interface +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +AudioVibraControlCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/audiovibracontrolcistub/src/AudioVibraControlCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/audiovibracontrolcistub/src/AudioVibraControlCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,108 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +// INCLUDE FILES +#include "AudioVibraControlCI.h" +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CAudioVibraControlCI::CAudioVibraControlCI +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CAudioVibraControlCI::CAudioVibraControlCI() + { + + } + +// ----------------------------------------------------------------------------- +// CAudioVibraControlCI::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CAudioVibraControlCI::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CAudioVibraControlCI::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CAudioVibraControlCI* CAudioVibraControlCI::NewL() + { + CAudioVibraControlCI* self = new (ELeave)CAudioVibraControlCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// Destructor +EXPORT_C CAudioVibraControlCI::~CAudioVibraControlCI() + { + + } + +// ----------------------------------------------------------------------------- +// CAudioVibraControlCI::StartVibra +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CAudioVibraControlCI::StartVibra() + { + RDebug::Print(_L("CAudioVibraControlCI::StartVibra")); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CAudioVibraControlCI::StopVibra +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CAudioVibraControlCI::StopVibra() + { + RDebug::Print(_L("CAudioVibraControlCI::StopVibra")); + return KErrNone; + } + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/eaacplusdecoderintfccistub/BWINS/EAacPlusDecoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/eaacplusdecoderintfccistub/BWINS/EAacPlusDecoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,15 @@ +EXPORTS + ??1CEAacPlusDecoderIntfcCI@@UAE@XZ @ 1 NONAME ; CEAacPlusDecoderIntfcCI::~CEAacPlusDecoderIntfcCI(void) + ?ApplyConfig@CEAacPlusDecoderIntfcCI@@UAEHXZ @ 2 NONAME ; int CEAacPlusDecoderIntfcCI::ApplyConfig(void) + ?GetAudioObjectType@CEAacPlusDecoderIntfcCI@@UAEHAAW4TAudioObjectType@CEAacPlusDecoderIntfc@@@Z @ 3 NONAME ; int CEAacPlusDecoderIntfcCI::GetAudioObjectType(enum CEAacPlusDecoderIntfc::TAudioObjectType &) + ?GetDownSampledMode@CEAacPlusDecoderIntfcCI@@UAEHAAH@Z @ 4 NONAME ; int CEAacPlusDecoderIntfcCI::GetDownSampledMode(int &) + ?GetInputSamplingFrequency@CEAacPlusDecoderIntfcCI@@UAEHAAI@Z @ 5 NONAME ; int CEAacPlusDecoderIntfcCI::GetInputSamplingFrequency(unsigned int &) + ?GetNumOfChannels@CEAacPlusDecoderIntfcCI@@UAEHAAI@Z @ 6 NONAME ; int CEAacPlusDecoderIntfcCI::GetNumOfChannels(unsigned int &) + ?GetSbr@CEAacPlusDecoderIntfcCI@@UAEHAAH@Z @ 7 NONAME ; int CEAacPlusDecoderIntfcCI::GetSbr(int &) + ?NewL@CEAacPlusDecoderIntfcCI@@SAPAV1@XZ @ 8 NONAME ; class CEAacPlusDecoderIntfcCI * CEAacPlusDecoderIntfcCI::NewL(void) + ?SetAudioObjectType@CEAacPlusDecoderIntfcCI@@UAEXW4TAudioObjectType@CEAacPlusDecoderIntfc@@@Z @ 9 NONAME ; void CEAacPlusDecoderIntfcCI::SetAudioObjectType(enum CEAacPlusDecoderIntfc::TAudioObjectType) + ?SetDownSampledMode@CEAacPlusDecoderIntfcCI@@UAEXH@Z @ 10 NONAME ; void CEAacPlusDecoderIntfcCI::SetDownSampledMode(int) + ?SetInputSamplingFrequency@CEAacPlusDecoderIntfcCI@@UAEXI@Z @ 11 NONAME ; void CEAacPlusDecoderIntfcCI::SetInputSamplingFrequency(unsigned int) + ?SetNumOfChannels@CEAacPlusDecoderIntfcCI@@UAEXI@Z @ 12 NONAME ; void CEAacPlusDecoderIntfcCI::SetNumOfChannels(unsigned int) + ?SetSbr@CEAacPlusDecoderIntfcCI@@UAEXH@Z @ 13 NONAME ; void CEAacPlusDecoderIntfcCI::SetSbr(int) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/eaacplusdecoderintfccistub/EABI/EAacPlusDecoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/eaacplusdecoderintfccistub/EABI/EAacPlusDecoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,19 @@ +EXPORTS + _ZN23CEAacPlusDecoderIntfcCI11ApplyConfigEv @ 1 NONAME + _ZN23CEAacPlusDecoderIntfcCI16GetNumOfChannelsERj @ 2 NONAME + _ZN23CEAacPlusDecoderIntfcCI16SetNumOfChannelsEj @ 3 NONAME + _ZN23CEAacPlusDecoderIntfcCI18GetAudioObjectTypeERN21CEAacPlusDecoderIntfc16TAudioObjectTypeE @ 4 NONAME + _ZN23CEAacPlusDecoderIntfcCI18GetDownSampledModeERi @ 5 NONAME + _ZN23CEAacPlusDecoderIntfcCI18SetAudioObjectTypeEN21CEAacPlusDecoderIntfc16TAudioObjectTypeE @ 6 NONAME + _ZN23CEAacPlusDecoderIntfcCI18SetDownSampledModeEi @ 7 NONAME + _ZN23CEAacPlusDecoderIntfcCI25GetInputSamplingFrequencyERj @ 8 NONAME + _ZN23CEAacPlusDecoderIntfcCI25SetInputSamplingFrequencyEj @ 9 NONAME + _ZN23CEAacPlusDecoderIntfcCI4NewLEv @ 10 NONAME + _ZN23CEAacPlusDecoderIntfcCI6GetSbrERi @ 11 NONAME + _ZN23CEAacPlusDecoderIntfcCI6SetSbrEi @ 12 NONAME + _ZN23CEAacPlusDecoderIntfcCID0Ev @ 13 NONAME + _ZN23CEAacPlusDecoderIntfcCID1Ev @ 14 NONAME + _ZN23CEAacPlusDecoderIntfcCID2Ev @ 15 NONAME + _ZTI23CEAacPlusDecoderIntfcCI @ 16 NONAME ; ## + _ZTV23CEAacPlusDecoderIntfcCI @ 17 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/eaacplusdecoderintfccistub/Group/EAacPlusDecoderIntfcCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/eaacplusdecoderintfccistub/Group/EAacPlusDecoderIntfcCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project specification for Enahanced AAC+ decoder configuration +* : Custom Interface stub implementation. +* Version : %version: bh1mmcf#7.1.7 % +* +*/ + +#include + +TARGET EAacPlusDecoderIntfcCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B1D + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE EAacPlusDecoderIntfcCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY EAacPlusDecoderIntfcCI.lib + +LINKAS EAacPlusDecoderIntfcCI.dll + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/eaacplusdecoderintfccistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/eaacplusdecoderintfccistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for Enahanced AAC+ Decoder Custom Interface +* : stub implementation. +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +EAacPlusDecoderIntfcCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/eaacplusdecoderintfccistub/src/EAacPlusDecoderIntfcCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/eaacplusdecoderintfccistub/src/EAacPlusDecoderIntfcCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,254 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Custom Interface stub implementation for eAAC+ decoder. +* +*/ + + +// INCLUDE FILES +#include +#include "EAacPlusDecoderIntfcCI.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +/** + * CEAacPlusDecoderIntfcCI::CEAacPlusDecoderIntfcCI + * C++ default constructor can NOT contain any code, that might leave. + */ +CEAacPlusDecoderIntfcCI::CEAacPlusDecoderIntfcCI() + { + } + +/** + * CEAacPlusDecoderIntfcCI::ConstructL + * Symbian 2nd phase constructor can leave. + */ +void CEAacPlusDecoderIntfcCI::ConstructL() + { + } + +/** + * CEAacPlusDecoderIntfcCI::NewL + * Two-phased constructor. + */ +EXPORT_C CEAacPlusDecoderIntfcCI* CEAacPlusDecoderIntfcCI::NewL() + { + CEAacPlusDecoderIntfcCI* self = new (ELeave)CEAacPlusDecoderIntfcCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +/** + * Destructor + */ +EXPORT_C CEAacPlusDecoderIntfcCI::~CEAacPlusDecoderIntfcCI() + { + } + + +// From CEAacPlusDecoderIntfc + +/** + * Configures decoder's profile defined by TAudioObjectType. + * (other items defined in the header) + */ +EXPORT_C void CEAacPlusDecoderIntfcCI::SetAudioObjectType( + TAudioObjectType aAudioObjectType) + { + iAudioObjectType = aAudioObjectType; + +#ifdef _DEBUG + RDebug::Print(_L("CEAacPlusDecoderIntfcCI::SetAudioObjectType - object type[%d]"), + iAudioObjectType); +#endif //_DEBUG + } + +/** + * Configures decoder's input sampling frequency. + * (other items defined in the header) + */ +EXPORT_C void CEAacPlusDecoderIntfcCI::SetInputSamplingFrequency( + TUint aInputSamplingFrequency) + { + iInputSamplingFrequency = aInputSamplingFrequency; + +#ifdef _DEBUG + RDebug::Print(_L("CEAacPlusDecoderIntfcCI::SetInputSamplingFrequency [%d]"), + iInputSamplingFrequency); +#endif //_DEBUG + } + +/** + * Configures decoder's channel settings. + * (other items defined in the header) + */ +EXPORT_C void CEAacPlusDecoderIntfcCI::SetNumOfChannels(TUint aNumChannels) + { + iNumOfChannels = aNumChannels; + +#ifdef _DEBUG + RDebug::Print(_L("CEAacPlusDecoderIntfcCI::SetNumOfChannels [%d]"), + iNumOfChannels); +#endif //_DEBUG + } + +/** + * Configures decoder's SBR settings. + * (other items defined in the header) + */ +EXPORT_C void CEAacPlusDecoderIntfcCI::SetSbr(TBool aSbrEnabled) + { + iSbrEnabled = aSbrEnabled; + +#ifdef _DEBUG + RDebug::Print(_L("CEAacPlusDecoderIntfcCI::SetSbr [%d]"), iSbrEnabled); +#endif //_DEBUG + } + +/** + * Configures decoder's DSM settings. + * (other items defined in the header) + */ +EXPORT_C void CEAacPlusDecoderIntfcCI::SetDownSampledMode(TBool aDsmEnabled) + { + iDsmEnabled = aDsmEnabled; + +#ifdef _DEBUG + RDebug::Print(_L("CEAacPlusDecoderIntfcCI::SetDownSampledMode [%d]"), + iDsmEnabled); +#endif //_DEBUG + } + +/** + * Returns decoder's AAC profile settings. + * (other items defined in the header) + */ +EXPORT_C TInt CEAacPlusDecoderIntfcCI::GetAudioObjectType( + TAudioObjectType& aAudioObjectType) + { + aAudioObjectType = iCurrentAudioObjectType; + +#ifdef _DEBUG + RDebug::Print(_L("CEAacPlusDecoderIntfcCI::GetAudioObjectType [%d]"), + iAudioObjectType); +#endif //_DEBUG + + return KErrNone; + } + +/** + * Returns decoder's input sampling frequency settings. + * (other items defined in the header) + */ +EXPORT_C TInt CEAacPlusDecoderIntfcCI::GetInputSamplingFrequency( + TUint& aInputSamplingFrequency) + { + aInputSamplingFrequency = iCurrentInputSamplingFrequency; + +#ifdef _DEBUG + RDebug::Print(_L("CEAacPlusDecoderIntfcCI::GetInputSamplingFrequency [%d]"), + iInputSamplingFrequency); +#endif //_DEBUG + + return KErrNone; + } + +/** + * Returns decoder's channel settings. + * (other items defined in the header) + */ +EXPORT_C TInt CEAacPlusDecoderIntfcCI::GetNumOfChannels(TUint& aNumOfChannels) + { + aNumOfChannels = iCurrentNumOfChannels; + +#ifdef _DEBUG + RDebug::Print(_L("CEAacPlusDecoderIntfcCI::GetNumOfChannels [%d]"), + iCurrentNumOfChannels); +#endif //_DEBUG + + return KErrNone; + } + +/** + * Returns decoder's SBR settings. + * (other items defined in the header) + */ +EXPORT_C TInt CEAacPlusDecoderIntfcCI::GetSbr(TBool& aSbrEnabled) + { + aSbrEnabled = iCurrentSbrEnabled; + +#ifdef _DEBUG + RDebug::Print(_L("CEAacPlusDecoderIntfcCI::GetSbr [%d]"), + iCurrentSbrEnabled); +#endif //_DEBUG + + return KErrNone; + } + +/** + * Returns decoder's DSM settings. + * (other items defined in the header) + */ +EXPORT_C TInt CEAacPlusDecoderIntfcCI::GetDownSampledMode(TBool& aDsmEnabled) + { + aDsmEnabled = iCurrentDsmEnabled; + +#ifdef _DEBUG + RDebug::Print(_L("CEAacPlusDecoderIntfcCI::GetDownSampledMode [%d]"), + iCurrentDsmEnabled); +#endif //_DEBUG + + return KErrNone; + } + +/** + * Applies configuration settings to the decoder. + * (other items defined in the header) + */ +EXPORT_C TInt CEAacPlusDecoderIntfcCI::ApplyConfig() + { + iCurrentAudioObjectType = iAudioObjectType; + iCurrentInputSamplingFrequency = iInputSamplingFrequency; + iCurrentNumOfChannels = iNumOfChannels; + iCurrentSbrEnabled = iSbrEnabled; + iCurrentDsmEnabled = iDsmEnabled; + +#ifdef _DEBUG + RDebug::Print(_L("CEAacPlusDecoderIntfcCI::ApplyConfig - eAAC+ Config Applied")); +#endif //_DEBUG + + return KErrNone; + } + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/errorconcealmentintfccistub/BWINS/ErrorConcealmentIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/errorconcealmentintfccistub/BWINS/ErrorConcealmentIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,7 @@ +EXPORTS + ??1CErrorConcealmentIntfcCI@@UAE@XZ @ 1 NONAME ; CErrorConcealmentIntfcCI::~CErrorConcealmentIntfcCI(void) + ?ConcealErrorForNextBuffer@CErrorConcealmentIntfcCI@@UAEHXZ @ 2 NONAME ; int CErrorConcealmentIntfcCI::ConcealErrorForNextBuffer(void) + ?FrameModeRqrdForEC@CErrorConcealmentIntfcCI@@UAEHAAH@Z @ 3 NONAME ; int CErrorConcealmentIntfcCI::FrameModeRqrdForEC(int &) + ?NewL@CErrorConcealmentIntfcCI@@SAPAV1@XZ @ 4 NONAME ; class CErrorConcealmentIntfcCI * CErrorConcealmentIntfcCI::NewL(void) + ?SetFrameMode@CErrorConcealmentIntfcCI@@UAEHH@Z @ 5 NONAME ; int CErrorConcealmentIntfcCI::SetFrameMode(int) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/errorconcealmentintfccistub/EABI/ErrorConcealmentIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/errorconcealmentintfccistub/EABI/ErrorConcealmentIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,11 @@ +EXPORTS + _ZN24CErrorConcealmentIntfcCI12SetFrameModeEi @ 1 NONAME + _ZN24CErrorConcealmentIntfcCI18FrameModeRqrdForECERi @ 2 NONAME + _ZN24CErrorConcealmentIntfcCI25ConcealErrorForNextBufferEv @ 3 NONAME + _ZN24CErrorConcealmentIntfcCI4NewLEv @ 4 NONAME + _ZN24CErrorConcealmentIntfcCID0Ev @ 5 NONAME + _ZN24CErrorConcealmentIntfcCID1Ev @ 6 NONAME + _ZN24CErrorConcealmentIntfcCID2Ev @ 7 NONAME + _ZTI24CErrorConcealmentIntfcCI @ 8 NONAME ; ## + _ZTV24CErrorConcealmentIntfcCI @ 9 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/errorconcealmentintfccistub/group/ErrorConcealmentIntfcCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/errorconcealmentintfccistub/group/ErrorConcealmentIntfcCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* Version : %version: bh1mmcf#14 % +* +*/ + + +#include + +TARGET ErrorConcealmentIntfcCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B0D + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE ErrorConcealmentIntfcCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY ErrorConcealmentIntfcCI.lib + +LINKAS ErrorConcealmentIntfcCI.dll + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/errorconcealmentintfccistub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/errorconcealmentintfccistub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for error concealment custom interface +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +ErrorConcealmentIntfcCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/errorconcealmentintfccistub/src/ErrorConcealmentIntfcCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/errorconcealmentintfccistub/src/ErrorConcealmentIntfcCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +// INCLUDE FILES +#include "ErrorConcealmentIntfcCI.h" +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CErrorConcealmentIntfcCI::CErrorConcealmentIntfcCI +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CErrorConcealmentIntfcCI::CErrorConcealmentIntfcCI() + { + + } + +// ----------------------------------------------------------------------------- +// CErrorConcealmentIntfcCI::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CErrorConcealmentIntfcCI::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CErrorConcealmentIntfcCI::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CErrorConcealmentIntfcCI* CErrorConcealmentIntfcCI::NewL() + { + CErrorConcealmentIntfcCI* self = new (ELeave)CErrorConcealmentIntfcCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// Destructor +EXPORT_C CErrorConcealmentIntfcCI::~CErrorConcealmentIntfcCI() + { + + } + +// ----------------------------------------------------------------------------- +// CErrorConcealmentIntfcCI::ConcealErrorForNextBuffer +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CErrorConcealmentIntfcCI::ConcealErrorForNextBuffer() + { + RDebug::Print(_L("CErrorConcealmentIntfcCI::ConcealErrorForNextBuffer")); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CErrorConcealmentIntfcCI::SetFrameMode +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CErrorConcealmentIntfcCI::SetFrameMode(TBool aFrameMode) + { + TBool myFrameMode = aFrameMode; + RDebug::Print(_L("CErrorConcealmentIntfcCI::SetFrameMode frameMode[%d]"), myFrameMode); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CErrorConcealmentIntfcCI::FrameModeRqrdForEC +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CErrorConcealmentIntfcCI::FrameModeRqrdForEC(TBool& aFrameModeRqrd) + { + iFrameModeRqrd = !iFrameModeRqrd; + aFrameModeRqrd = iFrameModeRqrd; + RDebug::Print(_L("CErrorConcealmentIntfcCI::FrameModeRqrdForEC frameModeRqrd[%d]"), aFrameModeRqrd); + return KErrNone; + } diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711decoderintfccistub/BWINS/G711DecoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711decoderintfccistub/BWINS/G711DecoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,8 @@ +EXPORTS + ??1CG711DecoderIntfcCI@@UAE@XZ @ 1 NONAME ; CG711DecoderIntfcCI::~CG711DecoderIntfcCI(void) + ?GetCng@CG711DecoderIntfcCI@@UAEHAAH@Z @ 2 NONAME ; int CG711DecoderIntfcCI::GetCng(int &) + ?NewL@CG711DecoderIntfcCI@@SAPAV1@XZ @ 3 NONAME ; class CG711DecoderIntfcCI * CG711DecoderIntfcCI::NewL(void) + ?SetCng@CG711DecoderIntfcCI@@UAEHH@Z @ 4 NONAME ; int CG711DecoderIntfcCI::SetCng(int) + ?SetDecoderMode@CG711DecoderIntfcCI@@UAEHW4TDecodeMode@CG711DecoderIntfc@@@Z @ 5 NONAME ; int CG711DecoderIntfcCI::SetDecoderMode(enum CG711DecoderIntfc::TDecodeMode) + ?SetPlc@CG711DecoderIntfcCI@@UAEHH@Z @ 6 NONAME ; int CG711DecoderIntfcCI::SetPlc(int) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711decoderintfccistub/EABI/G711DecoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711decoderintfccistub/EABI/G711DecoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,12 @@ +EXPORTS + _ZN19CG711DecoderIntfcCI14SetDecoderModeEN17CG711DecoderIntfc11TDecodeModeE @ 1 NONAME + _ZN19CG711DecoderIntfcCI4NewLEv @ 2 NONAME + _ZN19CG711DecoderIntfcCI6GetCngERi @ 3 NONAME + _ZN19CG711DecoderIntfcCI6SetCngEi @ 4 NONAME + _ZN19CG711DecoderIntfcCI6SetPlcEi @ 5 NONAME + _ZN19CG711DecoderIntfcCID0Ev @ 6 NONAME + _ZN19CG711DecoderIntfcCID1Ev @ 7 NONAME + _ZN19CG711DecoderIntfcCID2Ev @ 8 NONAME + _ZTI19CG711DecoderIntfcCI @ 9 NONAME ; ## + _ZTV19CG711DecoderIntfcCI @ 10 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711decoderintfccistub/group/G711DecoderIntfcCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711decoderintfccistub/group/G711DecoderIntfcCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* Version : %version: bh1mmcf#14 % +* +*/ + + +#include + +TARGET G711DecoderIntfcCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B0E + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE G711DecoderIntfcCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY G711DecoderIntfcCI.lib + +LINKAS G711DecoderIntfcCI.dll + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711decoderintfccistub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711decoderintfccistub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for G711 decoder custom interface +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +G711DecoderIntfcCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711decoderintfccistub/src/G711DecoderIntfcCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711decoderintfccistub/src/G711DecoderIntfcCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,135 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +// INCLUDE FILES +#include "G711DecoderIntfcCI.h" +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CG711DecoderIntfcCI::CG711DecoderIntfcCI +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CG711DecoderIntfcCI::CG711DecoderIntfcCI() + { + + } + +// ----------------------------------------------------------------------------- +// CG711DecoderIntfcCI::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CG711DecoderIntfcCI::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CG711DecoderIntfcCI::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CG711DecoderIntfcCI* CG711DecoderIntfcCI::NewL() + { + CG711DecoderIntfcCI* self = new (ELeave)CG711DecoderIntfcCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// Destructor +EXPORT_C CG711DecoderIntfcCI::~CG711DecoderIntfcCI() + { + + } + +// ----------------------------------------------------------------------------- +// CG711DecoderIntfcCI::SetDecoderMode +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CG711DecoderIntfcCI::SetDecoderMode(TDecodeMode aDecodeMode) + { + TBool myDecodeMode = aDecodeMode; + RDebug::Print(_L("CG711DecoderIntfcCI::SetDecoderMode decodeMode[%d]"), myDecodeMode); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CG711DecoderIntfcCI::SetCng +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CG711DecoderIntfcCI::SetCng(TBool aCng) + { + iCng = aCng; + RDebug::Print(_L("CG711DecoderIntfcCI::SetCng cng[%d]"), iCng); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CG711DecoderIntfcCI::GetCng +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CG711DecoderIntfcCI::GetCng(TBool& aCng) + { + aCng = iCng; + RDebug::Print(_L("CG711DecoderIntfcCI::GetCng cng[%d]"), aCng); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CG711DecoderIntfcCI::SetPlc +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CG711DecoderIntfcCI::SetPlc(TBool aPlc) + { + TBool myPlc = aPlc; + RDebug::Print(_L("CG711DecoderIntfcCI::SetPlc plc[%d]"), myPlc); + return KErrNone; + } diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711encoderintfccistub/BWINS/G711EncoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711encoderintfccistub/BWINS/G711EncoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,7 @@ +EXPORTS + ??1CG711EncoderIntfcCI@@UAE@XZ @ 1 NONAME ; CG711EncoderIntfcCI::~CG711EncoderIntfcCI(void) + ?GetVadMode@CG711EncoderIntfcCI@@UAEHAAH@Z @ 2 NONAME ; int CG711EncoderIntfcCI::GetVadMode(int &) + ?NewL@CG711EncoderIntfcCI@@SAPAV1@XZ @ 3 NONAME ; class CG711EncoderIntfcCI * CG711EncoderIntfcCI::NewL(void) + ?SetEncoderMode@CG711EncoderIntfcCI@@UAEHW4TEncodeMode@CG711EncoderIntfc@@@Z @ 4 NONAME ; int CG711EncoderIntfcCI::SetEncoderMode(enum CG711EncoderIntfc::TEncodeMode) + ?SetVadMode@CG711EncoderIntfcCI@@UAEHH@Z @ 5 NONAME ; int CG711EncoderIntfcCI::SetVadMode(int) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711encoderintfccistub/EABI/G711EncoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711encoderintfccistub/EABI/G711EncoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,11 @@ +EXPORTS + _ZN19CG711EncoderIntfcCI10GetVadModeERi @ 1 NONAME + _ZN19CG711EncoderIntfcCI10SetVadModeEi @ 2 NONAME + _ZN19CG711EncoderIntfcCI14SetEncoderModeEN17CG711EncoderIntfc11TEncodeModeE @ 3 NONAME + _ZN19CG711EncoderIntfcCI4NewLEv @ 4 NONAME + _ZN19CG711EncoderIntfcCID0Ev @ 5 NONAME + _ZN19CG711EncoderIntfcCID1Ev @ 6 NONAME + _ZN19CG711EncoderIntfcCID2Ev @ 7 NONAME + _ZTI19CG711EncoderIntfcCI @ 8 NONAME ; ## + _ZTV19CG711EncoderIntfcCI @ 9 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711encoderintfccistub/group/G711EncoderIntfcCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711encoderintfccistub/group/G711EncoderIntfcCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* Version : %version: bh1mmcf#14 % +* +*/ + + +#include + +TARGET G711EncoderIntfcCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B0F + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE G711EncoderIntfcCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY G711EncoderIntfcCI.lib + +LINKAS G711EncoderIntfcCI.dll + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711encoderintfccistub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711encoderintfccistub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for G711 encoder custom interface +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +G711EncoderIntfcCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711encoderintfccistub/src/G711EncoderIntfcCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g711encoderintfccistub/src/G711EncoderIntfcCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +// INCLUDE FILES +#include "G711EncoderIntfcCI.h" +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CG711EncoderIntfcCI::CG711EncoderIntfcCI +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CG711EncoderIntfcCI::CG711EncoderIntfcCI() + { + + } + +// ----------------------------------------------------------------------------- +// CG711EncoderIntfcCI::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CG711EncoderIntfcCI::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CG711EncoderIntfcCI::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CG711EncoderIntfcCI* CG711EncoderIntfcCI::NewL() + { + CG711EncoderIntfcCI* self = new (ELeave)CG711EncoderIntfcCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// Destructor +EXPORT_C CG711EncoderIntfcCI::~CG711EncoderIntfcCI() + { + + } + +// ----------------------------------------------------------------------------- +// CG711EncoderIntfcCI::SetEncoderMode +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CG711EncoderIntfcCI::SetEncoderMode(TEncodeMode aEncodeMode) + { + TBool myEncodeMode = aEncodeMode; + RDebug::Print(_L("CG711EncoderIntfcCI::SetEncoderMode encodeMode[%d]"), myEncodeMode); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CG711EncoderIntfcCI::SetVadMode +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CG711EncoderIntfcCI::SetVadMode(TBool aVadMode) + { + iVadMode = aVadMode; + RDebug::Print(_L("CG711EncoderIntfcCI::SetVadMode VAD mode[%d]"), iVadMode); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CG711EncoderIntfcCI::GetVadMode +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CG711EncoderIntfcCI::GetVadMode(TBool& aVadMode) + { + aVadMode = iVadMode; + RDebug::Print(_L("CG711EncoderIntfcCI::GetVadMode VAD mode[%d]"), aVadMode); + return KErrNone; + } + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729decoderintfccistub/BWINS/G729DecoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729decoderintfccistub/BWINS/G729DecoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,5 @@ +EXPORTS + ??1CG729DecoderIntfcCI@@UAE@XZ @ 1 NONAME ; CG729DecoderIntfcCI::~CG729DecoderIntfcCI(void) + ?BadLsfNextBuffer@CG729DecoderIntfcCI@@UAEHXZ @ 2 NONAME ; int CG729DecoderIntfcCI::BadLsfNextBuffer(void) + ?NewL@CG729DecoderIntfcCI@@SAPAV1@XZ @ 3 NONAME ; class CG729DecoderIntfcCI * CG729DecoderIntfcCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729decoderintfccistub/EABI/G729DecoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729decoderintfccistub/EABI/G729DecoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,9 @@ +EXPORTS + _ZN19CG729DecoderIntfcCI16BadLsfNextBufferEv @ 1 NONAME + _ZN19CG729DecoderIntfcCI4NewLEv @ 2 NONAME + _ZN19CG729DecoderIntfcCID0Ev @ 3 NONAME + _ZN19CG729DecoderIntfcCID1Ev @ 4 NONAME + _ZN19CG729DecoderIntfcCID2Ev @ 5 NONAME + _ZTI19CG729DecoderIntfcCI @ 6 NONAME ; ## + _ZTV19CG729DecoderIntfcCI @ 7 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729decoderintfccistub/group/G729DecoderIntfcCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729decoderintfccistub/group/G729DecoderIntfcCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* Version : %version: bh1mmcf#10.1.7 % +* +*/ + + +#include + +TARGET G729DecoderIntfcCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B10 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE G729DecoderIntfcCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY G729DecoderIntfcCI.lib + +LINKAS G729DecoderIntfcCI.dll + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729decoderintfccistub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729decoderintfccistub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for G729 decoder custom interface +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +G729DecoderIntfcCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729decoderintfccistub/src/G729DecoderIntfcCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729decoderintfccistub/src/G729DecoderIntfcCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +// INCLUDE FILES +#include "G729DecoderIntfcCI.h" +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CG729DecoderIntfcCI::CG729DecoderIntfcCI +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CG729DecoderIntfcCI::CG729DecoderIntfcCI() + { + + } + +// ----------------------------------------------------------------------------- +// CG729DecoderIntfcCI::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CG729DecoderIntfcCI::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CG729DecoderIntfcCI::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CG729DecoderIntfcCI* CG729DecoderIntfcCI::NewL() + { + CG729DecoderIntfcCI* self = new (ELeave)CG729DecoderIntfcCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// Destructor +EXPORT_C CG729DecoderIntfcCI::~CG729DecoderIntfcCI() + { + + } + +// ----------------------------------------------------------------------------- +// CG729DecoderIntfcCI::BadLsfNextBuffer +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CG729DecoderIntfcCI::BadLsfNextBuffer() + { + RDebug::Print(_L("CG729DecoderIntfcCI::BadLsfNextBuffer")); + return KErrNone; + } + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729encoderintfccistub/BWINS/G729EncoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729encoderintfccistub/BWINS/G729EncoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + ??1CG729EncoderIntfcCI@@UAE@XZ @ 1 NONAME ; CG729EncoderIntfcCI::~CG729EncoderIntfcCI(void) + ?GetVadMode@CG729EncoderIntfcCI@@UAEHAAH@Z @ 2 NONAME ; int CG729EncoderIntfcCI::GetVadMode(int &) + ?NewL@CG729EncoderIntfcCI@@SAPAV1@XZ @ 3 NONAME ; class CG729EncoderIntfcCI * CG729EncoderIntfcCI::NewL(void) + ?SetVadMode@CG729EncoderIntfcCI@@UAEHH@Z @ 4 NONAME ; int CG729EncoderIntfcCI::SetVadMode(int) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729encoderintfccistub/EABI/G729EncoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729encoderintfccistub/EABI/G729EncoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,10 @@ +EXPORTS + _ZN19CG729EncoderIntfcCI10GetVadModeERi @ 1 NONAME + _ZN19CG729EncoderIntfcCI10SetVadModeEi @ 2 NONAME + _ZN19CG729EncoderIntfcCI4NewLEv @ 3 NONAME + _ZN19CG729EncoderIntfcCID0Ev @ 4 NONAME + _ZN19CG729EncoderIntfcCID1Ev @ 5 NONAME + _ZN19CG729EncoderIntfcCID2Ev @ 6 NONAME + _ZTI19CG729EncoderIntfcCI @ 7 NONAME ; ## + _ZTV19CG729EncoderIntfcCI @ 8 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729encoderintfccistub/group/G729EncoderIntfcCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729encoderintfccistub/group/G729EncoderIntfcCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* Version : %version: bh1mmcf#14 % +* +*/ + + +#include + +TARGET G729EncoderIntfcCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B11 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + + +SOURCEPATH ../src +SOURCE G729EncoderIntfcCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY G729EncoderIntfcCI.lib + +LINKAS G729EncoderIntfcCI.dll + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729encoderintfccistub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729encoderintfccistub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for G729 encoder custom interface +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +G729EncoderIntfcCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729encoderintfccistub/src/G729EncoderIntfcCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/g729encoderintfccistub/src/G729EncoderIntfcCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +// INCLUDE FILES +#include "G729EncoderIntfcCI.h" +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CG729EncoderIntfcCI::CG729EncoderIntfcCI +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CG729EncoderIntfcCI::CG729EncoderIntfcCI() + { + + } + +// ----------------------------------------------------------------------------- +// CG729EncoderIntfcCI::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CG729EncoderIntfcCI::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CG729EncoderIntfcCI::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CG729EncoderIntfcCI* CG729EncoderIntfcCI::NewL() + { + CG729EncoderIntfcCI* self = new (ELeave)CG729EncoderIntfcCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// Destructor +EXPORT_C CG729EncoderIntfcCI::~CG729EncoderIntfcCI() + { + + } + + +EXPORT_C TInt CG729EncoderIntfcCI::SetVadMode(TBool aVadMode) + { + iVadMode = aVadMode; + RDebug::Print(_L("CG729EncoderIntfcCI::SetVadMode VAD mode[%d]"), iVadMode); + return KErrNone; + } + +EXPORT_C TInt CG729EncoderIntfcCI::GetVadMode(TBool& aVadMode) + { + aVadMode = iVadMode; + RDebug::Print(_L("CG729EncoderIntfcCI::GetVadMode VAD mode[%d]"), aVadMode); + return KErrNone; + } diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +#include "../aacdecoderconfigcistub/group/bld.inf" +//#include "../audiovibracontrolcistub/group/bld.inf" //Audio vibra Control API is deprecated +#include "../eaacplusdecoderintfccistub/Group/bld.inf" +#include "../errorconcealmentintfccistub/group/bld.inf" +#include "../g711decoderintfccistub/group/bld.inf" +#include "../g711encoderintfccistub/group/bld.inf" +#include "../g729decoderintfccistub/group/bld.inf" +#include "../g729encoderintfccistub/group/bld.inf" +#include "../ilbcdecoderintfccistub/group/bld.inf" +#include "../ilbcencoderintfccistub/group/bld.inf" +#include "../sbcencoderintfccistub/Group/bld.inf" +#include "../speechencoderconfigcistub/group/bld.inf" +#include "../ra8decoderintfccistub/Group/bld.inf" +#include "../wmadecodercintfccistub/group/bld.inf" + +// End of File + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcdecoderintfccistub/BWINS/IlbcDecoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcdecoderintfccistub/BWINS/IlbcDecoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,7 @@ +EXPORTS + ??1CIlbcDecoderIntfcCI@@UAE@XZ @ 1 NONAME ; CIlbcDecoderIntfcCI::~CIlbcDecoderIntfcCI(void) + ?GetCng@CIlbcDecoderIntfcCI@@UAEHAAH@Z @ 2 NONAME ; int CIlbcDecoderIntfcCI::GetCng(int &) + ?NewL@CIlbcDecoderIntfcCI@@SAPAV1@XZ @ 3 NONAME ; class CIlbcDecoderIntfcCI * CIlbcDecoderIntfcCI::NewL(void) + ?SetCng@CIlbcDecoderIntfcCI@@UAEHH@Z @ 4 NONAME ; int CIlbcDecoderIntfcCI::SetCng(int) + ?SetDecoderMode@CIlbcDecoderIntfcCI@@UAEHW4TDecodeMode@CIlbcDecoderIntfc@@@Z @ 5 NONAME ; int CIlbcDecoderIntfcCI::SetDecoderMode(enum CIlbcDecoderIntfc::TDecodeMode) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcdecoderintfccistub/EABI/IlbcDecoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcdecoderintfccistub/EABI/IlbcDecoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,11 @@ +EXPORTS + _ZN19CIlbcDecoderIntfcCI14SetDecoderModeEN17CIlbcDecoderIntfc11TDecodeModeE @ 1 NONAME + _ZN19CIlbcDecoderIntfcCI4NewLEv @ 2 NONAME + _ZN19CIlbcDecoderIntfcCI6GetCngERi @ 3 NONAME + _ZN19CIlbcDecoderIntfcCI6SetCngEi @ 4 NONAME + _ZN19CIlbcDecoderIntfcCID0Ev @ 5 NONAME + _ZN19CIlbcDecoderIntfcCID1Ev @ 6 NONAME + _ZN19CIlbcDecoderIntfcCID2Ev @ 7 NONAME + _ZTI19CIlbcDecoderIntfcCI @ 8 NONAME ; ## + _ZTV19CIlbcDecoderIntfcCI @ 9 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcdecoderintfccistub/group/IlbcDecoderIntfcCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcdecoderintfccistub/group/IlbcDecoderIntfcCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* Version : %version: bh1mmcf#14 % +* +*/ + + +#include + +TARGET IlbcDecoderIntfcCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B12 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE IlbcDecoderIntfcCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY IlbcDecoderIntfcCI.lib + +LINKAS IlbcDecoderIntfcCI.dll + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcdecoderintfccistub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcdecoderintfccistub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for Ilbc decoder custom interface +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +IlbcDecoderIntfcCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcdecoderintfccistub/src/IlbcDecoderIntfcCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcdecoderintfccistub/src/IlbcDecoderIntfcCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +// INCLUDE FILES +#include "IlbcDecoderIntfcCI.h" +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CIlbcDecoderIntfcCI::CIlbcDecoderIntfcCI +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CIlbcDecoderIntfcCI::CIlbcDecoderIntfcCI() + { + + } + +// ----------------------------------------------------------------------------- +// CIlbcDecoderIntfcCI::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CIlbcDecoderIntfcCI::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CIlbcDecoderIntfcCI::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CIlbcDecoderIntfcCI* CIlbcDecoderIntfcCI::NewL() + { + CIlbcDecoderIntfcCI* self = new (ELeave)CIlbcDecoderIntfcCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// Destructor +EXPORT_C CIlbcDecoderIntfcCI::~CIlbcDecoderIntfcCI() + { + + } + +// ----------------------------------------------------------------------------- +// CIlbcDecoderIntfcCI::SetDecoderMode +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CIlbcDecoderIntfcCI::SetDecoderMode(TDecodeMode aDecodeMode) + { + TBool myDecodeMode = aDecodeMode; + RDebug::Print(_L("CIlbcDecoderIntfcCI::SetDecoderMode decodeMode[%d]"), myDecodeMode); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CIlbcDecoderIntfcCI::SetCng +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CIlbcDecoderIntfcCI::SetCng(TBool aCng) + { + iCng = aCng; + RDebug::Print(_L("CIlbcDecoderIntfcCI::SetCng cng[%d]"), iCng); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CIlbcDecoderIntfcCI::GetCng +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CIlbcDecoderIntfcCI::GetCng(TBool& aCng) + { + aCng = iCng; + RDebug::Print(_L("CIlbcDecoderIntfcCI::GetCng cng[%d]"), aCng); + return KErrNone; + } diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcencoderintfccistub/BWINS/IlbcEncoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcencoderintfccistub/BWINS/IlbcEncoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,7 @@ +EXPORTS + ??1CIlbcEncoderIntfcCI@@UAE@XZ @ 1 NONAME ; CIlbcEncoderIntfcCI::~CIlbcEncoderIntfcCI(void) + ?GetVadMode@CIlbcEncoderIntfcCI@@UAEHAAH@Z @ 2 NONAME ; int CIlbcEncoderIntfcCI::GetVadMode(int &) + ?NewL@CIlbcEncoderIntfcCI@@SAPAV1@XZ @ 3 NONAME ; class CIlbcEncoderIntfcCI * CIlbcEncoderIntfcCI::NewL(void) + ?SetEncoderMode@CIlbcEncoderIntfcCI@@UAEHW4TEncodeMode@CIlbcEncoderIntfc@@@Z @ 4 NONAME ; int CIlbcEncoderIntfcCI::SetEncoderMode(enum CIlbcEncoderIntfc::TEncodeMode) + ?SetVadMode@CIlbcEncoderIntfcCI@@UAEHH@Z @ 5 NONAME ; int CIlbcEncoderIntfcCI::SetVadMode(int) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcencoderintfccistub/EABI/IlbcEncoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcencoderintfccistub/EABI/IlbcEncoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,11 @@ +EXPORTS + _ZN19CIlbcEncoderIntfcCI10GetVadModeERi @ 1 NONAME + _ZN19CIlbcEncoderIntfcCI10SetVadModeEi @ 2 NONAME + _ZN19CIlbcEncoderIntfcCI14SetEncoderModeEN17CIlbcEncoderIntfc11TEncodeModeE @ 3 NONAME + _ZN19CIlbcEncoderIntfcCI4NewLEv @ 4 NONAME + _ZN19CIlbcEncoderIntfcCID0Ev @ 5 NONAME + _ZN19CIlbcEncoderIntfcCID1Ev @ 6 NONAME + _ZN19CIlbcEncoderIntfcCID2Ev @ 7 NONAME + _ZTI19CIlbcEncoderIntfcCI @ 8 NONAME ; ## + _ZTV19CIlbcEncoderIntfcCI @ 9 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcencoderintfccistub/group/IlbcEncoderIntfcCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcencoderintfccistub/group/IlbcEncoderIntfcCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* Version : %version: bh1mmcf#10.1.7 % +* +*/ + + +#include + +TARGET IlbcEncoderIntfcCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B13 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE IlbcEncoderIntfcCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY IlbcEncoderIntfcCI.lib + +LINKAS IlbcEncoderIntfcCI.dll + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcencoderintfccistub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcencoderintfccistub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for Ilbc encoder custom interface +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +IlbcEncoderIntfcCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcencoderintfccistub/src/IlbcEncoderIntfcCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ilbcencoderintfccistub/src/IlbcEncoderIntfcCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +// INCLUDE FILES +#include "IlbcEncoderIntfcCI.h" +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CIlbcEncoderIntfcCI::CIlbcEncoderIntfcCI +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CIlbcEncoderIntfcCI::CIlbcEncoderIntfcCI() + { + + } + +// ----------------------------------------------------------------------------- +// CIlbcEncoderIntfcCI::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CIlbcEncoderIntfcCI::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CIlbcEncoderIntfcCI::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CIlbcEncoderIntfcCI* CIlbcEncoderIntfcCI::NewL() + { + CIlbcEncoderIntfcCI* self = new (ELeave)CIlbcEncoderIntfcCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// Destructor +EXPORT_C CIlbcEncoderIntfcCI::~CIlbcEncoderIntfcCI() + { + + } + +// ----------------------------------------------------------------------------- +// CIlbcEncoderIntfcCI::SetEncoderMode +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CIlbcEncoderIntfcCI::SetEncoderMode(TEncodeMode aEncodeMode) + { + TBool myEncodeMode = aEncodeMode; + RDebug::Print(_L("CIlbcEncoderIntfcCI::SetEncoderMode encodeMode[%d]"), myEncodeMode); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CIlbcEncoderIntfcCI::SetVadMode +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CIlbcEncoderIntfcCI::SetVadMode(TBool aVadMode) + { + iVadMode = aVadMode; + RDebug::Print(_L("CIlbcEncoderIntfcCI::SetVadMode VAD mode[%d]"), iVadMode); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CIlbcEncoderIntfcCI::GetVadMode +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CIlbcEncoderIntfcCI::GetVadMode(TBool& aVadMode) + { + aVadMode = iVadMode; + RDebug::Print(_L("CIlbcEncoderIntfcCI::GetVadMode VAD mode[%d]"), aVadMode); + return KErrNone; + } diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ra8decoderintfccistub/BWINS/Ra8DecoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ra8decoderintfccistub/BWINS/Ra8DecoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + ??1CRa8DecoderIntfcCI@@UAE@XZ @ 1 NONAME ; CRa8DecoderIntfcCI::~CRa8DecoderIntfcCI(void) + ?FrameNumber@CRa8DecoderIntfcCI@@UAEHXZ @ 2 NONAME ; int CRa8DecoderIntfcCI::FrameNumber(void) + ?NewL@CRa8DecoderIntfcCI@@SAPAV1@XZ @ 3 NONAME ; class CRa8DecoderIntfcCI * CRa8DecoderIntfcCI::NewL(void) + ?SetInitString@CRa8DecoderIntfcCI@@UAEHAAVTDesC8@@@Z @ 4 NONAME ; int CRa8DecoderIntfcCI::SetInitString(class TDesC8 &) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ra8decoderintfccistub/EABI/Ra8DecoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ra8decoderintfccistub/EABI/Ra8DecoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,10 @@ +EXPORTS + _ZN18CRa8DecoderIntfcCI11FrameNumberEv @ 1 NONAME + _ZN18CRa8DecoderIntfcCI13SetInitStringER6TDesC8 @ 2 NONAME + _ZN18CRa8DecoderIntfcCI4NewLEv @ 3 NONAME + _ZN18CRa8DecoderIntfcCID0Ev @ 4 NONAME + _ZN18CRa8DecoderIntfcCID1Ev @ 5 NONAME + _ZN18CRa8DecoderIntfcCID2Ev @ 6 NONAME + _ZTI18CRa8DecoderIntfcCI @ 7 NONAME ; ## + _ZTV18CRa8DecoderIntfcCI @ 8 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ra8decoderintfccistub/Group/Ra8DecoderIntfcCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ra8decoderintfccistub/Group/Ra8DecoderIntfcCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project specification for RA8 decoder configuration custom +* : interface stub implementation. +* Version : %version: bh1mmcf#8 % +* +*/ + + +#include + +TARGET Ra8DecoderIntfcCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B80 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE Ra8DecoderIntfcCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY Ra8DecoderIntfcCI.lib + +LINKAS Ra8DecoderIntfcCI.dll + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ra8decoderintfccistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ra8decoderintfccistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for RA8 decoder custom interface stub +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +Ra8DecoderIntfcCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/ra8decoderintfccistub/src/Ra8DecoderIntfcCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/ra8decoderintfccistub/src/Ra8DecoderIntfcCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Custom Interface stub object for configuring the RA8 decoder. +* +*/ + + +// INCLUDE FILES +#include +#include "Ra8CustomInterfaceCI.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +/** + * CRa8DecoderIntfcCI::CRa8DecoderIntfcCI + * C++ default constructor. + */ +CRa8DecoderIntfcCI::CRa8DecoderIntfcCI() + { + } + +/** + * CRa8DecoderIntfcCI::ConstructL + * Symbian 2nd phase constructor. + */ +void CRa8DecoderIntfcCI::ConstructL() + { + } + +/** + * CRa8DecoderIntfcCI::NewL + * Two-phased constructor. + */ +EXPORT_C CRa8DecoderIntfcCI* CRa8DecoderIntfcCI::NewL() + { + CRa8DecoderIntfcCI* self = new (ELeave)CRa8DecoderIntfcCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +/** + * Destructor + */ +EXPORT_C CRa8DecoderIntfcCI::~CRa8DecoderIntfcCI() + { + } + +/** + * CRa8DecoderIntfcCI::FrameNumber + * Returns frame number from the codec. + * (other items were commented in a header). + */ +EXPORT_C TInt CRa8DecoderIntfcCI::FrameNumber() + { + TInt frameNum(125); //any number is good + +#ifdef _DEBUG + RDebug::Print(_L("CRa8DecoderIntfcCI::FrameNumber [%d]"), frameNum); +#endif + return frameNum; + } + +/* + * CRa8DecoderIntfcCI::SetInitString + * Processes received init string. + * (other items were commented in a header). + */ +EXPORT_C TInt CRa8DecoderIntfcCI::SetInitString(TDesC8& aInitString) + { +#ifdef _DEBUG + RDebug::Print(_L("CRa8DecoderIntfcCI::SetInitString")); +#endif + + TBuf<64> buf; + buf.Copy(aInitString); + +#ifdef _DEBUG + _LIT(KTest, "RECEIVED STRING: [%S]\n"); + RDebug::Print(KTest, &buf); +#endif + + return KErrNone; + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/rom/AudioCodecCI_Stubs.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/rom/AudioCodecCI_Stubs.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Image description file for project Audio Codec Stubs +* +*/ + + +#ifndef __AUDIOCODECCI_STUBS_IBY__ +#define __AUDIOCODECCI_STUBS_IBY__ + + +file=ABI_DIR\BUILD_DIR\AacDecoderConfigCI_stub.dll SHARED_LIB_DIR\AacDecoderConfigCI_stub.dll +file=ABI_DIR\BUILD_DIR\AudioVibraControlCI_stub.dll SHARED_LIB_DIR\AudioVibraControlCI_stub.dll +file=ABI_DIR\BUILD_DIR\ErrorConcealmentIntfcCI_stub.dll SHARED_LIB_DIR\ErrorConcealmentIntfcCI_stub.dll +file=ABI_DIR\BUILD_DIR\G711DecoderIntfcCI_stub.dll SHARED_LIB_DIR\G711DecoderIntfcCI_stub.dll +file=ABI_DIR\BUILD_DIR\G711EncoderIntfcCI_stub.dll SHARED_LIB_DIR\G711EncoderIntfcCI_stub.dll +file=ABI_DIR\BUILD_DIR\G729DecoderIntfcCI_stub.dll SHARED_LIB_DIR\G729DecoderIntfcCI_stub.dll +file=ABI_DIR\BUILD_DIR\G729EncoderIntfcCI_stub.dll SHARED_LIB_DIR\G729EncoderIntfcCI_stub.dll +file=ABI_DIR\BUILD_DIR\IlbcDecoderIntfcCI_stub.dll SHARED_LIB_DIR\IlbcDecoderIntfcCI_stub.dll +file=ABI_DIR\BUILD_DIR\IlbcEncoderIntfcCI_stub.dll SHARED_LIB_DIR\IlbcEncoderIntfcCI_stub.dll +file=ABI_DIR\BUILD_DIR\SpeechEncoderConfigCI_stub.dll SHARED_LIB_DIR\SpeechEncoderConfigCI_stub.dll +file=ABI_DIR\BUILD_DIR\EAacPlusDecoderIntfcCI_stub.dll SHARED_LIB_DIR\EAacPlusDecoderIntfcCI_stub.dll +file=ABI_DIR\BUILD_DIR\SbcEncoderIntfcCI_stub.dll SHARED_LIB_DIR\SbcEncoderIntfcCI_stub.dll +file=ABI_DIR\BUILD_DIR\Ra8DecoderIntfcCI_stub.dll SHARED_LIB_DIR\Ra8DecoderIntfcCI_stub.dll +file=ABI_DIR\BUILD_DIR\WmaDecoderIntfcCI_Stub.dll SHARED_LIB_DIR\WmaDecoderIntfcCI_Stub.dll + + +#endif __AUDIOCODECCI_STUBS_IBY__ diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/sbcencoderintfccistub/BWINS/SbcEncoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/sbcencoderintfccistub/BWINS/SbcEncoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,23 @@ +EXPORTS + ??1CSbcEncoderIntfcCI@@UAE@XZ @ 1 NONAME ; CSbcEncoderIntfcCI::~CSbcEncoderIntfcCI(void) + ?ApplyConfig@CSbcEncoderIntfcCI@@UAEHXZ @ 2 NONAME ; int CSbcEncoderIntfcCI::ApplyConfig(void) + ?GetAllocationMethod@CSbcEncoderIntfcCI@@UAEHAAW4TSbcAllocationMethod@CSbcEncoderIntfc@@@Z @ 3 NONAME ; int CSbcEncoderIntfcCI::GetAllocationMethod(enum CSbcEncoderIntfc::TSbcAllocationMethod &) + ?GetBitpoolSize@CSbcEncoderIntfcCI@@UAEHAAI@Z @ 4 NONAME ; int CSbcEncoderIntfcCI::GetBitpoolSize(unsigned int &) + ?GetChannelMode@CSbcEncoderIntfcCI@@UAEHAAW4TSbcChannelMode@CSbcEncoderIntfc@@@Z @ 5 NONAME ; int CSbcEncoderIntfcCI::GetChannelMode(enum CSbcEncoderIntfc::TSbcChannelMode &) + ?GetNumOfBlocks@CSbcEncoderIntfcCI@@UAEHAAI@Z @ 6 NONAME ; int CSbcEncoderIntfcCI::GetNumOfBlocks(unsigned int &) + ?GetNumOfSubbands@CSbcEncoderIntfcCI@@UAEHAAI@Z @ 7 NONAME ; int CSbcEncoderIntfcCI::GetNumOfSubbands(unsigned int &) + ?GetSamplingFrequency@CSbcEncoderIntfcCI@@UAEHAAI@Z @ 8 NONAME ; int CSbcEncoderIntfcCI::GetSamplingFrequency(unsigned int &) + ?GetSupportedAllocationMethods@CSbcEncoderIntfcCI@@UAEHAAV?$RArray@W4TSbcAllocationMethod@CSbcEncoderIntfc@@@@@Z @ 9 NONAME ; int CSbcEncoderIntfcCI::GetSupportedAllocationMethods(class RArray &) + ?GetSupportedBitpoolRange@CSbcEncoderIntfcCI@@UAEHAAI0@Z @ 10 NONAME ; int CSbcEncoderIntfcCI::GetSupportedBitpoolRange(unsigned int &, unsigned int &) + ?GetSupportedChannelModes@CSbcEncoderIntfcCI@@UAEHAAV?$RArray@W4TSbcChannelMode@CSbcEncoderIntfc@@@@@Z @ 11 NONAME ; int CSbcEncoderIntfcCI::GetSupportedChannelModes(class RArray &) + ?GetSupportedNumOfBlocks@CSbcEncoderIntfcCI@@UAEHAAV?$RArray@I@@@Z @ 12 NONAME ; int CSbcEncoderIntfcCI::GetSupportedNumOfBlocks(class RArray &) + ?GetSupportedNumOfSubbands@CSbcEncoderIntfcCI@@UAEHAAV?$RArray@I@@@Z @ 13 NONAME ; int CSbcEncoderIntfcCI::GetSupportedNumOfSubbands(class RArray &) + ?GetSupportedSamplingFrequencies@CSbcEncoderIntfcCI@@UAEHAAV?$RArray@I@@@Z @ 14 NONAME ; int CSbcEncoderIntfcCI::GetSupportedSamplingFrequencies(class RArray &) + ?NewL@CSbcEncoderIntfcCI@@SAPAV1@XZ @ 15 NONAME ; class CSbcEncoderIntfcCI * CSbcEncoderIntfcCI::NewL(void) + ?SetAllocationMethod@CSbcEncoderIntfcCI@@UAEXW4TSbcAllocationMethod@CSbcEncoderIntfc@@@Z @ 16 NONAME ; void CSbcEncoderIntfcCI::SetAllocationMethod(enum CSbcEncoderIntfc::TSbcAllocationMethod) + ?SetBitpoolSize@CSbcEncoderIntfcCI@@UAEXI@Z @ 17 NONAME ; void CSbcEncoderIntfcCI::SetBitpoolSize(unsigned int) + ?SetChannelMode@CSbcEncoderIntfcCI@@UAEXW4TSbcChannelMode@CSbcEncoderIntfc@@@Z @ 18 NONAME ; void CSbcEncoderIntfcCI::SetChannelMode(enum CSbcEncoderIntfc::TSbcChannelMode) + ?SetNumOfBlocks@CSbcEncoderIntfcCI@@UAEXI@Z @ 19 NONAME ; void CSbcEncoderIntfcCI::SetNumOfBlocks(unsigned int) + ?SetNumOfSubbands@CSbcEncoderIntfcCI@@UAEXI@Z @ 20 NONAME ; void CSbcEncoderIntfcCI::SetNumOfSubbands(unsigned int) + ?SetSamplingFrequency@CSbcEncoderIntfcCI@@UAEXI@Z @ 21 NONAME ; void CSbcEncoderIntfcCI::SetSamplingFrequency(unsigned int) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/sbcencoderintfccistub/EABI/SbcEncoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/sbcencoderintfccistub/EABI/SbcEncoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +EXPORTS + _ZN18CSbcEncoderIntfcCI11ApplyConfigEv @ 1 NONAME + _ZN18CSbcEncoderIntfcCI14GetBitpoolSizeERj @ 2 NONAME + _ZN18CSbcEncoderIntfcCI14GetChannelModeERN16CSbcEncoderIntfc15TSbcChannelModeE @ 3 NONAME + _ZN18CSbcEncoderIntfcCI14GetNumOfBlocksERj @ 4 NONAME + _ZN18CSbcEncoderIntfcCI14SetBitpoolSizeEj @ 5 NONAME + _ZN18CSbcEncoderIntfcCI14SetChannelModeEN16CSbcEncoderIntfc15TSbcChannelModeE @ 6 NONAME + _ZN18CSbcEncoderIntfcCI14SetNumOfBlocksEj @ 7 NONAME + _ZN18CSbcEncoderIntfcCI16GetNumOfSubbandsERj @ 8 NONAME + _ZN18CSbcEncoderIntfcCI16SetNumOfSubbandsEj @ 9 NONAME + _ZN18CSbcEncoderIntfcCI19GetAllocationMethodERN16CSbcEncoderIntfc20TSbcAllocationMethodE @ 10 NONAME + _ZN18CSbcEncoderIntfcCI19SetAllocationMethodEN16CSbcEncoderIntfc20TSbcAllocationMethodE @ 11 NONAME + _ZN18CSbcEncoderIntfcCI20GetSamplingFrequencyERj @ 12 NONAME + _ZN18CSbcEncoderIntfcCI20SetSamplingFrequencyEj @ 13 NONAME + _ZN18CSbcEncoderIntfcCI23GetSupportedNumOfBlocksER6RArrayIjE @ 14 NONAME + _ZN18CSbcEncoderIntfcCI24GetSupportedBitpoolRangeERjS0_ @ 15 NONAME + _ZN18CSbcEncoderIntfcCI24GetSupportedChannelModesER6RArrayIN16CSbcEncoderIntfc15TSbcChannelModeEE @ 16 NONAME + _ZN18CSbcEncoderIntfcCI25GetSupportedNumOfSubbandsER6RArrayIjE @ 17 NONAME + _ZN18CSbcEncoderIntfcCI29GetSupportedAllocationMethodsER6RArrayIN16CSbcEncoderIntfc20TSbcAllocationMethodEE @ 18 NONAME + _ZN18CSbcEncoderIntfcCI31GetSupportedSamplingFrequenciesER6RArrayIjE @ 19 NONAME + _ZN18CSbcEncoderIntfcCI4NewLEv @ 20 NONAME + _ZN18CSbcEncoderIntfcCID0Ev @ 21 NONAME + _ZN18CSbcEncoderIntfcCID1Ev @ 22 NONAME + _ZN18CSbcEncoderIntfcCID2Ev @ 23 NONAME + _ZTI18CSbcEncoderIntfcCI @ 24 NONAME ; ## + _ZTV18CSbcEncoderIntfcCI @ 25 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/sbcencoderintfccistub/Group/SbcEncoderIntfcCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/sbcencoderintfccistub/Group/SbcEncoderIntfcCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project specification for BT SBC Encoder configuration custom +* : interface stub implementation. +* Version : %version: bh1mmcf#10 % +* +*/ + + +#include + +TARGET SbcEncoderIntfcCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B0B + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE SbcEncoderIntfcCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY SbcEncoderIntfcCI.lib + +LINKAS SbcEncoderIntfcCI.dll + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/sbcencoderintfccistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/sbcencoderintfccistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for BT SBC encoder custom interface +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +SbcEncoderIntfcCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/sbcencoderintfccistub/src/SbcEncoderIntfcCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/sbcencoderintfccistub/src/SbcEncoderIntfcCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,408 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Custom Interface stub object for configuring the SBC encoder. +* +*/ + + +// INCLUDE FILES +#include +#include "SbcEncoderIntfcCI.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +/** + * CSbcEncoderIntfcCI::CSbcEncoderIntfcCI + * C++ default constructor. + */ +CSbcEncoderIntfcCI::CSbcEncoderIntfcCI() + { + } + +/** + * CSbcEncoderIntfcCI::ConstructL + * Symbian 2nd phase constructor. + */ +void CSbcEncoderIntfcCI::ConstructL() + { + } + +/** + * CSbcEncoderIntfcCI::NewL + * Two-phased constructor. + */ +EXPORT_C CSbcEncoderIntfcCI* CSbcEncoderIntfcCI::NewL() + { + CSbcEncoderIntfcCI* self = new (ELeave)CSbcEncoderIntfcCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +/** + * Destructor + */ +EXPORT_C CSbcEncoderIntfcCI::~CSbcEncoderIntfcCI() + { + } + +/** + * CSbcEncoderIntfcCI::GetSupportedSamplingFrequencies + * Returns and array of supported sampling frequencies. + * (other items were commented in a header). + */ +EXPORT_C TInt CSbcEncoderIntfcCI::GetSupportedSamplingFrequencies( + RArray& aSupportedSamplingFrequencies) + { + aSupportedSamplingFrequencies.Reset(); + aSupportedSamplingFrequencies.Append(16000); + aSupportedSamplingFrequencies.Append(32000); + aSupportedSamplingFrequencies.Append(44100); + aSupportedSamplingFrequencies.Append(48000); + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::GetSupportedSamplingFrequencies - Num of supported Fs[%d]"), + aSupportedSamplingFrequencies.Count()); +#endif + return KErrNone; + } + +/* + * CSbcEncoderIntfcCI::GetSupportedChannelModes + * Returns and array of supported channel modes. + * (other items were commented in a header). + */ +EXPORT_C TInt CSbcEncoderIntfcCI::GetSupportedChannelModes( + RArray& + aSupportedChannelModes) + { + aSupportedChannelModes.Reset(); + aSupportedChannelModes.Append(ESbcChannelMono); + aSupportedChannelModes.Append(ESbcChannelDual); + aSupportedChannelModes.Append(ESbcChannelStereo); + aSupportedChannelModes.Append(ESbcChannelJointStereo); + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::GetSupportedChannelModes - Num of supported ch modes[%d]"), + aSupportedChannelModes.Count()); +#endif + return KErrNone; + } + +/* + * CSbcEncoderIntfcCI::GetSupportedNumOfBlocks + * Returns an array of supported block numbers. + * (other items were commented in a header). + */ +EXPORT_C TInt CSbcEncoderIntfcCI::GetSupportedNumOfBlocks( + RArray& aSupportedNumOfBlocks) + { + aSupportedNumOfBlocks.Reset(); + aSupportedNumOfBlocks.Append(4); + aSupportedNumOfBlocks.Append(8); + aSupportedNumOfBlocks.Append(12); + aSupportedNumOfBlocks.Append(16); + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::GetSupportedNumOfBlocks - Num of supported blocks[%d]"), + aSupportedNumOfBlocks.Count()); +#endif + return KErrNone; + } + +/* + * CSbcEncoderIntfcCI::GetSupportedNumOfSubbands + * Returns an array of supported subbands. + * (other items were commented in a header). + */ +EXPORT_C TInt CSbcEncoderIntfcCI::GetSupportedNumOfSubbands( + RArray& aSupportedNumOfSubbands) + { + aSupportedNumOfSubbands.Reset(); + aSupportedNumOfSubbands.Append(4); + aSupportedNumOfSubbands.Append(8); + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::GetSupportedNumOfSubbands - Num of supported subbands[%d]"), + aSupportedNumOfSubbands.Count()); +#endif + return KErrNone; + } + +/* + * CSbcEncoderIntfcCI::GetSupportedAllocationMethods + * Returns an array of supported allocation methods. + * (other items were commented in a header). + */ +EXPORT_C TInt CSbcEncoderIntfcCI::GetSupportedAllocationMethods( + RArray& + aSupportedAllocationMethods) + { + aSupportedAllocationMethods.Reset(); + aSupportedAllocationMethods.Append(ESbcAllocationSNR); + aSupportedAllocationMethods.Append(ESbcAllocationLoudness); + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::GetSupportedAllocationMethods - Num of supported alloc methods[%d]"), + aSupportedAllocationMethods.Count()); +#endif + return KErrNone; + } + +/* + * CSbcEncoderIntfcCI::GetSupportedBitpoolRange + * Returns supported bitpool range. + * (other items were commented in a header). + */ +EXPORT_C TInt CSbcEncoderIntfcCI::GetSupportedBitpoolRange( + TUint& aMinSupportedBitpoolSize, + TUint& aMaxSupportedBitpoolSize) + { + aMinSupportedBitpoolSize = 2; + aMaxSupportedBitpoolSize = 250; + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::GetSupportedBitpoolRange - Min[%d] - Max [%d]"), + aMinSupportedBitpoolSize, + aMaxSupportedBitpoolSize); +#endif + return KErrNone; + } + +/* + * CSbcEncoderIntfcCI::SetSamplingFrequency + * Sets new sampling frequency. + * (other items were commented in a header). + */ +EXPORT_C void CSbcEncoderIntfcCI::SetSamplingFrequency(TUint aSamplingFrequency) + { + iSamplingFrequency = aSamplingFrequency; + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::SetSamplingFrequency [%d]"), + iSamplingFrequency); +#endif + } + +/* + * CSbcEncoderIntfcCI::GetSamplingFrequency + * Returns current sampling frequency. + * (other items were commented in a header). + */ +EXPORT_C TInt CSbcEncoderIntfcCI::GetSamplingFrequency( + TUint& aSamplingFrequency) + { + aSamplingFrequency = iCurrentSamplingFrequency; + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::GetSamplingFrequency [%d]"), + iCurrentSamplingFrequency); +#endif + return KErrNone; + } + +/* + * CSbcEncoderIntfcCI::SetChannelMode + * Sets new channel mode. + * (other items were commented in a header). + */ +EXPORT_C void CSbcEncoderIntfcCI::SetChannelMode(TSbcChannelMode aChannelMode) + { + iChannelMode = aChannelMode; + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::SetChannelMode [%d]"), iChannelMode); +#endif + } + +/* + * CSbcEncoderIntfcCI::GetChannelMode + * Returns current channel mode. + * (other items were commented in a header). + */ +EXPORT_C TInt CSbcEncoderIntfcCI::GetChannelMode(TSbcChannelMode& aChannelMode) + { + aChannelMode = iCurrentChannelMode; + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::GetChannelMode [%d]"), + iCurrentChannelMode); +#endif + return KErrNone; + } + +/* + * CSbcEncoderIntfcCI::SetNumOfSubbands + * Sets new number of subbands. + * (other items were commented in a header). + */ +EXPORT_C void CSbcEncoderIntfcCI::SetNumOfSubbands(TUint aNumOfSubbands) + { + iNumOfSubbands = aNumOfSubbands; + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::SetNumOfSubbands [%d]"), + iNumOfSubbands); +#endif + } + +/* + * CSbcEncoderIntfcCI::GetNumOfSubbands + * Returns current number of subbands. + * (other items were commented in a header). + */ +EXPORT_C TInt CSbcEncoderIntfcCI::GetNumOfSubbands(TUint& aNumOfSubbands) + { + aNumOfSubbands = iCurrentNumOfSubbands; + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::GetNumOfSubbands [%d]"), + iCurrentNumOfSubbands); +#endif + return KErrNone; + } + +/* + * CSbcEncoderIntfcCI::SetNumOfBlocks + * Sets new number of blocks. + * (other items were commented in a header). + */ +EXPORT_C void CSbcEncoderIntfcCI::SetNumOfBlocks(TUint aNumOfBlocks) + { + iNumOfBlocks = aNumOfBlocks; + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::SetNumOfBlocks [%d]"), iNumOfBlocks); +#endif + } + +/* + * CSbcEncoderIntfcCI::GetNumOfBlocks + * Returns current number of blocks. + * (other items were commented in a header). + */ +EXPORT_C TInt CSbcEncoderIntfcCI::GetNumOfBlocks(TUint& aNumOfBlocks) + { + aNumOfBlocks = iCurrentNumOfBlocks; + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::GetNumOfBlocks [%d]"), + iCurrentNumOfBlocks); +#endif + return KErrNone; + } + +/* + * CSbcEncoderIntfcCI::SetAllocationMethod + * Sets new allocation method. + * (other items were commented in a header). + */ +EXPORT_C void CSbcEncoderIntfcCI::SetAllocationMethod( + TSbcAllocationMethod aAllocationMethod) + { + iAllocationMethod = aAllocationMethod; + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::SetAllocationMethod [%d]"), + iAllocationMethod); +#endif + } + +/* + * CSbcEncoderIntfcCI::GetAllocationMethod + * Returns current allocation method. + * (other items were commented in a header). + */ +EXPORT_C TInt CSbcEncoderIntfcCI::GetAllocationMethod( + TSbcAllocationMethod& aAllocationMethod) + { + aAllocationMethod = iCurrentAllocationMethod; + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::GetAllocationMethod [%d]"), + iCurrentAllocationMethod); +#endif + return KErrNone; + } + +/* + * CSbcEncoderIntfcCI::SetBitpoolSize + * Sets new bitpool size. + * (other items were commented in a header). + */ +EXPORT_C void CSbcEncoderIntfcCI::SetBitpoolSize(TUint aBitpoolSize) + { + iBitpoolSize = aBitpoolSize; + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::SetBitpoolSize [%d]"), iBitpoolSize); +#endif + } + +/* + * CSbcEncoderIntfcCI::GetBitpoolSize + * Returns current bitpool size. + * (other items were commented in a header). + */ +EXPORT_C TInt CSbcEncoderIntfcCI::GetBitpoolSize(TUint& aBitpoolSize) + { + aBitpoolSize = iCurrentBitpoolSize; + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::GetBitpoolSize [%d]"), + iCurrentBitpoolSize); +#endif + return KErrNone; + } + +/* + * CSbcEncoderIntfcCI::ApplyConfig + * Commits new configutaion settings. + * (other items were commented in a header). + */ +EXPORT_C TInt CSbcEncoderIntfcCI::ApplyConfig() + { + iCurrentSamplingFrequency = iSamplingFrequency; + iCurrentChannelMode = iChannelMode; + iCurrentNumOfSubbands = iNumOfSubbands; + iCurrentNumOfBlocks = iNumOfBlocks; + iCurrentAllocationMethod = iAllocationMethod; + iCurrentBitpoolSize = iBitpoolSize; + +#ifdef _DEBUG + RDebug::Print(_L("CSbcEncoderIntfcCI::ApplyConfig - SBC config applied")); +#endif + return KErrNone; + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/speechencoderconfigcistub/BWINS/SpeechEncoderConfigCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/speechencoderconfigcistub/BWINS/SpeechEncoderConfigCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,9 @@ +EXPORTS + ??1CSpeechEncoderConfigCI@@UAE@XZ @ 1 NONAME ; CSpeechEncoderConfigCI::~CSpeechEncoderConfigCI(void) + ?GetBitrate@CSpeechEncoderConfigCI@@UAEHAAI@Z @ 2 NONAME ; int CSpeechEncoderConfigCI::GetBitrate(unsigned int &) + ?GetSupportedBitrates@CSpeechEncoderConfigCI@@UAEHAAV?$RArray@I@@@Z @ 3 NONAME ; int CSpeechEncoderConfigCI::GetSupportedBitrates(class RArray &) + ?GetVadMode@CSpeechEncoderConfigCI@@UAEHAAH@Z @ 4 NONAME ; int CSpeechEncoderConfigCI::GetVadMode(int &) + ?NewL@CSpeechEncoderConfigCI@@SAPAV1@XZ @ 5 NONAME ; class CSpeechEncoderConfigCI * CSpeechEncoderConfigCI::NewL(void) + ?SetBitrate@CSpeechEncoderConfigCI@@UAEHI@Z @ 6 NONAME ; int CSpeechEncoderConfigCI::SetBitrate(unsigned int) + ?SetVadMode@CSpeechEncoderConfigCI@@UAEHH@Z @ 7 NONAME ; int CSpeechEncoderConfigCI::SetVadMode(int) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/speechencoderconfigcistub/EABI/SpeechEncoderConfigCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/speechencoderconfigcistub/EABI/SpeechEncoderConfigCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,13 @@ +EXPORTS + _ZN22CSpeechEncoderConfigCI10GetBitrateERj @ 1 NONAME + _ZN22CSpeechEncoderConfigCI10GetVadModeERi @ 2 NONAME + _ZN22CSpeechEncoderConfigCI10SetBitrateEj @ 3 NONAME + _ZN22CSpeechEncoderConfigCI10SetVadModeEi @ 4 NONAME + _ZN22CSpeechEncoderConfigCI20GetSupportedBitratesER6RArrayIjE @ 5 NONAME + _ZN22CSpeechEncoderConfigCI4NewLEv @ 6 NONAME + _ZN22CSpeechEncoderConfigCID0Ev @ 7 NONAME + _ZN22CSpeechEncoderConfigCID1Ev @ 8 NONAME + _ZN22CSpeechEncoderConfigCID2Ev @ 9 NONAME + _ZTI22CSpeechEncoderConfigCI @ 10 NONAME ; ## + _ZTV22CSpeechEncoderConfigCI @ 11 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/speechencoderconfigcistub/group/SpeechEncoderConfigCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/speechencoderconfigcistub/group/SpeechEncoderConfigCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* Version : %version: bh1mmcf#14 % +* +*/ + + +#include + +TARGET SpeechEncoderConfigCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B0B + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE SpeechEncoderConfigCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server +SYSTEMINCLUDE ../inc + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY SpeechEncoderConfigCI.lib + +LINKAS SpeechEncoderConfigCI.dll + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/speechencoderconfigcistub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/speechencoderconfigcistub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for speech encoder custom interface +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +SpeechEncoderConfigCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/speechencoderconfigcistub/src/SpeechEncoderConfigCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/speechencoderconfigcistub/src/SpeechEncoderConfigCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +// INCLUDE FILES +#include "SpeechEncoderConfigCI.h" +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CSpeechEncoderConfigCI::CSpeechEncoderConfigCI +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CSpeechEncoderConfigCI::CSpeechEncoderConfigCI() + { + + } + +// ----------------------------------------------------------------------------- +// CSpeechEncoderConfigCI::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CSpeechEncoderConfigCI::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CSpeechEncoderConfigCI::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CSpeechEncoderConfigCI* CSpeechEncoderConfigCI::NewL() + { + CSpeechEncoderConfigCI* self = new (ELeave)CSpeechEncoderConfigCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// Destructor +EXPORT_C CSpeechEncoderConfigCI::~CSpeechEncoderConfigCI() + { + + } + +// ----------------------------------------------------------------------------- +// CSpeechEncoderConfigCI::GetSupportedBitrates +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSpeechEncoderConfigCI::GetSupportedBitrates(RArray& aSupportedBitrates) + { + aSupportedBitrates.Reset(); + aSupportedBitrates.Append(8000); + aSupportedBitrates.Append(16000); + aSupportedBitrates.Append(44100); + aSupportedBitrates.Append(48000); + RDebug::Print(_L("CSpeechEncoderConfigCI::GetSupportedBitrates")); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CSpeechEncoderConfigCI::SetBitrate +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSpeechEncoderConfigCI::SetBitrate(TUint aBitrate) + { + iBitrate = aBitrate; + RDebug::Print(_L("CSpeechEncoderConfigCI::SetBitrate bitrate[%d]"), iBitrate); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CSpeechEncoderConfigCI::GetBitrate +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSpeechEncoderConfigCI::GetBitrate(TUint& aBitrate) + { + aBitrate = iBitrate; + RDebug::Print(_L("CSpeechEncoderConfigCI::GetBitrate bitrate[%d]"), aBitrate); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CSpeechEncoderConfigCI::SetVadMode +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSpeechEncoderConfigCI::SetVadMode(TBool aVadMode) + { + iVadMode = aVadMode; + RDebug::Print(_L("CSpeechEncoderConfigCI::SetVadMode VAD mode[%d]"), iVadMode); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CSpeechEncoderConfigCI::GetVadMode +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSpeechEncoderConfigCI::GetVadMode(TBool& aVadMode) + { + aVadMode = iVadMode; + RDebug::Print(_L("CSpeechEncoderConfigCI::GetVadMode VAD mode[%d]"), aVadMode); + return KErrNone; + } + + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/wmadecodercintfccistub/BWINS/WmaDecoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/wmadecodercintfccistub/BWINS/WmaDecoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,34 @@ +EXPORTS + ??1CWmaDecoderIntfcCI@@UAE@XZ @ 1 NONAME ; CWmaDecoderIntfcCI::~CWmaDecoderIntfcCI(void) + ?ApplyConfig@CWmaDecoderIntfcCI@@UAEHXZ @ 2 NONAME ; int CWmaDecoderIntfcCI::ApplyConfig(void) + ?DisableTool@CWmaDecoderIntfcCI@@UAEXW4TTool@CWmaDecoderIntfc@@@Z @ 3 NONAME ; void CWmaDecoderIntfcCI::DisableTool(enum CWmaDecoderIntfc::TTool) + ?EnableTool@CWmaDecoderIntfcCI@@UAEXW4TTool@CWmaDecoderIntfc@@@Z @ 4 NONAME ; void CWmaDecoderIntfcCI::EnableTool(enum CWmaDecoderIntfc::TTool) + ?GetAvgBytesPerSec@CWmaDecoderIntfcCI@@UAEHAAI@Z @ 5 NONAME ; int CWmaDecoderIntfcCI::GetAvgBytesPerSec(unsigned int &) + ?GetBitsPerSampleIn@CWmaDecoderIntfcCI@@UAEHAAI@Z @ 6 NONAME ; int CWmaDecoderIntfcCI::GetBitsPerSampleIn(unsigned int &) + ?GetBlockAlign@CWmaDecoderIntfcCI@@UAEHAAI@Z @ 7 NONAME ; int CWmaDecoderIntfcCI::GetBlockAlign(unsigned int &) + ?GetChannelMaskIn@CWmaDecoderIntfcCI@@UAEHAAI@Z @ 8 NONAME ; int CWmaDecoderIntfcCI::GetChannelMaskIn(unsigned int &) + ?GetControllableTools@CWmaDecoderIntfcCI@@UAEHAAV?$RArray@W4TTool@CWmaDecoderIntfc@@@@@Z @ 9 NONAME ; int CWmaDecoderIntfcCI::GetControllableTools(class RArray &) + ?GetEncodeOptions1@CWmaDecoderIntfcCI@@UAEHAAI@Z @ 10 NONAME ; int CWmaDecoderIntfcCI::GetEncodeOptions1(unsigned int &) + ?GetEncodeOptions2@CWmaDecoderIntfcCI@@UAEHAAI@Z @ 11 NONAME ; int CWmaDecoderIntfcCI::GetEncodeOptions2(unsigned int &) + ?GetEncodeOptions@CWmaDecoderIntfcCI@@UAEHAAI@Z @ 12 NONAME ; int CWmaDecoderIntfcCI::GetEncodeOptions(unsigned int &) + ?GetFormat@CWmaDecoderIntfcCI@@UAEHAAW4TFormat@CWmaDecoderIntfc@@@Z @ 13 NONAME ; int CWmaDecoderIntfcCI::GetFormat(enum CWmaDecoderIntfc::TFormat &) + ?GetNumOfChannelsIn@CWmaDecoderIntfcCI@@UAEHAAI@Z @ 14 NONAME ; int CWmaDecoderIntfcCI::GetNumOfChannelsIn(unsigned int &) + ?GetSamplesPerSec@CWmaDecoderIntfcCI@@UAEHAAI@Z @ 15 NONAME ; int CWmaDecoderIntfcCI::GetSamplesPerSec(unsigned int &) + ?GetSupportedFormats@CWmaDecoderIntfcCI@@UAEHAAV?$RArray@W4TFormat@CWmaDecoderIntfc@@@@@Z @ 16 NONAME ; int CWmaDecoderIntfcCI::GetSupportedFormats(class RArray &) + ?GetSupportedMaxBitrate@CWmaDecoderIntfcCI@@UAEHAAI@Z @ 17 NONAME ; int CWmaDecoderIntfcCI::GetSupportedMaxBitrate(unsigned int &) + ?GetSupportedMaxChannelsIn@CWmaDecoderIntfcCI@@UAEHAAI@Z @ 18 NONAME ; int CWmaDecoderIntfcCI::GetSupportedMaxChannelsIn(unsigned int &) + ?GetSupportedMaxSampleRate@CWmaDecoderIntfcCI@@UAEHAAI@Z @ 19 NONAME ; int CWmaDecoderIntfcCI::GetSupportedMaxSampleRate(unsigned int &) + ?GetSupportedTools@CWmaDecoderIntfcCI@@UAEHAAV?$RArray@W4TTool@CWmaDecoderIntfc@@@@@Z @ 20 NONAME ; int CWmaDecoderIntfcCI::GetSupportedTools(class RArray &) + ?GetTool@CWmaDecoderIntfcCI@@UAEHW4TTool@CWmaDecoderIntfc@@AAH@Z @ 21 NONAME ; int CWmaDecoderIntfcCI::GetTool(enum CWmaDecoderIntfc::TTool, int &) + ?NewL@CWmaDecoderIntfcCI@@SAPAV1@XZ @ 22 NONAME ; class CWmaDecoderIntfcCI * CWmaDecoderIntfcCI::NewL(void) + ?SetAvgBytesPerSec@CWmaDecoderIntfcCI@@UAEXI@Z @ 23 NONAME ; void CWmaDecoderIntfcCI::SetAvgBytesPerSec(unsigned int) + ?SetBitsPerSampleIn@CWmaDecoderIntfcCI@@UAEXI@Z @ 24 NONAME ; void CWmaDecoderIntfcCI::SetBitsPerSampleIn(unsigned int) + ?SetBlockAlign@CWmaDecoderIntfcCI@@UAEXI@Z @ 25 NONAME ; void CWmaDecoderIntfcCI::SetBlockAlign(unsigned int) + ?SetChannelMaskIn@CWmaDecoderIntfcCI@@UAEXI@Z @ 26 NONAME ; void CWmaDecoderIntfcCI::SetChannelMaskIn(unsigned int) + ?SetEncodeOptions1@CWmaDecoderIntfcCI@@UAEXI@Z @ 27 NONAME ; void CWmaDecoderIntfcCI::SetEncodeOptions1(unsigned int) + ?SetEncodeOptions2@CWmaDecoderIntfcCI@@UAEXI@Z @ 28 NONAME ; void CWmaDecoderIntfcCI::SetEncodeOptions2(unsigned int) + ?SetEncodeOptions@CWmaDecoderIntfcCI@@UAEXI@Z @ 29 NONAME ; void CWmaDecoderIntfcCI::SetEncodeOptions(unsigned int) + ?SetFormat@CWmaDecoderIntfcCI@@UAEXW4TFormat@CWmaDecoderIntfc@@@Z @ 30 NONAME ; void CWmaDecoderIntfcCI::SetFormat(enum CWmaDecoderIntfc::TFormat) + ?SetNumChannelsIn@CWmaDecoderIntfcCI@@UAEXI@Z @ 31 NONAME ; void CWmaDecoderIntfcCI::SetNumChannelsIn(unsigned int) + ?SetSamplesPerSec@CWmaDecoderIntfcCI@@UAEXI@Z @ 32 NONAME ; void CWmaDecoderIntfcCI::SetSamplesPerSec(unsigned int) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/wmadecodercintfccistub/EABI/WmaDecoderIntfcCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/wmadecodercintfccistub/EABI/WmaDecoderIntfcCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,38 @@ +EXPORTS + _ZN18CWmaDecoderIntfcCI10EnableToolEN16CWmaDecoderIntfc5TToolE @ 1 NONAME + _ZN18CWmaDecoderIntfcCI11ApplyConfigEv @ 2 NONAME + _ZN18CWmaDecoderIntfcCI11DisableToolEN16CWmaDecoderIntfc5TToolE @ 3 NONAME + _ZN18CWmaDecoderIntfcCI13GetBlockAlignERj @ 4 NONAME + _ZN18CWmaDecoderIntfcCI13SetBlockAlignEj @ 5 NONAME + _ZN18CWmaDecoderIntfcCI16GetChannelMaskInERj @ 6 NONAME + _ZN18CWmaDecoderIntfcCI16GetEncodeOptionsERj @ 7 NONAME + _ZN18CWmaDecoderIntfcCI16GetSamplesPerSecERj @ 8 NONAME + _ZN18CWmaDecoderIntfcCI16SetChannelMaskInEj @ 9 NONAME + _ZN18CWmaDecoderIntfcCI16SetEncodeOptionsEj @ 10 NONAME + _ZN18CWmaDecoderIntfcCI16SetNumChannelsInEj @ 11 NONAME + _ZN18CWmaDecoderIntfcCI16SetSamplesPerSecEj @ 12 NONAME + _ZN18CWmaDecoderIntfcCI17GetAvgBytesPerSecERj @ 13 NONAME + _ZN18CWmaDecoderIntfcCI17GetEncodeOptions1ERj @ 14 NONAME + _ZN18CWmaDecoderIntfcCI17GetEncodeOptions2ERj @ 15 NONAME + _ZN18CWmaDecoderIntfcCI17GetSupportedToolsER6RArrayIN16CWmaDecoderIntfc5TToolEE @ 16 NONAME + _ZN18CWmaDecoderIntfcCI17SetAvgBytesPerSecEj @ 17 NONAME + _ZN18CWmaDecoderIntfcCI17SetEncodeOptions1Ej @ 18 NONAME + _ZN18CWmaDecoderIntfcCI17SetEncodeOptions2Ej @ 19 NONAME + _ZN18CWmaDecoderIntfcCI18GetBitsPerSampleInERj @ 20 NONAME + _ZN18CWmaDecoderIntfcCI18GetNumOfChannelsInERj @ 21 NONAME + _ZN18CWmaDecoderIntfcCI18SetBitsPerSampleInEj @ 22 NONAME + _ZN18CWmaDecoderIntfcCI19GetSupportedFormatsER6RArrayIN16CWmaDecoderIntfc7TFormatEE @ 23 NONAME + _ZN18CWmaDecoderIntfcCI20GetControllableToolsER6RArrayIN16CWmaDecoderIntfc5TToolEE @ 24 NONAME + _ZN18CWmaDecoderIntfcCI22GetSupportedMaxBitrateERj @ 25 NONAME + _ZN18CWmaDecoderIntfcCI25GetSupportedMaxChannelsInERj @ 26 NONAME + _ZN18CWmaDecoderIntfcCI25GetSupportedMaxSampleRateERj @ 27 NONAME + _ZN18CWmaDecoderIntfcCI4NewLEv @ 28 NONAME + _ZN18CWmaDecoderIntfcCI7GetToolEN16CWmaDecoderIntfc5TToolERi @ 29 NONAME + _ZN18CWmaDecoderIntfcCI9GetFormatERN16CWmaDecoderIntfc7TFormatE @ 30 NONAME + _ZN18CWmaDecoderIntfcCI9SetFormatEN16CWmaDecoderIntfc7TFormatE @ 31 NONAME + _ZN18CWmaDecoderIntfcCID0Ev @ 32 NONAME + _ZN18CWmaDecoderIntfcCID1Ev @ 33 NONAME + _ZN18CWmaDecoderIntfcCID2Ev @ 34 NONAME + _ZTI18CWmaDecoderIntfcCI @ 35 NONAME ; ## + _ZTV18CWmaDecoderIntfcCI @ 36 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/wmadecodercintfccistub/group/WmaDecoderintfcStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/wmadecodercintfccistub/group/WmaDecoderintfcStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* Version : %version: bh1mmcf#3.1.7 % +* +*/ + + +#include + +TARGET WmaDecoderIntfcCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207BAE + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE WmaDecoderIntfcCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +//EXPORTLIBRARY WmaDecoderIntfc_CI.lib + +LINKAS WmaDecoderIntfcCI.dll + +// End of files diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/wmadecodercintfccistub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/wmadecodercintfccistub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for AAC decoder config custom interface +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +WmaDecoderintfcStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiocodeccistubs/wmadecodercintfccistub/src/WmaDecoderIntfcCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiocodeccistubs/wmadecodercintfccistub/src/WmaDecoderIntfcCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,707 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +// INCLUDE FILES +#include "WmaDecoderIntfcCI.h" +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CWmaDecoderIntfcCI::CWmaDecoderIntfcCI +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CWmaDecoderIntfcCI::CWmaDecoderIntfcCI() + { + + } + +// ----------------------------------------------------------------------------- +// CWmaDecoderIntfcCI::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CWmaDecoderIntfcCI::ConstructL() + { + iCurrentFormat = EWma; + iCurrentBitsPerSample = 8; + iCurrentNumChannelsIn = 2; + iCurrentSamplesPerSec = 4600; + iCurrentAvgBytesPerSec = 3600; + iCurrentBlockAlign = 4945; + iCurrentEncodeOptions = 5; + iCurrentEncodeOptions1 = 5; + iCurrentEncodeOptions2 = 5; + + iCurrentChannelMask = 2; + iCurrentSupportedMaxSampleRate = 8900; + iCurrentSupportedMaxChannelsIn = 5678; + iCurrentSupportedMaxBitrate = 4356; + iCurrentEnable = CWmaDecoderIntfc::EToolOutput32Bit; + iCurrentDisable = CWmaDecoderIntfc::EDownMixToStereo; +/* + iSupportedFormats.Append(EWma); + iSupportedFormats.Append(EWmaPro); + + iSupportedTools.Append(EDownMixToStereo); + iSupportedTools.Append(ELostDataConcealment); + iSupportedTools.Append(EToolOutput32Bit); + + iControllableTools.Append(EToolOutput32Bit); + iControllableTools.Append(EDownMixToStereo); + iControllableTools.Append(EToolOutput32Bit); + iControllableTools.Append(ELostDataConcealment); + */ + + iCurrentSupportedFormats.Append(EWma); + iCurrentSupportedFormats.Append(EWmaPro); + + iCurrentSupportedTools.Append(EDownMixToStereo); + iCurrentSupportedTools.Append(ELostDataConcealment); + // iCurrentSupportedTools.Append(EToolOutput32Bit); + + iCurrentControllableTools.Append(EToolOutput32Bit); + // iCurrentControllableTools.Append(EDownMixToStereo); + //iCurrentControllableTools.Append(EToolOutput32Bit); + // iCurrentControllableTools.Append(ELostDataConcealment); + + // iCurrentControllableTools; + + + } + +// ----------------------------------------------------------------------------- +// CWmaDecoderIntfcCI::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CWmaDecoderIntfcCI* CWmaDecoderIntfcCI::NewL() + { + CWmaDecoderIntfcCI* self = new (ELeave)CWmaDecoderIntfcCI; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// Destructor +EXPORT_C CWmaDecoderIntfcCI::~CWmaDecoderIntfcCI() + { + iCurrentSupportedFormats.Close(); + iCurrentSupportedTools.Close(); + iCurrentControllableTools.Close(); +/* + iSupportedFormats.Close(); + iSupportedTools.Close(); + iControllableTools.Close(); + */ + } + +// ----------------------------------------------------------------------------- +// CWmaDecoderIntfcCI::SetAudioConfig +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +// From CWmaDecoderIntfc +/** + * Configures format. + * + */ +EXPORT_C void CWmaDecoderIntfcCI::SetFormat(TFormat aFormat) + { + iCurrentFormat = aFormat; + } + +/** + * Configures decoder's bits per sample. + * + */ +EXPORT_C void CWmaDecoderIntfcCI::SetBitsPerSampleIn(TUint aBitsPerSample) + { + iCurrentBitsPerSample = aBitsPerSample; + } + +/** + * Configures decoder's number of channels. + * + */ +EXPORT_C void CWmaDecoderIntfcCI::SetNumChannelsIn (TUint aNumChannelsIn) + { + iCurrentNumChannelsIn = aNumChannelsIn; + } + +/** + * Configures decoder's sample rate. + * + */ +EXPORT_C void CWmaDecoderIntfcCI::SetSamplesPerSec (TUint aSamplesPerSec) + { + iCurrentSamplesPerSec = aSamplesPerSec; + } + +/** + * Configures decoder's average bytes per second. + * + */ +EXPORT_C void CWmaDecoderIntfcCI::SetAvgBytesPerSec (TUint aAvgBytesPerSec) + { + iCurrentAvgBytesPerSec = aAvgBytesPerSec; + } + +/** + * Configures decoder's block align. + * + */ +EXPORT_C void CWmaDecoderIntfcCI::SetBlockAlign (TUint aBlockAlign) + { + iCurrentBlockAlign = aBlockAlign; + } + +/** + * Configures decoder's Encode Options. + * + */ +EXPORT_C void CWmaDecoderIntfcCI::SetEncodeOptions (TUint aEncodeOptions) + { + iCurrentEncodeOptions = aEncodeOptions; + } + +/** + * Configures decoder's Advance Encode Options. + * + */ +EXPORT_C void CWmaDecoderIntfcCI::SetEncodeOptions1 (TUint aEncodeOptions) + { + iCurrentEncodeOptions1 = aEncodeOptions; + } + +/** + * Configures decoder's Advance Encode Options. + * + */ +EXPORT_C void CWmaDecoderIntfcCI::SetEncodeOptions2 (TUint aEncodeOptions) + { + iCurrentEncodeOptions2 = aEncodeOptions; + } + +/** + * Configures decoder's Channel Mask. + * + */ +EXPORT_C void CWmaDecoderIntfcCI::SetChannelMaskIn (TUint aChannelMask) + { + iCurrentChannelMask = aChannelMask; + } + +/** + * Returns decoder's current configured format. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetFormat (TFormat& aFormat) + { + TInt status = KErrNone; + aFormat = iCurrentFormat; +/* + else if (iApplyConfStatus == KErrNone || iApplyConfStatus == KErrCompletion || + iApplyConfStatus == KErrUnknown || iApplyConfStatus == KErrArgument || + iApplyConfStatus == KErrNotReady || iApplyConfStatus == KErrNotFound) + { + status = iApplyConfStatus; + } + else + { + status = KErrGeneral; + } +*/ + return status; + } + +/** + * Returns configured bits per sample . + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetBitsPerSampleIn(TUint& aBitsPerSample) + { + TInt status = KErrNone; + aBitsPerSample = iCurrentBitsPerSample; +/* + else if (iApplyConfStatus == KErrNone || iApplyConfStatus == KErrCompletion || + iApplyConfStatus == KErrUnknown || iApplyConfStatus == KErrArgument || + iApplyConfStatus == KErrNotReady || iApplyConfStatus == KErrNotFound) + { + status = iApplyConfStatus; + } + else + { + status = KErrGeneral; + } + */ + return status; + } + +/** + * Returns configured number of channels. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetNumOfChannelsIn (TUint& aNumOfChannels) + { + TInt status = KErrNone; + aNumOfChannels = iCurrentNumChannelsIn; + +/* + else if (iApplyConfStatus == KErrNone || iApplyConfStatus == KErrCompletion || + iApplyConfStatus == KErrUnknown || iApplyConfStatus == KErrArgument || + iApplyConfStatus == KErrNotReady || iApplyConfStatus == KErrNotFound) + { + status = iApplyConfStatus; + } + else + { + status = KErrGeneral; + } + */ + return status; + } + +/** + * Returns configured sample rate. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetSamplesPerSec (TUint& aSamplesPerSec) + { + TInt status = KErrNone; + aSamplesPerSec = iCurrentSamplesPerSec; +/* + else if (iApplyConfStatus == KErrNone || iApplyConfStatus == KErrCompletion || + iApplyConfStatus == KErrUnknown || iApplyConfStatus == KErrArgument || + iApplyConfStatus == KErrNotReady || iApplyConfStatus == KErrNotFound) + { + status = iApplyConfStatus; + } + else + { + status = KErrGeneral; + } + */ + return status; + } + +/** + * Returns configured average bytes per second. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetAvgBytesPerSec (TUint& aAvgBytesPerSec) + { + TInt status = KErrNone; + aAvgBytesPerSec = iCurrentAvgBytesPerSec; +/* + else if (iApplyConfStatus == KErrNone || iApplyConfStatus == KErrCompletion || + iApplyConfStatus == KErrUnknown || iApplyConfStatus == KErrArgument || + iApplyConfStatus == KErrNotReady || iApplyConfStatus == KErrNotFound) + { + status = iApplyConfStatus; + } + else + { + status = KErrGeneral; + } + */ + + return status; + } + +/** + * Returns configured block align. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetBlockAlign (TUint& aBlockAlign) + { + TInt status = KErrNone; + aBlockAlign = iCurrentBlockAlign; +/* + else if (iApplyConfStatus == KErrNone || iApplyConfStatus == KErrCompletion || + iApplyConfStatus == KErrUnknown || iApplyConfStatus == KErrArgument || + iApplyConfStatus == KErrNotReady || iApplyConfStatus == KErrNotFound) + { + status = iApplyConfStatus; + } + else + { + status = KErrGeneral; + } +*/ + return status; + } + +/** + * Returns configured encode options. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetEncodeOptions (TUint& aEncodeOpts) + { + TInt status = KErrNone; + aEncodeOpts = iCurrentEncodeOptions; +/* + else if (iApplyConfStatus == KErrNone || iApplyConfStatus == KErrCompletion || + iApplyConfStatus == KErrUnknown || iApplyConfStatus == KErrArgument || + iApplyConfStatus == KErrNotReady || iApplyConfStatus == KErrNotFound) + { + status = iApplyConfStatus; + } + else + { + status = KErrGeneral; + } + */ + return status; + } + +/** + * Returns configured advanced encode options. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetEncodeOptions1 (TUint& aEncodeOpts1) + { + TInt status = KErrNone; + aEncodeOpts1 = iCurrentEncodeOptions1; + +/* + else if (iApplyConfStatus == KErrNone || iApplyConfStatus == KErrCompletion || + iApplyConfStatus == KErrUnknown || iApplyConfStatus == KErrArgument || + iApplyConfStatus == KErrNotReady || iApplyConfStatus == KErrNotFound || + iApplyConfStatus == KErrNotSupported) + { + status = iApplyConfStatus; + } + else + { + status = KErrGeneral; + } +*/ + + return status; + } + + /** + * Returns configured advanced encode options. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetEncodeOptions2 (TUint& aEncodeOpts2) + { + TInt status = KErrNone; + aEncodeOpts2 = iCurrentEncodeOptions2; + +/* + else if (iApplyConfStatus == KErrNone || iApplyConfStatus == KErrCompletion || + iApplyConfStatus == KErrUnknown || iApplyConfStatus == KErrArgument || + iApplyConfStatus == KErrNotReady || iApplyConfStatus == KErrNotFound || + iApplyConfStatus == KErrNotSupported) + { + status = iApplyConfStatus; + } + else + { + status = KErrGeneral; + } +*/ + + return status; + } + +/** + * Returns configured channel mask. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetChannelMaskIn (TUint& aChannelMask) + { + TInt status = KErrNone; + aChannelMask = iCurrentChannelMask; +/* + else if (iApplyConfStatus == KErrNone || iApplyConfStatus == KErrCompletion || + iApplyConfStatus == KErrUnknown || iApplyConfStatus == KErrArgument || + iApplyConfStatus == KErrNotReady || iApplyConfStatus == KErrNotFound || + iApplyConfStatus == KErrNotSupported) + { + status = iApplyConfStatus; + } + else + { + status = KErrGeneral; + } +*/ + return status; + } + +/** + * Returns supported formats. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetSupportedFormats(RArray& aSupportedFormats) + { + TInt status = KErrNone; + TInt num = iCurrentSupportedFormats.Count(); + aSupportedFormats.Reset(); + for (int i = 0; i < num; ++i) + { + aSupportedFormats.Append(iCurrentSupportedFormats[i]); + + } + return status; + } + + +/** + * Returns supported tools. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetSupportedTools(RArray& aSupportedTools) + { + TInt status = KErrNone; + TInt num = iCurrentSupportedTools.Count(); + aSupportedTools.Reset(); + for (int i = 0; i < num; ++i) + { + aSupportedTools.Append(iCurrentSupportedTools[i]); + + } + return status; + } + +/** + * Returns supported max number of channels. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetSupportedMaxChannelsIn(TUint& aSupportedMaxChannelsIn) + { + TInt status = KErrNone; + aSupportedMaxChannelsIn = iCurrentSupportedMaxChannelsIn; + return status; + } + +/** + * Returns supported max bit rate. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetSupportedMaxBitrate(TUint& aSupportedMaxBitrate) + { + TInt status = KErrNone; + aSupportedMaxBitrate = iCurrentSupportedMaxBitrate; + return status; + } + +/** + * Returns supported max sample rate. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetSupportedMaxSampleRate(TUint& aSupportedMaxSampleRate) + { + TInt status = KErrNone; + aSupportedMaxSampleRate = iCurrentSupportedMaxSampleRate; + return status; + } + +/** + * Returns controllable tools. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetControllableTools(RArray& aControllableTools) + { + TInt status = KErrNone; + TInt num = iCurrentControllableTools.Count(); + aControllableTools.Reset(); + for (int i = 0; i < num; ++i) + { + aControllableTools.Append(iCurrentControllableTools[i]); + + } + return status; + } + +/** + * Enable tool. + * + */ +EXPORT_C void CWmaDecoderIntfcCI::EnableTool(TTool aTool) + { + switch (aTool) + { + case EToolOutput32Bit: + iCurrentToolOutPut32Bit = ETrue; + break; + case EDownMixToStereo: + iCurrentToolDownMixToStereo = ETrue; + break; + case ELostDataConcealment: + iCurrentToolLostDataConcealment = ETrue; + break; + default: + break; + } + } +/** + * disable tool. + * + */ +EXPORT_C void CWmaDecoderIntfcCI::DisableTool(TTool aTool) + { + switch (aTool) + { + case EToolOutput32Bit: + iCurrentToolOutPut32Bit = EFalse; + break; + case EDownMixToStereo: + iCurrentToolDownMixToStereo = EFalse; + break; + case ELostDataConcealment: + iCurrentToolLostDataConcealment = EFalse; + break; + default: + break; + } + } + + +/** + * Returns tool state. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::GetTool(TTool aTool, TBool& aEnabled) + { + + TInt status = KErrNone; + switch (aTool) + { + case EToolOutput32Bit: + if (iCurrentToolOutPut32Bit) + { + aEnabled = ETrue; + } + else + { + aEnabled = EFalse; + } + break; + + case EDownMixToStereo: + if (iCurrentToolDownMixToStereo) + { + aEnabled = ETrue; + } + else + { + aEnabled = EFalse; + } + break; + + case ELostDataConcealment: + if (iCurrentToolLostDataConcealment) + { + aEnabled = ETrue; + } + else + { + aEnabled = EFalse; + } + break; + default: + break; + } + +return status; +} + +/** + * Applies configuration settings to the decoder. + * + */ +EXPORT_C TInt CWmaDecoderIntfcCI::ApplyConfig() + { + iCurrentFormat = iFormat; + iCurrentBitsPerSample = iBitsPerSample; + iCurrentNumChannelsIn = iNumChannelsIn; + iCurrentSamplesPerSec = iSamplesPerSec; + iCurrentAvgBytesPerSec = iAvgBytesPerSec; + iCurrentBlockAlign = iBlockAlign; + iCurrentEncodeOptions = iEncodeOptions; + + iCurrentEncodeOptions1 = iEncodeOptions1; + iCurrentEncodeOptions2 = iEncodeOptions2; + + iCurrentChannelMask = iChannelMask; + iCurrentSupportedMaxSampleRate = iSupportedMaxSampleRate; + iCurrentSupportedMaxChannelsIn = iSupportedMaxChannelsIn; + iCurrentSupportedMaxBitrate = iSupportedMaxBitrate; + iCurrentEnable = iEnable; + iCurrentDisable = iDisable; + + iCurrentToolOutPut32Bit = iToolOutPut32Bit; + iCurrentToolDownMixToStereo = iToolDownMixToStereo; + iCurrentToolLostDataConcealment = iToolLostDataConcealment; + + + return KErrNone; + } + + +/* + iCurrentFormat = EWma; + iCurrentBitsPerSample = 8; + iCurrentNumChannelsIn = 2; + iCurrentSamplesPerSec = 4600; + iCurrentAvgBytesPerSec = 3600; + iCurrentBlockAlign = 4945; + iCurrentEncodeOptions = 5; + iCurrentEncodeOptions1 = 5; + iCurrentEncodeOptions2 = 5; + + iCurrentChannelMask = 2; + iCurrentSupportedMaxSampleRate = 8900; + iCurrentSupportedMaxChannelsIn = 5678; + iCurrentSupportedMaxBitrate = 4356; + iCurrentEnable = CWmaDecoderIntfc::EToolOutput32Bit; + iCurrentDisable = CWmaDecoderIntfc::EDownMixToStereo; + + iCurrentSupportedFormats[0] = EWma; + iCurrentSupportedFormats[1] = EWmaPro; + + iCurrentSupportedTools[0] = EToolOutput32Bit; + iCurrentSupportedTools[1] = EToolOutput32Bit; + iCurrentSupportedTools[2] = EToolOutput32Bit; +*/ diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/audioequalizercistub/BWINS/AUDIOEQUALIZERCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/audioequalizercistub/BWINS/AUDIOEQUALIZERCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CAudioEqualizerCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CAudioEqualizerCI * CAudioEqualizerCI::NewL(class CMMFDevSound &) + ?NewL@CAudioEqualizerCI@@SAPAV1@XZ @ 2 NONAME ; class CAudioEqualizerCI * CAudioEqualizerCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/audioequalizercistub/EABI/AudioEqualizerCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/audioequalizercistub/EABI/AudioEqualizerCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN17CAudioEqualizerCI4NewLER12CMMFDevSound @ 1 NONAME + _ZTI17CAudioEqualizerCI @ 2 NONAME ; ## + _ZTV17CAudioEqualizerCI @ 3 NONAME ; ## + _ZN17CAudioEqualizerCI4NewLEv @ 4 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/audioequalizercistub/Group/AudioEqualizerCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/audioequalizercistub/Group/AudioEqualizerCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project file for Equalizer Effect Custom Interface STUB. +* +* +*/ + + +#include + +TARGET AudioEqualizerCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10203839 + + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + + +SOURCEPATH ../src +SOURCE AudioEqualizerCIStub.cpp + +USERINCLUDE ../inc ../src + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common + + +LIBRARY euser.lib +LIBRARY EffectBase.lib +LIBRARY AudioEqualizerEffect.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY AudioEqualizerCI.lib + +LINKAS AudioEqualizerCI.dll + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/audioequalizercistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/audioequalizercistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface stub +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +AudioEqualizerCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/audioequalizercistub/inc/AudioEqualizerCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/audioequalizercistub/inc/AudioEqualizerCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the AudioEqualizer Custom Interface class. +* +* +*/ + + +#include +#include + +class CMMFDevSound; + +class CAudioEqualizerCI : public CAudioEqualizer + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CAudioEqualizerCI* NewL(CMMFDevSound& aDevSound); + + /** + * Destructor. + */ + virtual ~CAudioEqualizerCI(); + + /** + * From CAudioEffect + * Apply effect settings + * @since 3.0 + */ + virtual void ApplyL(); + + IMPORT_C static CAudioEqualizerCI* NewL(); + + private: + + /** + * C++ default constructor. + */ + CAudioEqualizerCI(CMMFDevSound& aDevSound); + CAudioEqualizerCI(); + + private: // Data + + CMMFDevSound* iDevSound; + }; diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/audioequalizercistub/src/AudioEqualizerCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/audioequalizercistub/src/AudioEqualizerCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the AudioEqualizer effect Custom Interface class +* +*/ + + +#ifdef _DEBUG +#include +#endif +#include "AudioEqualizerCI.h" + + +EXPORT_C CAudioEqualizerCI* CAudioEqualizerCI::NewL( + CMMFDevSound& aDevSound ) + { + CAudioEqualizerCI* self = new(ELeave) CAudioEqualizerCI(aDevSound); + return self; + } + +CAudioEqualizerCI::CAudioEqualizerCI( + CMMFDevSound& aDevSound ) + : iDevSound(&aDevSound ) + { + iAudioEqualizerData.iMindB = -20; // Initial value + iAudioEqualizerData.iMaxdB = 20; // Initial value + + TEfAudioEqualizerBand band; + +// for (TInt i=1; i<=8; i++) + + for (TInt i=1; i<=5; i++) { + band.iBandId = i; + band.iBandLevel = 1+i; + band.iBandWidth = 10+i; + band.iCenterFrequency = 20+i; + band.iCrossoverFrequency = 30+i; + + iBandsData.Append(band); + } + + } + +EXPORT_C CAudioEqualizerCI* CAudioEqualizerCI::NewL() + { + CAudioEqualizerCI* self = new(ELeave) CAudioEqualizerCI(); + return self; + } + +CAudioEqualizerCI::CAudioEqualizerCI() + { + iAudioEqualizerData.iMindB = -20; // Initial value + iAudioEqualizerData.iMaxdB = 20; // Initial value + + TEfAudioEqualizerBand band; + +// for (TInt i=1; i<=8; i++) + for (TInt i=1; i<=5; i++) + { + band.iBandId = i; + band.iBandLevel = 1+i; + band.iBandWidth = 10+i; + band.iCenterFrequency = 20+i; + band.iCrossoverFrequency = 30+i; + + iBandsData.Append(band); + } + + } + + +CAudioEqualizerCI::~CAudioEqualizerCI() + { + } + +void CAudioEqualizerCI::ApplyL() + { +#ifdef _DEBUG + RDebug::Print(_L("CAudioEqualizerCI::ApplyL")); +#endif + + if (iObservers.Count() > 0) + { + iAudioEqualizerData.iEnabled = ETrue; + + iBandsData[4].iBandLevel = 99; + iBandsData[4].iBandWidth = 99; + iBandsData[4].iCenterFrequency = 99; + iBandsData[4].iCrossoverFrequency = 99; + + iObservers[0]->EffectChanged(this, (TUint8)MAudioEqualizerObserver::KBand5Changed); + + } + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/bassboostcistub/BWINS/BassBoostCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/bassboostcistub/BWINS/BassBoostCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CBassBoostCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CBassBoostCI * CBassBoostCI::NewL(class CMMFDevSound &) + ?NewL@CBassBoostCI@@SAPAV1@XZ @ 2 NONAME ; class CBassBoostCI * CBassBoostCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/bassboostcistub/EABI/BassBoostCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/bassboostcistub/EABI/BassBoostCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN12CBassBoostCI4NewLER12CMMFDevSound @ 1 NONAME + _ZTI12CBassBoostCI @ 2 NONAME ; ## + _ZTV12CBassBoostCI @ 3 NONAME ; ## + _ZN12CBassBoostCI4NewLEv @ 4 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/bassboostcistub/Group/BassBoostCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/bassboostcistub/Group/BassBoostCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project file for BassBoost Effect Custom Interface STUB. +* +* +*/ + +#include + +TARGET BassBoostCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207A97 +VENDORID VID_DEFAULT + + +CAPABILITY CAP_GENERAL_DLL + + +SOURCEPATH ../src +SOURCE BassBoostCIStub.cpp + +USERINCLUDE ../inc ../src + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + + +LIBRARY euser.lib +LIBRARY EffectBase.lib +LIBRARY BassBoostEffect.lib +LIBRARY MMFDevSound.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY BassBoostCI.lib + +LINKAS BassBoostCI.dll + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/bassboostcistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/bassboostcistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface STUB +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +BassBoostCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/bassboostcistub/inc/BassBoostCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/bassboostcistub/inc/BassBoostCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the bassboost Custom Interface class. +* This serves as an example of how adaptation might define the +* custom interface class. +* The CBassBoostCI object is typically instantiated by a DevSound +* instance and return to the client when the CustomInterface() +* method is invoked. +* +* +*/ + + +#include +#include + +class CMMFDevSound; + +class CBassBoostCI : public CBassBoost + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CBassBoostCI* NewL(CMMFDevSound& aDevSound); + + /** + * Destructor. + */ + virtual ~CBassBoostCI(); + + public: // From Base Class + + /** + * From CAudioEffect + * Apply effect settings + * @since 3.0 + */ + virtual void ApplyL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CBassBoostCI* NewL(); + + private: + + /** + * C++ default constructor. + */ + CBassBoostCI(CMMFDevSound& aDevSound); + CBassBoostCI(); + + private: // Data + + CMMFDevSound* iDevSound; + }; diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/bassboostcistub/src/BassBoostCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/bassboostcistub/src/BassBoostCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the bassboost effect Custom Interface class +* +*/ + + +#ifdef _DEBUG +#include // Needed for RDebug Prints +#endif + +#include "BassBoostCI.h" +#include + +// ----------------------------------------------------------------------------- +// CBassBoost::NewL +// Static function for creating an instance of the CBassBoostCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CBassBoostCI* CBassBoostCI::NewL( + CMMFDevSound& aDevSound ) + { + CBassBoostCI* self = new(ELeave) CBassBoostCI(aDevSound); + return self; + } + +CBassBoostCI::CBassBoostCI( + CMMFDevSound& aDevSound ) + : iDevSound(&aDevSound) + { + } + +// ----------------------------------------------------------------------------- +// CBassBoost::NewL +// Static function for creating an instance of the CBassBoostCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CBassBoostCI* CBassBoostCI::NewL() + { + CBassBoostCI* self = new(ELeave) CBassBoostCI(); + return self; + } + +CBassBoostCI::CBassBoostCI() + { + } + +// Destructor + +CBassBoostCI::~CBassBoostCI() + { +#ifdef _DEBUG + RDebug::Print(_L("CBassBoostCI::~CBassBoostCI")); +#endif + } + +// ----------------------------------------------------------------------------- +// CBassBoostCI::ApplyL +// +// Applies the bassboost settings. +// Adaptation must check each settings and take appropriate actions since +// this method might be called after several settings have been made. +// ----------------------------------------------------------------------------- +// +void CBassBoostCI::ApplyL() + { +#ifdef _DEBUG + RDebug::Print(_L("CBassBoostCI::ApplyL")); +#endif + + if ( !HaveUpdateRights() ) + { + User::Leave(KErrAccessDenied); + } + + if ( IsEnabled() ) + { + } + + // The effect change event is simulated by changing the bassboost and + // sending the observer a message indicating bassboost has changed. + // This is done for testing only. + + // The intention of this callback is to notify the observer when the bassboost + // object changes spontaneously. ie the user did not change the settings but + // event somewhere in the system causes the bassboost object to change state. + + if (iObservers.Count() > 0) + { + iObservers[0]->EffectChanged(this, (TUint8)MBassBoostObserver::KBassBoostChanged); + } + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/distanceattenuationcistub/BWINS/DistanceAttenuationCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/distanceattenuationcistub/BWINS/DistanceAttenuationCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CDistanceAttenuationCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CDistanceAttenuationCI * CDistanceAttenuationCI::NewL(class CMMFDevSound &) + ?NewL@CDistanceAttenuationCI@@SAPAV1@XZ @ 2 NONAME ; class CDistanceAttenuationCI * CDistanceAttenuationCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/distanceattenuationcistub/EABI/DistanceAttenuationCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/distanceattenuationcistub/EABI/DistanceAttenuationCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN22CDistanceAttenuationCI4NewLER12CMMFDevSound @ 1 NONAME + _ZTI22CDistanceAttenuationCI @ 2 NONAME ; ## + _ZTV22CDistanceAttenuationCI @ 3 NONAME ; ## + _ZN22CDistanceAttenuationCI4NewLEv @ 4 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/distanceattenuationcistub/Group/DistanceAttenuationCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/distanceattenuationcistub/Group/DistanceAttenuationCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project file for DistanceAttenuation Custom Interface STUB. +* +* +*/ + + +#include + +TARGET DistanceAttenuationCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207ADC + + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + + +SOURCEPATH ../src +SOURCE DistanceAttenuationCIStub.cpp + +USERINCLUDE ../inc ../src + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common + +LIBRARY euser.lib +LIBRARY EffectBase.lib +LIBRARY DistanceAttenuationEffect.lib + + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY DistanceAttenuationCI.lib + +LINKAS DistanceAttenuationCI.dll + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/distanceattenuationcistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/distanceattenuationcistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface stub +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +DistanceAttenuationCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/distanceattenuationcistub/inc/DistanceAttenuationCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/distanceattenuationcistub/inc/DistanceAttenuationCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the DistanceAttenuation Custom Interface class. +* +* +*/ + + +#include +#include + +class CMMFDevSound; + +class CDistanceAttenuationCI : public CDistanceAttenuation + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CDistanceAttenuationCI* NewL(CMMFDevSound& aDevSound); + + /** + * Destructor. + */ + virtual ~CDistanceAttenuationCI(); + + /** + * From CAudioEffect + * Apply effect settings + * @since 3.0 + */ + virtual void ApplyL(); + + IMPORT_C static CDistanceAttenuationCI* NewL(); + + private: + + /** + * C++ default constructor. + */ + CDistanceAttenuationCI(CMMFDevSound& aDevSound); + CDistanceAttenuationCI(); + + private: // Data + + CMMFDevSound* iDevSound; + }; diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/distanceattenuationcistub/src/DistanceAttenuationCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/distanceattenuationcistub/src/DistanceAttenuationCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the DistanceAttenuation effect Custom Interface class +* +*/ + + +#ifdef _DEBUG +#include +#endif +#include "DistanceAttenuationCI.h" + + +EXPORT_C CDistanceAttenuationCI* CDistanceAttenuationCI::NewL( + CMMFDevSound& aDevSound ) + { + CDistanceAttenuationCI* self = new(ELeave) CDistanceAttenuationCI(aDevSound); + return self; + } + +CDistanceAttenuationCI::CDistanceAttenuationCI( + CMMFDevSound& aDevSound ) + : iDevSound(&aDevSound ) + { + iDistanceAttenuationData.iRMin = 0; + iDistanceAttenuationData.iRMax = 100; + iDistanceAttenuationData.iMuteAfterMax = EFalse; + iDistanceAttenuationData.iRollOffFactor = 100; + iDistanceAttenuationData.iRoomRollOffFactor = 100; + iDistanceAttenuationData.iRollOffFactorMax = 1000; + iDistanceAttenuationData.iRoomRollOffFactorMax = 1000; + + } + +EXPORT_C CDistanceAttenuationCI* CDistanceAttenuationCI::NewL() + { + CDistanceAttenuationCI* self = new(ELeave) CDistanceAttenuationCI(); + return self; + } + +CDistanceAttenuationCI::CDistanceAttenuationCI() + { + iDistanceAttenuationData.iRMin = 0; + iDistanceAttenuationData.iRMax = 100; + iDistanceAttenuationData.iMuteAfterMax = EFalse; + iDistanceAttenuationData.iRollOffFactor = 100; + iDistanceAttenuationData.iRoomRollOffFactor = 100; + iDistanceAttenuationData.iRollOffFactorMax = 1000; + iDistanceAttenuationData.iRoomRollOffFactorMax = 1000; + + } + +CDistanceAttenuationCI::~CDistanceAttenuationCI() + { + } + +void CDistanceAttenuationCI::ApplyL() + { +#ifdef _DEBUG + RDebug::Print(_L("CDistanceAttenuationCI::ApplyL")); +#endif + + if (iObservers.Count() > 0) + { + if(iDistanceAttenuationData.iEnabled) + { + iEnabled = iDistanceAttenuationData.iEnabled; + iObservers[0]->EffectChanged(this, (TUint8)MAudioEffectObserver::KEnabled); + } + else + { + iEnabled = iDistanceAttenuationData.iEnabled; + iObservers[0]->EffectChanged(this, (TUint8)MAudioEffectObserver::KDisabled); + } + + } + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/environmentalreverbcistub/BWINS/EnvironmentalReverbCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/environmentalreverbcistub/BWINS/EnvironmentalReverbCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CEnvironmentalReverbCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CEnvironmentalReverbCI * CEnvironmentalReverbCI::NewL(class CMMFDevSound &) + ?NewL@CEnvironmentalReverbCI@@SAPAV1@XZ @ 2 NONAME ; class CEnvironmentalReverbCI * CEnvironmentalReverbCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/environmentalreverbcistub/EABI/EnvironmentalReverbCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/environmentalreverbcistub/EABI/EnvironmentalReverbCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN22CEnvironmentalReverbCI4NewLER12CMMFDevSound @ 1 NONAME + _ZTI22CEnvironmentalReverbCI @ 2 NONAME ; ## + _ZTV22CEnvironmentalReverbCI @ 3 NONAME ; ## + _ZN22CEnvironmentalReverbCI4NewLEv @ 4 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/environmentalreverbcistub/Group/EnvironmentalReverbCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/environmentalreverbcistub/Group/EnvironmentalReverbCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project file for Environmental Reverb Custom Interface STUB. +* +* +*/ + + +#include + +TARGET EnvironmentalReverbCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207A83 + + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + + +SOURCEPATH ../src +SOURCE EnvironmentalReverbCIStub.cpp + +USERINCLUDE ../inc ../src + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common + +LIBRARY euser.lib +LIBRARY EffectBase.lib +LIBRARY EnvironmentalReverbEffect.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY EnvironmentalReverbCI.lib + +LINKAS EnvironmentalReverbCI.dll + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/environmentalreverbcistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/environmentalreverbcistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface stub +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +PRJ_MMPFILES +EnvironmentalReverbCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/environmentalreverbcistub/inc/EnvironmentalReverbCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/environmentalreverbcistub/inc/EnvironmentalReverbCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the EnvironmentalReverb Custom Interface class. +* +* +*/ + + +#include +#include + +class CMMFDevSound; + +class CEnvironmentalReverbCI : public CEnvironmentalReverb + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CEnvironmentalReverbCI* NewL(CMMFDevSound& aDevSound); + + /** + * Destructor. + */ + virtual ~CEnvironmentalReverbCI(); + + /** + * From CAudioEffect + * Apply effect settings + * @since 3.0 + */ + virtual void ApplyL(); + + IMPORT_C static CEnvironmentalReverbCI* NewL(); + + private: + + /** + * C++ default constructor. + */ + CEnvironmentalReverbCI(CMMFDevSound& aDevSound); + CEnvironmentalReverbCI(); + + private: // Data + + CMMFDevSound* iDevSound; + }; diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/environmentalreverbcistub/src/EnvironmentalReverbCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/environmentalreverbcistub/src/EnvironmentalReverbCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the EnvironmentalReverb effect Custom Interface class +* +*/ + + +#ifdef _DEBUG +#include +#endif +#include "EnvironmentalReverbCI.h" + + +EXPORT_C CEnvironmentalReverbCI* CEnvironmentalReverbCI::NewL( + CMMFDevSound& aDevSound ) + { + CEnvironmentalReverbCI* self = new(ELeave) CEnvironmentalReverbCI(aDevSound); + return self; + } + +CEnvironmentalReverbCI::CEnvironmentalReverbCI( + CMMFDevSound& aDevSound ) + : iDevSound(&aDevSound ) + { + iReverbData.iDecayHFRatio = 0; + iReverbData.iDecayHFRatioMin = 0; + iReverbData.iDecayHFRatioMax = 10000; + iReverbData.iDecayTime = 0; + iReverbData.iDecayTimeMin = 0; + iReverbData.iDecayTimeMax = 100000; + iReverbData.iDensity = 0; + iReverbData.iDiffusion = 0; + iReverbData.iReflectionsLevel = 0; + iReverbData.iReflectionLevelMin = 0; + iReverbData.iReflectionLevelMax = 1000; + iReverbData.iReflectionsDelay = 0; + iReverbData.iReflectionsDelayMax = 10000; + iReverbData.iReverbDelay = 0; + iReverbData.iReverbDelayMax = 100000; + iReverbData.iReverbLevel = 0; + iReverbData.iReverbLevelMin = 0; + iReverbData.iReverbLevelMax = 1000; + iReverbData.iRoomHFLevel = 0; + iReverbData.iRoomHFLevelMin = 0; + iReverbData.iRoomHFLevelMax = 1000; + iReverbData.iRoomLevel = 0; + iReverbData.iRoomLevelMin = 0; + iReverbData.iRoomLevelMax = 1000; + iReverbData.iDelayMax = 110000; + iReverbData.iEnvironmentalReverbId = 54; + } + +EXPORT_C CEnvironmentalReverbCI* CEnvironmentalReverbCI::NewL() + { + CEnvironmentalReverbCI* self = new(ELeave) CEnvironmentalReverbCI(); + return self; + } + +CEnvironmentalReverbCI::CEnvironmentalReverbCI() + { + iReverbData.iDecayHFRatio = 0; + iReverbData.iDecayHFRatioMin = 0; + iReverbData.iDecayHFRatioMax = 10000; + iReverbData.iDecayTime = 0; + iReverbData.iDecayTimeMin = 0; + iReverbData.iDecayTimeMax = 100000; + iReverbData.iDensity = 0; + iReverbData.iDiffusion = 0; + iReverbData.iReflectionsLevel = 0; + iReverbData.iReflectionLevelMin = 0; + iReverbData.iReflectionLevelMax = 1000; + iReverbData.iReflectionsDelay = 0; + iReverbData.iReflectionsDelayMax = 10000; + iReverbData.iReverbDelay = 0; + iReverbData.iReverbDelayMax = 100000; + iReverbData.iReverbLevel = 0; + iReverbData.iReverbLevelMin = 0; + iReverbData.iReverbLevelMax = 1000; + iReverbData.iRoomHFLevel = 0; + iReverbData.iRoomHFLevelMin = 0; + iReverbData.iRoomHFLevelMax = 1000; + iReverbData.iRoomLevel = 0; + iReverbData.iRoomLevelMin = 0; + iReverbData.iRoomLevelMax = 1000; + iReverbData.iDelayMax = 110000; + iReverbData.iEnvironmentalReverbId = 54; + } + +CEnvironmentalReverbCI::~CEnvironmentalReverbCI() + { + } + +void CEnvironmentalReverbCI::ApplyL() + { +#ifdef _DEBUG + RDebug::Print(_L("CEnvironmentalReverbCI::ApplyL")); +#endif + + if (iObservers.Count() > 0) + { + iReverbData.iEnabled = ETrue; + iObservers[0]->EffectChanged(this, (TUint8)MAudioEffectObserver::KEnabled); + + } + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +#include "../audioequalizercistub/Group/bld.inf" +#include "../bassboostcistub/Group/bld.inf" +#include "../distanceattenuationcistub/Group/bld.inf" +#include "../environmentalreverbcistub/Group/bld.inf" +#include "../listenerdopplercistub/Group/bld.inf" +#include "../listenerlocationcistub/Group/bld.inf" +#include "../listenerorientationcistub/Group/bld.inf" +#include "../loudnesscistub/Group/bld.inf" +#include "../roomlevelcistub/Group/bld.inf" +#include "../sourcedopplercistub/Group/bld.inf" +#include "../sourcelocationcistub/Group/bld.inf" +#include "../sourceorientationcistub/Group/bld.inf" +#include "../stereowideningcistub/Group/bld.inf" \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerdopplercistub/BWINS/ListenerDopplerCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerdopplercistub/BWINS/ListenerDopplerCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CListenerDopplerCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CListenerDopplerCI * CListenerDopplerCI::NewL(class CMMFDevSound &) + ?NewL@CListenerDopplerCI@@SAPAV1@XZ @ 2 NONAME ; class CListenerDopplerCI * CListenerDopplerCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerdopplercistub/EABI/ListenerDopplerCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerdopplercistub/EABI/ListenerDopplerCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN18CListenerDopplerCI4NewLER12CMMFDevSound @ 1 NONAME + _ZN18CListenerDopplerCI4NewLEv @ 2 NONAME + _ZTI18CListenerDopplerCI @ 3 NONAME ; ## + _ZTV18CListenerDopplerCI @ 4 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerdopplercistub/Group/ListenerDopplerCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerdopplercistub/Group/ListenerDopplerCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project file for Listener Doppler Effect Custom Interface STUB. +* +* +*/ + + +#include + +TARGET ListenerDopplerCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B18 +VENDORID VID_DEFAULT + + +CAPABILITY CAP_GENERAL_DLL + + +SOURCEPATH ../src +SOURCE ListenerDopplerCIStub.cpp + +USERINCLUDE ../inc ../src + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib +LIBRARY EffectBase.lib +LIBRARY DopplerBase.lib +LIBRARY ListenerDopplerEffect.lib +LIBRARY MMFDevSound.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY ListenerDopplerCI.lib + +LINKAS ListenerDopplerCI.dll + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerdopplercistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerdopplercistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface STUB +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +PRJ_MMPFILES +ListenerDopplerCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerdopplercistub/inc/ListenerDopplerCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerdopplercistub/inc/ListenerDopplerCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the ListenerDoppler Custom Interface class. +* This serves as an example of how adaptation might define the +* custom interface class. +* The CListenerDopplerCI object is typically instantiated by a DevSound +* instance and return to the client when the CustomInterface() +* method is invoked. +* +* +*/ + + +#include +#include + +class CMMFDevSound; + +class CListenerDopplerCI : public CListenerDoppler + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CListenerDopplerCI* NewL(CMMFDevSound& aDevSound); + + /** + * Destructor. + */ + virtual ~CListenerDopplerCI(); + + public: // From Base Class + + /** + * From CAudioEffect + * Apply effect settings + * @since 3.0 + */ + virtual void ApplyL(); + + IMPORT_C static CListenerDopplerCI* NewL(); + + private: + + /** + * C++ default constructor. + */ + CListenerDopplerCI(CMMFDevSound& aDevSound); + CListenerDopplerCI(); + + private: // Data + + CMMFDevSound* iDevSound; + }; diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerdopplercistub/src/ListenerDopplerCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerdopplercistub/src/ListenerDopplerCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the doppler effect Custom Interface class +* +*/ + + +#ifdef _DEBUG +#include // Needed for RDebug Prints +#endif + +#include "ListenerDopplerCI.h" +#include + +// ----------------------------------------------------------------------------- +// CListenerDoppler::NewL +// Static function for creating an instance of the CListenerDopplerCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CListenerDopplerCI* CListenerDopplerCI::NewL( + CMMFDevSound& aDevSound ) + { + CListenerDopplerCI* self = new(ELeave) CListenerDopplerCI(aDevSound); + return self; + } + +CListenerDopplerCI::CListenerDopplerCI( + CMMFDevSound& aDevSound ) + : iDevSound(&aDevSound) + { + iDopplerData.iVelocityX = 10; + iDopplerData.iVelocityY = 10; + iDopplerData.iVelocityZ = 10; + iDopplerData.iAzimuth = 20; + iDopplerData.iElevation = 20; + iDopplerData.iRadius = 20; + iDopplerData.iFactor = 5; + iDopplerData.iMaxFactor = 10; + } + +// ----------------------------------------------------------------------------- +// CListenerDoppler::NewL +// Static function for creating an instance of the CListenerDopplerCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CListenerDopplerCI* CListenerDopplerCI::NewL() + { + CListenerDopplerCI* self = new(ELeave) CListenerDopplerCI(); + return self; + } + +CListenerDopplerCI::CListenerDopplerCI() + { + iDopplerData.iVelocityX = 10; + iDopplerData.iVelocityY = 10; + iDopplerData.iVelocityZ = 10; + iDopplerData.iAzimuth = 20; + iDopplerData.iElevation = 20; + iDopplerData.iRadius = 20; + iDopplerData.iFactor = 5; + iDopplerData.iMaxFactor = 10; + } + +// Destructor + +CListenerDopplerCI::~CListenerDopplerCI() + { +#ifdef _DEBUG + RDebug::Print(_L("CListenerDopplerCI::~CListenerDopplerCI")); +#endif + } + +// ----------------------------------------------------------------------------- +// CListenerDopplerCI::ApplyL +// +// Applies the ListenerDoppler settings. +// Adaptation must check each settings and take appropriate actions since +// this method might be called after several settings have been made. +// ----------------------------------------------------------------------------- +// +void CListenerDopplerCI::ApplyL() + { +#ifdef _DEBUG + RDebug::Print(_L("CListenerDopplerCI::ApplyL")); +#endif + + if ( !HaveUpdateRights() ) + { + User::Leave(KErrAccessDenied); + } + + if (iObservers.Count() > 0) + { + if(iDopplerData.iEnabled) + { + iEnabled = iDopplerData.iEnabled; + iObservers[0]->EffectChanged(this, (TUint8)MAudioEffectObserver::KEnabled); + } + else + { + iEnabled = iDopplerData.iEnabled; + iObservers[0]->EffectChanged(this, (TUint8)MAudioEffectObserver::KDisabled); + } + + } + + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerlocationcistub/BWINS/ListenerLocationCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerlocationcistub/BWINS/ListenerLocationCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CListenerLocationCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CListenerLocationCI * CListenerLocationCI::NewL(class CMMFDevSound &) + ?NewL@CListenerLocationCI@@SAPAV1@XZ @ 2 NONAME ; class CListenerLocationCI * CListenerLocationCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerlocationcistub/EABI/ListenerLocationCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerlocationcistub/EABI/ListenerLocationCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN19CListenerLocationCI4NewLER12CMMFDevSound @ 1 NONAME + _ZTI19CListenerLocationCI @ 2 NONAME ; ## + _ZTV19CListenerLocationCI @ 3 NONAME ; ## + _ZN19CListenerLocationCI4NewLEv @ 4 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerlocationcistub/Group/ListenerLocationCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerlocationcistub/Group/ListenerLocationCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project file for ListenerLocation Effect Custom Interface STUB. +* +* +*/ + + +#include + +TARGET ListenerLocationCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207ACC +VENDORID VID_DEFAULT + + +CAPABILITY CAP_GENERAL_DLL + + +SOURCEPATH ../src +SOURCE ListenerLocationCIStub.cpp + +USERINCLUDE ../inc ../src + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib +LIBRARY EffectBase.lib +LIBRARY LocationBase.lib +LIBRARY ListenerLocationEffect.lib +LIBRARY MMFDevSound.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY ListenerLocationCI.lib + +LINKAS ListenerLocationCI.dll + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerlocationcistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerlocationcistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface STUB +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +PRJ_MMPFILES +ListenerLocationCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerlocationcistub/inc/ListenerLocationCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerlocationcistub/inc/ListenerLocationCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the bassboost Custom Interface class. +* This serves as an example of how adaptation might define the +* custom interface class. +* The CListenerLocationCI object is typically instantiated by a DevSound +* instance and return to the client when the CustomInterface() +* method is invoked. +* +* +*/ + + +#include +#include + +class CMMFDevSound; + +class CListenerLocationCI : public CListenerLocation + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CListenerLocationCI* NewL(CMMFDevSound& aDevSound); + + /** + * Destructor. + */ + virtual ~CListenerLocationCI(); + + public: // From Base Class + + /** + * From CAudioEffect + * Apply effect settings + * @since 3.0 + */ + virtual void ApplyL(); + + IMPORT_C static CListenerLocationCI* NewL(); + + private: + + /** + * C++ default constructor. + */ + CListenerLocationCI(CMMFDevSound& aDevSound); + CListenerLocationCI(); + + private: // Data + + CMMFDevSound* iDevSound; + }; diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerlocationcistub/src/ListenerLocationCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerlocationcistub/src/ListenerLocationCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the bassboost effect Custom Interface class +* +*/ + + +#ifdef _DEBUG +#include // Needed for RDebug Prints +#endif + +#include "ListenerLocationCI.h" +#include + +// ----------------------------------------------------------------------------- +// CListenerLocation::NewL +// Static function for creating an instance of the CListenerLocationCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CListenerLocationCI* CListenerLocationCI::NewL( + CMMFDevSound& aDevSound ) + { + CListenerLocationCI* self = new(ELeave) CListenerLocationCI(aDevSound); + return self; + } + +CListenerLocationCI::CListenerLocationCI( + CMMFDevSound& aDevSound ) + : iDevSound(&aDevSound) + { + iLocationData.iXCoordinate = 10; + iLocationData.iYCoordinate = 10; + iLocationData.iZCoordinate = 10; + iLocationData.iAzimuth = 10; + iLocationData.iElevation = 10; + iLocationData.iRadius = 10; + } + +// ----------------------------------------------------------------------------- +// CListenerLocation::NewL +// Static function for creating an instance of the CListenerLocationCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CListenerLocationCI* CListenerLocationCI::NewL() + { + CListenerLocationCI* self = new(ELeave) CListenerLocationCI(); + return self; + } + +CListenerLocationCI::CListenerLocationCI() + { + iLocationData.iXCoordinate = 10; + iLocationData.iYCoordinate = 10; + iLocationData.iZCoordinate = 10; + iLocationData.iAzimuth = 10; + iLocationData.iElevation = 10; + iLocationData.iRadius = 10; + } + +// Destructor + +CListenerLocationCI::~CListenerLocationCI() + { +#ifdef _DEBUG + RDebug::Print(_L("CListenerLocationCI::~CListenerLocationCI")); +#endif + } + +// ----------------------------------------------------------------------------- +// CListenerLocationCI::ApplyL +// +// Applies the bassboost settings. +// Adaptation must check each settings and take appropriate actions since +// this method might be called after several settings have been made. +// ----------------------------------------------------------------------------- +// +void CListenerLocationCI::ApplyL() + { +#ifdef _DEBUG + RDebug::Print(_L("CListenerLocationCI::ApplyL")); +#endif + + if ( !HaveUpdateRights() ) + { + User::Leave(KErrAccessDenied); + } + + if ( IsEnabled() ) + { + } + + // The effect change event is simulated by changing the bassboost and + // sending the observer a message indicating bassboost has changed. + // This is done for testing only. + + // The intention of this callback is to notify the observer when the bassboost + // object changes spontaneously. ie the user did not change the settings but + // event somewhere in the system causes the bassboost object to change state. + + if (iObservers.Count() > 0) + { + iObservers[0]->EffectChanged(this, (TUint8)MListenerLocationObserver::KSpecificEffectBase); + } + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerorientationcistub/BWINS/ListenerOrientationCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerorientationcistub/BWINS/ListenerOrientationCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CListenerOrientationCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CListenerOrientationCI * CListenerOrientationCI::NewL(class CMMFDevSound &) + ?NewL@CListenerOrientationCI@@SAPAV1@XZ @ 2 NONAME ; class CListenerOrientationCI * CListenerOrientationCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerorientationcistub/EABI/ListenerOrientationCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerorientationcistub/EABI/ListenerOrientationCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN22CListenerOrientationCI4NewLER12CMMFDevSound @ 1 NONAME + _ZTI22CListenerOrientationCI @ 2 NONAME ; ## + _ZTV22CListenerOrientationCI @ 3 NONAME ; ## + _ZN22CListenerOrientationCI4NewLEv @ 4 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerorientationcistub/Group/ListenerOrientationCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerorientationcistub/Group/ListenerOrientationCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project file for ListenerOrientation Effect Custom Interface STUB. +* +* +*/ + + +#include + +TARGET ListenerOrientationCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207AD0 +VENDORID VID_DEFAULT + + +CAPABILITY CAP_GENERAL_DLL + + +SOURCEPATH ../src +SOURCE ListenerOrientationCIStub.cpp + +USERINCLUDE ../inc ../src + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib +LIBRARY EffectBase.lib +LIBRARY OrientationBase.lib +LIBRARY ListenerOrientationEffect.lib +LIBRARY MMFDevSound.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY ListenerOrientationCI.lib + +LINKAS ListenerOrientationCI.dll + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerorientationcistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerorientationcistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface STUB +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +PRJ_MMPFILES +ListenerOrientationCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerorientationcistub/inc/ListenerOrientationCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerorientationcistub/inc/ListenerOrientationCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the bassboost Custom Interface class. +* This serves as an example of how adaptation might define the +* custom interface class. +* The CListenerOrientationCI object is typically instantiated by a DevSound +* instance and return to the client when the CustomInterface() +* method is invoked. +* +* +*/ + + +#include +#include + +class CMMFDevSound; + +class CListenerOrientationCI : public CListenerOrientation + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CListenerOrientationCI* NewL(CMMFDevSound& aDevSound); + + /** + * Destructor. + */ + virtual ~CListenerOrientationCI(); + + public: // From Base Class + + /** + * From CAudioEffect + * Apply effect settings + * @since 3.0 + */ + virtual void ApplyL(); + + IMPORT_C static CListenerOrientationCI* NewL(); + + private: + + /** + * C++ default constructor. + */ + CListenerOrientationCI(CMMFDevSound& aDevSound); + CListenerOrientationCI(); + + private: // Data + + CMMFDevSound* iDevSound; + }; diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerorientationcistub/src/ListenerOrientationCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/listenerorientationcistub/src/ListenerOrientationCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the bassboost effect Custom Interface class +* +*/ + + +#ifdef _DEBUG +#include // Needed for RDebug Prints +#endif + +#include "ListenerOrientationCI.h" +#include + +// ----------------------------------------------------------------------------- +// CListenerOrientation::NewL +// Static function for creating an instance of the CListenerOrientationCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CListenerOrientationCI* CListenerOrientationCI::NewL( + CMMFDevSound& aDevSound ) + { + CListenerOrientationCI* self = new(ELeave) CListenerOrientationCI(aDevSound); + return self; + } + +CListenerOrientationCI::CListenerOrientationCI( + CMMFDevSound& aDevSound ) + : iDevSound(&aDevSound) + { + iOrientationData.iHeading = 10; + iOrientationData.iPitch = 10; + iOrientationData.iRoll = 10; + iOrientationData.iFrontX = 10; + iOrientationData.iFrontY = 10; + iOrientationData.iFrontZ = 10; + iOrientationData.iAboveX = 10; + iOrientationData.iAboveY = 10; + iOrientationData.iAboveZ = 10; + + } + +// ----------------------------------------------------------------------------- +// CListenerOrientation::NewL +// Static function for creating an instance of the CListenerOrientationCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CListenerOrientationCI* CListenerOrientationCI::NewL() + { + CListenerOrientationCI* self = new(ELeave) CListenerOrientationCI(); + return self; + } + +CListenerOrientationCI::CListenerOrientationCI() + { + iOrientationData.iHeading = 10; + iOrientationData.iPitch = 10; + iOrientationData.iRoll = 10; + iOrientationData.iFrontX = 10; + iOrientationData.iFrontY = 10; + iOrientationData.iFrontZ = 10; + iOrientationData.iAboveX = 10; + iOrientationData.iAboveY = 10; + iOrientationData.iAboveZ = 10; + + } + +// Destructor + +CListenerOrientationCI::~CListenerOrientationCI() + { +#ifdef _DEBUG + RDebug::Print(_L("CListenerOrientationCI::~CListenerOrientationCI")); +#endif + } + +// ----------------------------------------------------------------------------- +// CListenerOrientationCI::ApplyL +// +// Applies the bassboost settings. +// Adaptation must check each settings and take appropriate actions since +// this method might be called after several settings have been made. +// ----------------------------------------------------------------------------- +// +void CListenerOrientationCI::ApplyL() + { +#ifdef _DEBUG + RDebug::Print(_L("CListenerOrientationCI::ApplyL")); +#endif + + if ( !HaveUpdateRights() ) + { + User::Leave(KErrAccessDenied); + } + + if ( IsEnabled() ) + { + } + + // The effect change event is simulated by changing the bassboost and + // sending the observer a message indicating bassboost has changed. + // This is done for testing only. + + // The intention of this callback is to notify the observer when the bassboost + // object changes spontaneously. ie the user did not change the settings but + // event somewhere in the system causes the bassboost object to change state. + + if (iObservers.Count() > 0) + { + iObservers[0]->EffectChanged(this, (TUint8)MListenerOrientationObserver::KSpecificEffectBase); + } + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/loudnesscistub/BWINS/LoudnessCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/loudnesscistub/BWINS/LoudnessCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CLoudnessCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CLoudnessCI * CLoudnessCI::NewL(class CMMFDevSound &) + ?NewL@CLoudnessCI@@SAPAV1@XZ @ 2 NONAME ; class CLoudnessCI * CLoudnessCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/loudnesscistub/EABI/LoudnessCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/loudnesscistub/EABI/LoudnessCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN11CLoudnessCI4NewLER12CMMFDevSound @ 1 NONAME + _ZTI11CLoudnessCI @ 2 NONAME ; ## + _ZTV11CLoudnessCI @ 3 NONAME ; ## + _ZN11CLoudnessCI4NewLEv @ 4 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/loudnesscistub/Group/LoudnessCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/loudnesscistub/Group/LoudnessCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project file for Loudness Custom Interface STUB. +* +* +*/ + + +#include + +TARGET LoudnessCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207AEC + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + + +SOURCEPATH ../src +SOURCE LoudnessCIStub.cpp + +USERINCLUDE ../inc ../src + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common + +LIBRARY euser.lib +LIBRARY EffectBase.lib +LIBRARY LoudnessEffect.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY LoudnessCI.lib + +LINKAS LoudnessCI.dll + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/loudnesscistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/loudnesscistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface stub +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +LoudnessCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/loudnesscistub/inc/LoudnessCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/loudnesscistub/inc/LoudnessCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the Loudness Custom Interface class. +* +* +*/ + + +#include +#include + +class CMMFDevSound; + +class CLoudnessCI : public CLoudness + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CLoudnessCI* NewL(CMMFDevSound& aDevSound); + + /** + * Destructor. + */ + virtual ~CLoudnessCI(); + + /** + * From CAudioEffect + * Apply effect settings + * @since 3.0 + */ + virtual void ApplyL(); + + IMPORT_C static CLoudnessCI* NewL(); + + private: + + /** + * C++ default constructor. + */ + CLoudnessCI(CMMFDevSound& aDevSound); + CLoudnessCI(); + + private: // Data + + CMMFDevSound* iDevSound; + }; diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/loudnesscistub/src/LoudnessCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/loudnesscistub/src/LoudnessCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the Loudness effect Custom Interface class +* +*/ + + +#ifdef _DEBUG +#include +#endif +#include "LoudnessCI.h" + + +EXPORT_C CLoudnessCI* CLoudnessCI::NewL( + CMMFDevSound& aDevSound ) + { + CLoudnessCI* self = new(ELeave) CLoudnessCI(aDevSound); + return self; + } + +CLoudnessCI::CLoudnessCI( + CMMFDevSound& aDevSound ) + : iDevSound(&aDevSound ) + { + } + +EXPORT_C CLoudnessCI* CLoudnessCI::NewL() + { + CLoudnessCI* self = new(ELeave) CLoudnessCI(); + return self; + } + +CLoudnessCI::CLoudnessCI() + { + } + +CLoudnessCI::~CLoudnessCI() + { + } + +void CLoudnessCI::ApplyL() + { +#ifdef _DEBUG + RDebug::Print(_L("CLoudnessCI::ApplyL")); +#endif + + if (iObservers.Count() > 0) + { + if(iLoudnessData.iEnabled) + { + iEnabled = iLoudnessData.iEnabled; + iObservers[0]->EffectChanged(this, (TUint8)MAudioEffectObserver::KEnabled); + } + else + { + iEnabled = iLoudnessData.iEnabled; + iObservers[0]->EffectChanged(this, (TUint8)MAudioEffectObserver::KDisabled); + } + + } + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/rom/Effects_Stubs.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/rom/Effects_Stubs.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Support for Effects CI Stubs +* +*/ + +#ifndef __EFFECTS_STUBS_IBY__ +#define __EFFECTS_STUBS_IBY__ + +file=ABI_DIR\BUILD_DIR\AudioEqualizerCI_Stub.dll SHARED_LIB_DIR\AudioEqualizerCI_Stub.dll +file=ABI_DIR\BUILD_DIR\EnvironmentalReverbCI_Stub.dll SHARED_LIB_DIR\EnvironmentalReverbCI_Stub.dll +file=ABI_DIR\BUILD_DIR\StereoWideningCI_Stub.dll SHARED_LIB_DIR\StereoWideningCI_Stub.dll +file=ABI_DIR\BUILD_DIR\BassBoostCI_Stub.dll SHARED_LIB_DIR\BassBoostCI_Stub.dll +file=ABI_DIR\BUILD_DIR\ListenerDopplerCI_Stub.dll SHARED_LIB_DIR\ListenerDopplerCI_Stub.dll +file=ABI_DIR\BUILD_DIR\SourceDopplerCI_Stub.dll SHARED_LIB_DIR\SourceDopplerCI_Stub.dll +file=ABI_DIR\BUILD_DIR\ListenerLocationCI_Stub.dll SHARED_LIB_DIR\ListenerLocationCI_Stub.dll +file=ABI_DIR\BUILD_DIR\ListenerOrientationCI_Stub.dll SHARED_LIB_DIR\ListenerOrientationCI_Stub.dll +file=ABI_DIR\BUILD_DIR\SourceLocationCI_Stub.dll SHARED_LIB_DIR\SourceLocationCI_Stub.dll +file=ABI_DIR\BUILD_DIR\SourceOrientationCI_Stub.dll SHARED_LIB_DIR\SourceOrientationCI_Stub.dll +file=ABI_DIR\BUILD_DIR\DistanceAttenuationCI_Stub.dll SHARED_LIB_DIR\DistanceAttenuationCI_Stub.dll +file=ABI_DIR\BUILD_DIR\LoudnessCI_Stub.dll SHARED_LIB_DIR\LoudnessCI_Stub.dll +file=ABI_DIR\BUILD_DIR\RoomLevelCI_Stub.dll SHARED_LIB_DIR\RoomLevelCI_Stub.dll + +#endif diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/roomlevelcistub/BWINS/RoomLevelCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/roomlevelcistub/BWINS/RoomLevelCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CRoomLevelCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CRoomLevelCI * CRoomLevelCI::NewL(class CMMFDevSound &) + ?NewL@CRoomLevelCI@@SAPAV1@XZ @ 2 NONAME ; class CRoomLevelCI * CRoomLevelCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/roomlevelcistub/EABI/RoomLevelCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/roomlevelcistub/EABI/RoomLevelCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN12CRoomLevelCI4NewLER12CMMFDevSound @ 1 NONAME + _ZN12CRoomLevelCI4NewLEv @ 2 NONAME + _ZTI12CRoomLevelCI @ 3 NONAME ; ## + _ZTV12CRoomLevelCI @ 4 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/roomlevelcistub/Group/RoomLevelCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/roomlevelcistub/Group/RoomLevelCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project file for RoomLevel Custom Interface STUB. +* +* +*/ + + +#include + +TARGET RoomLevelCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B3F + + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + + +SOURCEPATH ../src +SOURCE RoomLevelCIStub.cpp + +USERINCLUDE ../inc ../src + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common + +LIBRARY euser.lib +LIBRARY EffectBase.lib +LIBRARY RoomLevelEffect.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY RoomLevelCI.lib + +LINKAS RoomLevelCI.dll + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/roomlevelcistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/roomlevelcistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface stub +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +PRJ_MMPFILES +RoomLevelCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/roomlevelcistub/inc/RoomLevelCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/roomlevelcistub/inc/RoomLevelCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the RoomLevel Custom Interface class. +* +* +*/ + + +#include +#include + +class CMMFDevSound; + +class CRoomLevelCI : public CRoomLevel + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CRoomLevelCI* NewL(CMMFDevSound& aDevSound); + + /** + * Destructor. + */ + virtual ~CRoomLevelCI(); + + /** + * From CAudioEffect + * Apply effect settings + * @since 3.0 + */ + virtual void ApplyL(); + + IMPORT_C static CRoomLevelCI* NewL(); + + private: + + /** + * C++ default constructor. + */ + CRoomLevelCI(CMMFDevSound& aDevSound); + CRoomLevelCI(); + + private: // Data + + CMMFDevSound* iDevSound; + }; diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/roomlevelcistub/src/RoomLevelCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/roomlevelcistub/src/RoomLevelCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the RoomLevel effect Custom Interface class +* +*/ + + +#ifdef _DEBUG +#include +#endif +#include "RoomLevelCI.h" + + +EXPORT_C CRoomLevelCI* CRoomLevelCI::NewL( + CMMFDevSound& aDevSound ) + { + CRoomLevelCI* self = new(ELeave) CRoomLevelCI(aDevSound); + return self; + } + +CRoomLevelCI::CRoomLevelCI( + CMMFDevSound& aDevSound ) + : iDevSound(&aDevSound ) + { + iRoomLevelData.iEnvironmentalReverbId = 123456; + iRoomLevelData.iStreamRoomLevel = 0; + iRoomLevelData.iStreamMinRoomLevel = 0; + iRoomLevelData.iStreamMaxRoomLevel = 1000; + + } + +EXPORT_C CRoomLevelCI* CRoomLevelCI::NewL() + { + CRoomLevelCI* self = new(ELeave) CRoomLevelCI(); + return self; + } + +CRoomLevelCI::CRoomLevelCI() + { + iRoomLevelData.iEnvironmentalReverbId = 123456; + iRoomLevelData.iStreamRoomLevel = 0; + iRoomLevelData.iStreamMinRoomLevel = 0; + iRoomLevelData.iStreamMaxRoomLevel = 1000; + } + +CRoomLevelCI::~CRoomLevelCI() + { + } + +void CRoomLevelCI::ApplyL() + { +#ifdef _DEBUG + RDebug::Print(_L("CRoomLevelCI::ApplyL")); +#endif + + if (iObservers.Count() > 0) + { + iRoomLevelData.iEnabled = ETrue; + iObservers[0]->EffectChanged(this, (TUint8)MAudioEffectObserver::KEnabled); + + } + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcedopplercistub/BWINS/SourceDopplerCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcedopplercistub/BWINS/SourceDopplerCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CSourceDopplerCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CSourceDopplerCI * CSourceDopplerCI::NewL(class CMMFDevSound &) + ?NewL@CSourceDopplerCI@@SAPAV1@XZ @ 2 NONAME ; class CSourceDopplerCI * CSourceDopplerCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcedopplercistub/EABI/SourceDopplerCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcedopplercistub/EABI/SourceDopplerCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN16CSourceDopplerCI4NewLER12CMMFDevSound @ 1 NONAME + _ZN16CSourceDopplerCI4NewLEv @ 2 NONAME + _ZTI16CSourceDopplerCI @ 3 NONAME ; ## + _ZTV16CSourceDopplerCI @ 4 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcedopplercistub/Group/SourceDopplerCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcedopplercistub/Group/SourceDopplerCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project file for Source Doppler Effect Custom Interface STUB. +* +* +*/ + + + +#include + +TARGET SourceDopplerCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207AA5 +VENDORID VID_DEFAULT + + +CAPABILITY CAP_GENERAL_DLL + + +SOURCEPATH ../src +SOURCE SourceDopplerCIStub.cpp + +USERINCLUDE ../inc ../src + + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib +LIBRARY EffectBase.lib +LIBRARY DopplerBase.lib +LIBRARY SourceDopplerEffect.lib +LIBRARY MMFDevSound.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY SourceDopplerCI.lib + +LINKAS SourceDopplerCI.dll + + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcedopplercistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcedopplercistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface STUB +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +SourceDopplerCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcedopplercistub/inc/SourceDopplerCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcedopplercistub/inc/SourceDopplerCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the SourceDoppler Custom Interface class. +* This serves as an example of how adaptation might define the +* custom interface class. +* The CSourceDopplerCI object is typically instantiated by a DevSound +* instance and return to the client when the CustomInterface() +* method is invoked. +* +* +*/ + + +#include +#include + +class CMMFDevSound; + +class CSourceDopplerCI : public CSourceDoppler + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CSourceDopplerCI* NewL(CMMFDevSound& aDevSound); + + /** + * Destructor. + */ + virtual ~CSourceDopplerCI(); + + public: // From Base Class + + /** + * From CAudioEffect + * Apply effect settings + * @since 3.0 + */ + virtual void ApplyL(); + + IMPORT_C static CSourceDopplerCI* NewL(); + + private: + + /** + * C++ default constructor. + */ + CSourceDopplerCI(CMMFDevSound& aDevSound); + CSourceDopplerCI(); + + private: // Data + + CMMFDevSound* iDevSound; + }; diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcedopplercistub/src/SourceDopplerCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcedopplercistub/src/SourceDopplerCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the Source Doppler Effect Custom Interface class +* +*/ + + +#ifdef _DEBUG +#include // Needed for RDebug Prints +#endif + +#include "SourceDopplerCI.h" +#include + +// ----------------------------------------------------------------------------- +// CSourceDoppler::NewL +// Static function for creating an instance of the CSourceDopplerCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CSourceDopplerCI* CSourceDopplerCI::NewL( + CMMFDevSound& aDevSound ) + { + CSourceDopplerCI* self = new(ELeave) CSourceDopplerCI(aDevSound); + return self; + } + +CSourceDopplerCI::CSourceDopplerCI( + CMMFDevSound& aDevSound ) + : iDevSound(&aDevSound) + { + iDopplerData.iVelocityX = 10; + iDopplerData.iVelocityY = 10; + iDopplerData.iVelocityZ = 10; + iDopplerData.iAzimuth = 20; + iDopplerData.iElevation = 20; + iDopplerData.iRadius = 20; + iDopplerData.iFactor = 5; + iDopplerData.iMaxFactor = 10; + } + +// ----------------------------------------------------------------------------- +// CSourceDoppler::NewL +// Static function for creating an instance of the CSourceDopplerCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CSourceDopplerCI* CSourceDopplerCI::NewL() + { + CSourceDopplerCI* self = new(ELeave) CSourceDopplerCI(); + return self; + } + +CSourceDopplerCI::CSourceDopplerCI() + { + iDopplerData.iVelocityX = 10; + iDopplerData.iVelocityY = 10; + iDopplerData.iVelocityZ = 10; + iDopplerData.iAzimuth = 20; + iDopplerData.iElevation = 20; + iDopplerData.iRadius = 20; + iDopplerData.iFactor = 5; + iDopplerData.iMaxFactor = 10; + } + +// Destructor + +CSourceDopplerCI::~CSourceDopplerCI() + { +#ifdef _DEBUG + RDebug::Print(_L("CSourceDopplerCI::~CSourceDopplerCI")); +#endif + } + +// ----------------------------------------------------------------------------- +// CSourceDopplerCI::ApplyL +// +// Applies the SourceDoppler settings. +// Adaptation must check each settings and take appropriate actions since +// this method might be called after several settings have been made. +// ----------------------------------------------------------------------------- +// +void CSourceDopplerCI::ApplyL() + { +#ifdef _DEBUG + RDebug::Print(_L("CSourceDopplerCI::ApplyL")); +#endif + + if ( !HaveUpdateRights() ) + { + User::Leave(KErrAccessDenied); + } + + if (iObservers.Count() > 0) + { + if(iDopplerData.iEnabled) + { + iEnabled = iDopplerData.iEnabled; + iObservers[0]->EffectChanged(this, (TUint8)MAudioEffectObserver::KEnabled); + } + else + { + iEnabled = iDopplerData.iEnabled; + iObservers[0]->EffectChanged(this, (TUint8)MAudioEffectObserver::KDisabled); + } + + } + + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/BWINS/SourceLocationCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/BWINS/SourceLocationCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CSourceLocationCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CSourceLocationCI * CSourceLocationCI::NewL(class CMMFDevSound &) + ?NewL@CSourceLocationCI@@SAPAV1@XZ @ 2 NONAME ; class CSourceLocationCI * CSourceLocationCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/BWINS/SourceLocationCI_StubU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/BWINS/SourceLocationCI_StubU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CSourceLocationCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CSourceLocationCI * CSourceLocationCI::NewL(class CMMFDevSound &) + ?NewL@CSourceLocationCI@@SAPAV1@XZ @ 2 NONAME ; class CSourceLocationCI * CSourceLocationCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/EABI/SourceLocationCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/EABI/SourceLocationCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN17CSourceLocationCI4NewLER12CMMFDevSound @ 1 NONAME + _ZTI17CSourceLocationCI @ 2 NONAME ; ## + _ZTV17CSourceLocationCI @ 3 NONAME ; ## + _ZN17CSourceLocationCI4NewLEv @ 4 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/EABI/SourceLocationCI_StubU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/EABI/SourceLocationCI_StubU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN17CSourceLocationCI4NewLER12CMMFDevSound @ 1 NONAME + _ZN17CSourceLocationCI4NewLEv @ 2 NONAME + _ZTI17CSourceLocationCI @ 3 NONAME ; ## + _ZTV17CSourceLocationCI @ 4 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/Group/SourceLocationCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/Group/SourceLocationCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project file for SourceLocation Effect Custom Interface STUB. +* +* +*/ + + +#include + +TARGET SourceLocationCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207AD4 +VENDORID VID_DEFAULT + + +CAPABILITY CAP_GENERAL_DLL + + +SOURCEPATH ../src +SOURCE SourceLocationCIStub.cpp + +USERINCLUDE ../inc ../src + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib +LIBRARY EffectBase.lib +LIBRARY LocationBase.lib +LIBRARY SourceLocationEffect.lib +LIBRARY MMFDevSound.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY SourceLocationCI.lib + +LINKAS SourceLocationCI.dll + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface STUB +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +PRJ_MMPFILES +SourceLocationCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/inc/SourceLocationCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/inc/SourceLocationCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the bassboost Custom Interface class. +* This serves as an example of how adaptation might define the +* custom interface class. +* The CSourceLocationCI object is typically instantiated by a DevSound +* instance and return to the client when the CustomInterface() +* method is invoked. +* +* +*/ + + +#include +#include + +class CMMFDevSound; + +class CSourceLocationCI : public CSourceLocation + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CSourceLocationCI* NewL(CMMFDevSound& aDevSound); + + /** + * Destructor. + */ + virtual ~CSourceLocationCI(); + + public: // From Base Class + + /** + * From CAudioEffect + * Apply effect settings + * @since 3.0 + */ + virtual void ApplyL(); + + IMPORT_C static CSourceLocationCI* NewL(); + + private: + + /** + * C++ default constructor. + */ + CSourceLocationCI(CMMFDevSound& aDevSound); + CSourceLocationCI(); + + private: // Data + + CMMFDevSound* iDevSound; + }; diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/src/SourceLocationCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourcelocationcistub/src/SourceLocationCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the bassboost effect Custom Interface class +* +*/ + + +#ifdef _DEBUG +#include // Needed for RDebug Prints +#endif + +#include "SourceLocationCI.h" +#include + +// ----------------------------------------------------------------------------- +// CSourceLocation::NewL +// Static function for creating an instance of the CSourceLocationCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CSourceLocationCI* CSourceLocationCI::NewL( + CMMFDevSound& aDevSound ) + { + CSourceLocationCI* self = new(ELeave) CSourceLocationCI(aDevSound); + return self; + } + +CSourceLocationCI::CSourceLocationCI( + CMMFDevSound& aDevSound ) + : iDevSound(&aDevSound) + { + iLocationData.iXCoordinate = 10; + iLocationData.iYCoordinate = 10; + iLocationData.iZCoordinate = 10; + iLocationData.iAzimuth = 10; + iLocationData.iElevation = 10; + iLocationData.iRadius = 10; + } + +// ----------------------------------------------------------------------------- +// CSourceLocation::NewL +// Static function for creating an instance of the CSourceLocationCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CSourceLocationCI* CSourceLocationCI::NewL() + { + CSourceLocationCI* self = new(ELeave) CSourceLocationCI(); + return self; + } + +CSourceLocationCI::CSourceLocationCI() + { + iLocationData.iXCoordinate = 10; + iLocationData.iYCoordinate = 10; + iLocationData.iZCoordinate = 10; + iLocationData.iAzimuth = 10; + iLocationData.iElevation = 10; + iLocationData.iRadius = 10; + } + +// Destructor + +CSourceLocationCI::~CSourceLocationCI() + { +#ifdef _DEBUG + RDebug::Print(_L("CSourceLocationCI::~CSourceLocationCI")); +#endif + } + +// ----------------------------------------------------------------------------- +// CSourceLocationCI::ApplyL +// +// Applies the bassboost settings. +// Adaptation must check each settings and take appropriate actions since +// this method might be called after several settings have been made. +// ----------------------------------------------------------------------------- +// +void CSourceLocationCI::ApplyL() + { +#ifdef _DEBUG + RDebug::Print(_L("CSourceLocationCI::ApplyL")); +#endif + + if ( !HaveUpdateRights() ) + { + User::Leave(KErrAccessDenied); + } + + if ( IsEnabled() ) + { + } + + // The effect change event is simulated by changing the bassboost and + // sending the observer a message indicating bassboost has changed. + // This is done for testing only. + + // The intention of this callback is to notify the observer when the bassboost + // object changes spontaneously. ie the user did not change the settings but + // event somewhere in the system causes the bassboost object to change state. + + if (iObservers.Count() > 0) + { + iObservers[0]->EffectChanged(this, (TUint8)MSourceLocationObserver::KSpecificEffectBase); + } + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourceorientationcistub/BWINS/SourceOrientationCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourceorientationcistub/BWINS/SourceOrientationCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CSourceOrientationCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CSourceOrientationCI * CSourceOrientationCI::NewL(class CMMFDevSound &) + ?NewL@CSourceOrientationCI@@SAPAV1@XZ @ 2 NONAME ; class CSourceOrientationCI * CSourceOrientationCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourceorientationcistub/EABI/SourceOrientationCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourceorientationcistub/EABI/SourceOrientationCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN20CSourceOrientationCI4NewLER12CMMFDevSound @ 1 NONAME + _ZTI20CSourceOrientationCI @ 2 NONAME ; ## + _ZTV20CSourceOrientationCI @ 3 NONAME ; ## + _ZN20CSourceOrientationCI4NewLEv @ 4 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourceorientationcistub/Group/SourceOrientationCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourceorientationcistub/Group/SourceOrientationCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project file for SourceOrientation Effect Custom Interface STUB. +* +* +*/ + + +#include + +TARGET SourceOrientationCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207AD8 +VENDORID VID_DEFAULT + + +CAPABILITY CAP_GENERAL_DLL + + +SOURCEPATH ../src +SOURCE SourceOrientationCIStub.cpp + +USERINCLUDE ../inc ../src + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib +LIBRARY EffectBase.lib +LIBRARY OrientationBase.lib +LIBRARY SourceOrientationEffect.lib +LIBRARY MMFDevSound.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY SourceOrientationCI.lib + +LINKAS SourceOrientationCI.dll + + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourceorientationcistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourceorientationcistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface STUB +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +PRJ_MMPFILES +SourceOrientationCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourceorientationcistub/inc/SourceOrientationCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourceorientationcistub/inc/SourceOrientationCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the bassboost Custom Interface class. +* This serves as an example of how adaptation might define the +* custom interface class. +* The CSourceOrientationCI object is typically instantiated by a DevSound +* instance and return to the client when the CustomInterface() +* method is invoked. +* +* +*/ + + +#include +#include + +class CMMFDevSound; + +class CSourceOrientationCI : public CSourceOrientation + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CSourceOrientationCI* NewL(CMMFDevSound& aDevSound); + + /** + * Destructor. + */ + virtual ~CSourceOrientationCI(); + + public: // From Base Class + + /** + * From CAudioEffect + * Apply effect settings + * @since 3.0 + */ + virtual void ApplyL(); + + IMPORT_C static CSourceOrientationCI* NewL(); + + private: + + /** + * C++ default constructor. + */ + CSourceOrientationCI(CMMFDevSound& aDevSound); + CSourceOrientationCI(); + + private: // Data + + CMMFDevSound* iDevSound; + }; diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourceorientationcistub/src/SourceOrientationCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/sourceorientationcistub/src/SourceOrientationCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the bassboost effect Custom Interface class +* +*/ + + +#ifdef _DEBUG +#include // Needed for RDebug Prints +#endif + +#include "SourceOrientationCI.h" +#include + +// ----------------------------------------------------------------------------- +// CSourceOrientation::NewL +// Static function for creating an instance of the CSourceOrientationCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CSourceOrientationCI* CSourceOrientationCI::NewL( + CMMFDevSound& aDevSound ) + { + CSourceOrientationCI* self = new(ELeave) CSourceOrientationCI(aDevSound); + return self; + } + +CSourceOrientationCI::CSourceOrientationCI( + CMMFDevSound& aDevSound ) + : iDevSound(&aDevSound) + { + iOrientationData.iHeading = 10; + iOrientationData.iPitch = 10; + iOrientationData.iRoll = 10; + iOrientationData.iFrontX = 10; + iOrientationData.iFrontY = 10; + iOrientationData.iFrontZ = 10; + iOrientationData.iAboveX = 10; + iOrientationData.iAboveY = 10; + iOrientationData.iAboveZ = 10; + } + +// ----------------------------------------------------------------------------- +// CSourceOrientation::NewL +// Static function for creating an instance of the CSourceOrientationCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CSourceOrientationCI* CSourceOrientationCI::NewL() + { + CSourceOrientationCI* self = new(ELeave) CSourceOrientationCI(); + return self; + } + +CSourceOrientationCI::CSourceOrientationCI() + { + iOrientationData.iHeading = 10; + iOrientationData.iPitch = 10; + iOrientationData.iRoll = 10; + iOrientationData.iFrontX = 10; + iOrientationData.iFrontY = 10; + iOrientationData.iFrontZ = 10; + iOrientationData.iAboveX = 10; + iOrientationData.iAboveY = 10; + iOrientationData.iAboveZ = 10; + } + +// Destructor + +CSourceOrientationCI::~CSourceOrientationCI() + { +#ifdef _DEBUG + RDebug::Print(_L("CSourceOrientationCI::~CSourceOrientationCI")); +#endif + } + +// ----------------------------------------------------------------------------- +// CSourceOrientationCI::ApplyL +// +// Applies the bassboost settings. +// Adaptation must check each settings and take appropriate actions since +// this method might be called after several settings have been made. +// ----------------------------------------------------------------------------- +// +void CSourceOrientationCI::ApplyL() + { +#ifdef _DEBUG + RDebug::Print(_L("CSourceOrientationCI::ApplyL")); +#endif + + if ( !HaveUpdateRights() ) + { + User::Leave(KErrAccessDenied); + } + + if ( IsEnabled() ) + { + } + + // The effect change event is simulated by changing the bassboost and + // sending the observer a message indicating bassboost has changed. + // This is done for testing only. + + // The intention of this callback is to notify the observer when the bassboost + // object changes spontaneously. ie the user did not change the settings but + // event somewhere in the system causes the bassboost object to change state. + + if (iObservers.Count() > 0) + { + iObservers[0]->EffectChanged(this, (TUint8)MSourceOrientationObserver::KSpecificEffectBase); + } + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/stereowideningcistub/BWINS/StereoWideningCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/stereowideningcistub/BWINS/StereoWideningCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CStereoWideningCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CStereoWideningCI * CStereoWideningCI::NewL(class CMMFDevSound &) + ?NewL@CStereoWideningCI@@SAPAV1@XZ @ 2 NONAME ; class CStereoWideningCI * CStereoWideningCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/stereowideningcistub/EABI/StereoWideningCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/stereowideningcistub/EABI/StereoWideningCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN17CStereoWideningCI4NewLER12CMMFDevSound @ 1 NONAME + _ZTI17CStereoWideningCI @ 2 NONAME ; ## + _ZTV17CStereoWideningCI @ 3 NONAME ; ## + _ZN17CStereoWideningCI4NewLEv @ 4 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/stereowideningcistub/Group/StereoWideningCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/stereowideningcistub/Group/StereoWideningCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project file for StereoWidening Custom Interface STUB. +* +* +*/ + + +#include + +TARGET StereoWideningCI_Stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207A88 + + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + + +SOURCEPATH ../src +SOURCE StereoWideningCIStub.cpp + +USERINCLUDE ../inc ../src + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common + +LIBRARY euser.lib +LIBRARY EffectBase.lib +LIBRARY StereoWideningEffect.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY StereoWideningCI.lib + +LINKAS StereoWideningCI.dll + + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/stereowideningcistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/stereowideningcistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface stub +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +PRJ_MMPFILES +StereoWideningCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/stereowideningcistub/inc/StereoWideningCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/stereowideningcistub/inc/StereoWideningCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the StereoWidening Custom Interface class. +* +* +*/ + + +#include +#include + +class CMMFDevSound; + +class CStereoWideningCI : public CStereoWidening + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CStereoWideningCI* NewL(CMMFDevSound& aDevSound); + + /** + * Destructor. + */ + virtual ~CStereoWideningCI(); + + /** + * From CAudioEffect + * Apply effect settings + * @since 3.0 + */ + virtual void ApplyL(); + + IMPORT_C static CStereoWideningCI* NewL(); + + private: + + /** + * C++ default constructor. + */ + CStereoWideningCI(CMMFDevSound& aDevSound); + CStereoWideningCI(); + + private: // Data + + CMMFDevSound* iDevSound; + }; diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioeffectscistubs/stereowideningcistub/src/StereoWideningCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioeffectscistubs/stereowideningcistub/src/StereoWideningCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the StereoWidening effect Custom Interface class +* +*/ + + +#ifdef _DEBUG +#include +#endif +#include "StereoWideningCI.h" + + +EXPORT_C CStereoWideningCI* CStereoWideningCI::NewL( + CMMFDevSound& aDevSound ) + { + CStereoWideningCI* self = new(ELeave) CStereoWideningCI(aDevSound); + return self; + } + +CStereoWideningCI::CStereoWideningCI( + CMMFDevSound& aDevSound ) + : iDevSound(&aDevSound ) + { + iStereoWideningData.iLevel = 20; // Initial value + iStereoWideningData.iContinuousLevelSupported = EFalse; // Initial value + } + +EXPORT_C CStereoWideningCI* CStereoWideningCI::NewL() + { + CStereoWideningCI* self = new(ELeave) CStereoWideningCI(); + return self; + } + +CStereoWideningCI::CStereoWideningCI() + { + iStereoWideningData.iLevel = 20; // Initial value + iStereoWideningData.iContinuousLevelSupported = EFalse; // Initial value + } + +CStereoWideningCI::~CStereoWideningCI() + { + } + +void CStereoWideningCI::ApplyL() + { +#ifdef _DEBUG + RDebug::Print(_L("CStereoWideningCI::ApplyL")); +#endif + + if (iObservers.Count() > 0) + { + if(iStereoWideningData.iEnabled) + { + iEnabled = iStereoWideningData.iEnabled; + iObservers[0]->EffectChanged(this, (TUint8)MAudioEffectObserver::KEnabled); + } + else + { + iEnabled = iStereoWideningData.iEnabled; + iObservers[0]->EffectChanged(this, (TUint8)MAudioEffectObserver::KDisabled); + } + + } + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/CustomInterfaceProxyFactory_stub/BWINS/CustomInterfaceProxyFactoryU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/CustomInterfaceProxyFactory_stub/BWINS/CustomInterfaceProxyFactoryU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateProxy@CCustomInterfaceProxyFactory@@SAPAXVTUid@@V?$TPckgBuf@VTMMFMessageDestination@@@@AAVMCustomCommand@@PAVCCustomInterfaceUtility@@@Z @ 1 NONAME ; void * CCustomInterfaceProxyFactory::CreateProxy(class TUid, class TPckgBuf, class MCustomCommand &, class CCustomInterfaceUtility *) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/CustomInterfaceProxyFactory_stub/EABI/CustomInterfaceProxyFactoryU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/CustomInterfaceProxyFactory_stub/EABI/CustomInterfaceProxyFactoryU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,3 @@ +EXPORTS + _ZN28CCustomInterfaceProxyFactory11CreateProxyE4TUid8TPckgBufI22TMMFMessageDestinationER14MCustomCommandP23CCustomInterfaceUtility @ 1 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/CustomInterfaceProxyFactory_stub/group/CustomInterfaceProxyFactory_stub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/CustomInterfaceProxyFactory_stub/group/CustomInterfaceProxyFactory_stub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + +#include + +TARGET CustomInterfaceProxyFactory.dll +TARGETTYPE DLL +UID 0x1000008D 0x10200012 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + + +SOURCEPATH ../src +SOURCE CustomInterfaceProxyFactory.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../Inc +USERINCLUDE ../src + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib +LIBRARY AudioEqualizerProxy.lib +LIBRARY EnvironmentalReverbProxy.lib +LIBRARY StereoWideningProxy.lib +LIBRARY BassBoostProxy.lib +LIBRARY ListenerDopplerProxy.lib +LIBRARY ListenerLocationProxy.lib +LIBRARY ListenerOrientationProxy.lib +LIBRARY SourceDopplerProxy.lib +LIBRARY SourceLocationProxy.lib +LIBRARY SourceOrientationProxy.lib +LIBRARY DistanceAttenuationProxy.lib +LIBRARY LoudnessProxy.lib +LIBRARY RoomLevelProxy.lib +LIBRARY AddedDevSoundControlProxy.lib +LIBRARY RestrictedAudioOutputProxy.lib +LIBRARY AudioInputProxy.lib +LIBRARY AudioOutputProxy.lib +LIBRARY G711DecoderIntfcProxy.lib +LIBRARY G729DecoderIntfcProxy.lib +LIBRARY IlbcDecoderIntfcProxy.lib +LIBRARY G711EncoderIntfcProxy.lib +LIBRARY G729EncoderIntfcProxy.lib +LIBRARY IlbcEncoderIntfcProxy.lib +LIBRARY SpeechEncoderConfigProxy.lib +LIBRARY ErrorConcealmentIntfcProxy.lib + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/CustomInterfaceProxyFactory_stub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/CustomInterfaceProxyFactory_stub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file custom interface proxy builder. +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +CustomInterfaceProxyFactory_stub.mmp + +// End of File + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/CustomInterfaceProxyFactory_stub/inc/CustomInterfaceProxyFactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/CustomInterfaceProxyFactory_stub/inc/CustomInterfaceProxyFactory.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - CustomInterfaceProxyFactory adaptation stub implementation. +* +*/ + +#ifndef __CUSTOMINTERFACEPROXYFACTORY_H +#define __CUSTOMINTERFACEPROXYFACTORY_H + +#include +#include + +// FORWARD DECLARATIONS +class CCustomInterfaceUtility; + +// CLASS DECLARATION +class CCustomInterfaceProxyFactory + { +public: + IMPORT_C static TAny* CreateProxy(TUid aInterfaceUid, + TMMFMessageDestinationPckg aHandlePckg, + MCustomCommand& aCustomCommand, + CCustomInterfaceUtility* aCustomInterfaceUtility); + }; + +#endif + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/CustomInterfaceProxyFactory_stub/src/CustomInterfaceProxyFactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/CustomInterfaceProxyFactory_stub/src/CustomInterfaceProxyFactory.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,187 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + +#include "AudioEqualizerProxy.h" +#include "BassBoostProxy.h" +#include "DistanceAttenuationProxy.h" +#include "EnvironmentalReverbProxy.h" +#include "ListenerDopplerProxy.h" +#include "ListenerLocationProxy.h" +#include "ListenerOrientationProxy.h" +#include "LoudnessProxy.h" +#include "RoomLevelProxy.h" +#include "SourceDopplerProxy.h" +#include "SourceLocationProxy.h" +#include "SourceOrientationProxy.h" +#include "StereoWideningProxy.h" +#include "AddedDevSoundControlCI.h" +#include "AddedDevSoundControlProxy.h" +#include "RestrictedAudioOutputProxy.h" +#include "AudioInputProxy.h" +#include "AudioOutputProxy.h" +#include "AudioInputMessageTypes.h" +#include "AudioOutputMessageTypes.h" +#include "G711DecoderIntfcProxy.h" +#include "G729DecoderIntfcProxy.h" +#include "IlbcDecoderIntfcProxy.h" +#include "G711EncoderIntfcProxy.h" +#include "G729EncoderIntfcProxy.h" +#include "IlbcEncoderIntfcProxy.h" +#include "SpeechEncoderConfigProxy.h" +#include "ErrorConcealmentIntfcProxy.h" +#include "CustomInterfaceProxyFactory.h" + + +EXPORT_C TAny* CCustomInterfaceProxyFactory::CreateProxy(TUid aInterfaceUid, + TMMFMessageDestinationPckg aHandlePckg, + MCustomCommand& aCustomCommand, + CCustomInterfaceUtility* aCustomInterfaceUtility) + { + TAny* customInterface = NULL; + + if (aInterfaceUid == KUidAudioInput) + { + CAudioInputProxy* inputProxy = CAudioInputProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = inputProxy; + } + else if(aInterfaceUid == KUidAudioOutput) + { + CAudioOutputProxy* outputProxy = CAudioOutputProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = outputProxy; + } + else if (aInterfaceUid == KUidAudioEqualizerEffect) + { + CAudioEqualizerProxy* audioEqualizerProxy = CAudioEqualizerProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = audioEqualizerProxy; + } + else if (aInterfaceUid == KUidBassBoostEffect) + { + CBassBoostProxy* bassBoostProxy = CBassBoostProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = bassBoostProxy; + } + else if (aInterfaceUid == KUidDistanceAttenuationEffect) + { + CDistanceAttenuationProxy* distanceAttenuationProxy = CDistanceAttenuationProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = distanceAttenuationProxy; + } + else if (aInterfaceUid == KUidEnvironmentalReverbEffect) + { + CEnvironmentalReverbProxy* environmentalReverbProxy = CEnvironmentalReverbProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = environmentalReverbProxy; + } + else if (aInterfaceUid == KUidListenerDopplerEffect) + { + CListenerDopplerProxy* listenerDopplerProxy = CListenerDopplerProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = listenerDopplerProxy; + } + else if (aInterfaceUid == KUidListenerLocationEffect) + { + CListenerLocationProxy* listenerLocationProxy = CListenerLocationProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = listenerLocationProxy; + } + else if (aInterfaceUid == KUidListenerOrientationEffect) + { + CListenerOrientationProxy* listenerOrientationProxy = CListenerOrientationProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = listenerOrientationProxy; + } + else if (aInterfaceUid == KUidLoudnessEffect) + { + CLoudnessProxy* loudnessProxy = CLoudnessProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = loudnessProxy; + } + else if (aInterfaceUid == KUidRoomLevelEffect) + { + CRoomLevelProxy* roomLevelProxy = CRoomLevelProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = roomLevelProxy; + } + else if (aInterfaceUid == KUidSourceDopplerEffect) + { + CSourceDopplerProxy* sourceDopplerProxy = CSourceDopplerProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = sourceDopplerProxy; + } + else if (aInterfaceUid == KUidSourceLocationEffect) + { + CSourceLocationProxy* sourceLocationProxy = CSourceLocationProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = sourceLocationProxy; + } + else if (aInterfaceUid == KUidSourceOrientationEffect) + { + CSourceOrientationProxy* sourceOrientationProxy = CSourceOrientationProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = sourceOrientationProxy; + } + else if (aInterfaceUid == KUidStereoWideningEffect) + { + CStereoWideningProxy* stereoWideningProxy = CStereoWideningProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = stereoWideningProxy; + } + else if(aInterfaceUid == KUidAddedDevSoundControlInterface) + { + CAddedDevSoundControlProxy* proxy = CAddedDevSoundControlProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = proxy; + } + else if (aInterfaceUid == KUidG711DecoderIntfc) + { + CG711DecoderIntfcProxy* g711DecoderIntfcProxy = CG711DecoderIntfcProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = g711DecoderIntfcProxy; + } + else if (aInterfaceUid == KUidG729DecoderIntfc) + { + CG729DecoderIntfcProxy* g729DecoderIntfcProxy = CG729DecoderIntfcProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = g729DecoderIntfcProxy; + } + else if (aInterfaceUid == KUidIlbcDecoderIntfc) + { + CIlbcDecoderIntfcProxy* iIlbcDecoderIntfcProxy = CIlbcDecoderIntfcProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = iIlbcDecoderIntfcProxy; + } + else if (aInterfaceUid == KUidG711EncoderIntfc) + { + CG711EncoderIntfcProxy* g711EncoderIntfcProxy = CG711EncoderIntfcProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = g711EncoderIntfcProxy; + } + else if (aInterfaceUid == KUidG729EncoderIntfc) + { + CG729EncoderIntfcProxy* g729EncoderIntfcProxy = CG729EncoderIntfcProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = g729EncoderIntfcProxy; + } + else if (aInterfaceUid == KUidIlbcEncoderIntfc) + { + CIlbcEncoderIntfcProxy* iIlbcEncoderIntfcProxy = CIlbcEncoderIntfcProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = iIlbcEncoderIntfcProxy; + } + else if (aInterfaceUid == KUidSpeechEncoderConfig) + { + CSpeechEncoderConfigProxy* speechEncoderIntfcProxy = CSpeechEncoderConfigProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = speechEncoderIntfcProxy; + } + else if (aInterfaceUid == KUidErrorConcealmentIntfc) + { + CErrorConcealmentIntfcProxy* errConcealmentIntfcProxy = CErrorConcealmentIntfcProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = errConcealmentIntfcProxy; + } + else if(aInterfaceUid == KUidRestrictedAudioOutput) + { + CRestrictedAudioOutputProxy* proxy = CRestrictedAudioOutputProxy::NewL(aHandlePckg, aCustomCommand, aCustomInterfaceUtility); + customInterface = proxy; + } + + return customInterface; + } + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/Inc/AddedDevSoundControlMsgHdlr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/Inc/AddedDevSoundControlMsgHdlr.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Message handler for AddedDevSoundControl CI. +* +*/ + + +#ifndef CADDEDDEVSOUNDCONTROLMSGHDLR_H +#define CADDEDDEVSOUNDCONTROLMSGHDLR_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class MAddedDevSoundControl; + +// CLASS DECLARATION + +/** + * Handle messages received from the interface proxy. + * The class receives the messages sent by the custom interface proxy + * and makes the appropriate call on its custom interface implementation. + * + * @lib AddedDevSoundControlMsgHdlr.lib + * @since S60 3.2 + */ +class CAddedDevSoundControlMsgHdlr: public CMMFObject + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CAddedDevSoundControlMsgHdlr* NewL( + TAny* aAddedDSControlCI); + + /** + * Destructor. + */ + virtual ~CAddedDevSoundControlMsgHdlr(); + + public: // New functions + + public: // Functions from base classes + + /** + * From CAddedDevSoundControl + */ + virtual void HandleRequest(TMMFMessage& aMessage); + + protected: // New functions + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CAddedDevSoundControlMsgHdlr(MAddedDevSoundControl* + aAddedDSControlCI); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Determines which custom interface to call. + * + * @since S60 3.2 + * @param TMMFMessage& - client/server message container. + * @return void + * + */ + void DoHandleRequestL(TMMFMessage& aMessage); + + /** + * Handles EAddedDSControlSetHwAwareness message from the proxy and + * calls custom interface method. + * + * @since S60 3.2 + * @param TMMFMessage& - client/server message container. + * @return void + * + */ + void DoSetHwAwarenessL(TMMFMessage& aMessage); + + /** + * Handles EAddedDSControlPauseAndFlush message from the proxy and + * calls custom interface method. + * + * @since S60 3.2 + * @param TMMFMessage& - client/server message container. + * @return void + * + */ + void DoPauseAndFlushL(TMMFMessage& aMessage); + + + public: // Data + protected: // Data + private: // Data + + // Pointer to the actual custom interface implementation + MAddedDevSoundControl* iAddedDSControlCI; + + public: // Friend classes + protected: // Friend classes + private: // Friend classes + + }; + +#endif // CADDEDDEVSOUNDCONTROLMSGHDLR_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/Inc/AddedDevSoundControlProxy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/Inc/AddedDevSoundControlProxy.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Interface proxy for AddedDevSoundControl CI. +* +*/ + + +#ifndef ADDEDDEVSOUNDCONTROLPROXY_H +#define ADDEDDEVSOUNDCONTROLPROXY_H + +// INCLUDES +#include +#include "AddedDevSoundControlCI.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CCustomInterfaceUtility; +class MCustomCommand; + +// CLASS DECLARATION + +/** + * Proxy for AddedDevSoundControl CI. + * This proxy translates the interface API calls to messages and + * sends them to the message handler. + * + * @lib AddedDevSoundControlProxy.lib + * @since S60 3.2 + */ +class CAddedDevSoundControlProxy : public MAddedDevSoundControl + + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CAddedDevSoundControlProxy* NewL( + TMMFMessageDestinationPckg aMessageHandler, + MCustomCommand& aCustomCommand, + CCustomInterfaceUtility* aCustomInterfaceUtility); + + /** + * Destructor. + */ + virtual ~CAddedDevSoundControlProxy(); + + public: // New functions + + public: // Functions from base classes + + // From MAddedDevSoundControl + + /** + * Handles client request to alter DevSound's behavior for Pause. + * + * @since S60 3.2 + * @param TBool - Toggles HW awarness + * @return TInt - Function call status + * + */ + virtual TInt SetHwAwareness(TBool aHwAware); + + /** + * Handles client request to pause the audio resources and flush. + * the buffers. + * + * @since S60 3.2 + * @return TInt - Function call status + */ + virtual TInt PauseAndFlush(); + + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CAddedDevSoundControlProxy( + TMMFMessageDestinationPckg aMessageHandler, + MCustomCommand& aCustomCommand, + CCustomInterfaceUtility* aCustomInterfaceUtility); + + public: // Data + protected: // Data + private: // Data + + // Handle to object used for sending IPC commands + MCustomCommand& iCustomCommand; + + // Message object destined for the message handler + TMMFMessageDestinationPckg iMessageHandler; + + // Handle to utility object used in interface framework + CCustomInterfaceUtility* iCustomInterfaceUtility; + + }; + +#endif // ADDEDDEVSOUNDCONTROLPROXY_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/MessageHandlerFactory_stub/BWINS/MESSAGEHANDLERFACTORYU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/MessageHandlerFactory_stub/BWINS/MESSAGEHANDLERFACTORYU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?Create@CMessageHandlerFactory@@SAPAVCMMFObject@@VTUid@@PAXAAVCMMFObjectContainer@@@Z @ 1 NONAME ; class CMMFObject * CMessageHandlerFactory::Create(class TUid, void *, class CMMFObjectContainer &) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/MessageHandlerFactory_stub/EABI/MessageHandlerFactoryU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/MessageHandlerFactory_stub/EABI/MessageHandlerFactoryU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,3 @@ +EXPORTS + _ZN22CMessageHandlerFactory6CreateE4TUidPvR19CMMFObjectContainer @ 1 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/MessageHandlerFactory_stub/group/MessageHandlerFactory_stub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/MessageHandlerFactory_stub/group/MessageHandlerFactory_stub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project definition file for project MessageHandlerFactory_stub +* Version : %version: bh1mmcf#16 % +* +*/ + + +#include + +TARGET MessageHandlerFactory.dll +TARGETTYPE DLL +UID 0x1000008D 0x10203821 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE MessageHandlerFactory.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../Inc +USERINCLUDE ../src + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common + +LIBRARY euser.lib + +LIBRARY AudioEqualizerMessageHandler.lib +LIBRARY EnvironmentalReverbMessageHandler.lib +LIBRARY StereoWideningMessageHandler.lib +LIBRARY BassBoostMessageHandler.lib +LIBRARY ListenerDopplerMessageHandler.lib +LIBRARY ListenerLocationMessageHandler.lib +LIBRARY ListenerOrientationMessageHandler.lib +LIBRARY SourceDopplerMessageHandler.lib +LIBRARY SourceLocationMessageHandler.lib +LIBRARY SourceOrientationMessageHandler.lib +LIBRARY DistanceAttenuationMessageHandler.lib +LIBRARY LoudnessMessageHandler.lib +LIBRARY RoomLevelMessageHandler.lib +LIBRARY RestrictedAudioOutputMessageHandler.lib +LIBRARY AudioInputMessageHandler.lib +LIBRARY AudioOutputMessageHandler.lib +LIBRARY SpeechEncoderConfigMsgHdlr.lib +LIBRARY ErrorConcealmentIntfcMsgHdlr.lib +LIBRARY G711DecoderIntfcMsgHdlr.lib +LIBRARY G729DecoderIntfcMsgHdlr.lib +LIBRARY IlbcDecoderIntfcMsgHdlr.lib +LIBRARY G711EncoderIntfcMsgHdlr.lib +LIBRARY G729EncoderIntfcMsgHdlr.lib +LIBRARY IlbcEncoderIntfcMsgHdlr.lib +LIBRARY AddedDevSoundControlMsgHdlr.lib + +//enable each line when supported by the adaptation +//LIBRARY AudioResourceMessageHandler.lib +//LIBRARY AacDecoderConfigMsgHdlr.lib +//LIBRARY AudioVibraControlMsgHdlr.lib + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/MessageHandlerFactory_stub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/MessageHandlerFactory_stub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file custom interface proxy builder. +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +MessageHandlerFactory_stub.mmp + +// End of File + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/MessageHandlerFactory_stub/inc/MessageHandlerFactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/MessageHandlerFactory_stub/inc/MessageHandlerFactory.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Declaration of the adaptation stub for MessageHandlerFactory. +* +*/ + +#ifndef __CMESSAGEHANDLERFACTORY_H +#define __CMESSAGEHANDLERFACTORY_H + +#include +#include + +// CLASS DECLARATION +class CMessageHandlerFactory : public CBase + { +public: + IMPORT_C static CMMFObject* Create(TUid aInterfaceUid, + TAny* aCustomInterface, + CMMFObjectContainer& aContainer); + }; + +#endif + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/MessageHandlerFactory_stub/src/MessageHandlerFactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/MessageHandlerFactory_stub/src/MessageHandlerFactory.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,196 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the adaptation stub for +* : MessageHandlerFactory. +* +*/ + +#include "MessageHandlerFactory.h" +#include "AudioInputMessageHandler.h" +#include "AudioOutputMessageHandler.h" +#include "AudioInputMessageTypes.h" +#include "AudioOutputMessageTypes.h" + +#include "MessageHandlerFactory.h" +#include "AudioEqualizerMessageHandler.h" +#include "BassBoostMessageHandler.h" +#include "DistanceAttenuationMessageHandler.h" +#include "EnvironmentalReverbMessageHandler.h" +#include "ListenerDopplerMessageHandler.h" +#include "ListenerLocationMessageHandler.h" +#include "ListenerOrientationMessageHandler.h" +#include "LoudnessMessageHandler.h" +#include "RoomLevelMessageHandler.h" +#include "SourceDopplerMessageHandler.h" +#include "SourceLocationMessageHandler.h" +#include "SourceOrientationMessageHandler.h" +#include "StereoWideningMessageHandler.h" +#include "AddedDevSoundControlMsgHdlr.h" +#include "RestrictedAudioOutputMessageHandler.h" +#include "AudioOutputMessageHandler.h" + +#include "SpeechEncoderConfigMsgHdlr.h" +#include "ErrorConcealmentIntfcMsgHdlr.h" +#include "G711DecoderIntfcMsgHdlr.h" +#include "G729DecoderIntfcMsgHdlr.h" +#include "IlbcDecoderIntfcMsgHdlr.h" +#include "G711EncoderIntfcMsgHdlr.h" +#include "G729EncoderIntfcMsgHdlr.h" +#include "IlbcEncoderIntfcMsgHdlr.h" +#include "AacDecoderConfigMsgHdlr.h" +//#include "AudioVibraControlMsgHdlr.h" // Audio Vibra Control API is deprecated + +#include "SpeechEncoderConfig.h" +#include "AacDecoderConfig.h" +#include "ErrorConcealmentIntfc.h" +#include "G711DecoderIntfc.h" +#include "G729DecoderIntfc.h" +#include "IlbcDecoderIntfc.h" +#include "G711EncoderIntfc.h" +#include "G729EncoderIntfc.h" +#include "IlbcEncoderIntfc.h" +//#include "AudioVibraControl.h" // Audio Vibra Control API is deprecated + +EXPORT_C CMMFObject* CMessageHandlerFactory::Create(TUid aInterfaceUid, + TAny* aCustomInterface, + CMMFObjectContainer& aContainer) + { + CMMFObject* messageHandler = NULL; + + if (aInterfaceUid == KUidAudioEqualizerEffect) + { + messageHandler = CAudioEqualizerMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidBassBoostEffect) + { + messageHandler = CBassBoostMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidDistanceAttenuationEffect) + { + messageHandler = CDistanceAttenuationMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidEnvironmentalReverbEffect) + { + messageHandler = CEnvironmentalReverbMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidListenerDopplerEffect) + { + messageHandler = CListenerDopplerMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidListenerLocationEffect) + { + messageHandler = CListenerLocationMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidListenerOrientationEffect) + { + messageHandler = CListenerOrientationMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidLoudnessEffect) + { + messageHandler = CLoudnessMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidRoomLevelEffect) + { + messageHandler = CRoomLevelMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidSourceDopplerEffect) + { + messageHandler = CSourceDopplerMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidSourceLocationEffect) + { + messageHandler = CSourceLocationMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidSourceOrientationEffect) + { + messageHandler = CSourceOrientationMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidStereoWideningEffect) + { + messageHandler = CStereoWideningMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidRestrictedAudioOutput) + { + messageHandler = CRestrictedAudioOutputMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidAudioOutput) + { + messageHandler = CAudioOutputMessageHandler::NewL(aCustomInterface, aContainer); + } + else if (aInterfaceUid == KUidAudioInput) + { + messageHandler = CAudioInputMessageHandler::NewL(aCustomInterface, aContainer); + } + else if (aInterfaceUid == KUidAudioOutput) + { + messageHandler = CAudioOutputMessageHandler::NewL(aCustomInterface, aContainer); + } + else if (aInterfaceUid == KUidSpeechEncoderConfig) + { + messageHandler = CSpeechEncoderConfigMsgHdlr::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidErrorConcealmentIntfc) + { + messageHandler = CErrorConcealmentIntfcMsgHdlr::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidG711DecoderIntfc) + { + messageHandler = CG711DecoderIntfcMsgHdlr::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidG729DecoderIntfc) + { + messageHandler = CG729DecoderIntfcMsgHdlr::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidIlbcDecoderIntfc) + { + messageHandler = CIlbcDecoderIntfcMsgHdlr::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidG711EncoderIntfc) + { + messageHandler = CG711EncoderIntfcMsgHdlr::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidG729EncoderIntfc) + { + messageHandler = CG729EncoderIntfcMsgHdlr::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidIlbcEncoderIntfc) + { + messageHandler = CIlbcEncoderIntfcMsgHdlr::NewL(aCustomInterface); + }/* + else if (aInterfaceUid == KUidAddedDevSoundControlInterface) + { + messageHandler = CAddedDevSoundControlMsgHdlr::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidAudioResource) + { + messageHandler = CAudioResourceMessageHandler::NewL(aCustomInterface, aContainer); + } + else if (aInterfaceUid == KUidAudioEqualizerEffect) + { + messageHandler = CAudioEqualizerMessageHandler::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidAudioVibraControl) + { + messageHandler = CAudioVibraControlMsgHdlr::NewL(aCustomInterface); + } + else if (aInterfaceUid == KUidAacDecoderConfig) + { + messageHandler = CAacDecoderConfigMsgHdlr::NewL(aCustomInterface); + }*/ + + return messageHandler; + } + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioenhancementfactorystubs/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file custom command utility +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +../CustomInterfaceProxyFactory_stub/group/CustomInterfaceProxyFactory_stub.mmp +../MessageHandlerFactory_stub/group/MessageHandlerFactory_stub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioinputcistub/BWINS/AUDIOINPUTCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioinputcistub/BWINS/AUDIOINPUTCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewL@CAudioInputCI@@SAPAV1@AAVCMMFDevSound@@@Z @ 1 NONAME ; class CAudioInputCI * CAudioInputCI::NewL(class CMMFDevSound &) + ?NewL@CAudioInputCI@@SAPAV1@XZ @ 2 NONAME ; class CAudioInputCI * CAudioInputCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioinputcistub/EABI/AudioInputCIU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioinputcistub/EABI/AudioInputCIU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN13CAudioInputCI4NewLER12CMMFDevSound @ 1 NONAME + _ZN13CAudioInputCI4NewLEv @ 2 NONAME + _ZTI13CAudioInputCI @ 3 NONAME ; ## + _ZTV13CAudioInputCI @ 4 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioinputcistub/Group/AudioInputCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioinputcistub/Group/AudioInputCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project definition file for project AudioInputCIStub +* Version : %version: bh1mmcf#17 % +* +*/ + +#include + +TARGET AudioInputCI_stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x1020381B + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE AudioInputCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY AudioInputCI.lib + +LINKAS AudioInputCI.dll + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioinputcistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioinputcistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface builder stub +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +AudioInputCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioinputcistub/rom/AudioInputCI_Stub.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioinputcistub/rom/AudioInputCI_Stub.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Support for AudioInput Routing API Stubs +* +*/ + +#ifndef __AUDIOINPUTCI_STUB_IBY__ +#define __AUDIOINPUTCI_STUB_IBY__ + +file=ABI_DIR\BUILD_DIR\AudioInputCI_Stub.dll SHARED_LIB_DIR\AudioInputCI_Stub.dll + +#endif diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audioinputcistub/src/AudioInputCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audioinputcistub/src/AudioInputCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - AudioInput CI Stub +* +*/ + +#include +#include "AudioInputCI.h" + + +EXPORT_C CAudioInputCI* CAudioInputCI::NewL(CMMFDevSound& aDevSound) + { + CAudioInputCI* self = new(ELeave) CAudioInputCI(aDevSound); + return self; + } + +EXPORT_C CAudioInputCI* CAudioInputCI::NewL() + { + CAudioInputCI* self = new(ELeave) CAudioInputCI(); + return self; + } + +CAudioInputCI::CAudioInputCI(CMMFDevSound& aDevSound) : + iDevSound(&aDevSound), + iInputArray(4) + { + } + +CAudioInputCI::CAudioInputCI() : + iInputArray(4) + { + } + +CAudioInputCI::~CAudioInputCI() + { + } + +CAudioInput::TAudioInputArray CAudioInputCI::AudioInput() + { +#ifdef _DEBUG + RDebug::Print(_L("CAudioInputCI::AudioInput")); +#endif + return iInputArray.Array(); + } + +void CAudioInputCI::SetAudioInputL(TAudioInputArray aAudioInputs) + { +#ifdef _DEBUG + RDebug::Print(_L("CAudioInputCI::SetAudioInputL")); +#endif + iInputArray.Reset(); + TInt count = aAudioInputs.Count(); + + + for(int i=0; i# + _ZTI17CAudioOutputTimer @ 4 NONAME ; ## + _ZTV14CAudioOutputCI @ 5 NONAME ; ## + _ZTV17CAudioOutputTimer @ 6 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiooutputcistub/Group/AudioOutputCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiooutputcistub/Group/AudioOutputCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project definition file for project AudioOutputCIStub +* Version : %version: bh1mmcf#16 % +* +*/ + + +#include + +TARGET AudioOutputCI_stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x1020381B + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE AudioOutputCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY AudioOutputCI.lib + +LINKAS AudioOutputCI.dll + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiooutputcistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiooutputcistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface builder stub +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +AudioOutputCIStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiooutputcistub/rom/AudioOutputCI_Stub.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiooutputcistub/rom/AudioOutputCI_Stub.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Support for AudioOutput Routing API Stubs +* +*/ + +#ifndef __AUDIOOUTPUTCI_STUB_IBY__ +#define __AUDIOOUTPUTCI_STUB_IBY__ + +file=ABI_DIR\BUILD_DIR\AudioOutputCI_Stub.dll SHARED_LIB_DIR\AudioOutputCI_Stub.dll + +#endif diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiooutputcistub/src/AudioOutputCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiooutputcistub/src/AudioOutputCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,167 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - AudioOutput CI Stub +* +*/ + +#include +//#include "AudioOutputCustomInterfaceHandler.h" +#include "AudioOutputCI.h" +//#include "AudioOutputMessageTypes.h" +#include +#include + +EXPORT_C CAudioOutputCI* CAudioOutputCI::NewL(CMMFDevSound& aDevSound) + { + CAudioOutputCI* self = new(ELeave) CAudioOutputCI(aDevSound); + return self; + } + +CAudioOutputCI::CAudioOutputCI(CMMFDevSound& aDevSound) : + iDevSound(&aDevSound), + iDefault(EPublic) + { + if (!iAudioOutputTimer) + { + iAudioOutputTimer = new (ELeave) CAudioOutputTimer(this); + } + iAudioOutputTimer->After(5000000); + } + +CAudioOutputCI::~CAudioOutputCI() + { + delete iAudioOutputTimer; + } + +CAudioOutput::TAudioOutputPreference CAudioOutputCI::AudioOutput() + { + return iOutput; + } + +CAudioOutput::TAudioOutputPreference CAudioOutputCI::DefaultAudioOutput() + { + return iDefault; + } + +void CAudioOutputCI::RegisterObserverL( MAudioOutputObserver& aObserver ) + { + iObserver = &aObserver; + } + +TBool CAudioOutputCI::SecureOutput() + { +#ifdef _DEBUG + RDebug::Print(_L("CAudioOutputCI::SecureOutput")); +#endif + return iSecureOutput; + } + +void CAudioOutputCI::SetAudioOutputL( TAudioOutputPreference aAudioOutput ) + { +#ifdef _DEBUG + RDebug::Print(_L("CAudioOutputCI::SetAudioOutputL")); +#endif + iOutput = aAudioOutput; + } + +void CAudioOutputCI::SetSecureOutputL( TBool aSecure ) + { +#ifdef _DEBUG + RDebug::Print(_L("CAudioOutputCI::SetSecureOutputL")); +#endif + iSecureOutput = aSecure; + } + +void CAudioOutputCI::UnregisterObserver( MAudioOutputObserver&/* aObserver */) + { + iObserver = NULL; + } + +void CAudioOutputCI::DefaultChanged() + { + + if (iCount % 4 == 0) + { + iDefault = EAll; + } + else if (iCount % 4 == 1) + { + iDefault = ENoOutput; + } + else if ( iCount % 4 == 2) + { + iDefault = EPrivate; + } + else if (iCount % 4 == 3) + { + iDefault = EPublic; + } + + if (iObserver) + { + iObserver->DefaultAudioOutputChanged(*this,iDefault); + } + iCount++; + iAudioOutputTimer->After(5000000); + + } + +EXPORT_C CAudioOutputCI* CAudioOutputCI::NewL() + { + CAudioOutputCI* self = new(ELeave) CAudioOutputCI(); + return self; + } + +CAudioOutputCI::CAudioOutputCI() : + iDefault(EPublic) + { + if (!iAudioOutputTimer) + { + iAudioOutputTimer = new (ELeave) CAudioOutputTimer(this); + } + iAudioOutputTimer->After(5000000); + } + +CAudioOutputTimer::CAudioOutputTimer(CAudioOutputCI* aCustomInterface) : + CTimer(0), + iCustomInterface(aCustomInterface) + { + CTimer::ConstructL(); + CActiveScheduler::Add(this); + } + +CAudioOutputTimer::~CAudioOutputTimer() + { + Cancel(); + } + +void CAudioOutputTimer::RunL() + { +#ifdef _DEBUG + RDebug::Print(_L("CAudioOutputTimer::RunL")); +#endif + iCustomInterface->DefaultChanged(); + } + +void CAudioOutputTimer::DoCancel() + { + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiovisualizationstub/Bwins/VisualizationU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiovisualizationstub/Bwins/VisualizationU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,19 @@ +EXPORTS + ?DataRate@CVisualization@@QBEKXZ @ 1 NONAME ; unsigned long CVisualization::DataRate(void) const + ?DataRateRange@CVisualization@@QAEXAAK0@Z @ 2 NONAME ; void CVisualization::DataRateRange(unsigned long &, unsigned long &) + ?EnableFrequencyData@CVisualization@@QAEXH@Z @ 3 NONAME ; void CVisualization::EnableFrequencyData(int) + ?EnableWaveformData@CVisualization@@QAEXH@Z @ 4 NONAME ; void CVisualization::EnableWaveformData(int) + ?FreqencyBandCount@CVisualization@@QBEKXZ @ 5 NONAME ; unsigned long CVisualization::FreqencyBandCount(void) const + ?FrequencyBandCountRange@CVisualization@@QAEXAAK0@Z @ 6 NONAME ; void CVisualization::FrequencyBandCountRange(unsigned long &, unsigned long &) + ?IsFrequencyDataEnabled@CVisualization@@QBEHXZ @ 7 NONAME ; int CVisualization::IsFrequencyDataEnabled(void) const + ?IsWaveformDataEnabled@CVisualization@@QBEHXZ @ 8 NONAME ; int CVisualization::IsWaveformDataEnabled(void) const + ?NewL@CVisualization@@SAPAV1@AAVMVisualizationObserver@@@Z @ 9 NONAME ; class CVisualization * CVisualization::NewL(class MVisualizationObserver &) + ?SamplingRate@CVisualization@@QBEKXZ @ 10 NONAME ; unsigned long CVisualization::SamplingRate(void) const + ?SetDataRateL@CVisualization@@QAEXK@Z @ 11 NONAME ; void CVisualization::SetDataRateL(unsigned long) + ?SetFrequencyBandCountL@CVisualization@@QAEXK@Z @ 12 NONAME ; void CVisualization::SetFrequencyBandCountL(unsigned long) + ?SetWaveformDataLengthL@CVisualization@@QAEXK@Z @ 13 NONAME ; void CVisualization::SetWaveformDataLengthL(unsigned long) + ?StartL@CVisualization@@QAEXXZ @ 14 NONAME ; void CVisualization::StartL(void) + ?StopL@CVisualization@@QAEXXZ @ 15 NONAME ; void CVisualization::StopL(void) + ?WaveformDataLength@CVisualization@@QBEKXZ @ 16 NONAME ; unsigned long CVisualization::WaveformDataLength(void) const + ?WaveformDataLengthRange@CVisualization@@QAEXAAK0@Z @ 17 NONAME ; void CVisualization::WaveformDataLengthRange(unsigned long &, unsigned long &) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiovisualizationstub/EABI/VisualizationU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiovisualizationstub/EABI/VisualizationU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,23 @@ +EXPORTS + _ZN14CVisualization12SetDataRateLEm @ 1 NONAME + _ZN14CVisualization13DataRateRangeERmS0_ @ 2 NONAME + _ZN14CVisualization18EnableWaveformDataEi @ 3 NONAME + _ZN14CVisualization19EnableFrequencyDataEi @ 4 NONAME + _ZN14CVisualization22SetFrequencyBandCountLEm @ 5 NONAME + _ZN14CVisualization22SetWaveformDataLengthLEm @ 6 NONAME + _ZN14CVisualization23FrequencyBandCountRangeERmS0_ @ 7 NONAME + _ZN14CVisualization23WaveformDataLengthRangeERmS0_ @ 8 NONAME + _ZN14CVisualization4NewLER22MVisualizationObserver @ 9 NONAME + _ZN14CVisualization5StopLEv @ 10 NONAME + _ZN14CVisualization6StartLEv @ 11 NONAME + _ZNK14CVisualization12SamplingRateEv @ 12 NONAME + _ZNK14CVisualization17FreqencyBandCountEv @ 13 NONAME + _ZNK14CVisualization18WaveformDataLengthEv @ 14 NONAME + _ZNK14CVisualization21IsWaveformDataEnabledEv @ 15 NONAME + _ZNK14CVisualization22IsFrequencyDataEnabledEv @ 16 NONAME + _ZNK14CVisualization8DataRateEv @ 17 NONAME + _ZTI14CVisualization @ 18 NONAME ; ## + _ZTIN14CVisualization5CBodyE @ 19 NONAME ; ## + _ZTV14CVisualization @ 20 NONAME ; ## + _ZTVN14CVisualization5CBodyE @ 21 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiovisualizationstub/Group/Visualization.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiovisualizationstub/Group/Visualization.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project file for Audio Visualization +* +* +*/ + + +#include + +TARGET Visualization_stub.dll +TARGETTYPE dll +UID 0x1000008d 0x10207A99 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src + +USERINCLUDE ../inc ../src + +OS_LAYER_SYSTEMINCLUDE + +SOURCE Visualization.cpp +SOURCE VisualizationBody.cpp + +LIBRARY Euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY Visualization.lib + +LINKAS Visualization.dll diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiovisualizationstub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiovisualizationstub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for Audio Visualization +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +Visualization.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiovisualizationstub/rom/Visualization_stub.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiovisualizationstub/rom/Visualization_stub.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - IBY file for the AudioVisualizationStub +* +*/ + + +#ifndef VISUALIZATION_IBY +#define VISUALIZATION_IBY + +#ifdef __AUDIO_EFFECTS_API + +file=ABI_DIR\BUILD_DIR\Visualization_stub.dll SHARED_LIB_DIR\Visualization.dll + +#endif //__AUDIO_EFFECTS_API +#endif // VISUALIZATION_IBY + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiovisualizationstub/src/VisualizationBody.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiovisualizationstub/src/VisualizationBody.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,261 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of class Audio VisualiztionBody. +* +*/ + + +// INCLUDE FILES + +#ifdef _DEBUG +#include +#endif +#include +#include +#include "VisualizationBody.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVisualization::CVisualization +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVisualization::CBody::CBody() + : iFrequencyDataEnabled(EFalse), + iWaveFormDataEnabled(EFalse) + { + } + + +// Destructor +CVisualization::CBody::~CBody() + { + iFrequencyData.Close(); + iWaveFormData.Close(); + } + +// ----------------------------------------------------------------------------- +// CVisualization::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CVisualization::CBody::ConstructL( + MVisualizationObserver& aObserver ) + { +#ifdef _DEBUG + RDebug::Print(_L("CVisualization::Body::ConstructL")); +#endif + iObserver = &aObserver; + } + +// ----------------------------------------------------------------------------- +// CVisualization::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CVisualization::CBody* CVisualization::CBody::NewL( + MVisualizationObserver& aObserver ) + { +#ifdef _DEBUG + RDebug::Print(_L("CVisualization::Cbody::NewL")); +#endif + CVisualization::CBody* self = new (ELeave) CVisualization::CBody(); + CleanupStack::PushL(self); + self->ConstructL(aObserver); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CVisualization::DataRate +// ----------------------------------------------------------------------------- +// + TUint32 CVisualization::CBody::DataRate() const + { + return iDataRate; + } + +// ----------------------------------------------------------------------------- +// CVisualization::DataRateRange +// ----------------------------------------------------------------------------- +// + void CVisualization::CBody::DataRateRange( + TUint32& aMin, + TUint32& aMax ) + { + aMin = iDataRateMin; + aMax = iDataRateMax; + } + +// ----------------------------------------------------------------------------- +// CVisualization::EnableFrequencyData +// ----------------------------------------------------------------------------- +// + void CVisualization::CBody::EnableFrequencyData( + TBool aIndicator ) + { + iFrequencyDataEnabled = aIndicator; + } + +// ----------------------------------------------------------------------------- +// CVisualization::EnableWaveformData +// ----------------------------------------------------------------------------- +// + void CVisualization::CBody::EnableWaveformData( + TBool aIndicator ) + { + iWaveFormDataEnabled = aIndicator; + } + +// ----------------------------------------------------------------------------- +// CVisualization::FreqencyBandCount +// ----------------------------------------------------------------------------- +// + TUint32 CVisualization::CBody::FreqencyBandCount() const + { + return iFreqencyBandCount; + } + +// ----------------------------------------------------------------------------- +// CVisualization::FrequencyBandCountRange +// ----------------------------------------------------------------------------- +// + void CVisualization::CBody::FrequencyBandCountRange( + TUint32& aMin, + TUint32& aMax ) + { + aMin = iFreqencyBandCountMin; + aMax = iFreqencyBandCountMax; + } + +// ----------------------------------------------------------------------------- +// CVisualization::IsFrequencyDataEnabled +// ----------------------------------------------------------------------------- +// + TBool CVisualization::CBody::IsFrequencyDataEnabled() const + { + return iFrequencyDataEnabled; + } + +// ----------------------------------------------------------------------------- +// CVisualization::IsWaveformDataEnabled +// ----------------------------------------------------------------------------- +// + TBool CVisualization::CBody::IsWaveformDataEnabled() const + { + return iWaveFormDataEnabled; + } + +// ----------------------------------------------------------------------------- +// CVisualization::SamplingRate +// ----------------------------------------------------------------------------- +// + TUint32 CVisualization::CBody::SamplingRate() const + { + return iSamplingRate; + } + +// ----------------------------------------------------------------------------- +// CVisualization::SetDataRateL +// ----------------------------------------------------------------------------- +// + void CVisualization::CBody::SetDataRateL( + TUint32 aDataRate ) + { + if ( (aDataRate >= iDataRateMin) && (aDataRate <= iDataRateMax) ) + { + iDataRate = aDataRate; + } + else + { + User::Leave(KErrArgument); + } + } + +// ----------------------------------------------------------------------------- +// CVisualization::SetFrequencyBandCount +// ----------------------------------------------------------------------------- +// + void CVisualization::CBody::SetFrequencyBandCountL( + TUint32 aFrequencyBandCount ) + { + if ( (aFrequencyBandCount >= iFreqencyBandCountMin) && (aFrequencyBandCount <= iFreqencyBandCountMax) ) + { + iFreqencyBandCount = aFrequencyBandCount; + } + else + { + User::Leave(KErrArgument); + } + } + +// ----------------------------------------------------------------------------- +// CVisualization::SetWaveformDataLength +// ----------------------------------------------------------------------------- +// + void CVisualization::CBody::SetWaveformDataLengthL( + TUint32 aWaveformDataLength ) + { + if ( (aWaveformDataLength >= iWaveformDataLengthMin) && (aWaveformDataLength <= iWaveformDataLengthMax) ) + { + iWaveformDataLength = aWaveformDataLength; + } + else + { + User::Leave(KErrArgument); + } + } + +// ----------------------------------------------------------------------------- +// CVisualization::StartL +// ----------------------------------------------------------------------------- +// + void CVisualization::CBody::StartL() + { + User::Leave(KErrNotSupported); + } + +// ----------------------------------------------------------------------------- +// CVisualization::StopL +// ----------------------------------------------------------------------------- +// + void CVisualization::CBody::StopL() + { + User::Leave(KErrNotSupported); + } + +// ----------------------------------------------------------------------------- +// CVisualization::WaveformDataLength +// ----------------------------------------------------------------------------- +// + TUint32 CVisualization::CBody::WaveformDataLength() const + { + return iWaveformDataLength; + } + +// ----------------------------------------------------------------------------- +// CVisualization::WaveformDataLengthRange +// ----------------------------------------------------------------------------- +// + void CVisualization::CBody::WaveformDataLengthRange( + TUint32& aMin, + TUint32& aMax ) + { + aMin = iWaveformDataLengthMin; + aMax = iWaveformDataLengthMax; + } + + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiovisualizationstub/src/VisualizationBody.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiovisualizationstub/src/VisualizationBody.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,223 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the audio visualization body class. +* +* +*/ + + +#ifndef CVISUALIZATIONBODY_H +#define CVISUALIZATIONBODY_H + +// INCLUDES +#include + +// FORWARD DECLARATION +class MVisualizationObserver; + +// CLASS DECLARATION + +/** +* This is the base class for audio visualization. +* +* @lib Visualization.lib +* @since 3.0 +*/ + +class CVisualization::CBody: public CBase + { + + public: // Constructors and destructor + + /** + * Factory function for creating the volume object. + * @since 3.0 + * @param aObserver A visualization observer. + * @return pointer to CVisualization object + */ + static CBody* NewL( MVisualizationObserver& aObserver); + + /** + * Destructor + */ + virtual ~CBody(); + + public: // New functions + + /** + * Get the data rate. + * @since 3.0 + * @return data rate in Hz. + */ + TUint32 DataRate() const; + + /** + * Get the upper and lower limits of the supported data rate range + * @since 3.0 + * @param aMin The lower limit of the data rate range + * @param aMax The upper limit of the data rate range + */ + void DataRateRange( TUint32& aMin, TUint32& aMax ); + + /** + * Used by application enable or disable frequency data. + * @since 3.0 + * @param aIndicator Set to ETrue to enable frequency, EFalse to disable frequency data. + */ + void EnableFrequencyData( TBool aIndicator ); + + /** + * Used by application to enable or disable waveform data. + * @since 3.0 + * @param aIndicator Set to ETrue to enable waveform data, EFalse to disable waveform data. + */ + void EnableWaveformData( TBool aIndicator ); + + /** + * Get frequency band count. + * @since 3.0 + * @return frequency band count. + */ + TUint32 FreqencyBandCount( ) const; + + /** + * Get frequency band count range. + * @since 3.0 + * @param aMin Lower limit of the frequency band count range + * @param aMax Upper limit of the frequency band count range + */ + void FrequencyBandCountRange( TUint32& aMin, TUint32& aMax ); + + /** + * Determine whether frequency data is enabled. + * @since 3.0 + * @return ETrue, if frequency data is enabled. EFalse, if frequency data is disabled. + */ + TBool IsFrequencyDataEnabled( ) const; + + /** + * Determine whether waveform data is enabled. + * @since 3.0 + * @return ETrue, if waveform data is enabled. EFalse, if waveform data is disabled. + */ + TBool IsWaveformDataEnabled( ) const; + + /** + * Get the sampling rate. + * @since 3.0 + * @return The sampling rate. + */ + TUint32 SamplingRate() const; + + /** + * Set the data rate. + * @since 3.0 + * @param aDataRate The data rate. + */ + void SetDataRateL( TUint32 aDataRate ); + + /** + * Sets the frequency band count. Results in a call to + * MVisualizationObserver::FrequencyBandCountChanged(). + * @since 3.0 + * @param aFrequencyBandCount The frequency band count. + */ + void SetFrequencyBandCountL( TUint32 aFrequencyBandCount ); + + /** + * Sets the waveform band count. Results in a call to + * MVisualizationObserver::WaveformDataLengthChanged(). + * @since 3.0 + * @param aWaveformDataLength The waveform data length in samples. + */ + void SetWaveformDataLengthL( TUint32 aWaveformDataLength ); + + /** + * Starts visualization. Results in a call to MVisualizationObserver::VisualizationStarted() + * @since 3.0 + */ + void StartL( ); + + /** + * Stops visualization. Results in a call to MVisualizationObserver::VisualizationStopped() + * @since 3.0 + */ + void StopL( ); + + /** + * Get the waveform data length. + * @since 3.0 + * @return The waveform data length in samples. + */ + TUint32 WaveformDataLength() const; + + /** + * Get the waveform data length range in samples. + * @since 3.0 + * @param aMin The lower limit of the waveform data length range + * @param aMax The upper limit of the waveform data length range + */ + void WaveformDataLengthRange( TUint32& aMin, TUint32& aMax ); + + private: + + /** + * Private C++ constructor for this class. + * @since 3.0 + */ + CBody(); + + /** + * Second Phase Costructor + * @since 3.0 + * @param aObserver Visualization Observer + */ + void ConstructL(MVisualizationObserver& aObserver ); + + private: // Data + + // Indicate whether frequency data is enabled or not + TBool iFrequencyDataEnabled; + + // Indicate whether waveform data is enabled or not + TBool iWaveFormDataEnabled; + + // Data rate + TUint32 iDataRate; + TUint32 iDataRateMin; + TUint32 iDataRateMax; + + // Frequency Data + TUint32 iFreqencyBandCount; + TUint32 iFreqencyBandCountMin; + TUint32 iFreqencyBandCountMax; + + // Sampling rate + TUint32 iSamplingRate; + + // Waveform Data + TUint32 iWaveformDataLength; + TUint32 iWaveformDataLengthMin; + TUint32 iWaveformDataLengthMax; + + RArray iFrequencyData; + RArray iWaveFormData; + + // Pointer to Observer + MVisualizationObserver* iObserver; + }; + +#endif // of CVISUALIZATIONCBODY_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/audiovisualizationstub/src/visualization.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/audiovisualizationstub/src/visualization.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,232 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of class Audio Visualiztion. +* +*/ + + +// INCLUDE FILES + +#ifdef _DEBUG +#include +#endif +#include +#include +#include "VisualizationBody.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVisualization::CVisualization +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVisualization::CVisualization() + { + } + + +// Destructor +CVisualization::~CVisualization() + { + delete iBody; + } + +// ----------------------------------------------------------------------------- +// CVisualization::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CVisualization::ConstructL(MVisualizationObserver& aObserver) + { +#ifdef _DEBUG + RDebug::Print(_L("CVisualization::ConstructL")); +#endif + iBody = CVisualization::CBody::NewL(aObserver); + } + +// ----------------------------------------------------------------------------- +// CVisualization::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CVisualization* CVisualization::NewL( + MVisualizationObserver& aObserver ) + { +#ifdef _DEBUG + RDebug::Print(_L("CVisualization::NewL")); +#endif + CVisualization* self = new (ELeave) CVisualization(); + CleanupStack::PushL(self); + self->ConstructL(aObserver); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CVisualization::DataRate +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CVisualization::DataRate() const + { + return iBody->DataRate(); + } + +// ----------------------------------------------------------------------------- +// CVisualization::DataRateRange +// ----------------------------------------------------------------------------- +// +EXPORT_C void CVisualization::DataRateRange( + TUint32& aMin, + TUint32& aMax ) + { + iBody->DataRateRange(aMin, aMax); + } + +// ----------------------------------------------------------------------------- +// CVisualization::EnableFrequencyData +// ----------------------------------------------------------------------------- +// +EXPORT_C void CVisualization::EnableFrequencyData( + TBool aIndicator ) + { + iBody->EnableFrequencyData(aIndicator); + } + +// ----------------------------------------------------------------------------- +// CVisualization::EnableWaveformData +// ----------------------------------------------------------------------------- +// +EXPORT_C void CVisualization::EnableWaveformData( + TBool aIndicator ) + { + iBody->EnableWaveformData(aIndicator); + } + +// ----------------------------------------------------------------------------- +// CVisualization::FreqencyBandCount +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CVisualization::FreqencyBandCount() const + { + return iBody->FreqencyBandCount(); + } + +// ----------------------------------------------------------------------------- +// CVisualization::FrequencyBandCountRange +// ----------------------------------------------------------------------------- +// +EXPORT_C void CVisualization::FrequencyBandCountRange( + TUint32& aMin, + TUint32& aMax ) + { + iBody->FrequencyBandCountRange(aMin, aMax); + } + +// ----------------------------------------------------------------------------- +// CVisualization::IsFrequencyDataEnabled +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CVisualization::IsFrequencyDataEnabled() const + { + return iBody->IsFrequencyDataEnabled(); + } + +// ----------------------------------------------------------------------------- +// CVisualization::IsWaveformDataEnabled +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CVisualization::IsWaveformDataEnabled() const + { + return iBody->IsWaveformDataEnabled(); + } + +// ----------------------------------------------------------------------------- +// CVisualization::SamplingRate +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CVisualization::SamplingRate() const + { + return iBody->SamplingRate(); + } + +// ----------------------------------------------------------------------------- +// CVisualization::SetDataRateL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CVisualization::SetDataRateL( + TUint32 aDataRate ) + { + iBody->SetDataRateL(aDataRate); + } + +// ----------------------------------------------------------------------------- +// CVisualization::SetFrequencyBandCount +// ----------------------------------------------------------------------------- +// +EXPORT_C void CVisualization::SetFrequencyBandCountL( + TUint32 aFrequencyBandCount ) + { + iBody->SetFrequencyBandCountL(aFrequencyBandCount); + } + +// ----------------------------------------------------------------------------- +// CVisualization::SetWaveformDataLength +// ----------------------------------------------------------------------------- +// +EXPORT_C void CVisualization::SetWaveformDataLengthL( + TUint32 aWaveformDataLength ) + { + iBody->SetWaveformDataLengthL(aWaveformDataLength ); + } + +// ----------------------------------------------------------------------------- +// CVisualization::StartL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CVisualization::StartL() + { + User::Leave(KErrNotSupported); + } + +// ----------------------------------------------------------------------------- +// CVisualization::StopL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CVisualization::StopL() + { + User::Leave(KErrNotSupported); + } + +// ----------------------------------------------------------------------------- +// CVisualization::WaveformDataLength +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CVisualization::WaveformDataLength() const + { + return iBody->WaveformDataLength(); + } + +// ----------------------------------------------------------------------------- +// CVisualization::WaveformDataLengthRange +// ----------------------------------------------------------------------------- +// +EXPORT_C void CVisualization::WaveformDataLengthRange( + TUint32& aMin, + TUint32& aMax ) + { + iBody->WaveformDataLengthRange(aMin,aMax); + } + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/cistubplugin/data/cistubplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/cistubplugin/data/cistubplugin.rss Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Stubplugin rss +* +*/ + + + +#include +#include +#include "cistubplugin.hrh" + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidCustomInterfacePluginDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KMmfUidS60CustomInterfaceStub; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidCustomInterfaceStubPlugin; + version_no = 1; + display_name = "Audio Play Routing Control Stub"; + default_data = "10207cab" ; + opaque_data = ""; + } + }; + } + }; + } + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/cistubplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/cistubplugin/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +cistubplugin.mmp diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/cistubplugin/group/cistubplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/cistubplugin/group/cistubplugin.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CI Stub plugin mmp +* +*/ + + +#include + +TARGET cistubplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10207C70 +CAPABILITY ALL -TCB +VENDORID VID_DEFAULT + + +USERINCLUDE ../inc +USERINCLUDE ../../inc +OS_LAYER_SYSTEMINCLUDE +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/mmf/server +SYSTEMINCLUDE /epoc32/include/mmf/common + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY RestrictedAudioOutputCI.lib +LIBRARY AudioOutputCI.lib +LIBRARY AudioInputCI.lib + +SOURCEPATH ../src + +SOURCE cistubplugin.cpp +SOURCE cistubpluginMain.cpp + +SOURCEPATH ../data +START RESOURCE cistubplugin.rss +TARGET cistubplugin.rsc +END + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/cistubplugin/inc/cistubplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/cistubplugin/inc/cistubplugin.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CI stub plugin +* +*/ + + + +// This file defines the API for AudiPlayRoutingControlCIStub.dll + +#ifndef CISTUBPLUGIN_H +#define CISTUBPLUGIN_H + +#include // CBase +#include // TBuf +#include +#include +#include "RestrictedAudioOutputCIStub.h" +#include "AudioOutputCI.h" +#include "AudioInputCI.h" +#include "AudioOutputMessageTypes.h" +#include "AudioInputMessageTypes.h" + +class MyMCustomInterface + { +public: + virtual TAny* CustomInterface(TUid aCustomeInterface) = 0; + virtual void Release() = 0; + virtual void PassDestructionKey(TUid aUid) = 0; + }; + +class CCIStubPlugin : public CBase,public MyMCustomInterface + { +public: + + static MyMCustomInterface* NewL(); + static CCIStubPlugin* NewLC(); + ~CCIStubPlugin(); + TAny* CustomInterface(TUid aInterfaceId); + void Release(); + void PassDestructionKey(TUid aUid); + +private: + TUid iDtor_ID_Key; + CCIStubPlugin(); + void ConstructL(); + }; + +#endif // __AUDIPLAYROUTINGCONTROLHWDEVICE_H__ diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/cistubplugin/inc/cistubplugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/cistubplugin/inc/cistubplugin.hrh Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ci stub plugin uids +* +*/ + + +#ifndef CISTUBPLUGIN_HRH +#define CISTUBPLUGIN_HRH + + +#define KMmfUidS60CustomInterfaceStub 0x10207C49 +#define KUidCustomInterfacePluginDll 0x10207C70 +#define KUidCustomInterfaceStubPlugin 0x10207C71 + +#endif diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/cistubplugin/src/cistubplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/cistubplugin/src/cistubplugin.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Generic Stub plugin that load required CI stub in WINSCW + * + */ + + + +#include "cistubplugin.h" + +#ifdef _DEBUG +#define DEBPRN0 RDebug::Printf( "*CI STUB PLUGIN* %s", __PRETTY_FUNCTION__); +#define DEBPRN1(str) RDebug::Printf( "%s %s", __PRETTY_FUNCTION__, str ); +#else +#define DEBPRN0 +#define DEBPRN1(str) +#endif + +#define KTenSeconds 3000000 +// Member Functions + + +CCIStubPlugin* CCIStubPlugin::NewLC() + { + DEBPRN0; + CCIStubPlugin* self = new (ELeave) CCIStubPlugin; + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +MyMCustomInterface* CCIStubPlugin::NewL() + { + DEBPRN0; + CCIStubPlugin* self = CCIStubPlugin::NewLC(); + CleanupStack::Pop(self); + return (MyMCustomInterface*) self; + } + +CCIStubPlugin::CCIStubPlugin() +// note, CBase initialises all member variables to zero + { + DEBPRN0; + } + +void CCIStubPlugin::ConstructL() + { + DEBPRN0; + } + +CCIStubPlugin::~CCIStubPlugin() + { + DEBPRN0; + } + +TAny* CCIStubPlugin::CustomInterface(TUid aInterfaceId) + { + DEBPRN0; + if (aInterfaceId == KUidRestrictedAudioOutput) + { + return (TAny*)CRestrictedAudioOutputCI::NewL(); + } + if(aInterfaceId == KUidAudioOutput) + { + return (TAny*)CAudioOutputCI::NewL(); + } + if(aInterfaceId == KUidAudioInput) + { + return (TAny*)CAudioInputCI::NewL(); + } + return NULL; + } + +void CCIStubPlugin::Release() + { + DEBPRN0; + REComSession::DestroyedImplementation(iDtor_ID_Key); + delete this; + } +void CCIStubPlugin::PassDestructionKey(TUid aUid) + { + DEBPRN0; + iDtor_ID_Key = aUid; + } diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/cistubplugin/src/cistubpluginMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/cistubplugin/src/cistubpluginMain.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Stub plugin main +* +*/ + + + +#include +#include +#include "cistubplugin.h" +#include "cistubplugin.hrh" + + +// ImplementationTable + +const TImplementationProxy + ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(KUidCustomInterfaceStubPlugin, CCIStubPlugin::NewL), + }; + + +// ImplementationGroupProxy + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Build file for AdvancedAudioController including the projects that +* are needed to be built. +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +// MmfDevSoundAdaptation Stub +#include "../mmfdevsoundadaptation_stub/group/bld.inf" + +// mmfaudioserverfactorystub Stub +#include "../mmfaudioserverfactorystub/group/bld.inf" + +// Added DevSoundControl CI Stub +#include "../addeddevsoundcontrolcistub/Group/bld.inf" + +// Audio Enhancement Factory Stubs +#include "../audioenhancementfactorystubs/group/bld.inf" + +// Audio Routing CI Stub +#include "../audioinputcistub/Group/bld.inf" +#include "../audiooutputcistub/Group/bld.inf" + +// Audio Effect CI Stub +#include "../audioeffectscistubs/group/bld.inf" + +// Audio Codec CI Stub +#include "../audiocodeccistubs/group/bld.inf" + +// Audio Visualization Stub -- As Audio Visualization is deprecated, this also should be deprecated +//#include "../audiovisualizationstub/Group/bld.inf" + +// Restricted Audio Output CI Stub +#include "../restrictedaudiooutputcistub/Group/bld.inf" + +//CI stub plugin +#include "../cistubplugin/group/bld.inf" + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + +//////////////////////////////////////////////////////////////////////////////// +// END OF FILE // +//////////////////////////////////////////////////////////////////////////////// diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/AacDecoderConfigCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/AacDecoderConfigCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + +#ifndef AACDECODERCONFIGCIIMPL_H +#define AACDECODERCONFIGCIIMPL_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class CAacDecoderConfigCI : public CAacDecoderConfig + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CAacDecoderConfigCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CAacDecoderConfigCI(); + + public: // New functions + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 + * @return + */ + IMPORT_C virtual TInt SetAudioConfig(TAudioConfig& aAudioConfig); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CAacDecoderConfigCI(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + public: // Friend classes + protected: // Friend classes + private: // Friend classes + + }; + +#endif // AACDECODERCONFIGCIIMPL_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/AudioInputCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/AudioInputCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - AudioInput CI +* +*/ + +#include "AudioInput.h" + +class CMMFDevSound; + +class CAudioInputCI : public CAudioInput + { + public: + IMPORT_C static CAudioInputCI* NewL(CMMFDevSound& aDevSound); + IMPORT_C static CAudioInputCI* NewL(); + virtual ~CAudioInputCI(); + + virtual TAudioInputArray AudioInput(); + virtual void SetAudioInputL(TAudioInputArray aAudioInputs); + + private: + CAudioInputCI(CMMFDevSound& aDevSound); + CAudioInputCI(); + + CMMFDevSound* iDevSound; + CArrayFixFlat iInputArray; + }; diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/AudioOutputCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/AudioOutputCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - AudioOutput CI +* +*/ + +#ifndef _AUDIOOUTPUTCI_H__ +#define _AUDIOOUTPUTCI_H__ + +#include +#include "AudioOutput.h" + +class CMMFDevSound; +class CAudioOutputCustomInterfaceHandler; +class CAudioOutputTimer; + +class CAudioOutputCI : public CAudioOutput + { + public: + IMPORT_C static CAudioOutputCI* NewL(CMMFDevSound& aDevSound); + virtual ~CAudioOutputCI(); + + + virtual TAudioOutputPreference AudioOutput(); + virtual TAudioOutputPreference DefaultAudioOutput(); + virtual void RegisterObserverL( MAudioOutputObserver& aObserver ); + virtual TBool SecureOutput(); + virtual void SetAudioOutputL( TAudioOutputPreference aAudioOutput = ENoPreference ); + virtual void SetSecureOutputL( TBool aSecure = EFalse ); + virtual void UnregisterObserver( MAudioOutputObserver& aObserver ); + void DefaultChanged(); + + IMPORT_C static CAudioOutputCI* NewL(); + + private: + CAudioOutputCI(CMMFDevSound& aDevSound); + CAudioOutputCI(); + + private: + //CMMFDevSound& iDevSound; + CMMFDevSound* iDevSound; + TAudioOutputPreference iOutput; + TBool iSecureOutput; + TAudioOutputPreference iDefault; + MAudioOutputObserver* iObserver; + CAudioOutputTimer* iAudioOutputTimer; + TInt iCount; + + }; + + +class CAudioOutputTimer : public CTimer + { + public: + CAudioOutputTimer(CAudioOutputCI* aCustomInterface); + ~CAudioOutputTimer(); + void RunL(); + void DoCancel(); + + private: + CAudioOutputCI* iCustomInterface; + }; + +#endif \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/AudioVibraControlCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/AudioVibraControlCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + +#ifndef AUDIOVIBRACONTROLCI_H +#define AUDIOVIBRACONTROLCI_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class CAudioVibraControlCI : public CAudioVibraControl + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CAudioVibraControlCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CAudioVibraControlCI(); + + public: // New functions + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 + * @return + */ + IMPORT_C virtual TInt StartVibra(); + IMPORT_C virtual TInt StopVibra(); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CAudioVibraControlCI(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + public: // Friend classes + protected: // Friend classes + private: // Friend classes + + }; + +#endif // AUDIOVIBRACONTROLCI_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/EAacPlusDecoderIntfcCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/EAacPlusDecoderIntfcCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,192 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Custom Interface for eAAC+ decoder. +* +*/ + + +#ifndef EAACPLUSDECODERINTFCCI_H +#define EAACPLUSDECODERINTFCCI_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Custom Interface for eAAC+ decoder. +* +* @lib EAacPlusDecoderIntfcCI_Stub.lib +* @since S60 3.0 +*/ +class CEAacPlusDecoderIntfcCI : public CEAacPlusDecoderIntfc + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CEAacPlusDecoderIntfcCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CEAacPlusDecoderIntfcCI(); + + public: // New functions + + public: // Functions from CEAacPlusDecoderIntfc + + /** + * Configures decoder's profile defined by TAudioObjectType. + * @since S60 3.0 + * @param TAudioObjectType - Supported AAC profile. + * @return void + */ + IMPORT_C virtual void SetAudioObjectType( + TAudioObjectType aAudioObjectType); + + /** + * Configures decoder's input sampling frequency. + * @since S60 3.0 + * @param TUint - Decoder's input sampling frequency value. + * @return void + */ + IMPORT_C virtual void SetInputSamplingFrequency( + TUint aInputSamplingFrequency); + + /** + * Configures the number of channels to be used by the decoder. + * @since S60 3.0 + * @param TUint - Number of channels (stereo/mono). + * @return void + */ + IMPORT_C virtual void SetNumOfChannels(TUint aNumOfChannels); + + /** + * Configures decoder's spectral bandwidth replication (SBR). + * @since S60 3.0 + * @param TBool - Toggle SBR. + * @return void + */ + IMPORT_C virtual void SetSbr(TBool aSbrEnabled); + + /** + * Configures decoder's down-sampled mode (DSM). + * @since S60 3.0 + * @param TBool - Toggle DSM. + * @return void + */ + IMPORT_C virtual void SetDownSampledMode(TBool aDsmEnabled); + + /** + * Commits configuration settings to the decoder. + * @since S60 3.0 + * @return TInt - Status + */ + IMPORT_C virtual TInt ApplyConfig(); + + /** + * Returns decoder's AAC profile setting. + * @since S60 3.0 + * @param TAudioObjectType& - Reference to AAC profile. + * @return TInt - Status + */ + IMPORT_C virtual TInt GetAudioObjectType( + TAudioObjectType& aAudioObjectType); + + /** + * Returns decoder's input sampling frequency setting. + * @since S60 3.0 + * @param TUint& - Reference to input sampling frequency. + * @return TInt - Status + */ + IMPORT_C virtual TInt GetInputSamplingFrequency( + TUint& aInputSamplingFrequency); + + /** + * Returns decoder's channel setting. + * @since S60 3.0 + * @param TUint& - Reference to the number of channels. + * @return TInt - Status + */ + IMPORT_C virtual TInt GetNumOfChannels(TUint& aNumOfChannels); + + /** + * Returns decoder's SBR setting. + * @since S60 3.0 + * @param TBool& - Reference to the SBR setting. + * @return TInt - Status + */ + IMPORT_C virtual TInt GetSbr(TBool& aSbrEnabled); + + /** + * Returns decoder's DSM setting. + * @since S60 3.0 + * @param TBool& - Reference to the DSM setting. + * @return TInt - Status + */ + IMPORT_C virtual TInt GetDownSampledMode(TBool& aDsmEnabled); + + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CEAacPlusDecoderIntfcCI(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + + // Working config before ApplyConfig() + TAudioObjectType iAudioObjectType; + TUint iInputSamplingFrequency; + TUint iNumOfChannels; + TBool iSbrEnabled; + TBool iDsmEnabled; + + // Current config after ApplyConfig() + TAudioObjectType iCurrentAudioObjectType; + TUint iCurrentInputSamplingFrequency; + TUint iCurrentNumOfChannels; + TBool iCurrentSbrEnabled; + TBool iCurrentDsmEnabled; + + }; + +#endif // EAACPLUSDECODERINTFCCI_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/ErrorConcealmentIntfcCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/ErrorConcealmentIntfcCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + +#ifndef ERRORCONCEALMENTINTFCCI_H +#define ERRORCONCEALMENTINTFCCI_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class CErrorConcealmentIntfcCI : public CErrorConcealmentIntfc + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CErrorConcealmentIntfcCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CErrorConcealmentIntfcCI(); + + public: // New functions + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 + * @return + */ + IMPORT_C virtual TInt ConcealErrorForNextBuffer(); + IMPORT_C virtual TInt SetFrameMode(TBool aFrameMode); + IMPORT_C virtual TInt FrameModeRqrdForEC(TBool& aFrameModeRqrd); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CErrorConcealmentIntfcCI(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + TBool iFrameModeRqrd; + public: // Friend classes + protected: // Friend classes + private: // Friend classes + + }; + +#endif // ERRORCONCEALMENTINTFCCI_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/G711DecoderIntfcCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/G711DecoderIntfcCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + +#ifndef G711DECODERINTFCCI_H +#define G711DECODERINTFCCI_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class CG711DecoderIntfcCI : public CG711DecoderIntfc + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CG711DecoderIntfcCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CG711DecoderIntfcCI(); + + public: // New functions + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 + * @return + */ + IMPORT_C virtual TInt SetDecoderMode(TDecodeMode aDecodeMode); + IMPORT_C virtual TInt SetCng(TBool aCng); + IMPORT_C virtual TInt GetCng(TBool& aCng); + IMPORT_C virtual TInt SetPlc(TBool aPlc); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CG711DecoderIntfcCI(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + TBool iCng; + public: // Friend classes + protected: // Friend classes + private: // Friend classes + + }; + +#endif // G711DECODERINTFCCI_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/G711EncoderIntfcCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/G711EncoderIntfcCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + +#ifndef G711ENCODERINTFCCI_H +#define G711ENCODERINTFCCI_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class CG711EncoderIntfcCI : public CG711EncoderIntfc + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CG711EncoderIntfcCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CG711EncoderIntfcCI(); + + public: // New functions + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 + * @return + */ + IMPORT_C virtual TInt SetEncoderMode(TEncodeMode aEncodeMode); + IMPORT_C virtual TInt SetVadMode(TBool aVadMode); + IMPORT_C virtual TInt GetVadMode(TBool& aVadMode); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CG711EncoderIntfcCI(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + TBool iVadMode; + public: // Friend classes + protected: // Friend classes + private: // Friend classes + + }; + +#endif // G711ENCODERINTFCCI_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/G729DecoderIntfcCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/G729DecoderIntfcCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + +#ifndef G729DECODERINTFCCI_H +#define G729DECODERINTFCCI_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class CG729DecoderIntfcCI : public CG729DecoderIntfc + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CG729DecoderIntfcCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CG729DecoderIntfcCI(); + + public: // New functions + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 + * @return + */ + IMPORT_C virtual TInt BadLsfNextBuffer(); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CG729DecoderIntfcCI(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + TBool iCng; + public: // Friend classes + protected: // Friend classes + private: // Friend classes + + }; + +#endif // G729DECODERINTFCCI_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/G729EncoderIntfcCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/G729EncoderIntfcCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + +#ifndef G729ENCODERINTFCCI_H +#define G729ENCODERINTFCCI_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class CG729EncoderIntfcCI : public CG729EncoderIntfc + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CG729EncoderIntfcCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CG729EncoderIntfcCI(); + + public: // New functions + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 + * @return + */ + IMPORT_C virtual TInt SetVadMode(TBool aVadMode); + IMPORT_C virtual TInt GetVadMode(TBool& aVadMode); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CG729EncoderIntfcCI(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + TBool iVadMode; + public: // Friend classes + protected: // Friend classes + private: // Friend classes + + }; + +#endif // G729ENCODERINTFCCI_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/IlbcDecoderIntfcCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/IlbcDecoderIntfcCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + +#ifndef ILBCDECODERINTFCCI_H +#define ILBCDECODERINTFCCI_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class CIlbcDecoderIntfcCI : public CIlbcDecoderIntfc + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CIlbcDecoderIntfcCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CIlbcDecoderIntfcCI(); + + public: // New functions + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 + * @return + */ + IMPORT_C virtual TInt SetDecoderMode(TDecodeMode aDecodeMode); + IMPORT_C virtual TInt SetCng(TBool aCng); + IMPORT_C virtual TInt GetCng(TBool& aCng); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CIlbcDecoderIntfcCI(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + TBool iCng; + public: // Friend classes + protected: // Friend classes + private: // Friend classes + + }; + +#endif // ILBCDECODERINTFCCI_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/IlbcEncoderIntfcCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/IlbcEncoderIntfcCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + +#ifndef ILBCENCODERINTFCCI_H +#define ILBCENCODERINTFCCI_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class CIlbcEncoderIntfcCI : public CIlbcEncoderIntfc + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CIlbcEncoderIntfcCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CIlbcEncoderIntfcCI(); + + public: // New functions + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 + * @return + */ + IMPORT_C virtual TInt SetEncoderMode(TEncodeMode aEncodeMode); + IMPORT_C virtual TInt SetVadMode(TBool aVadMode); + IMPORT_C virtual TInt GetVadMode(TBool& aVadMode); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CIlbcEncoderIntfcCI(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + TBool iVadMode; + public: // Friend classes + protected: // Friend classes + private: // Friend classes + + }; + +#endif // ILBCENCODERINTFCCI_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/Ra8CustomInterfaceCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/Ra8CustomInterfaceCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Custom Interface Stub implementation for RA8 decoder. +* +*/ + + +#ifndef RA8DECODERINTFCCI_H +#define RA8DECODERINTFCCI_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +//class CCustomInterfaceUtility; +//class MCustomCommand; +//class CMMFDevSound; + +// CLASS DECLARATION + +/** +* Custom Interface for RA8 decoder. +* Stub implementation. +* +* @lib Ra8DecoderIntfcCI_Stub.lib +* @since Series 60 3.2 +*/ +class CRa8DecoderIntfcCI : public CRa8CustomInterface + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CRa8DecoderIntfcCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CRa8DecoderIntfcCI(); + + public: // New functions + + public: // Functions from base classes + + /** + * From CRa8CustomInterface + */ + IMPORT_C virtual TInt FrameNumber(); + IMPORT_C virtual TInt SetInitString(TDesC8& aInitString); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CRa8DecoderIntfcCI(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + public: // Friend classes + protected: // Friend classes + private: // Friend classes + + }; + +#endif // RA8DECODERINTFCCI_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/RestrictedAudioOutputCIStub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/RestrictedAudioOutputCIStub.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the RestrictedAudioOutput Custom Interface class. +* This serves as an example of how adaptation might define the +* custom interface class. +* The CRestrictedAudioOutputCI object is typically instantiated by a DevSound +* instance and return to the client when the CustomInterface() +* method is invoked. +* +* +*/ + +#ifndef RESTRICTEDAUDIOOUTPUTCI_H +#define RESTRICTEDAUDIOOUTPUTCI_H + +#include +#include +# +class CMMFDevSound; + +class CRestrictedAudioOutputCI : public CRestrictedAudioOutput + + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CRestrictedAudioOutputCI* NewL(); + + /** + * Destructor. + */ + virtual ~CRestrictedAudioOutputCI(); + + public: // From Base Class + + /** + * + * + * @since 3.2 + */ + virtual TInt Commit(); + + private: + + /** + * By default Symbian 2nd phase constructor is private. + */ + // static void ConstructL(); + /** + * C++ default constructor. + */ + + CRestrictedAudioOutputCI(); + + private: // Data + + + }; +#endif //RESTRICTEDAUDIOOUTPUTCI_H diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/SbcEncoderIntfcCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/SbcEncoderIntfcCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,266 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Custom Interface stub object for configuring the SBC encoder. +* +*/ + + +#ifndef CSBCENCODERINTFCCI_H +#define CSBCENCODERINTFCCI_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** + * Custom Interface stub for configuring the SBC encoder operating modes. + * This class processes requests received from the CSbcEncoderIntfcProxy. + * + * @lib SbcEncoderIntfcCI_Stub.lib + * @since S60 3.0 + */ +class CSbcEncoderIntfcCI : public CSbcEncoderIntfc + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CSbcEncoderIntfcCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CSbcEncoderIntfcCI(); + + public: // New functions + + public: // Functions from CSbcEncoderInfc base class + + /** + * Retrieves the sampling frequencies supported by the encoder. + * @since S60 3.0 + * @param RArray& - reference to the array of sampling freq. + * @return TInt status + */ + IMPORT_C virtual TInt GetSupportedSamplingFrequencies( + RArray& aSupportedSamplingFrequencies); + + /** + * Retrieves the channel modes supported by the encoder. + * @since S60 3.0 + * @param RArray& - reference to the array of channel modes. + * @return TInt status + */ + IMPORT_C virtual TInt GetSupportedChannelModes( + RArray& aSupportedChannelModes); + + /** + * Retrieves the blocks supported by the encoder. + * @since S60 3.0 + * @param RArray& - reference to the array of blocks. + * @return TInt status + */ + IMPORT_C virtual TInt GetSupportedNumOfBlocks( + RArray& aSupportedNumOfBlocks); + + /** + * Retrieves the subbands supported by the encoder. + * @since S60 3.0 + * @param RArray& - reference to the array of subbands. + * @return TInt status + */ + IMPORT_C virtual TInt GetSupportedNumOfSubbands( + RArray& aSupportedNumOfSubbands); + + /** + * Retrieves the allocation methods supported by the encoder. + * @since S60 3.0 + * @param RArray& - reference to the array of alloc. methods. + * @return TInt status + */ + IMPORT_C virtual TInt GetSupportedAllocationMethods( + RArray& + aSupportedAllocationMethods); + + /** + * Retrieves the bitpool size supported by the encoder. + * @since S60 3.0 + * @param TUint& - reference to the min bitpool size. + * @param TUint& - reference to the max bitpool size. + * @return TInt status + */ + IMPORT_C virtual TInt GetSupportedBitpoolRange( + TUint& aMinSupportedBitpoolSize, + TUint& aMaxSupportedBitpoolSize); + + /** + * Sets new sampling frequency. + * @since S60 3.0 + * @param TUint - sampling frequency to be set. + * @return void + */ + IMPORT_C virtual void SetSamplingFrequency(TUint aSamplingFrequency); + + /** + * Returns current sampling frequency. + * @since S60 3.0 + * @param TUint& - current sampling frequency. + * @return TInt - status + */ + IMPORT_C virtual TInt GetSamplingFrequency(TUint& aSamplingFrequency); + + /** + * Sets new channel mode. + * @since S60 3.0 + * @param TSbcChannelMode - channel mode to be set. + * @return void + */ + IMPORT_C virtual void SetChannelMode(TSbcChannelMode aChannelMode); + + /** + * Returns current channel mode. + * @since S60 3.0 + * @param TSbcChannelMode& - current channel mode. + * @return TInt - status + */ + IMPORT_C virtual TInt GetChannelMode(TSbcChannelMode& aChannelMode); + + /** + * Sets new number of subbands. + * @since S60 3.0 + * @param TSbcChannelMode - number of subbands to be set. + * @return void + */ + IMPORT_C virtual void SetNumOfSubbands(TUint aNumOfSubbands); + + /** + * Returns current number of subbands. + * @since S60 3.0 + * @param TUint& - current subbands. + * @return TInt - status + */ + IMPORT_C virtual TInt GetNumOfSubbands(TUint& aNumOfSubbands); + + /** + * Sets new number of blocks. + * @since S60 3.0 + * @param TSbcChannelMode - number of blocks to be set. + * @return void + */ + IMPORT_C virtual void SetNumOfBlocks(TUint aNumOfBlocks); + + /** + * Returns current number of blocks. + * @since S60 3.0 + * @param TUint& - current number of blocks. + * @return TInt - status + */ + IMPORT_C virtual TInt GetNumOfBlocks(TUint& aNumOfBlocks); + + /** + * Sets new allocation method. + * @since S60 3.0 + * @param TSbcAllocationMethod - allocation method to be set. + * @return void + */ + IMPORT_C virtual void SetAllocationMethod( + TSbcAllocationMethod aAllocationMethod); + + /** + * Returns current allocation method. + * @since S60 3.0 + * @param TUint& - current allocation method. + * @return TInt - status + */ + IMPORT_C virtual TInt GetAllocationMethod( + TSbcAllocationMethod& aAllocationMethod); + + /** + * Sets new bitpool size. + * @since S60 3.0 + * @param TUint - bitpool size to be set. + * @return void + */ + IMPORT_C virtual void SetBitpoolSize(TUint aBitpoolSize); + + /** + * Returns current bitpool size. + * @since S60 3.0 + * @param TUint& - current bitpool size. + * @return TInt - status + */ + IMPORT_C virtual TInt GetBitpoolSize(TUint& aBitpoolSize); + + /** + * Commits new configuration settings. + * @since S60 3.0 + * @return TInt - status + */ + IMPORT_C virtual TInt ApplyConfig(); + + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CSbcEncoderIntfcCI(); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + + // Working config before ApplyConfig() + TUint iSamplingFrequency; + TSbcChannelMode iChannelMode; + TUint iNumOfSubbands; + TUint iNumOfBlocks; + TSbcAllocationMethod iAllocationMethod; + TUint iBitpoolSize; + + // Current config after ApplyConfig() + TUint iCurrentSamplingFrequency; + TSbcChannelMode iCurrentChannelMode; + TUint iCurrentNumOfSubbands; + TUint iCurrentNumOfBlocks; + TSbcAllocationMethod iCurrentAllocationMethod; + TUint iCurrentBitpoolSize; + + }; + +#endif // CSBCENCODERINTFCCI_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/SpeechEncoderConfigCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/SpeechEncoderConfigCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + +#ifndef CSPEECHENCODERCONFIGCI_H +#define CSPEECHENCODERCONFIGCI_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class CSpeechEncoderConfigCI : public CSpeechEncoderConfig + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CSpeechEncoderConfigCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CSpeechEncoderConfigCI(); + + public: // New functions + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 + * @return + */ + IMPORT_C virtual TInt GetSupportedBitrates(RArray& aSupportedBitrates); + IMPORT_C virtual TInt SetBitrate(TUint aBitrate); + IMPORT_C virtual TInt GetBitrate(TUint& aBitrate); + IMPORT_C virtual TInt SetVadMode(TBool aVadMode); + IMPORT_C virtual TInt GetVadMode(TBool& aVadMode); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CSpeechEncoderConfigCI(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + TUint iBitrate; + TBool iVadMode; + public: // Friend classes + protected: // Friend classes + private: // Friend classes + + }; + +#endif // CSPEECHENCODERCONFIGCI_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/WmaDecoderIntfcCI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/WmaDecoderIntfcCI.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,383 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + +#ifndef WmaDECODERINTFCCIIMPL_H +#define WmaDECODERINTFCCIIMPL_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class CWmaDecoderIntfcCI : public CWmaDecoderIntfc + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CWmaDecoderIntfcCI* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CWmaDecoderIntfcCI(); + + public: // New functions + + public: // Functions from base classes + + public: // Functions from base classes + + // From CWmaDecoderIntfc + + /** + * Identifies the compressed audio format + * @since S60 3.2 + * @param aFormat - the audio format. + * @return void + */ + IMPORT_C virtual void SetFormat(TFormat aFormat) ; + + /** + * Specifies the number of bits per sample + * @since S60 3.2 + * @param aFormat - the audio format. + * @return void + */ + IMPORT_C virtual void SetBitsPerSampleIn(TUint aBitsPerSample) ; + + /** + * Specifies the number of audio channels + * @since S60 3.2 + * @param aNumOfChannels: The number of audio channels. + * @return void + */ + IMPORT_C virtual void SetNumChannelsIn (TUint aNumChannelsIn) ; + + /** + * Specifies the sampling rate + * @since S60 3.2 + * @param aSamplesPerSec: Sample rate value in Hertz. + * @return void + */ + IMPORT_C virtual void SetSamplesPerSec (TUint aSamplesPerSec) ; + + /** + * Specifies the average number of bytes per second + * @since S60 3.2 + * @param aAvgBytesPerSec: Average bytes per second. + * @return void + */ + IMPORT_C virtual void SetAvgBytesPerSec (TUint aAvgBytesPerSec) ; + + /** + * Specifies the block size in bytes + * @since S60 3.2 + * @param aBlockAlign: Block size in bytes + * @return void + */ + IMPORT_C virtual void SetBlockAlign (TUint aBlockAlign) ; + + /** + * Configuration information specific to the WMA decoder + * @since S60 3.2 + * @param aEncodeOptions: The encode options + * @return void + */ + IMPORT_C virtual void SetEncodeOptions (TUint aEncodeOptions) ; + + /** + * Returns the configuration state of the advanced encode options. + * @since S60 3.2 + * @return aAdvEncodeOpts: The encode options + */ + IMPORT_C virtual TInt GetEncodeOptions1 (TUint& aEncodeOpts1); + + /** + * Returns the configuration state of the advanced encode options. + * @since S60 3.2 + * @return aAdvEncodeOpts: The encode options + */ + IMPORT_C virtual TInt GetEncodeOptions2 (TUint& aEncodeOpts2); + + /** + * Configures the decoder for the channel data arrangement + * @since S60 3.2 + * @param aChannelMask: Channel mask + * @return void + */ + IMPORT_C virtual void SetChannelMaskIn (TUint aChannelMask) ; + + /** + * Commits configuration settings to the decoder. + * @since S60 3.2 + * @return TInt - Status + */ + IMPORT_C virtual TInt ApplyConfig() ; + + /** + * Returns the configuration state of audio format. + * @since S60 3.2 + * @return aFormat: The audio format + */ + IMPORT_C virtual TInt GetFormat (TFormat& aFormat) ; + + /** + * Returns the configuration state of number of bits per sample. + * @since S60 3.2 + * @return aBitsPerSample: Number of bits per sample + */ + IMPORT_C virtual TInt GetBitsPerSampleIn(TUint& aBitsPerSample) ; + + /** + * Returns the configuration state of the number of channels. + * @since S60 3.2 + * @return aNumOfChannels: Number of channels + */ + IMPORT_C virtual TInt GetNumOfChannelsIn (TUint& aNumOfChannels) ; + + /** + * Returns the configuration state of the sample rate. + * @since S60 3.2 + * @return aSamplesPerSec: Sample rate value in Hertz + */ + IMPORT_C virtual TInt GetSamplesPerSec (TUint& aSamplesPerSec) ; + + /** + * Returns the configuration state of average bytes per second. + * @since S60 3.2 + * @return aAvgBytesPerSec: Average bytes per second + */ + IMPORT_C virtual TInt GetAvgBytesPerSec (TUint& aAvgBytesPerSec) ; + + /** + * Returns the configuration state of block alignment. + * @since S60 3.2 + * @return aBlockAlign: Block size in bytes + */ + IMPORT_C virtual TInt GetBlockAlign (TUint& aBlockAlign) ; + + /** + * Returns the configuration state of the encode options. + * @since S60 3.2 + * @return aEncodeOpts: The encode options. + */ + IMPORT_C virtual TInt GetEncodeOptions (TUint& aEncodeOpts) ; + + + /** + * Returns the configuration state of the input channel mask. + * @since S60 3.2 + * @return aChannelMask: Channel mask. + */ + IMPORT_C virtual TInt GetChannelMaskIn (TUint& aChannelMask) ; + + /** + * Gets a list of formats supported by the decoder. + * @since S60 3.2 + * @return aSupportedFormats: An array of the formats, as defined in TFormat + */ + IMPORT_C virtual TInt GetSupportedFormats(RArray& aSupportedFormats) ; + + /** + * Gets a list of tools supported by the decoder. + * @since S60 3.2 + * @return aSupportedTools: An array of the tools supported by the decoder + */ + IMPORT_C virtual TInt GetSupportedTools(RArray& aSupportedTools) ; + + /** + * Get the maximum number of input channels supported by the decoder. + * @since S60 3.2 + * @return aSupportedMaxChannelsIn: number of channels. + */ + IMPORT_C virtual TInt GetSupportedMaxChannelsIn(TUint& aSupportedMaxChannelsIn) ; + + /** + * Get the maximum bitrate supported by the decoder. + * @since S60 3.2 + * @return aSupportedMaxBitrate: maximum bitrate + */ + IMPORT_C virtual TInt GetSupportedMaxBitrate(TUint& aSupportedMaxBitrate) ; + + /** + * Get the maximum sample rate supported by the decoder. + * @since S60 3.2 + * @return aSupportedMaxSampleRate: maximum sample rate + */ + IMPORT_C virtual TInt GetSupportedMaxSampleRate(TUint& aSupportedMaxSampleRate) ; + + /** + * Gets a list of the tools that are controllable through this interface. + * @since S60 3.2 + * @return aControllableTools: An array of the tools that are controllable through this interface. + */ + IMPORT_C virtual TInt GetControllableTools(RArray& aControllableTools) ; + + /** + * Enables the tool specified. + * @since S60 3.2 + * @return aTool: Specifies the tool to enable. + */ + IMPORT_C virtual void EnableTool(TTool aTool) ; + + /** + * Disables the tool specified. + * @since S60 3.2 + * @return aTool: Specifies the tool to disable. + */ + IMPORT_C virtual void DisableTool(TTool aTool) ; + + /** + * Returns the state of the specified tool + * @since S60 3.2 + * @return aTool: Specifies the tool for which the state is requested + * @ aEnabled : Indicates the state of the tool specified in aTool + */ + IMPORT_C virtual TInt GetTool(TTool aTool, TBool& aEnabled) ; + + /** + * Configuration information specific to the WMA decoder + * @since S60 3.2 + * @param aEncodeOptions: The encode options + * @return void + */ + IMPORT_C virtual void SetEncodeOptions1 (TUint aEncodeOptions1); + + /** + * Configuration information specific to the WMA decoder + * @since S60 3.2 + * @param aEncodeOptions: The encode options + * @return void + */ + IMPORT_C virtual void SetEncodeOptions2 (TUint aEncodeOptions2); + + /** + * Configures the decoder for the channel data arrangement + * @since S60 3.2 + * @param aChannelMask: Channel mask + * @return void + */ + + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CWmaDecoderIntfcCI(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + protected: // Data + private: // Data + // Working config before ApplyConfig() + TFormat iFormat; + TUint iBitsPerSample; + TUint iNumChannelsIn; + TUint iSamplesPerSec; + TUint iAvgBytesPerSec; + TUint iBlockAlign; + TUint iEncodeOptions; + TUint iEncodeOptions1; + TUint iEncodeOptions2; + + TUint iChannelMask; + RArray iSupportedFormats; + RArray iSupportedTools; + RArray iControllableTools; + TUint iSupportedMaxSampleRate; + TUint iSupportedMaxChannelsIn; + TUint iSupportedMaxBitrate; + TTool iEnable; + TTool iDisable; + + + TBool iToolOutPut32Bit; + TBool iToolDownMixToStereo; + TBool iToolLostDataConcealment; + + + TFormat iCurrentFormat; + TUint iCurrentBitsPerSample; + TUint iCurrentNumChannelsIn; + TUint iCurrentSamplesPerSec; + TUint iCurrentAvgBytesPerSec; + TUint iCurrentBlockAlign; + TUint iCurrentEncodeOptions; + TUint iCurrentEncodeOptions1; + TUint iCurrentEncodeOptions2; + + TUint iCurrentChannelMask; + RArrayiCurrentSupportedFormats; + RArray iCurrentSupportedTools; + RArray iCurrentControllableTools; + TUint iCurrentSupportedMaxSampleRate; + TUint iCurrentSupportedMaxChannelsIn; + TUint iCurrentSupportedMaxBitrate; + + TBool iCurrentToolOutPut32Bit; + TBool iCurrentToolDownMixToStereo; + TBool iCurrentToolLostDataConcealment; + + TTool iCurrentEnable; + TTool iCurrentDisable; + + // Flag indicating readiness of the data to be applied + TBool iHasBeenApplied; + // returned status of function ApplyConfigL + TInt iApplyConfStatus; + + + public: // Friend classes + protected: // Friend classes + private: // Friend classes + + + }; + +#endif // WMADECODERINTFCCIIMPL_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/inc/devsoundextensionstubs_common.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/inc/devsoundextensionstubs_common.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Common definitions +* +*/ + +#ifndef DEVSOUNDEXTENSIONSTUBS_COMMON_H_ +#define DEVSOUNDEXTENSIONSTUBS_COMMON_H_ + +#define KUidDevsoundExtensionStubsInterface 0x10207C49 + +#define RET_ERR_IF_ERR(err) if ( err != KErrNone) return err; + +#ifdef _DEBUG +#include "e32debug.h" + +#define DB_IN RDebug::Printf("%s>ENTER", __PRETTY_FUNCTION__) +#define DB_OUT RDebug::Printf("%s>EXIT", __PRETTY_FUNCTION__) +#define DB_IF_ERR(err) if (err != KErrNone) RDebug::Printf( "%s>BREAK[%d]", __PRETTY_FUNCTION__, err ) + +#define DB0(str) RDebug::Print(str, this) +#define DB1(str, val1) RDebug::Print(str, this, val1) +#define DB2(str, val1, val2) RDebug::Print(str, this, val1, val2) + +#define DB_CUSTOM0(str) RDebug::Print(str) +#define DB_CUSTOM1(str, val1) RDebug::Print(str, val1) +#define DB_CUSTOM2(str, val1, val2) RDebug::Print(str, val1, val2) + +#else + +#define DB_IN +#define DB_OUT +#define DB_IF_ERR(err) +#define DB0(str) +#define DB1(str, val1) +#define DB2(str, val1, val2) +#define DB_CUSTOM0(str) +#define DB_CUSTOM1(str, val1) +#define DB_CUSTOM2(str, val1, val2) +#endif //_DEBUG + + +#endif /*DEVSOUNDEXTENSIONSTUBS_COMMON_H_*/ diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/bwinscw/mmfaudioserverfactorystubu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/bwinscw/mmfaudioserverfactorystubu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &) + ?NewL@CMMFAudioServerFactoryStub@@SAPAVMAudioSvrService@@XZ @ 2 NONAME ; class MAudioSvrService * CMMFAudioServerFactoryStub::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/data/10207ABC.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/data/10207ABC.rss Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - AudioServerFactoryStub ECOM plugin resource registry definition. +* +*/ + +// RESOURCE IDENTIFIER + +// INCLUDES +#include +#include // For KUidA3fAudioServicePlugin + +#include "mmfaudioserverfactorystub.hrh" + +// RESOURCE DEFINITIONS +// ----------------------------------------------------------------------------- +// +// Identifies adapters for ECOM. +// +// ----------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = KMMFAudioServiceFactoryStubUID; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidA3fAudioServicePlugin; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KMMFAudioServiceFactoryStubImplementationUID; + version_no = 1; + display_name = "Telephony Audio Routing Manager Service"; + rom_only = 1; + } + }; + } + }; + } + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/eabi/mmfaudioserverfactorystubu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/eabi/mmfaudioserverfactorystubu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,8 @@ +EXPORTS + _Z24ImplementationGroupProxyRi @ 1 NONAME + _ZN26CMMFAudioServerFactoryStub4NewLEv @ 2 NONAME + _ZTI26CMMFAudioServerFactoryStub @ 3 NONAME ; ## + _ZTI33CTelephonyAudioRoutingManagerStub @ 4 NONAME ; ## + _ZTV26CMMFAudioServerFactoryStub @ 5 NONAME ; ## + _ZTV33CTelephonyAudioRoutingManagerStub @ 6 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for the Audio Server Factory +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +mmfaudioserverfactorystub.mmp diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/group/mmfaudioserverfactorystub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/group/mmfaudioserverfactorystub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project specification file for AudioServerFactory stub +* +*/ + +#include + +TARGET mmfaudioserverfactorystub.dll +TARGETTYPE PLUGIN +UID 0x10009d8d 0x10207ABB + +VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN + +#if defined(WINSCW) +DEFFILE ../bwinscw/ +#elif defined(WINS) +DEFFILE ../bwins/ +#elif defined(GCC32) +DEFFILE ../bmarm/ +#else +DEFFILE ../eabi/ +#endif + +SOURCEPATH ../src +SOURCE main.cpp +SOURCE mmfaudioserverfactorystub.cpp +SOURCE telephonyaudioroutingmanagerstub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/a3f +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/ecom + + +SOURCEPATH ../data +START RESOURCE 10207ABC.rss + TARGET mmfaudioserverfactorystub.rsc +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY TelephonyAudioRoutingManager.lib diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/inc/mmfaudioserverfactorystub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/inc/mmfaudioserverfactorystub.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - CMMFAudioServerFactoryStub class declaration. +* +*/ + +#ifndef MMFAUDIOSERVERFACTORYSTUB_H +#define MMFAUDIOSERVERFACTORYSTUB_H + +#include + +// FORWARD DECLARATION +class CTelephonyAudioRoutingManagerStub; + +// CLASS DECLARATION +class CMMFAudioServerFactoryStub : public CBase, + public MAudioSvrService + { + public: + IMPORT_C static MAudioSvrService* NewL(); + + virtual void PassDestructorKey(TUid aUid); + virtual TInt Load(); + virtual TInt Start(); + virtual void Stop(); + virtual void Release(); + + private: + CMMFAudioServerFactoryStub(); + TUid iDestructorKeyUid; + + private: + CTelephonyAudioRoutingManagerStub* iTelephonyAudioRoutingManStub; + }; + +#endif // MMFAUDIOSERVERFACTORYSTUB_H diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/inc/mmfaudioserverfactorystub.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/inc/mmfaudioserverfactorystub.hrh Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Resource definitions of CMMFAudioServerFactoryStub. +* +*/ + +#ifndef MMFAUDIOSERVERFACTORYSTUB_HRH +#define MMFAUDIOSERVERFACTORYSTUB_HRH + +#define KMMFAudioServiceFactoryStubUID 0x10207ABB +#define KMMFAudioServiceFactoryStubImplementationUID 0x10207ABC + +#endif // MMFAUDIOSERVERFACTORYSTUB_HRH diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/inc/telephonyaudioroutingmanagerstub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/inc/telephonyaudioroutingmanagerstub.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - CTelephonyAudioRoutingManagerStub class declaration. +* +*/ + +#ifndef TELEPHONYAUDIOROUTINGMANAGERSTUB_H +#define TELEPHONYAUDIOROUTINGMANAGERSTUB_H + +#include + +// FORWARD DECLARATIONS +class CTelephonyAudioRoutingManager; + +// CLASS DECLARATION +class CTelephonyAudioRoutingManagerStub : + public CBase, + public MTelephonyAudioRoutingPolicyObserver + { + public: + // Construct/destruct + static CTelephonyAudioRoutingManagerStub* NewL(); + ~CTelephonyAudioRoutingManagerStub(); + + private: + // Construct/destruct + CTelephonyAudioRoutingManagerStub(); + void ConstructL(); + + // From MTelephonyAudioRoutingPolicyObserver + virtual void OutputChangeRequested( + CTelephonyAudioRoutingManager& + aTelephonyAudioRoutingManager, + CTelephonyAudioRouting::TAudioOutput aOutput); + + private: + CTelephonyAudioRoutingManager* iTelephonyAudioRoutingMan; + RArray iAudioOutput; + }; + + +#endif /* TELEPHONYAUDIOROUTINGMANAGERSTUB_H */ diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/src/main.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - ECOM implementationproxy definition. +* +*/ + +#include // For making it ECom plugin + +#include "mmfaudioserverfactorystub.h" +#include "mmfaudioserverfactorystub.hrh" + +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(KMMFAudioServiceFactoryStubImplementationUID, CMMFAudioServerFactoryStub::NewL), + }; + + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/src/mmfaudioserverfactorystub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/src/mmfaudioserverfactorystub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Audio Server factory stub class implementation. +* +*/ + +#include "devsoundextensionstubs_common.h" +#include "mmfaudioserverfactorystub.h" +#include "telephonyaudioroutingmanagerstub.h" + +CMMFAudioServerFactoryStub::CMMFAudioServerFactoryStub() + { + // No Impl + } + +EXPORT_C MAudioSvrService* CMMFAudioServerFactoryStub::NewL() + { + DB_IN; + CMMFAudioServerFactoryStub* self = new(ELeave)CMMFAudioServerFactoryStub(); + MAudioSvrService* ptr = static_cast(self); + DB_OUT; + return ptr; + } + +void CMMFAudioServerFactoryStub::PassDestructorKey(TUid aUid) + { + DB_IN; + iDestructorKeyUid = aUid; + DB_OUT; + } + +TInt CMMFAudioServerFactoryStub::Load() + { + DB_IN; + TInt err(KErrNone); + DB_OUT; + return err; + } + +TInt CMMFAudioServerFactoryStub::Start() + { + DB_IN; + TInt err(KErrNone); + iTelephonyAudioRoutingManStub = CTelephonyAudioRoutingManagerStub::NewL(); + DB_OUT; + return err; + } + +void CMMFAudioServerFactoryStub::Stop() + { + // No Impl + } + +void CMMFAudioServerFactoryStub::Release() + { + DB_IN; + delete iTelephonyAudioRoutingManStub; + REComSession::DestroyedImplementation(iDestructorKeyUid); + DB_OUT; + } diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/src/telephonyaudioroutingmanagerstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfaudioserverfactorystub/src/telephonyaudioroutingmanagerstub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - TelephonyAudioRoutingManagerStub class implementation. +* Starts the TelephonyAudioRoutingManager. +* +*/ + +#include + +#include "devsoundextensionstubs_common.h" +#include "telephonyaudioroutingmanagerstub.h" + +CTelephonyAudioRoutingManagerStub::CTelephonyAudioRoutingManagerStub() + { + // No Impl + } + +CTelephonyAudioRoutingManagerStub::~CTelephonyAudioRoutingManagerStub() + { + DB_IN; + iAudioOutput.Close(); + delete iTelephonyAudioRoutingMan; + DB_OUT; + } + +CTelephonyAudioRoutingManagerStub* CTelephonyAudioRoutingManagerStub::NewL() + { + DB_IN; + CTelephonyAudioRoutingManagerStub* self = new (ELeave) CTelephonyAudioRoutingManagerStub; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + DB_OUT; + return self; + } + +void CTelephonyAudioRoutingManagerStub::ConstructL() + { + DB_IN; + // Configure and launch Telephony Audio Routing Manager + iAudioOutput.Reset(); + iAudioOutput.Append(CTelephonyAudioRouting::EHandset); + iAudioOutput.Append(CTelephonyAudioRouting::ELoudspeaker); + + iTelephonyAudioRoutingMan = CTelephonyAudioRoutingManager::NewL(*this, iAudioOutput.Array()); + + DB_CUSTOM0(_L("Telephony Audio Routing Manager created")); + DB_OUT; + } + +void CTelephonyAudioRoutingManagerStub::OutputChangeRequested ( + CTelephonyAudioRoutingManager& /*aTelephonyAudioRoutingManager*/, + CTelephonyAudioRouting::TAudioOutput /*aOutput*/) + { + // No Impl + } diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/BWINS/MmfDevSoundAdaptation.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/BWINS/MmfDevSoundAdaptation.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,44 @@ +EXPORTS + ??1CMMFDevSoundAdaptation@@UAE@XZ @ 1 NONAME ; CMMFDevSoundAdaptation::~CMMFDevSoundAdaptation(void) + ?Capabilities@CMMFDevSoundAdaptation@@QAE?AVTMMFCapabilities@@XZ @ 2 NONAME ; class TMMFCapabilities CMMFDevSoundAdaptation::Capabilities(void) + ?ClientConfig@CMMFDevSoundAdaptation@@QBEABVTMMFClientConfig@@XZ @ 3 NONAME ; class TMMFClientConfig const & CMMFDevSoundAdaptation::ClientConfig(void) const + ?Config@CMMFDevSoundAdaptation@@QBE?AVTMMFCapabilities@@XZ @ 4 NONAME ; class TMMFCapabilities CMMFDevSoundAdaptation::Config(void) const + ?CustomInterface@CMMFDevSoundAdaptation@@QAEPAXVTUid@@@Z @ 5 NONAME ; void * CMMFDevSoundAdaptation::CustomInterface(class TUid) + ?FixedSequenceCount@CMMFDevSoundAdaptation@@QAEHXZ @ 6 NONAME ; int CMMFDevSoundAdaptation::FixedSequenceCount(void) + ?FixedSequenceName@CMMFDevSoundAdaptation@@QAEABVTDesC16@@H@Z @ 7 NONAME ; class TDesC16 const & CMMFDevSoundAdaptation::FixedSequenceName(int) + ?Gain@CMMFDevSoundAdaptation@@QAEHXZ @ 8 NONAME ; int CMMFDevSoundAdaptation::Gain(void) + ?GetPlayBalanceL@CMMFDevSoundAdaptation@@QAEXAAH0@Z @ 9 NONAME ; void CMMFDevSoundAdaptation::GetPlayBalanceL(int &, int &) + ?GetRecordBalanceL@CMMFDevSoundAdaptation@@QAEXAAH0@Z @ 10 NONAME ; void CMMFDevSoundAdaptation::GetRecordBalanceL(int &, int &) + ?GetSupportedInputDataTypesL@CMMFDevSoundAdaptation@@QBEXAAV?$RArray@VTFourCC@@@@ABVTMMFPrioritySettings@@@Z @ 11 NONAME ; void CMMFDevSoundAdaptation::GetSupportedInputDataTypesL(class RArray &, class TMMFPrioritySettings const &) const + ?GetSupportedOutputDataTypesL@CMMFDevSoundAdaptation@@QBEXAAV?$RArray@VTFourCC@@@@ABVTMMFPrioritySettings@@@Z @ 12 NONAME ; void CMMFDevSoundAdaptation::GetSupportedOutputDataTypesL(class RArray &, class TMMFPrioritySettings const &) const + ?InitializeL@CMMFDevSoundAdaptation@@QAEXAAVMDevSoundAdaptationObserver@@VTFourCC@@W4TMMFState@@@Z @ 13 NONAME ; void CMMFDevSoundAdaptation::InitializeL(class MDevSoundAdaptationObserver &, class TFourCC, enum TMMFState) + ?InitializeL@CMMFDevSoundAdaptation@@QAEXAAVMDevSoundAdaptationObserver@@VTUid@@W4TMMFState@@@Z @ 14 NONAME ; void CMMFDevSoundAdaptation::InitializeL(class MDevSoundAdaptationObserver &, class TUid, enum TMMFState) + ?InitializeL@CMMFDevSoundAdaptation@@QAEXAAVMDevSoundAdaptationObserver@@W4TMMFState@@@Z @ 15 NONAME ; void CMMFDevSoundAdaptation::InitializeL(class MDevSoundAdaptationObserver &, enum TMMFState) + ?MaxGain@CMMFDevSoundAdaptation@@QAEHXZ @ 16 NONAME ; int CMMFDevSoundAdaptation::MaxGain(void) + ?MaxVolume@CMMFDevSoundAdaptation@@QAEHXZ @ 17 NONAME ; int CMMFDevSoundAdaptation::MaxVolume(void) + ?NewL@CMMFDevSoundAdaptation@@SAPAV1@AAVRServer2@@@Z @ 18 NONAME ; class CMMFDevSoundAdaptation * CMMFDevSoundAdaptation::NewL(class RServer2 &) + ?Pause@CMMFDevSoundAdaptation@@QAEXXZ @ 19 NONAME ; void CMMFDevSoundAdaptation::Pause(void) + ?PlayDTMFStringL@CMMFDevSoundAdaptation@@QAEXABVTDesC16@@@Z @ 20 NONAME ; void CMMFDevSoundAdaptation::PlayDTMFStringL(class TDesC16 const &) + ?PlayData@CMMFDevSoundAdaptation@@QAEXXZ @ 21 NONAME ; void CMMFDevSoundAdaptation::PlayData(void) + ?PlayDualToneL@CMMFDevSoundAdaptation@@QAEXHHABVTTimeIntervalMicroSeconds@@@Z @ 22 NONAME ; void CMMFDevSoundAdaptation::PlayDualToneL(int, int, class TTimeIntervalMicroSeconds const &) + ?PlayFixedSequenceL@CMMFDevSoundAdaptation@@QAEXH@Z @ 23 NONAME ; void CMMFDevSoundAdaptation::PlayFixedSequenceL(int) + ?PlayInitL@CMMFDevSoundAdaptation@@QAEXXZ @ 24 NONAME ; void CMMFDevSoundAdaptation::PlayInitL(void) + ?PlayToneL@CMMFDevSoundAdaptation@@QAEXHABVTTimeIntervalMicroSeconds@@@Z @ 25 NONAME ; void CMMFDevSoundAdaptation::PlayToneL(int, class TTimeIntervalMicroSeconds const &) + ?PlayToneSequenceL@CMMFDevSoundAdaptation@@QAEXABVTDesC8@@@Z @ 26 NONAME ; void CMMFDevSoundAdaptation::PlayToneSequenceL(class TDesC8 const &) + ?RecordData@CMMFDevSoundAdaptation@@QAEXXZ @ 27 NONAME ; void CMMFDevSoundAdaptation::RecordData(void) + ?RecordInitL@CMMFDevSoundAdaptation@@QAEXXZ @ 28 NONAME ; void CMMFDevSoundAdaptation::RecordInitL(void) + ?SamplesPlayed@CMMFDevSoundAdaptation@@QAEHXZ @ 29 NONAME ; int CMMFDevSoundAdaptation::SamplesPlayed(void) + ?SamplesRecorded@CMMFDevSoundAdaptation@@QAEHXZ @ 30 NONAME ; int CMMFDevSoundAdaptation::SamplesRecorded(void) + ?SetClientConfig@CMMFDevSoundAdaptation@@QAEXABVTMMFClientConfig@@@Z @ 31 NONAME ; void CMMFDevSoundAdaptation::SetClientConfig(class TMMFClientConfig const &) + ?SetConfigL@CMMFDevSoundAdaptation@@QAEXABVTMMFCapabilities@@@Z @ 32 NONAME ; void CMMFDevSoundAdaptation::SetConfigL(class TMMFCapabilities const &) + ?SetDTMFLengths@CMMFDevSoundAdaptation@@QAEXAAVTTimeIntervalMicroSeconds32@@00@Z @ 33 NONAME ; void CMMFDevSoundAdaptation::SetDTMFLengths(class TTimeIntervalMicroSeconds32 &, class TTimeIntervalMicroSeconds32 &, class TTimeIntervalMicroSeconds32 &) + ?SetGain@CMMFDevSoundAdaptation@@QAEXH@Z @ 34 NONAME ; void CMMFDevSoundAdaptation::SetGain(int) + ?SetPlayBalanceL@CMMFDevSoundAdaptation@@QAEXHH@Z @ 35 NONAME ; void CMMFDevSoundAdaptation::SetPlayBalanceL(int, int) + ?SetPrioritySettings@CMMFDevSoundAdaptation@@QAEXABVTMMFPrioritySettings@@@Z @ 36 NONAME ; void CMMFDevSoundAdaptation::SetPrioritySettings(class TMMFPrioritySettings const &) + ?SetRecordBalanceL@CMMFDevSoundAdaptation@@QAEXHH@Z @ 37 NONAME ; void CMMFDevSoundAdaptation::SetRecordBalanceL(int, int) + ?SetToneRepeats@CMMFDevSoundAdaptation@@QAEXHABVTTimeIntervalMicroSeconds@@@Z @ 38 NONAME ; void CMMFDevSoundAdaptation::SetToneRepeats(int, class TTimeIntervalMicroSeconds const &) + ?SetVolume@CMMFDevSoundAdaptation@@QAEXH@Z @ 39 NONAME ; void CMMFDevSoundAdaptation::SetVolume(int) + ?SetVolumeRamp@CMMFDevSoundAdaptation@@QAEXABVTTimeIntervalMicroSeconds@@@Z @ 40 NONAME ; void CMMFDevSoundAdaptation::SetVolumeRamp(class TTimeIntervalMicroSeconds const &) + ?Stop@CMMFDevSoundAdaptation@@QAEXXZ @ 41 NONAME ; void CMMFDevSoundAdaptation::Stop(void) + ?Volume@CMMFDevSoundAdaptation@@QAEHXZ @ 42 NONAME ; int CMMFDevSoundAdaptation::Volume(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/EABI/MmfDevSoundAdaptation.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/EABI/MmfDevSoundAdaptation.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,66 @@ +EXPORTS + _ZN22CMMFDevSoundAdaptation10RecordDataEv @ 1 NONAME + _ZN22CMMFDevSoundAdaptation10SetConfigLERK16TMMFCapabilities @ 2 NONAME + _ZN22CMMFDevSoundAdaptation11InitializeLER27MDevSoundAdaptationObserver4TUid9TMMFState @ 3 NONAME + _ZN22CMMFDevSoundAdaptation11InitializeLER27MDevSoundAdaptationObserver7TFourCC9TMMFState @ 4 NONAME + _ZN22CMMFDevSoundAdaptation11InitializeLER27MDevSoundAdaptationObserver9TMMFState @ 5 NONAME + _ZN22CMMFDevSoundAdaptation11RecordInitLEv @ 6 NONAME + _ZN22CMMFDevSoundAdaptation12CapabilitiesEv @ 7 NONAME + _ZN22CMMFDevSoundAdaptation13PlayDualToneLEiiRK25TTimeIntervalMicroSeconds @ 8 NONAME + _ZN22CMMFDevSoundAdaptation13SamplesPlayedEv @ 9 NONAME + _ZN22CMMFDevSoundAdaptation13SetVolumeRampERK25TTimeIntervalMicroSeconds @ 10 NONAME + _ZN22CMMFDevSoundAdaptation14SetDTMFLengthsER27TTimeIntervalMicroSeconds32S1_S1_ @ 11 NONAME + _ZN22CMMFDevSoundAdaptation14SetToneRepeatsEiRK25TTimeIntervalMicroSeconds @ 12 NONAME + _ZN22CMMFDevSoundAdaptation15CustomInterfaceE4TUid @ 13 NONAME + _ZN22CMMFDevSoundAdaptation15GetPlayBalanceLERiS0_ @ 14 NONAME + _ZN22CMMFDevSoundAdaptation15PlayDTMFStringLERK7TDesC16 @ 15 NONAME + _ZN22CMMFDevSoundAdaptation15SamplesRecordedEv @ 16 NONAME + _ZN22CMMFDevSoundAdaptation15SetClientConfigERK16TMMFClientConfig @ 17 NONAME + _ZN22CMMFDevSoundAdaptation15SetPlayBalanceLEii @ 18 NONAME + _ZN22CMMFDevSoundAdaptation17FixedSequenceNameEi @ 19 NONAME + _ZN22CMMFDevSoundAdaptation17GetRecordBalanceLERiS0_ @ 20 NONAME + _ZN22CMMFDevSoundAdaptation17PlayToneSequenceLERK6TDesC8 @ 21 NONAME + _ZN22CMMFDevSoundAdaptation17SetRecordBalanceLEii @ 22 NONAME + _ZN22CMMFDevSoundAdaptation18FixedSequenceCountEv @ 23 NONAME + _ZN22CMMFDevSoundAdaptation18PlayFixedSequenceLEi @ 24 NONAME + _ZN22CMMFDevSoundAdaptation19SetPrioritySettingsERK20TMMFPrioritySettings @ 25 NONAME + _ZN22CMMFDevSoundAdaptation4GainEv @ 26 NONAME + _ZN22CMMFDevSoundAdaptation4NewLER8RServer2 @ 27 NONAME + _ZN22CMMFDevSoundAdaptation4StopEv @ 28 NONAME + _ZN22CMMFDevSoundAdaptation5PauseEv @ 29 NONAME + _ZN22CMMFDevSoundAdaptation6VolumeEv @ 30 NONAME + _ZN22CMMFDevSoundAdaptation7MaxGainEv @ 31 NONAME + _ZN22CMMFDevSoundAdaptation7SetGainEi @ 32 NONAME + _ZN22CMMFDevSoundAdaptation8PlayDataEv @ 33 NONAME + _ZN22CMMFDevSoundAdaptation9MaxVolumeEv @ 34 NONAME + _ZN22CMMFDevSoundAdaptation9PlayInitLEv @ 35 NONAME + _ZN22CMMFDevSoundAdaptation9PlayToneLEiRK25TTimeIntervalMicroSeconds @ 36 NONAME + _ZN22CMMFDevSoundAdaptation9SetVolumeEi @ 37 NONAME + _ZN22CMMFDevSoundAdaptationD0Ev @ 38 NONAME + _ZN22CMMFDevSoundAdaptationD1Ev @ 39 NONAME + _ZN22CMMFDevSoundAdaptationD2Ev @ 40 NONAME + _ZNK22CMMFDevSoundAdaptation12ClientConfigEv @ 41 NONAME + _ZNK22CMMFDevSoundAdaptation27GetSupportedInputDataTypesLER6RArrayI7TFourCCERK20TMMFPrioritySettings @ 42 NONAME + _ZNK22CMMFDevSoundAdaptation28GetSupportedOutputDataTypesLER6RArrayI7TFourCCERK20TMMFPrioritySettings @ 43 NONAME + _ZNK22CMMFDevSoundAdaptation6ConfigEv @ 44 NONAME + _ZTI16CMMFHwDeviceStub @ 45 NONAME DATA 12 ; ## + _ZTI17TMdaDTMFGenerator @ 46 NONAME DATA 12 ; ## + _ZTI17TMdaToneGenerator @ 47 NONAME DATA 12 ; ## + _ZTI19CMMFDevSoundUtility @ 48 NONAME DATA 12 ; ## + _ZTI21TMdaDualToneGenerator @ 49 NONAME DATA 12 ; ## + _ZTI21TMdaSequenceGenerator @ 50 NONAME DATA 12 ; ## + _ZTI22CMMFDevSoundAdaptation @ 51 NONAME DATA 12 ; ## + _ZTI22CTonePlayCompleteTimer @ 52 NONAME DATA 12 ; ## + _ZTI23TMdaSimpleToneGenerator @ 53 NONAME DATA 12 ; ## + _ZTIN22CMMFDevSoundAdaptation5CBodyE @ 54 NONAME DATA 32 ; ## + _ZTV16CMMFHwDeviceStub @ 55 NONAME DATA 36 ; ## + _ZTV17TMdaDTMFGenerator @ 56 NONAME DATA 24 ; ## + _ZTV17TMdaToneGenerator @ 57 NONAME DATA 24 ; ## + _ZTV19CMMFDevSoundUtility @ 58 NONAME DATA 20 ; ## + _ZTV21TMdaDualToneGenerator @ 59 NONAME DATA 24 ; ## + _ZTV21TMdaSequenceGenerator @ 60 NONAME DATA 24 ; ## + _ZTV22CMMFDevSoundAdaptation @ 61 NONAME DATA 20 ; ## + _ZTV22CTonePlayCompleteTimer @ 62 NONAME DATA 32 ; ## + _ZTV23TMdaSimpleToneGenerator @ 63 NONAME DATA 24 ; ## + _ZTVN22CMMFDevSoundAdaptation5CBodyE @ 64 NONAME DATA 68 ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/data/sample1.wav Binary file audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/data/sample1.wav has changed diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/group/MmfDevSoundAdaptation.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/group/MmfDevSoundAdaptation.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project specification file for MmfDevSoundAdaptation_Stub +* Version : %version: bh1mmcf#32 % +* +*/ + + +#include + +TARGET MmfDevSoundAdaptation_Stub.dll +CAPABILITY MultimediaDD ProtServ UserEnvironment +TARGETTYPE DLL + +UID 0x101F4549 0x10207ABC +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE MmfDevSoundAdaptation.cpp +SOURCE MmfDevSoundAdaptationBody.cpp +SOURCE MmfHwDeviceStub.cpp +SOURCE ToneGenerator.cpp +SOURCE DevSoundUtility.cpp +SOURCE TonePlayCompleteTimer.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +START RESOURCE FixedSequence.rss +TARGETPATH Resource/DevSound +HEADER +END + +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server + +LIBRARY euser.lib +LIBRARY mmfserverbaseclasses.lib +LIBRARY mmfcontrollerframework.lib +LIBRARY bafl.lib +LIBRARY efsrv.lib +LIBRARY ecom.lib + +LIBRARY AudioInputCI.lib +LIBRARY AudioOutputCI.lib +LIBRARY G711DecoderIntfcCI.lib +LIBRARY G729DecoderIntfcCI.lib +LIBRARY IlbcDecoderIntfcCI.lib +LIBRARY G711EncoderIntfcCI.lib +LIBRARY G729EncoderIntfcCI.lib +LIBRARY IlbcEncoderIntfcCI.lib +LIBRARY ErrorConcealmentIntfcCI.lib +LIBRARY SpeechEncoderConfigCI.lib + +deffile MmfDevSoundAdaptation.def +nostrictdef + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Build file for MMFDevSoundAdaptation Stub project +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// for Hw +../data/sample1.wav /Epoc32/Data/z/System/Data/DevSoundAdaptationStub/sample1.wav +// for Wins +../data/sample1.wav /Epoc32/winscw/c/sample1.wav + +PRJ_MMPFILES +./MmfDevSoundAdaptation.mmp diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/inc/MmfDevSoundAdaptation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/inc/MmfDevSoundAdaptation.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,776 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the MMF DevSound Server adaptation. +* +*/ + + +#ifndef MMFDEVSOUNDADAPTATION_H +#define MMFDEVSOUNDADAPTATION_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +An interface to a set of DevSound adaptation observer callback functions. + +This serves as the method of communication between the client and the +DevSound. + +The class is a mixin and is intended to be inherited by the client class +that is interested in observing the DevSound operation. The functions +encapsulated by this class are called when specific events occur in the +process of initializing and playing/recording an audio sample or playing +tones. +*/ +class MDevSoundAdaptationObserver + { +public: + /** + Handles initialization completion event. + + A derived class must provide an implementation to handle the initialization + request. + + CMMFDevSound object calls this function when its InitializeL() function + completes. + + @param aError + Error code. KErrNone if successful. Other values are possible + indicating a problem initializing CMMFDevSound object. + */ + virtual void InitializeComplete(TInt aError)=0; + + /** + Handles tone play completion event. + + A derived class must provide an implementation to handle the tone play + completion request. + + CMMFDevSound object calls this function when an attempt to play tone has + completed, successfully or otherwise. + + The following are the play tone functions; PlayToneL(), PlayDMTFStringL(), + PlayToneSequenceL(), and PlayFixedSequenceL(). + + @param aError + Error code. The status of tone playback. KErrUnderflow playing of + the tone is complete. KErrAccessDenied the sound device is in use by + another higher priority client. KErrCancel playing of the audio + sample is stopped by DevSound client another higher priority client. + */ + virtual void ToneFinished(TInt aError)=0; + + /** + Handles CMMFDevSound object's data request event. + + A derived class must provide an implementation to supply CMMFDevSound + object the data that it needs to play. + + CMMFDevSound object calls this function when and where it needs data for + playing. The observer should notify CMMFDevSound object as + quickly as possible after the data is read into buffer, aBuffer by calling + PlayData(), otherwise the implementation might callback function PlayError() + on derived class object with error code KErrUnderflow. + This does not apply to the very first call to PlayData(), however. + It is possible for a user of DevSound to hold the first buffer sent in + BufferToBeFilled() until ready to play. + The use case for this is if a low latency audio response + is required, as at this point all the resources used to play audio are open. + If used in this way then it is important to be aware that when when the + resources for audio are ready at the BufferToBeFilled() callback, a Devsound + on a real device will be running at increased power consumption as the audio + hw and any required DSPs will be powered up etc. + + @param aBuffer + Buffer into which data should be read. The amount of data that is + needed is specified in CMMFBuffer::RequestSize(). + */ + virtual void BufferToBeFilled(CMMFBuffer* aBuffer)=0; + + /** + Handles play completion or cancel event. + + A derived class must provide an implementation to handle the play + completion or cancel request. + + CMMFDevSound object calls this function when an attempt to play audio sample + has completed, successfully or otherwise. + + @param aError + Error code. The status of playback. KErrUnderflow playing of the + audio sample is complete. KErrAccessDenied the sound device is in + use by another higher priority client. + */ + virtual void PlayError(TInt aError)=0; + + /** + Handles CMMFDevSound object's data request event. + + A derived class must provide an implementation to process the data + supplied by CMMFDevSound object while recording. + + CMMFDevSound object calls this function when the buffer, aBuffer gets filled + while recording. The observer should notify CMMFDevSound + object as quickly as possible after data in the buffer is processed by + calling RecordData(), otherwise the implementation might callback + the function RecordError() on derived class object with error code + KErrOverflow. + + @param aBuffer + Buffer containing processed (recorded) data. The amount + of data that is available is specified in CMMFBuffer::RequestSize(). + */ + virtual void BufferToBeEmptied(CMMFBuffer* aBuffer)=0; + + /** + Handles record completion or cancel event. + + A derived class must provide an implementation to handle the record + completion or cancel request. + + CMMFDevSound object calls this function when an attempt to record audio + sample has completed, successfully or otherwise. + + @param aError + Error code. The status of recording. KErrOverflow audio devices + runs out of internal buffer. KErrAccessDenied the sound device is + in use by another higher priority client. + */ + virtual void RecordError(TInt aError)=0; + + /** + Handles device event. + + A derived class must provide an implementtion to handle the messages from + audio hardware device. + + CMMFDevSound object calls this function when a message is received from the + audio hardware device. + + @param aMessageType + Defines the type of message. Used to determine how to + interpret the contents of aMsg. + @param aMsg + Message that is packed in the Descriptor format. + */ + virtual void DeviceMessage(TUid aMessageType, const TDesC8& aMsg)=0; + + }; + + +/** +* A class representing client application information. +* +* @lib MmfDevSoundAdaptation.lib +* @since S60 3.0 +*/ +class TMMFClientConfig + { + public: + TVendorId iVendorId; // Application Vendor Id + TSecureId iSecureId; // Application Secure Id + TProcessId iProcessId; // Application Process Id + RArray iCapabilities; // Application capabilities array + }; + +// CLASS DECLARATION + +/** +* This class implements DevSound behavior in a hardware independent way. +* +* @lib MmfDevSoundAdaptation.lib +* @since S60 3.0 +*/ +class CMMFDevSoundAdaptation : public CBase + { + + public: // Constructors and destructor + + /** + * Constructs, and returns a pointer to, a new CMMFDevSoundAdaptation + * object. + * Leaves on failure.. + * @param RServer2& aPolicyServerHandle A handle to policy server. + * @return CMMFDevSoundAdaptation* A pointer to newly created object. + */ + IMPORT_C static CMMFDevSoundAdaptation* NewL( + RServer2& aPolicyServerHandle); + + /** + * Destructor. + */ + IMPORT_C virtual ~CMMFDevSoundAdaptation(); + + public: // New functions + + /** + * Initializes to raw audio data PCM16 and Sampling Rate of 8 KHz. + * On completion of Initialization, calls InitializeComplete() on + * aDevSoundObserver. + * Leaves on failure. + * @since S60 3.0 + * @param MDevSoundAdaptationObserver& aDevSoundObserver A reference to + * the DevSound Observer instance. + * @param TMMFState aMode Mode for which this object will be used. + * @return void + */ + IMPORT_C void InitializeL( + MDevSoundAdaptationObserver& aDevSoundObserver, + TMMFState aMode); + + /** + * Initializes DevSound object for the mode aMode for processing audio + * data with hardware device aHWDev. + * On completion of Initialization, calls InitializeComplete() on + * aDevSoundObserver. + * Leaves on failure. + * @since S60 3.0 + * @param MDevSoundAdaptationObserver& aDevSoundObserver A reference to + * the DevSound Observer instance. + * @param TUid aHWDev The CMMFHwDevice implementation identifier. + * @param TMMFState aMode The mode for which this object will be used + * @return void + */ + IMPORT_C void InitializeL( + MDevSoundAdaptationObserver& aDevSoundObserver, + TUid aHWDev, + TMMFState aMode); + + /** + * Initializes DevSound object for the mode aMode for processing audio + * data with hardware device supporting FourCC aDesiredFourCC. + * Leaves on failure. + * @since S60 3.0 + * @param MDevSoundAdaptationObserver& aDevSoundObserver A reference to + * DevSound Observer instance. + * @param TFourCC aDesiredFourCC The CMMFHwDevice implementation FourCC + * code. + * @param TMMFState aMode The mode for which this object will be used + * @return KErrNone if successfull, else corresponding error code + * @return void + */ + IMPORT_C void InitializeL( + MDevSoundAdaptationObserver& aDevSoundObserver, + TFourCC aDesiredFourCC, + TMMFState aMode); + + /** + * Returns the supported Audio settings ie. encoding, sample rates, + * mono/stereo operation, buffer size etc.. + * @since S60 3.0 + * @return TMMFCapabilities The device settings. + */ + IMPORT_C TMMFCapabilities Capabilities(); + + /** + * Returns the current device configuration. + * @since S60 3.0 + * @return TMMFCapabilities The device settings. + */ + IMPORT_C TMMFCapabilities Config() const; + + /** + * Configure CMMFDevSound object with the settings in aConfig. Use this + * to set sampling rate, encoding and mono/stereo. + * Leaves on failure. + * @since S60 3.0 + * @param const TMMFCapabilities& aConfig The attribute values to which + * CMMFDevSound object will be configured to. + * @return void + */ + IMPORT_C void SetConfigL(const TMMFCapabilities& aCaps); + + /** + * Returns an integer representing the maximum volume device supports. + * This is the maximum value which can be passed to + * CMMFDevSound::SetVolume. + * @since S60 3.0 + * @return TInt The maximum volume. This value is platform dependent but + * is always greater than or equal to one. + */ + IMPORT_C TInt MaxVolume(); + + /** + * Returns an integer representing the current volume. + * @since S60 3.0 + * @return TInt The current volume level. + */ + IMPORT_C TInt Volume(); + + /** + * Changes the current playback volume to a specified value. The volume + * can be changed before or during playback and is effective immediately. + * @since S60 3.0 + * @param TInt aVolume The volume setting. This can be any value from 0 + * to the value returned by a call to + * CMMFDevSound::MaxVolume(). If the volume is not + * within this range, the volume is automatically set + * to minimum or maximum value based on the value + * that is being passed. Setting a zero value mutes + * the sound. Setting the maximum value results in + * the loudest possible sound. + * @return void + */ + IMPORT_C void SetVolume(TInt aVolume); + + /** + * Returns an integer representing the maximum gain the device supports. + * This is the maximum value which can be passed to CMMFDevSound::SetGain + * @since S60 3.0 + * @return TInt The maximum gain. This value is platform dependent but is + * always greater than or equal to one. + */ + IMPORT_C TInt MaxGain(); + + /** + * Returns an integer representing the current gain. + * @since S60 3.0 + * @return TInt The current gain level. + */ + IMPORT_C TInt Gain(); + + /** + * Changes the current recording gain to a specified value. The gain can + * be changed before or during recording and is effective immediately. + * @since S60 3.0 + * @param TInt aGain The gain setting. This can be any value from zero to + * the value returned by a call to + * CMMFDevSound::MaxGain(). If the volume + * is not within this range, the gain is automatically + * set to minimum or maximum value based on the value + * that is being passed. Setting a zero value mutes the + * sound. Setting the maximum value results in the + * loudest possible sound. + * @return void + */ + IMPORT_C void SetGain(TInt aGain); + + /** + * Returns the speaker balance set for playing. + * Leaves on failure. + * @since S60 3.0 + * @param TInt &aLeftPercentage On return contains the left speaker + * volume percentage. + * @param TInt &aRightPercentage On return contains the right speaker + * volume percentage. + * @return void + */ + IMPORT_C void GetPlayBalanceL(TInt& aLeftPercentage, + TInt& aRightPercentage); + + /** + * Sets the speaker balance for playing. The speaker balance can be + * changed before or during playback and is effective immediately. + * Leaves on failure. + * @since S60 3.0 + * @param TInt aLeftPercentage The left speaker volume percentage. This + * can be any value from zero to 100. Setting + * a zero value mutes the sound on left + * speaker. + * @param TInt aRightPercentage The right speaker volume percentage. + * This can be any value from zero to 100. + * Setting a zero value mutes the sound on + * right speaker. + * @return void + */ + IMPORT_C void SetPlayBalanceL(TInt aLeftPercentage, + TInt aRightPercentage); + + /** + * Returns the microphone gain balance set for recording. + * Leaves on failure. + * @since S60 3.0 + * @param TInt &aLeftPercentage On return contains the left microphone + * gain percentage. + * @param TInt &aRightPercentage On return contains the right microphone + * gain percentage. + * @return void + */ + IMPORT_C void GetRecordBalanceL(TInt& aLeftPercentage, + TInt& aRightPercentage); + + /** + * Sets the microphone balance for recording. The microphone balance can + * be changed before or during recording and is effective immediately. + * Leaves on failure. + * @since S60 3.0 + * @param TInt aLeftPercentage The left microphone gain percentage. This + * can be any value from zero to 100. Setting + * a zero value mutes the sound from left + * microphone. + * @param TInt aRightPercentage The right microphone gain percentage. + * This can be any value from zero to 100. + * Setting a zero value mutes the sound from + * right microphone. + * @return void + */ + IMPORT_C void SetRecordBalanceL(TInt aLeftPercentage, + TInt aRightPercentage); + + /** + * Initializes the audio device and starts the play process. This + * function queries and acquires the audio policy before initializing + * audio device. If there was an error during policy initialization, + * PlayError() function will be called on the observer with error code + * KErrAccessDenied, otherwise BufferToBeFilled() function will be called + * with a buffer reference. After reading data into the buffer reference + * passed, the client should call PlayData() to play data. + * The amount of data that can be played is specified in + * CMMFBuffer::RequestSize(). Any data that is read into buffer beyond + * this size will be ignored. + * Leaves on failure. + * @since S60 3.0 + * @return void + */ + IMPORT_C void PlayInitL(); + + /** + * Initializes the audio device and starts the record process. This + * function queries and acquires the audio policy before initializing + * audio device. If there was an error during policy initialization, + * RecordError() function will be called on the observer with error code + * KErrAccessDenied, otherwise BufferToBeEmptied() function will be + * called with a buffer reference. This buffer contains recorded or + * encoded data. After processing data in the buffer reference passed, + * the client should call RecordData() to continue recording process. + * The amount of data that is available is specified in + * CMMFBuffer::RequestSize(). + * Leaves on failure. + * @since S60 3.0 + * @return void + */ + IMPORT_C void RecordInitL(); + + /** + * Plays data in the buffer at the current volume. + * The client should fill the buffer with audio data before calling this + * function. The observer gets a reference to the buffer along with the + * callback function BufferToBeFilled(). When playing of the audio sample + * is complete, successfully or otherwise, the function PlayError() on + * the observer is called. + * The last buffer of the audio stream being played should have the last + * buffer flag set using CMMFBuffer::SetLastBuffer(TBool). If a + * subsequent attempt to play the clip is made, this flag will need + * resetting by the client. + * @return void + */ + IMPORT_C void PlayData(); + + /** + * Contine the process of recording. + * Once the buffer is filled with recorded data, the Observer gets a + * reference to the buffer along with the callback function + * BufferToBeEmptied(). After processing the buffer (copying over to a + * different buffer or writing to file) the client should call this + * function to continue the recording process. + * @return void + */ + IMPORT_C void RecordData(); + + /** + * Stops the ongoing operation (Play, Record, TonePlay). + * @since S60 3.0 + * @return void + */ + IMPORT_C void Stop(); + + /** + * Temporarily Stops the ongoing operation (Play, Record, TonePlay). + * @since S60 3.0 + * @return void + */ + IMPORT_C void Pause(); + + /** + * Returns the Sample recorded so far + * @since S60 3.0 + * @return TInt Returns the samples recorded. + */ + IMPORT_C TInt SamplesRecorded(); + + /** + * Returns the Sample played so far + * @since S60 3.0 + * @return TInt Returns the samples played. + */ + IMPORT_C TInt SamplesPlayed(); + + /** + * Initializes the audio device and starts playing a tone. The tone is + * played with the frequency and duration specified. + * Leaves on failure. + * @since S60 3.0 + * @param TInt aFrequency The frequency at which the tone will be played. + * @param const TTimeIntervalMicroSeconds &aDuration The period over + * which the tone will be played. A zero value causes the no tone + * to be played. + * @return void + */ + IMPORT_C void PlayToneL( + TInt aFrequency, + const TTimeIntervalMicroSeconds& aDuration); + + /** + * Initializes audio device and starts playing a dual tone. Dual Tone is + * played with the specified frequencies and for the specified duration. + * Leaves on failure. + * @since S60 3.0 + * @param TInt aFrequencyOne The first frequency of dual tone. + * @param TInt aFrequencyTwo The second frequency of dual tone. + * @param const TTimeIntervalMicroSeconds &aDuration The period over + * which the tone will be played. A zero value causes the no tone + * to be played. + * @return void + */ + IMPORT_C void PlayDualToneL(TInt aFrequencyOne, + TInt aFrequencyTwo, + const TTimeIntervalMicroSeconds& aDuration); + + /** + * Initializes the audio device and starts playing the DTMF string + * aDTMFString. + * Leaves on failure. + * @since S60 3.0 + * @param const TDesC &aDTMFString The DTMF sequence in a descriptor. + * @return void + */ + IMPORT_C void PlayDTMFStringL(const TDesC& aDTMFString); + + /** + * Initializes the audio device and starts playing a tone sequence. + * Leaves on failure. + * @since S60 3.0 + * @param const TDesC8 &aData The tone sequence in a descriptor. + * @return void + */ + IMPORT_C void PlayToneSequenceL(const TDesC8& aData); + + /** + * Initializes the audio device and starts playing the specified + * pre-defined tone sequence. + * Leaves on failure. + * @since S60 3.0 + * @param TInt aSequenceNumber The index identifying the specific + * pre-defined tone sequence. Index values are relative to zero. + * This can be any value from zero to the value returned by a call + * to FixedSequenceCount() - 1. The function raises a panic if the + * sequence number is not within this range. + * @return void + */ + IMPORT_C void PlayFixedSequenceL(TInt aSequenceNumber); + + /** + * Defines the number of times the audio is to be repeated during the + * tone playback operation. A period of silence can follow each playing + * of a tone. The tone playing can be repeated indefinitely + * @since S60 3.0 + * @param TInt aRepeatCount The number of times the tone, together with + * the trailing silence, is to be repeated. If this is set to + * KMdaRepeatForever, then the tone, together with the trailing + * silence, is repeated indefinitely or until Stop() is called. + * If this is set to zero, then the tone is not repeated. + * @param const TTimeIntervalMicroSeconds &aRepeatTrailingSilence An + * interval of silence which will be played after each tone. + * Supported only during tone playing. + * @return void + */ + IMPORT_C void SetToneRepeats(TInt aRepeatCount, + const TTimeIntervalMicroSeconds& aRepeatTrailingSilence); + + /** + * Defines the duration of tone on, tone off and tone pause to be used + * during the DTMF tone playback operation. + * Supported only during tone playing. + * @since S60 3.0 + * @param TTimeIntervalMicroSeconds32 &aToneOnLength The period over + * which the tone will be played. If this is set to zero, then the + * tone is not played. + * @param TTimeIntervalMicroSeconds32 &aToneOffLength The period over + * which the no tone will be played. + * @param TTimeIntervalMicroSeconds32 &aPauseLength The period over which + * the tone playing will be paused. + * @return void + */ + IMPORT_C void SetDTMFLengths( + TTimeIntervalMicroSeconds32& aToneOnLength, + TTimeIntervalMicroSeconds32& aToneOffLength, + TTimeIntervalMicroSeconds32& aPauseLength); + + /** + * Defines the period over which the volume level is to rise smoothly + * from nothing to the normal volume level. + * The function is only available before playing. + * @since S60 3.0 + * @param const TTimeIntervalMicroSeconds &aRampDuration The period over + * which the volume is to rise. A zero value causes the tone + * sample to be played at the normal level for the full duration + * of the playback. A value, which is longer than the duration of + * the tone sample means that the sample never reaches its normal + * volume level. + * @return void + */ + IMPORT_C void SetVolumeRamp( + const TTimeIntervalMicroSeconds& aRampDuration); + + /** + * Defines the priority settings that should be used for this instance. + * @since S60 3.0 + * @param const TMMFPrioritySettings &aPrioritySettings A class type + * representing the client's priority, priority preference and + * state + * @return void + */ + IMPORT_C void SetPrioritySettings( + const TMMFPrioritySettings& aPrioritySettings); + + /** + * Retrieves a custom interface to the device. + * @since S60 3.0 + * @param TUid aInterfaceId The interface UID, defined with the custom + * interface. + * @return TAny* A pointer to the interface implementation, or NULL if + * the device does not implement the interface requested. The + * return value must be cast to the correct type by the user. + */ + IMPORT_C TAny* CustomInterface(TUid aInterfaceId); + + /** + * Returns the number of available pre-defined tone sequences. + * This is the number of fixed sequence supported by DevSound by default. + * @since S60 3.0 + * @return TInt The fixed sequence count. This value is implementation + * dependent. + */ + IMPORT_C TInt FixedSequenceCount(); + + /** + * Returns the name assigned to a specific pre-defined tone sequence. + * This is the number of the fixed sequence supported by DevSound by + * default. + * The function raises a panic if sequence number specified is invalid. + * @since S60 3.0 + * @param TInt aSequenceNumber The index identifying the specific + * pre-defined tone sequence. Index values are relative to zero. + * This can be any value from zero to the value returned by a call + * to CMdaAudioPlayerUtility::FixedSequenceCount() - 1. The + * function raises a panic if sequence number is not within this + * range. + * @return const TDesC & A reference to a Descriptor containing the fixed + * sequence name indexed by aSequenceNumber. + */ + IMPORT_C const TDesC& FixedSequenceName(TInt aSequenceNumber); + + /** + * Returns a list of the supported input datatypes that can be sent to + * DevSound for playing audio. The datatypes returned are those that the + * DevSound supports given the priority settings passed in + * aPrioritySettings. Note that if no supported data types are found this + * does not constitute failure, the function will return normally with no + * entries in aSupportedDataTypes. + * @since S60 3.0 + * @param RArray< TFourCC > &aSupportedDataTypes The array of supported + * data types that will be filled in by this function. The + * supported data types of the DevSound are in the form of an + * array of TFourCC codes. Any existing entries in the array will + * be overwritten on calling this function. If no supported data + * types are found given the priority settings, then the + * aSupportedDatatypes array will have zero entries. + * @param const TMMFPrioritySettings &aPrioritySettings The priority + * settings used to determine the supported datatypes. Note this + * does not set the priority settings. For input datatypes the + * iState member of the priority settings would be expected to be + * either EMMFStatePlaying or EMMFStatePlayingRecording. The + * priority settings may effect the supported datatypes depending + * on the audio routing. + * @return void + */ + IMPORT_C void GetSupportedInputDataTypesL( + RArray& aSupportedDataTypesconst, + const TMMFPrioritySettings& aPrioritySettings) const; + + /** + * Returns a list of the supported output dataypes that can be received + * from DevSound for recording audio. The datatypes returned are those + * that the DevSound supports given the priority settings passed in + * aPrioritySettings. Note that if no supported data types are found this + * does not constitute failure, the function will return normally with no + * entries in aSupportedDataTypes. + * @since S60 3.0 + * @param RArray< TFourCC > &aSupportedDataTypes The array of supported + * data types that will be filled in by this function. The + * supported datatypes of the DevSound are in the form of an array + * of TFourCC codes. Any existing entries in the array will be + * overwritten on calling this function. If no supported datatypes + * are found given the priority settings, then the + * aSupportedDatatypes array will have zero entries. + * @param const TMMFPrioritySettings &aPrioritySettings The priority + * settings used to determine the supported data types. Note this + * does not set the priority settings. For output data types the + * iState member of the priority settings would expected to be + * either EMMFStateRecording or EMMFStatePlayingRecording. The + * priority settings may effect the supported datatypes depending + * on the audio routing. + * @return void + */ + IMPORT_C void GetSupportedOutputDataTypesL( + RArray& aSupportedDataTypes, + const TMMFPrioritySettings& aPrioritySettings) const; + + /** + * Sets client configuration + * @since S60 3.0 + * @param TMMFClientConfig& aClientConfig A reference to client + * configuration object. + * @return void + */ + IMPORT_C void SetClientConfig(const TMMFClientConfig& aClientConfig); + + /** + * Returns client configuration + * @since S60 3.0 + * @return void + */ + IMPORT_C const TMMFClientConfig& ClientConfig() const; + + /* + * Empties the buffers below DevSound without deleting the codec + * @since S60 3.1 + * @return TInt + * + IMPORT_C TInt EmptyBuffers();*/ + + protected: + + // So that nobody can extend + CMMFDevSoundAdaptation(); + + // Second phase constructor + void ConstructL(RServer2& aPolicyServerHandle); + + protected: // Data + // Actual implementation class. + class CBody; + + //DevSoundAdaptation body implementation + CBody* iBody; + + }; + +#endif // MMFDEVSOUNDADAPTATION + +// End of File + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/inc/MmfDevSoundInfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/inc/MmfDevSoundInfo.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + +#ifndef MMF_DEVSOUNDINFO_H +#define MMF_DEVSOUNDINFO_H + +#include +#include + + +/** +* Class representing DevSound information. +* +* @lib MmfDevSoundAdaptation_Stub +* @since S60 3.0 +*/ +class TMMFDevSoundInfo + { +public: + TInt iDevSoundId; + // More to be added for OMAP server + }; + +typedef TPckgBuf TMMFDevSoundInfoPckg; + +#endif + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/rom/MmfDevSoundAdaptation.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/rom/MmfDevSoundAdaptation.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - DevSound adaptation stub. +* +*/ + + +#ifndef __MMFDEVSOUNDADAPTATION_IBY__ +#define __MMFDEVSOUNDADAPTATION_IBY__ + +file=ABI_DIR\BUILD_DIR\MmfDevSoundAdaptation_Stub.dll SHARED_LIB_DIR\MmfDevSoundAdaptation.dll +data=\Epoc32\data\Z\resource\DevSound\FixedSequence.rsc Resource\DevSound\FixedSequence.rsc +data=ZSYSTEM\Data\DevSoundAdaptationStub\sample1.wav System\Data\DevSoundAdaptationStub\sample1.wav + +#endif // __MMFDEVSOUNDADAPTATION_IBY__ diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/DevSoundUtility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/DevSoundUtility.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,625 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Implementation of the DevSound utilities. +* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include //needed for CleanupResetAndDestroyPushL() +#include +#include "DevSoundUtility.h" + +_LIT(KFixedSequenceResourceFile, "Z:\\Resource\\DevSound\\FixedSequence.rsc"); + +// CONSTANTS +const TUint K4ByteSeq = 4; +const TInt KFourCCStringLength = 9; + +inline TMMFRawPackage::TMMFRawPackage(TInt aDerivedSize) +#pragma warning( disable : 4355 ) +// 'this' : used in base member initializer list +: iThis((TUint8*)this,aDerivedSize,aDerivedSize) +#pragma warning( default : 4355 ) + { + } + +// ----------------------------------------------------------------------------- +// TMMFRawPackage::Package +// Returns a reference to descriptor pointer. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +inline TPtr8& TMMFRawPackage::Package() + { + ((TMMFRawPackage*)this)->iThis.Set((TUint8*)this, + iThis.Length(), + iThis.MaxLength()); + return iThis; + } + +// ----------------------------------------------------------------------------- +// TMMFRawPackage::Package +// Returns a reference to descriptor pointer. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +inline const TPtr8& TMMFRawPackage::Package() const + { + ((TMMFRawPackage*)this)->iThis.Set((TUint8*)this, + iThis.Length(), + iThis.MaxLength()); + return iThis; + } + +// ----------------------------------------------------------------------------- +// TMMFRawPackage::SetSize +// Sets the size of the raw package +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +inline void TMMFRawPackage::SetSize(TInt aDerivedSize) + { + iThis.Set((TUint8*)this,aDerivedSize,aDerivedSize); + } + +// ----------------------------------------------------------------------------- +// TMMFToneFixedSequenceNames::TMMFToneFixedSequenceNames +// Default constructor +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +inline TMMFToneFixedSequenceNames::TMMFToneFixedSequenceNames() + : TMMFRawPackage(sizeof(TMMFToneFixedSequenceNames)) + { + } + +// ----------------------------------------------------------------------------- +// TNameBuf class definition +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +#ifdef _UNICODE +class TNameBuf : public TBufCBase16 +#else +class TNameBuf : public TBufCBase8 +#endif + { + friend class HMMFToneFixedSequenceNames; + }; + +// ----------------------------------------------------------------------------- +// HMMFToneFixedSequenceNames::HMMFToneFixedSequenceNames +// Default constructor +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +HMMFToneFixedSequenceNames::HMMFToneFixedSequenceNames() + { + iCount = 0; + } + +// ----------------------------------------------------------------------------- +// HMMFToneFixedSequenceNames::AddNameL +// Append a copy of the supplied descriptor to the end of the +// current heap cell. This will involve a realloc that will normally +// result in the object moving +// ----------------------------------------------------------------------------- +// +HMMFToneFixedSequenceNames* +HMMFToneFixedSequenceNames::AddNameL(const TDesC& aName) + { + TInt size = Package().Length(); + TInt desSize = aName.Size() + sizeof(TInt); + if (desSize&3) + { + // Must round up to word boundary to keep aligned + desSize = ((desSize+4)&(~3)); + } + + HMMFToneFixedSequenceNames* self = + REINTERPRET_CAST(HMMFToneFixedSequenceNames*, + User::ReAllocL(STATIC_CAST(TAny*,this), + size + desSize)); + TUint8* newDesPtr = REINTERPRET_CAST(TUint8*,self) + size; + Mem::FillZ(newDesPtr,desSize); + TNameBuf* newDes = REINTERPRET_CAST(TNameBuf*,newDesPtr); + newDes->Copy(aName,aName.Length()); + self->SetSize(size+desSize); + self->iCount++; + return self; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMMFDevSoundUtility::CMMFDevSoundUtility +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CMMFDevSoundUtility::CMMFDevSoundUtility() + { + // No default implementation + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundUtility::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundUtility::ConstructL() + { + iFixedSequenceNames = new (ELeave) HMMFToneFixedSequenceNames; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundUtility::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMMFDevSoundUtility* CMMFDevSoundUtility::NewL() + { + CMMFDevSoundUtility* self = NewLC(); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundUtility::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMMFDevSoundUtility* CMMFDevSoundUtility::NewLC() + { + CMMFDevSoundUtility* self = new(ELeave) CMMFDevSoundUtility(); + CleanupStack::PushL(self); + self->ConstructL(); + // Leave it on Cleanupstack + return self; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundUtility::~CMMFDevSoundUtility +// Destructor +// ----------------------------------------------------------------------------- +// +CMMFDevSoundUtility::~CMMFDevSoundUtility() + { + delete iInfo; + delete iFixedSequenceNames; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundUtility::SeekUsingFourCCLC +// Finds the ECom plugins based on FourCC. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundUtility::SeekUsingFourCCLC( + TUid aInterfaceUid, + RImplInfoPtrArray& aPlugInArray, + const TFourCC& aSrcDataType, + const TFourCC& aDstDataType, + const TDesC& aPreferredSupplier) + { + // Create a match string using the two FourCC codes. + _LIT8(KEmptyFourCCString, " , "); + TBufC8<9> fourCCString(KEmptyFourCCString); + TPtr8 fourCCPtr = fourCCString.Des(); + TPtr8 fourCCPtr1(&fourCCPtr[0], 4); + TPtr8 fourCCPtr2(&fourCCPtr[5], 4 ); + aSrcDataType.FourCC(&fourCCPtr1); + aDstDataType.FourCC(&fourCCPtr2); + + // Create a TEcomResolverParams structure. + TEComResolverParams resolverParams; + resolverParams.SetDataType(fourCCPtr); + resolverParams.SetWildcardMatch(EFalse); + + // ListImplementationsL leaves if it cannot find anything so trap the error + // and ignore it. + TRAPD(err, REComSession::ListImplementationsL(aInterfaceUid, + resolverParams, + aPlugInArray)); + + // The error above may not be KErrNotFound eg could be KErrNoMemory in which + // case leave + User::LeaveIfError(err); + + // If there are no plugins, indicate failure + if (aPlugInArray.Count() == 0) + { + User::Leave(KErrNotFound) ; + } + + // If more than one match, narrow the search by preferred supplier + if ((aPlugInArray.Count() > 1) && aPreferredSupplier.Length()) + { + SelectByPreference( aPlugInArray, aPreferredSupplier ) ; + } + } + + +// ----------------------------------------------------------------------------- +// CMMFDevSoundUtility::SelectByPreference +// local function to disable items which do not match the preferred supplier. +// Note that at least one enabled item is returned (if there was an enabled item +// to begin with) which may not match the preferred supplier. +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundUtility::SelectByPreference(RImplInfoPtrArray& aPlugInArray, + const TDesC& aPreferredSupplier) + { + + // Use the Disabled flag to eliminated all currently enabled matches that + // do not match the preferred supplier. + TInt firstEnabled = -1 ; // to ensure that we return something valid + TInt matchCount = 0 ; + + for ( TInt ii = 0 ; ii < aPlugInArray.Count() ; ii++ ) + { + if (!(aPlugInArray[ii]->Disabled())) + { + if (firstEnabled == -1) + { + firstEnabled = ii; + } + + if (aPlugInArray[ii]->DisplayName().FindF(aPreferredSupplier) == + KErrNotFound) + { + aPlugInArray[ii]->SetDisabled(ETrue) ; + } + else + { + matchCount++ ; + } + } + } + + // If there are no matches then re-enable the first enabled + if (matchCount == 0 ) + { + aPlugInArray[firstEnabled]->SetDisabled(EFalse); + } + else if (matchCount > 1) + { + // find the latest version from more than one match + TInt highestVersionIndex = -1; + + for (TInt ii = 0; ii < aPlugInArray.Count(); ii++) + { + // only interested in enabled elements + if (!(aPlugInArray[ii]->Disabled())) + { + if (highestVersionIndex == -1) + { + // first match. Store this. Keep it enabled + highestVersionIndex = ii; + } + else if (aPlugInArray[ii]->Version() > + aPlugInArray[highestVersionIndex]->Version()) + { + // A new leader. Disable the previous leader. + // Keep this one. + aPlugInArray[highestVersionIndex]->SetDisabled(ETrue); + highestVersionIndex = ii; + } + else // we already have a higher version. + aPlugInArray[ii]->SetDisabled(ETrue); + } + } + } + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundUtility::SeekHwDevicePluginsL +// This method looks for hwDevicePlugins that support the state given in aState +// which must be either EMMFStatePlaying or EMMFStateRecording. +// For each HwDevice plugin found the datatype as indicated by its fourCC code +// from the default_data field in the resource file is added to the array of +// aSupportedDataTypes +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundUtility::SeekHwDevicePluginsL( + RArray& aSupportedDataTypes, + TMMFState aState) + { + //check argument precondition for aState + if ((aState != EMMFStatePlaying) && (aState != EMMFStateRecording)) + { + User::Leave(KErrArgument); + } + + //clear any existing data in aSupportedDataTypes array + aSupportedDataTypes.Reset(); + + // Array to return hw device plugin resource info(place on cleanupstack + // _after_ ListImplementationsL() ) + RImplInfoPtrArray plugInArray; + TUid KUidMmfHWPluginInterfaceCodec = {KMmfUidPluginInterfaceHwDevice}; + + // ListImplementationsL leaves if it cannot find anything so trap the error + TRAPD(err, REComSession::ListImplementationsL(KUidMmfHWPluginInterfaceCodec, + plugInArray)); + CleanupResetAndDestroyPushL(plugInArray); + + TUint numberOfHwDevicePlugins = plugInArray.Count(); + + // if no errors and have hwdevice plugin resource entries then scan entries + // matching on a datatype of pcm16 as the destination datatype for play and + // the source datatype for record. If a match is found and isn't already in + // the list of supported data types, then add it to the list + if ((err == KErrNone) && (numberOfHwDevicePlugins)) + { + CImplementationInformation* hwDeviceResourceEntry = NULL; + _LIT8(KPCM16FourCCString, " P16"); + TBufC8 fourCCStringPCM16(KPCM16FourCCString); + TPtr8 fourCCPtrPCM16 = fourCCStringPCM16.Des(); + TUint entryNumber = 0; + + // check each resource entry for dst 4CC = P16 for play and + // src 4CC = P16 for record + for (TUint hwDeviceEntry = 0; + hwDeviceEntry < numberOfHwDevicePlugins; + hwDeviceEntry++) + { + hwDeviceResourceEntry = plugInArray[hwDeviceEntry]; + + if (IsDataTypeMatch(hwDeviceResourceEntry, fourCCPtrPCM16, aState)) + { + // resource entry data field has dest/src datatype ' P16' + // i.e. pcm16 for play/record + TPtrC8 fourCCPtr(0,0); + + if (aState == EMMFStatePlaying) + { + // datatype supported 4CC is left 4 chars + fourCCPtr.Set( + hwDeviceResourceEntry->DataType().Left(KFOURCCLENGTH)); + } + else if (aState == EMMFStateRecording) + { + // datatype supported 4CC is right 4 chars + fourCCPtr.Set( + hwDeviceResourceEntry->DataType().Right(KFOURCCLENGTH)); + } + + TFourCC fourCCEntry(fourCCPtr); + //need to check if entry already exists to prevent + // duplicate entries + TBool alreadyExists = EFalse; + + for (TUint fourCCEntryNumber = 0; + fourCCEntryNumber < entryNumber; + fourCCEntryNumber++) + { + if (aSupportedDataTypes[fourCCEntryNumber]==fourCCEntry) + { + // we already have this 4CC in the supported data types + alreadyExists = ETrue; + break; + } + } + if (!alreadyExists) + { + err = aSupportedDataTypes.Append(fourCCEntry); + if (err) + { + // note: we don't destroy array because we don't own it + // but we do reset it as it is incomplete + aSupportedDataTypes.Reset(); + User::Leave(err); + } + } + } + } + } + else + { + // if an error occured and not KErrNotFound then must be a 'real' error + // e.g. KErrNoMemory + if ((err != KErrNotFound) && (err != KErrNone)) + { + User::Leave(err); + } + } + + CleanupStack::PopAndDestroy(&plugInArray); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundUtility::IsDataTypeMatch +// This method takes a given resource entry from a hardware device and +// determines whether the hwdevice plugin is a data type match for playing or +// recording depending on the setting of aState +// The method matchs the default_data field from the hw device resource entry +// matching it with the aHwMatchFourCC code. +// ----------------------------------------------------------------------------- +// +TBool CMMFDevSoundUtility::IsDataTypeMatch( + CImplementationInformation* aHwDeviceResourceEntry, + const TDesC8& aHwMatchFourCC, + TMMFState aState) + { + TBool match = EFalse; + // extra length safety check to remove adapter plugins and incorrect ones + if (aHwDeviceResourceEntry->DataType().Length()>=KFourCCStringLength) + { + if (aState == EMMFStatePlaying) + { + //play need to match with the right four characters + match = + (!(aHwMatchFourCC.Match( + aHwDeviceResourceEntry->DataType().Right(KFOURCCLENGTH)) == + KErrNotFound)); + } + else if (aState == EMMFStateRecording) + { + //record need to match with the left four characters + match = + (!(aHwMatchFourCC.Match( + aHwDeviceResourceEntry->DataType().Left(KFOURCCLENGTH)) == + KErrNotFound)); + } + } + return match; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundUtility::InitializeFixedSequenceL +// Populate fixed sequences +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundUtility::InitializeFixedSequenceL( + CPtrC8Array** aFixedSequences) + { + + RFs fsSession; + User::LeaveIfError(fsSession.Connect()); + CleanupClosePushL(fsSession); + + // Open the resource file + RResourceFile resourceFile; + resourceFile.OpenL(fsSession, KFixedSequenceResourceFile); + CleanupClosePushL(resourceFile); + + // Allocate buffer to hold resource data in binary format + iInfo = resourceFile.AllocReadL(FIXED_TONE_SEQUENCE); + + TResourceReader reader; + reader.SetBuffer(iInfo); + + // Create array to hold fixed sequences data + CPtrC8Array* tempSequences = new(ELeave) CPtrC8Array(8); // granularity + CleanupStack::PushL(tempSequences); + + // First word gives number of entries + TInt numberOfEntries = reader.ReadUint16(); + ASSERT(!(numberOfEntries&1)); // Should have atleast one entry + + // There must be an even number entries as each sequence structure is made + // of a name string and a data string (SEQUENCE_NAME and SEQUENCE_DATA) + + HMMFToneFixedSequenceNames* names = new (ELeave) HMMFToneFixedSequenceNames; + CleanupStack::PushL(names); + + for (TInt i = 0; i < numberOfEntries; i += 2) + { + // Copy name from resource array to returnable array + HMMFToneFixedSequenceNames* newNames = + names->AddNameL(reader.ReadTPtrC()); + + if (names != newNames) + { + // May have moved so fixup cleanupstack reference + CleanupStack::Pop(names); + names = newNames; + CleanupStack::PushL(names); + } + + TInt len = reader.ReadUint16(); + TPtrC8 tempTPtrC8(REINTERPRET_CAST(const TUint8*,reader.Ptr()),len<<1); + tempSequences->AppendL(tempTPtrC8); + reader.Advance(len<<1); + } + + CleanupStack::Pop(names); + + // Delete the old fixed sequence names + delete iFixedSequenceNames; + iFixedSequenceNames = NULL; + iFixedSequenceNames = names; + + *aFixedSequences = tempSequences; + CleanupStack::Pop(tempSequences); + CleanupStack::PopAndDestroy(&resourceFile); + CleanupStack::PopAndDestroy(&fsSession); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundUtility::RecognizeSequence +// Recognizes tone sequence. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CMMFDevSoundUtility::RecognizeSequence(const TDesC8& aData) + { + TBool ret = EFalse; + if (aData.Length() > K4ByteSeq) + { + //Check for Smart Message (OTA) formats + if ((aData[0x000] == 0x02) && + (aData[0x001] == 0x4a) && + (aData[0x002] == 0x3a)) + { + ret = ETrue; + } + else if ((aData[0x000] == 0x03) && + (aData[0x001] == 0x4a) && + (aData[0x002] == 0x44) && + (aData[0x003] == 0x3a)) + { + ret = ETrue; + } + else if ((aData[0] == 0x00) && + (aData[1] == 0x11)) // Check for Nokia Ring Tone format + { + ret = ETrue; + } + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundUtility::FixedSequenceName +// Returns a descriptor reference containing name of the fixed sequence. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +const TDesC& CMMFDevSoundUtility::FixedSequenceName(TInt aSequenceNumber) + { + ASSERT(iFixedSequenceNames); // Defect if not true when previous was true + ASSERT((aSequenceNumber>=0) && + (aSequenceNumberiCount)); + + // Ptr to first descriptor + TUint8* ptr = REINTERPRET_CAST(TUint8*, + &(iFixedSequenceNames->iCount))+sizeof(TInt); + TDesC* desPtr = REINTERPRET_CAST(TDesC*,ptr); // First des + + while (aSequenceNumber--) + { + TInt size = desPtr->Size(); + if (size&3) + { + size = ((size+4)&(~3)); + } + + ptr += sizeof(TInt) + size; + desPtr = REINTERPRET_CAST(TDesC*,ptr); // Next des + } + + return *desPtr; + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/DevSoundUtility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/DevSoundUtility.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,288 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Class that provides API to list ECOM plugin implementation IDs +* +*/ + + + +#ifndef MMFDEVSOUNDUTILITY_H +#define MMFDEVSOUNDUTILITY_H + +// INCLUDES + +#include +#include + +#include "mmfutilities.h" // For TFourCC + +#define KFOURCCLENGTH 4 + +// CLASS DECLARATION + +/** +* Utility class. +* +* @lib MmfDevSoundAdaptation.lib +* @since S60 3.0 +*/ +class TMMFRawPackage + { + public: + + /** + * Returns a descriptor reference. + * @since S60 3.0 + * @return TPtr8& A descriptor reference + */ + inline TPtr8& Package(); + + /** + * Returns a constant descriptor reference. + * @since S60 3.0 + * @return TPtr8& A constant descriptor reference + */ + inline const TPtr8& Package() const; + + protected: + + /** + * Constructor. + * @since S60 3.0 + * @param TInt aDerivedSize Size of the descriptor. + */ + TMMFRawPackage(TInt aDerivedSize); + + /** + * Sets the size of the descriptor. + * @since S60 3.0 + * @param TInt aDerivedSize New descriptor size. + * @return void + */ + inline void SetSize(TInt aDerivedSize); + + protected: + TPtr8 iThis; + }; + +// CLASS DECLARATION + +/** +* Utlilty class used for Fixed Sequences. +* +* @lib MmfDevSoundAdaptation.lib +* @since S60 3.0 +*/ +class TMMFToneFixedSequenceNames : public TMMFRawPackage + { + public: + + /** + * Constructor. + * @since S60 3.0 + */ + inline TMMFToneFixedSequenceNames(); + + public: + TInt iCount; + }; + +// CLASS DECLARATION + +/** +* Utlilty class used for Fixed Sequences. +* +* @lib MmfDevSoundAdaptation.lib +* @since S60 3.0 +*/ +class HMMFToneFixedSequenceNames : public TMMFToneFixedSequenceNames + { + public: + + /** + * Constructor. + * @since S60 3.0 + */ + HMMFToneFixedSequenceNames(); + + /** + * Adds name to this object. + * @since S60 3.0 + * @param const TDesC& aName A descriptor containing name to be added. + * @return HMMFToneFixedSequenceNames* A pointer to this object. + */ + HMMFToneFixedSequenceNames* AddNameL(const TDesC& aName); + }; + + +// CLASS DECLARATION + +/** +* Utility class.used by DevSound. +* +* @lib MmfDevSoundAdaptation.lib +* @since S60 3.0 +*/ +class CMMFDevSoundUtility : public CBase + { + public: // Constructors and destructor + + /** + * Constructs, and returns a pointer to, a new CMMFDevSound object. + * Leaves on failure. + * @return CMMFDevSoundUtility* A pointer to newly created utlitly object. + */ + static CMMFDevSoundUtility* NewL(); + + /** + * Constructs, leaves object on the cleanup stack, and returns a pointer + * to, a new CMMFDevSound object. + * Leaves on failure. + * @return CMMFDevSoundUtility* A pointer to newly created utlitly object. + */ + static CMMFDevSoundUtility* NewLC(); + + /** + * Destructor. + */ + ~CMMFDevSoundUtility(); + + public: // New functions + + /** + * Finds the ECom plugins based on FourCC. + * @since S60 3.0 + * @param TUid aInterfaceUid The interface Uid where to look for the plugin. + * @param RImplInfoPtrArray& aPlugInArray The array of ECom plugins Uids + * that will be filled in by this function. + * @param const TFourCC& aSrcDataType The source data type. + * @param const TFourCC& aDstDataType The destination data type. + * @return void + */ + void SeekUsingFourCCLC(TUid aInterfaceUid, + RImplInfoPtrArray& aPlugInArray, + const TFourCC& aSrcDataType, + const TFourCC& aDstDataType, + const TDesC& aPreferredSupplier); + + /** + * local function to disable items which do not match the preferred + * supplier. Note that at least one enabled item is returned (if there + * was an enabled item to begin with) which may not match the preferred + * supplier. + * @since S60 3.0 + * @param RImplInfoPtrArray& aPlugInArray An array containing the list of + * ECom plugin Uids. + * @param const TDesC &aPreferredSupplier Additional resolution criteria + * when searching for ECom plugin. If this is provided, the list + * of matching plugins will be further searched for the latest + * version of a plugin supplied by supplier named. Note that the + * display name field is parsed for a match. + * @return void + */ + void SelectByPreference(RImplInfoPtrArray& aPlugInArray, const TDesC& aPreferredSupplier); + + /* + * This method looks for hwDevicePlugins that support the state given in + * aState which must be either EMMFStatePlaying or EMMFStateRecording for + * each HwDevice plugin found the datatype as indicated by its FourCC + * code from the default_data field in the resource file is added to the + * array of aSupportedDataTypes + * Leaves on failure. + * @since S60 3.0 + * @param RArray& aSupportedDataTypes An array of fourCC codes + * that has a fourCC code added to for each hardware device found. + * @param TMMFState aState EMMFStatePlaying if seeking HwDevice plugins + * that support play and EMMFStateRecording if seeking HwDevice + * plugins that support record * + * @return void + */ + void SeekHwDevicePluginsL(RArray& aSupportedDataTypes, TMMFState aState); + + /** + * Initializes the names of Fixed Sequences. + * Leaves on failure. + * @since S60 3.0 + * @param CPtrC8Array** aFixedSequences A pointer to a pointer reference + * which will be populated with Fixed Sequence names when this + * funtion returns. + * @return void + */ + void InitializeFixedSequenceL(CPtrC8Array** aFixedSequences); + + /** + * Recognizes tone sequence. + * @since S60 3.0 + * @param const TDesC8& aData A reference to descriptor containing tone + * sequence. + * @return ETrue of the sequence starts with 'SQNC' else EFalse. + */ + TBool RecognizeSequence(const TDesC8& aData); + + /** + * Returns a descriptor reference containing name of the fixed sequence. + * @since S60 3.0 + * @param TInt aSequenceNumber Sequence number. + * @return A constant reference to descriptor. + */ + const TDesC& FixedSequenceName(TInt aSequenceNumber); + + private: + + /* + * This method takes a given resource entry from a hardware device and + * determines whether the hwdevice plugin is a data type match for + * playing or recording depending on the setting of aState. The method + * matchs the default_data field from the hw device resource entry + * matching it with the aHwMatchFourCC code. + * @since S60 3.0 + * @param CImplementationInformation aHwDeviceResourceEntry The hw device + * resource entry that is to be checked whether it can be used to + * play or record + * @param TDesC8& aHwMatchFourCC The data type FourCC code to match to + * that the hardware device that must convert to for playing and + * convert from for recording - for the reference DevSound this + * is always ' P16' ie pcm16 + * @param TMMFState aState EMMFStatePlaying for playing and + * EMMFStateRecording for recording + * @return ETrue if a match for play or record else EFalse. + */ + TBool IsDataTypeMatch(CImplementationInformation* hwDeviceResourceEntry, + const TDesC8& fourCCPtrPCM16, + TMMFState aState); + + + private: + + /** + * C++ default constructor. + */ + CMMFDevSoundUtility(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + //data_declaration; + + HMMFToneFixedSequenceNames* iFixedSequenceNames; + HBufC8* iInfo; + + }; + +#endif // MMFDEVSOUNDUTILITY_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/FixedSequence.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/FixedSequence.rss Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,300 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Definitions required for tone sequences +* +*/ + +// CONSTANTS + +// +// Definitions required for tone sequences +// + +// Signature definitions +#define SEQ_SIG1 0x5153 +#define SEQ_SIG2 0x434E +#define SEQ_SIG SEQ_SIG1,SEQ_SIG2, // Signature = "SQNC" ASCII + +// Commands +#define SEQ_CMD_RET -1 +#define SEQ_CMD_STARTLOOP -2, +#define SEQ_CMD_ENDLOOP -3, + +// Useful values +// Note frequencies +#define SEQ_FREQ_A0 440 +#define SEQ_FREQ_AsBf0 466 // 466.1637615 A#, Bb +#define SEQ_FREQ_B0 494 // 493.8833013 +#define SEQ_FREQ_C0 523 // 523.2511306 +#define SEQ_FREQ_CsDf0 554 // 554.365262 C#, Db, etc. +#define SEQ_FREQ_D0 587 // 587.3295358 +#define SEQ_FREQ_DsEf0 622 // 622.2539674 +#define SEQ_FREQ_E0 659 // 659.2551138 +#define SEQ_FREQ_F0 698 // 698.4564629 +#define SEQ_FREQ_FsGf0 740 // 739.9888454 +#define SEQ_FREQ_G0 784 // 783.990872 +#define SEQ_FREQ_GsAf0 831 // 830.6093952 +#define SEQ_FREQ_A1 880 +#define SEQ_FREQ_AsBf1 932 // 932.327523 +#define SEQ_FREQ_B1 988 // 987.7666025 +#define SEQ_FREQ_C1 1047 // 1046.502261 +#define SEQ_FREQ_CsDf1 1109 // 1108.730524 +#define SEQ_FREQ_D1 1175 // 1174.659072 +#define SEQ_FREQ_DsEf1 1245 // 1244.507935 +#define SEQ_FREQ_E1 1319 // 1318.510228 +#define SEQ_FREQ_F1 1397 // 1396.912926 +#define SEQ_FREQ_FsGf1 1480 // 1479.977691 +#define SEQ_FREQ_G1 1568 // 1567.981744 +#define SEQ_FREQ_GsAf1 1661 // 1661.21879 +#define SEQ_FREQ_A2 1760 +#define SEQ_FREQ_AsBf2 1865 // 1864.655046 +#define SEQ_FREQ_B2 1976 // 1975.533205 +#define SEQ_FREQ_C2 2093 // 2093.004522 +#define SEQ_FREQ_CsDf2 2217 // 2217.461048 +#define SEQ_FREQ_D2 2349 // 2349.318143 +#define SEQ_FREQ_DsEf2 2489 // 2489.01587 +#define SEQ_FREQ_E2 2673 // 2637.020455 +#define SEQ_FREQ_F2 2794 // 2793.825851 +#define SEQ_FREQ_FsGf2 2960 // 2959.955382 +#define SEQ_FREQ_G2 3136 // 3135.963488 +#define SEQ_FREQ_GsAf2 3322 // 3322.437581 +#define SEQ_FREQ_A3 3520 +#define SEQ_FREQ_AsBf3 3729 // 3729.310092 + +// Volume defines +#define SEQ_VOL_F 32767 // Forte = Loud +#define SEQ_VOL_MF 24575 // Mezzo forte = Medium loud +#define SEQ_VOL_MP 16383 // Mezzo piano = Medium soft +#define SEQ_VOL_P 8191 // Piano = Soft + +// Macros for defining sequences +#define SEQ_DATA(A) SEQ_SIG A SEQ_CMD_RET +#define SEQ_VAL(N) N, +#define SEQ_LOOP(NUMBEROFTIMES,DATA) SEQ_CMD_STARTLOOP SEQ_VAL(NUMBEROFTIMES) DATA SEQ_CMD_ENDLOOP +#define SEQ_TONE(DUR,F1,V1) SEQ_VAL(DUR) SEQ_VAL(F1) SEQ_VAL(V1) SEQ_VAL(0) SEQ_VAL(0) +#define SEQ_2TONES(DUR,F1,V1,F2,V2) SEQ_VAL(DUR) SEQ_VAL(F1) SEQ_VAL(V1) SEQ_VAL(F2) SEQ_VAL(V2) +#define SEQ_SILENCE(DUR) SEQ_VAL(DUR) SEQ_VAL(0) SEQ_VAL(0) SEQ_VAL(0) SEQ_VAL(0) +// DUR = number samples@8kHz hence 8000 = 1 second +// F1/F2 = frequency in Hz - can use note definitions above +// V1/V1 = volume in range 0-32767 - can use volume definitions above +// When playing two tones, sum of volumes should not be greater than 32767 +// e.g. can use MF+P or MP+MP + +STRUCT SEQUENCE_NAME + { + LTEXT name; // leading-byte counted text string + } + +STRUCT SEQUENCE_DATA + { + LEN WORD WORD data[]; // Array of 16bit data values + } + +STRUCT SEQUENCE_ARRAY + { + STRUCT sequences[]; + } + +// RESOURCE DEFINITIONS +// ----------------------------------------------------------------------------- +// +// fixed_tone_sequence +// Contains the sequences supported by the device (with localisable names) +// +// ----------------------------------------------------------------------------- +// +RESOURCE SEQUENCE_ARRAY fixed_tone_sequence + { + sequences = + { + SEQUENCE_NAME + { + // + // A loud piercing sequence that alternates between two toned "warbles" + // Duration: 5 seconds + // + name="Rings"; + }, + SEQUENCE_DATA + { + data = + { + SEQ_DATA + ( + SEQ_LOOP + ( + 2, + SEQ_LOOP + ( + 11, + SEQ_TONE(250,SEQ_FREQ_GsAf2,SEQ_VOL_F) + SEQ_TONE(250,SEQ_FREQ_DsEf2,SEQ_VOL_F) + ) + SEQ_LOOP + ( + 11, + SEQ_TONE(250,SEQ_FREQ_DsEf2,SEQ_VOL_F) + SEQ_TONE(250,SEQ_FREQ_GsAf1,SEQ_VOL_F) + ) + SEQ_SILENCE(6000) + ) + SEQ_SILENCE(6000) + ) + }; + }, + SEQUENCE_NAME + { + // + // A pleasant bell-like sequence based on clock chimes + // Duration: 5 seconds + // + name="Chimes"; + }, + SEQUENCE_DATA + { + data = + { + SEQ_DATA + ( + SEQ_2TONES(2500,SEQ_FREQ_E1,SEQ_VOL_MP,SEQ_FREQ_E1+5,SEQ_VOL_MP) + SEQ_2TONES(2500,SEQ_FREQ_C1,SEQ_VOL_MP,SEQ_FREQ_C1+5,SEQ_VOL_MP) + SEQ_2TONES(2500,SEQ_FREQ_D1,SEQ_VOL_MP,SEQ_FREQ_D1+5,SEQ_VOL_MP) + SEQ_2TONES(6250,SEQ_FREQ_G0,SEQ_VOL_MF,SEQ_FREQ_G0+5,SEQ_VOL_P) + SEQ_SILENCE(1250) + SEQ_2TONES(2500,SEQ_FREQ_G0,SEQ_VOL_MP,SEQ_FREQ_G0+5,SEQ_VOL_MP) + SEQ_2TONES(2500,SEQ_FREQ_D1,SEQ_VOL_MP,SEQ_FREQ_D1+5,SEQ_VOL_MP) + SEQ_2TONES(2500,SEQ_FREQ_E1,SEQ_VOL_MF,SEQ_FREQ_E1+5,SEQ_VOL_P) + SEQ_2TONES(7500,SEQ_FREQ_C1,SEQ_VOL_MP,SEQ_FREQ_C1+5,SEQ_VOL_MP) + SEQ_SILENCE(10000) + ) + }; + }, + SEQUENCE_NAME + { + // + // A quiet sequence similar to a digital watch alarm + // Duration: 2.5 seconds + // + name="Signal"; + }, + SEQUENCE_DATA + { + data = + { + SEQ_DATA + ( + SEQ_LOOP + ( + 3, + SEQ_LOOP + ( + 3, + SEQ_TONE(328,SEQ_FREQ_AsBf3,SEQ_VOL_MF) + SEQ_SILENCE(339) + ) + SEQ_SILENCE(2333) + ) + SEQ_SILENCE(6998) + ) + }; + }, + SEQUENCE_NAME + { + // + // Sounds like a fanfare played on an electric organ + // Duration: 2.6 seconds + // + name="Fanfare"; + }, + SEQUENCE_DATA + { + data = + { + SEQ_DATA + ( + SEQ_2TONES(2000,SEQ_FREQ_DsEf1,SEQ_VOL_MP,SEQ_FREQ_DsEf0,SEQ_VOL_MP) + SEQ_2TONES(2000,SEQ_FREQ_GsAf1,SEQ_VOL_MP,SEQ_FREQ_GsAf0,SEQ_VOL_MP) + SEQ_2TONES(1000,SEQ_FREQ_C2,SEQ_VOL_MP,SEQ_FREQ_C1,SEQ_VOL_MP) + SEQ_2TONES(1000,SEQ_FREQ_GsAf1,SEQ_VOL_MF,SEQ_FREQ_GsAf0,SEQ_VOL_P) + SEQ_2TONES(2000,SEQ_FREQ_DsEf1,SEQ_VOL_MP,SEQ_FREQ_DsEf0,SEQ_VOL_MP) + SEQ_2TONES(2000,SEQ_FREQ_GsAf1,SEQ_VOL_MP,SEQ_FREQ_GsAf0,SEQ_VOL_MP) + SEQ_2TONES(4000,SEQ_FREQ_C2,SEQ_VOL_MP,SEQ_FREQ_C1,SEQ_VOL_MP) + SEQ_2TONES(4000,SEQ_FREQ_GsAf1,SEQ_VOL_MF,SEQ_FREQ_GsAf0,SEQ_VOL_P) + SEQ_SILENCE(4000) + ) + }; + }, + SEQUENCE_NAME + { + // + // Pleasant two-tone chimes + // Duration: 4 seconds + // + name="Bells"; + }, + SEQUENCE_DATA + { + data = + { + SEQ_DATA + ( + SEQ_LOOP + ( + 2, + SEQ_2TONES(4000,SEQ_FREQ_E1,SEQ_VOL_MP,SEQ_FREQ_C1,SEQ_VOL_MP) + SEQ_2TONES(8000,SEQ_FREQ_C1,SEQ_VOL_MP,SEQ_FREQ_G0,SEQ_VOL_MP) + ) + SEQ_SILENCE(8000) + ) + }; + }, + SEQUENCE_NAME + { + // + // Cavalry charge + // Duration: 2 seconds + // + name="Cavalry"; + }, + SEQUENCE_DATA + { + data = + { + SEQ_DATA + ( + SEQ_LOOP + ( + 2, + SEQ_2TONES(1333,SEQ_FREQ_A2,SEQ_VOL_MP,SEQ_FREQ_A1,SEQ_VOL_MP) + SEQ_SILENCE(667) + SEQ_2TONES(333,SEQ_FREQ_A2,SEQ_VOL_MP,SEQ_FREQ_A1,SEQ_VOL_MP) + SEQ_SILENCE(333) + ) + SEQ_LOOP + ( + 2, + SEQ_2TONES(1333,SEQ_FREQ_E2,SEQ_VOL_MP,SEQ_FREQ_E1,SEQ_VOL_MP) + SEQ_SILENCE(667) + SEQ_2TONES(333,SEQ_FREQ_CsDf2,SEQ_VOL_MP,SEQ_FREQ_CsDf1,SEQ_VOL_MP) + SEQ_SILENCE(333) + ) + SEQ_2TONES(2667,SEQ_FREQ_A2,SEQ_VOL_MP,SEQ_FREQ_A1,SEQ_VOL_MP) + SEQ_SILENCE(2667) + ) + }; + } + }; + } + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/MmfDevSoundAdaptation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/MmfDevSoundAdaptation.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,628 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Stub implementation of the MMF DevSound Server adaptation. +* +*/ + + + +// INCLUDE FILES +#include +#include "MmfDevSoundAdaptationBody.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CMMFDevSoundAdaptation +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CMMFDevSoundAdaptation::CMMFDevSoundAdaptation() + { + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::ConstructL( + RServer2& aPolicyServerHandle) + { + iBody = CBody::NewL(); + // This is needed because in iBody->ConstructL(), Adaptation need to have + // a pointer reference to iBody to call SetDevSoundInfo. + iBody->ConstructL(aPolicyServerHandle); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CMMFDevSoundAdaptation* CMMFDevSoundAdaptation::NewL( + RServer2& aPolicyServerHandle) + { + CMMFDevSoundAdaptation* self = new (ELeave)CMMFDevSoundAdaptation; + CleanupStack::PushL(self); + self->ConstructL(aPolicyServerHandle); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::ConstructL +// Destructor +// ----------------------------------------------------------------------------- +// +EXPORT_C CMMFDevSoundAdaptation::~CMMFDevSoundAdaptation() + { + delete iBody; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::InitializeL +// Initializes CMMFDevSoundProxy object to play and record PCM16 raw audio data +// with sampling rate of 8 KHz.On completion of Initialization, calls +// InitializeComplete() on aDevSoundObserver. +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::InitializeL( + MDevSoundAdaptationObserver& aDevSoundObserver, + TMMFState aMode) + + { + iBody->InitializeL(aDevSoundObserver, aMode); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::InitializeL +// Initializes DevSound object for the mode aMode for processing audio data +// with hardware device aHWDev. On completion of Initialization, the observer +// will be notified via call back InitializeComplete(). +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::InitializeL( + MDevSoundAdaptationObserver& aDevSoundObserver, + TUid aHWDev, + TMMFState aMode) + { + iBody->InitializeL(aDevSoundObserver, aHWDev, aMode); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::InitializeL +// Initializes DevSound object for the mode aMode for processing audio data +// using an array of Hardware devices identified by aHWDevArray identifier +// array. The hardware devices are chained together with data flow starting +// with first array element.On completion of Initialization, the observer +// will be notified via call back InitializeComplete(). +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::InitializeL( + MDevSoundAdaptationObserver& aDevSoundObserver, + TFourCC aDesiredFourCC, + TMMFState aMode) + { + iBody->InitializeL(aDevSoundObserver, aDesiredFourCC, aMode); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::Capabilities +// Returns the supported Audio settings. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TMMFCapabilities CMMFDevSoundAdaptation::Capabilities() + { + return iBody->Capabilities(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::Config +// Returns the current audio settings. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TMMFCapabilities CMMFDevSoundAdaptation::Config() const + { + return iBody->Config(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::SetConfigL +// Configure CMMFDevSoundProxy object for the settings in aConfig. +// Use this to set sampling rate, Encoding and Mono/Stereo. +// As part of defect 20796, the iRecordFormat has been set under the iPlayFormat, +// before it was not set at all. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::SetConfigL( + const TMMFCapabilities& aConfig) + { + iBody->SetConfigL(aConfig); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::MaxVolume +// Returns an integer representing the maximum volume. +// This is the maximum value which can be passed to CMMFDevSoundProxy::SetVolume. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMMFDevSoundAdaptation::MaxVolume() + { + return iBody->MaxVolume(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::Volume +// Returns an integer representing the current volume. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMMFDevSoundAdaptation::Volume() + { + return iBody->Volume(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::SetVolume +// Changes the current playback volume to a specified value. +// The volume can be changed before or during playback and is effective +// immediately. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::SetVolume( + TInt aVolume) + { + iBody->SetVolume(aVolume); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::MaxGain +// Returns an integer representing the maximum gain. +// This is the maximum value which can be passed to CMMFDevSoundProxy::SetGain. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMMFDevSoundAdaptation::MaxGain() + { + return iBody->MaxGain(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::Gain +// Returns an integer representing the current gain. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMMFDevSoundAdaptation::Gain() + { + return iBody->Gain(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::SetGain +// Changes the current recording gain to a specified value. +// The gain can be changed before or during recording and is effective +// immediately. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::SetGain( + TInt aGain) + { + iBody->SetGain(aGain); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::GetPlayBalanceL +// Returns the speaker balance set for playing. +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::GetPlayBalanceL( + TInt& aLeftPercentage, + TInt& aRightPercentage) + { + iBody->GetPlayBalanceL(aLeftPercentage, aRightPercentage); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::SetPlayBalanceL +// Sets the speaker balance for playing. The speaker balance can be changed +// before or during playback and is effective immediately. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::SetPlayBalanceL( + TInt aLeftPercentage, + TInt aRightPercentage) + { + iBody->SetPlayBalanceL(aLeftPercentage, aRightPercentage); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::GetRecordBalanceL +// Returns the microphone gain balance set for recording. +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::GetRecordBalanceL( + TInt& aLeftPercentage, + TInt& aRightPercentage) + { + iBody->GetRecordBalanceL(aLeftPercentage, aRightPercentage); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::SetRecordBalanceL +// Sets the microphone gain balance for recording. +// The microphone gain balance can be changed before or during recording and +// is effective immediately. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::SetRecordBalanceL( + TInt aLeftPercentage, + TInt aRightPercentage) + { + iBody->SetRecordBalanceL(aLeftPercentage, aRightPercentage); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::PlayInitL +// Initializes audio device and start play process. This method queries and +// acquires the audio policy before initializing audio device. If there was an +// error during policy initialization, PlayError() method will be called on +// the observer with error code KErrAccessDenied, otherwise BufferToBeFilled() +// method will be called with a buffer reference. After reading data into the +// buffer reference passed, the client should call PlayData() to play data. +// +// The amount of data that can be played is specified in +// CMMFBuffer::RequestSize(). Any data that is read into buffer beyond this +// size will be ignored. +// +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::PlayInitL() + { + iBody->PlayInitL(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::RecordInitL +// Initializes audio device and start record process. This method queries and +// acquires the audio policy before initializing audio device. If there was an +// error during policy initialization, RecordError() method will be called on +// the observer with error code KErrAccessDenied, otherwise BufferToBeEmptied() +// method will be called with a buffer reference. This buffer contains recorded +// or encoded data. After processing data in the buffer reference passed, the +// client should call RecordData() to continue recording process. +// +// The amount of data that is available is specified in +// CMMFBuffer::RequestSize(). +// +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::RecordInitL() + { + iBody->RecordInitL(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::PlayData +// Plays data in the buffer at the current volume. The client should fill +// the buffer with audio data before calling this method. The Observer gets +// reference to buffer along with callback BufferToBeFilled(). When playing of +// the audio sample is complete, successfully or otherwise, the method +// PlayError() on observer is called. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::PlayData() + { + iBody->PlayData(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::RecordData +// Contine the process of recording. Once the buffer is filled with recorded +// data, the Observer gets reference to buffer along with callback +// BufferToBeEmptied(). After processing the buffer (copying over to a +// different buffer or writing to file) the client should call this +// method to continue recording process. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::RecordData() + { + iBody->RecordData(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::Stop +// Stops the ongoing operation (Play, Record, TonePlay, Convert) +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::Stop() + { + iBody->Stop(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::Pause +// Temporarily Stops the ongoing operation (Play, Record, TonePlay, Convert) +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::Pause() + { + iBody->Pause(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::SamplesRecorded +// Returns the sample recorded so far. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMMFDevSoundAdaptation::SamplesRecorded() + { + return iBody->SamplesRecorded(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::SamplesPlayed +// Returns the sample played so far. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMMFDevSoundAdaptation::SamplesPlayed() + { + return iBody->SamplesPlayed(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::PlayToneL +// Initializes audio device and start playing tone. Tone is played with +// frequency and for duration specified. +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::PlayToneL( + TInt aFrequency, + const TTimeIntervalMicroSeconds& aDuration) + { + iBody->PlayToneL(aFrequency, aDuration); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::PlayDualToneL +// Initializes audio device and start playing a dual tone. +// The tone consists of two sine waves of different frequencies summed together +// Dual Tone is played with specified frequencies and for specified duration. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::PlayDualToneL( + TInt aFrequencyOne, + TInt aFrequencyTwo, + const TTimeIntervalMicroSeconds& aDuration) + { + iBody->PlayDualToneL(aFrequencyOne, aFrequencyTwo, aDuration); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::PlayDTMFStringL +// Initializes audio device and start playing DTMF string aDTMFString. +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::PlayDTMFStringL( + const TDesC& aDTMFString) + { + iBody->PlayDTMFStringL(aDTMFString); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::PlayToneSequenceL +// Initializes audio device and start playing tone sequence. +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::PlayToneSequenceL( + const TDesC8& aData) + { + iBody->PlayToneSequenceL(aData); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::PlayFixedSequenceL +// Initializes audio device and start playing the specified pre-defined tone +// sequence. +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::PlayFixedSequenceL( + TInt aSequenceNumber) + { + iBody->PlayFixedSequenceL(aSequenceNumber); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::SetToneRepeats +// Defines the number of times the audio is to be repeated during the tone +// playback operation. A period of silence can follow each playing of tone. +// The tone playing can be repeated indefinitely. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::SetToneRepeats( + TInt aRepeatCount, + const TTimeIntervalMicroSeconds& aRepeatTrailingSilence) + { + iBody->SetToneRepeats(aRepeatCount, aRepeatTrailingSilence); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::SetDTMFLengths +// Defines the duration of tone on, tone off and tone pause to be used during the +// DTMF tone playback operation. +// Supported only during tone playing. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::SetDTMFLengths( + TTimeIntervalMicroSeconds32& aToneOnLength, + TTimeIntervalMicroSeconds32& aToneOffLength, + TTimeIntervalMicroSeconds32& aPauseLength) + { + iBody->SetDTMFLengths(aToneOnLength, aToneOffLength, aPauseLength); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::SetVolumeRamp +// Defines the period over which the volume level is to rise smoothly from +// nothing to the normal volume level. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::SetVolumeRamp( + const TTimeIntervalMicroSeconds& aRampDuration) + { + iBody->SetVolumeRamp(aRampDuration); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::SetPrioritySettings +// Defines the priority settings that should be used for this instance. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::SetPrioritySettings( + const TMMFPrioritySettings& aPrioritySettings) + { + iBody->SetPrioritySettings(aPrioritySettings); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CustomInterface +// see sounddevice.h +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TAny* CMMFDevSoundAdaptation::CustomInterface( + TUid aInterfaceId) + { + return iBody->CustomInterface(aInterfaceId); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::FixedSequenceCount +// Returns the number of available pre-defined tone sequences. +// This is the number of fixed sequence supported by DevSound by default. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMMFDevSoundAdaptation::FixedSequenceCount() + { + return iBody->FixedSequenceCount(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::FixedSequenceName +// Returns the name assigned to a specific pre-defined tone sequence. +// This is the number of fixed sequence supported by DevSound by default. +// The function raises a panic if sequence number specified invalid. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CMMFDevSoundAdaptation::FixedSequenceName( + TInt aSequenceNumber) + { + return iBody->FixedSequenceName(aSequenceNumber); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::GetSupportedInputDataTypesL +// see sounddevice.h +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::GetSupportedInputDataTypesL( + RArray& aSupportedDataTypes, + const TMMFPrioritySettings& aPrioritySettings) const + { + iBody->GetSupportedInputDataTypesL(aSupportedDataTypes, aPrioritySettings); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::GetSupportedOutputDataTypesL +// see sounddevice.h +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::GetSupportedOutputDataTypesL( + RArray& aSupportedDataTypes, + const TMMFPrioritySettings& aPrioritySettings) const + { + iBody->GetSupportedOutputDataTypesL(aSupportedDataTypes, aPrioritySettings); + } + +// ----------------------------------------------------------------------------- +// SetClientConfig +// Sets client capabilities for this instance of DevSound Adaptation. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMMFDevSoundAdaptation::SetClientConfig( + const TMMFClientConfig& aClientConfig) + { + iBody->SetClientConfig(aClientConfig); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::ClientConfig +// Returns client capabilities of this instance of DevSound Adaptation. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C const TMMFClientConfig& CMMFDevSoundAdaptation::ClientConfig() const + { + return iBody->ClientConfig(); + } + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/MmfDevSoundAdaptationBody.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/MmfDevSoundAdaptationBody.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,2019 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - DevSound adaptation stub body implementation. +* +*/ + + +// INCLUDE FILES +#include +#include + +#include "G711DecoderIntfc.h" +#include "G729DecoderIntfc.h" +#include "IlbcDecoderIntfc.h" +#include "G711EncoderIntfc.h" +#include "G729EncoderIntfc.h" +#include "IlbcEncoderIntfc.h" +#include "ErrorConcealmentIntfc.h" +#include "SpeechEncoderConfig.h" + +#include "AudioInputMessageTypes.h" +#include "AudioOutputMessageTypes.h" +//#include "AudioResourceMessageTypes.h" + +#include "AudioInputCI.h" +#include "AudioOutputCI.h" +#include "G711DecoderIntfcCI.h" +#include "G729DecoderIntfcCI.h" +#include "IlbcDecoderIntfcCI.h" +#include "G711EncoderIntfcCI.h" +#include "G729EncoderIntfcCI.h" +#include "IlbcEncoderIntfcCI.h" +#include "ErrorConcealmentIntfcCI.h" +#include "SpeechEncoderConfigCI.h" + +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include + +//#include +//#include +//#include + +#include "MmfDevSoundAdaptationBody.h" +#include "MmfHwDeviceStub.h" +#include "TonePlayCompleteTimer.h" + + +// CONSTANTS +#ifdef _DEBUG +#include "e32debug.h" + +#define DEBPRN0(str) RDebug::Print(str, this) +#define DEBPRN1(str, val1) RDebug::Print(str, this, val1) +#define DEBPRN2(str, val1, val2) RDebug::Print(str, this, val1, val2) +#else +#define DEBPRN0(str) +#define DEBPRN1(str, val1) +#define DEBPRN2(str, val1, val2) +#endif //_DEBUG + + +const TUint KMaxVolume = 10; +const TUint KToneSamplingRate = 8000; +const TUint KToneChannels = 2; +// Time to play one note 1/10th of 1/2 a second +const TUint KToneNotePlayTime = 50000; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::CBody +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CMMFDevSoundAdaptation::CBody::CBody() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CBody")); + iMode= EMMFStateIdle; + //Set reasonable default values for DTMF + iDTMFGen.SetToneDurations(250000,50000,250000); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::ConstructL +// Symbian 2nd phase constructor can leave. +// assumes that iParent has already been set up properly +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::ConstructL( + RServer2& /*aPolicyServerHandle*/) + { + // Default + // set the default capability + iDeviceCapabilities.iRate = EMMFSampleRate8000Hz; + iDeviceCapabilities.iEncoding = EMMFSoundEncoding16BitPCM; + iDeviceCapabilities.iChannels = EMMFMono; + iDeviceCapabilities.iBufferSize = KBufferLength; + + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::ConstructL:EXIT")); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMMFDevSoundAdaptation::CBody* CMMFDevSoundAdaptation::CBody::NewL() + { + CMMFDevSoundAdaptation::CBody* self = new (ELeave) CBody; + return self; + } + + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBodye::~CBody +// Destructor +// ----------------------------------------------------------------------------- +// +CMMFDevSoundAdaptation::CBody::~CBody() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::~CBody:ENTER")); + delete iToneBuffer1; + delete iToneBuffer2; + delete iDevSoundUtil; + delete iFixedSequences; + delete iCMMFHwDevice; + delete iTonePlayCompleteTimer; + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::~CBody:EXIT")); + } + + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::InitializeL +// Initializes CMMFDevSoundProxy object to play and record PCM16 raw audio data +// with sampling rate of 8 KHz. +// +// On completion of Initialization, calls InitializeComplete() on +// aDevSoundObserver. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::InitializeL( + MDevSoundAdaptationObserver& aDevSoundObserver, + TMMFState aMode) + { + // if no HwDevice id specified, load default null implementation + TUid rawUid = {0}; + InitializeL(aDevSoundObserver, rawUid, aMode); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::InitializeL +// Initializes DevSound object for the mode aMode for processing audio data +// with hardware device aHWDev. +// +// On completion of Initialization, the observer will be notified via call back +// InitializeComplete(). +// +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::InitializeL( + MDevSoundAdaptationObserver& aDevSoundObserver, + TUid aHWDev, + TMMFState aMode) + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::InitializeL:ENTER")); + TInt initError = KErrNone; + iDevSoundObserver = &aDevSoundObserver; + + if (aMode == EMMFStateIdle) + { + User::Leave(KErrNotSupported); + } + iMode= aMode; + + + iDevSoundObserver = &aDevSoundObserver; + iHwDeviceID.iUid = aHWDev.iUid; + if(iCMMFHwDevice) + { + delete iCMMFHwDevice; + iHwDeviceBuffer = NULL; // buffer is deleted by HwDevice delete + } + + iCMMFHwDevice = NULL; + iCMMFHwDevice = CMMFHwDeviceStub::NewL(); + + iDevInfo.iHwDeviceObserver = this; + initError = iCMMFHwDevice->Init(iDevInfo); + + iDevSoundObserver->InitializeComplete(initError); + + if (initError) + { + User::Leave(initError); + } + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::InitializeL:EXIT")); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::InitializeL +// Initializes DevSound object for the mode aMode for processing audio data +// with hardware device supporting FourCC aDesiredFourCC. +// +// On completion of Initialization, the observer will be notified via call back +// InitializeComplete(). +// +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::InitializeL( + MDevSoundAdaptationObserver& aDevSoundObserver, + TFourCC /*aDesiredFourCC*/, + TMMFState aMode) + { + TUid implUid = {0}; + InitializeL(aDevSoundObserver, implUid, aMode); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::Capabilities +// Returns the supported Audio settings. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TMMFCapabilities CMMFDevSoundAdaptation::CBody::Capabilities() + { + return iDeviceCapabilities; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::Config +// Returns the current audio settings. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TMMFCapabilities CMMFDevSoundAdaptation::CBody::Config() const + { + return iDeviceConfig; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::SetConfigL +// Configure CMMFDevSoundProxy object for the settings in aConfig. +// Use this to set sampling rate, Encoding and Mono/Stereo. +// As part of defect 20796, the iRecordFormat has been set under the iPlayFormat, +// before it was not set at all. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::SetConfigL( + const TMMFCapabilities& aConfig) + { + iDeviceConfig = aConfig; + + // Fix to WAV recording problem. + // A kludge to init channel number to 'something' in case the device returns 0. + if (!iDeviceConfig.iChannels) + { + iDeviceConfig.iChannels = EMMFMono; + } + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::MaxVolume +// Returns an integer representing the maximum volume. +// This is the maximum value which can be passed to CMMFDevSoundProxy::SetVolume. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::MaxVolume() + { + return KMaxVolume; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::Volume +// Returns an integer representing the current volume. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::Volume() + { + return iVolume; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::SetVolume +// Changes the current playback volume to a specified value. +// The volume can be changed before or during playback and is effective +// immediately. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::SetVolume( + TInt aVolume) + { + // Check and make sure that the volume is in valid range + if (aVolume < 0) + { + aVolume = 0; + } + if (aVolume > MaxVolume()) + { + aVolume = MaxVolume(); + } + iVolume = aVolume; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::MaxGain +// Returns an integer representing the maximum gain. +// This is the maximum value which can be passed to CMMFDevSoundProxy::SetGain. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::MaxGain() + { + return KMaxVolume;//uses iMaxVolume for iMaxGain + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::Gain +// Returns an integer representing the current gain. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::Gain() + { + return iGain; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::SetGain +// Changes the current recording gain to a specified value. +// +// The gain can be changed before or during recording and is effective +// immediately. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::SetGain(TInt aGain) + { + // make sure it falls with the correct range + if (aGain > MaxGain()) + { + aGain = MaxGain(); + } + else if (aGain < 0) + { + aGain = 0; + } + iGain = aGain; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::GetPlayBalanceL +// Returns the speaker balance set for playing. +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::GetPlayBalanceL( + TInt& aLeftPercentage, + TInt& aRightPercentage) + { + aLeftPercentage = iLeftPlayBalance; + aRightPercentage = iRightPlayBalance; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::SetPlayBalanceL +// Sets the speaker balance for playing. +// The speaker balance can be changed before or during playback and is +// effective immediately. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::SetPlayBalanceL( + TInt aLeftPercentage, + TInt aRightPercentage) + { + if (aLeftPercentage < 0) + { + aLeftPercentage = 0; + } + else if (aLeftPercentage > 100) + { + aLeftPercentage = 100; + } + if (aRightPercentage < 0) + { + aRightPercentage = 0; + } + else if (aRightPercentage > 100) + { + aRightPercentage = 100; + } + iLeftPlayBalance = aLeftPercentage; + iRightPlayBalance = aRightPercentage; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::GetRecordBalanceL +// Returns the microphone gain balance set for recording. +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::GetRecordBalanceL( + TInt& aLeftPercentage, + TInt& aRightPercentage) + { + aLeftPercentage = iLeftRecordBalance; + aRightPercentage = iRightRecordBalance; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::SetRecordBalanceL +// Sets the microphone gain balance for recording. +// The microphone gain balance can be changed before or during recording and +// is effective immediately. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::SetRecordBalanceL( + TInt aLeftPercentage, + TInt aRightPercentage) + { + if (aLeftPercentage < 0) + { + aLeftPercentage = 0; + } + else if (aLeftPercentage > 100) + { + aLeftPercentage = 100; + } + if (aRightPercentage < 0) + { + aRightPercentage = 0; + } + else if (aRightPercentage > 100) + { + aRightPercentage = 100; + } + iLeftRecordBalance = aLeftPercentage; + iRightRecordBalance = aRightPercentage; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::PlayInitL +// Initializes audio device and start play process. This method queries and +// acquires the audio policy before initializing audio device. If there was an +// error during policy initialization, PlayError() method will be called on +// the observer with error code KErrAccessDenied, otherwise BufferToBeFilled() +// method will be called with a buffer reference. After reading data into the +// buffer reference passed, the client should call PlayData() to play data. +// +// The amount of data that can be played is specified in +// CMMFBuffer::RequestSize(). Any data that is read into buffer beyond this +// size will be ignored. +// +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::PlayInitL() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::PlayInitL")); + if (!iDevSoundObserver) + { + User::Leave(KErrNotReady); + } + + StartPlayDataL(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::RecordInitL +// Initializes audio device and start record process. This method queries and +// acquires the audio policy before initializing audio device. If there was an +// error during policy initialization, RecordError() method will be called on +// the observer with error code KErrAccessDenied, otherwise BufferToBeEmptied() +// method will be called with a buffer reference. This buffer contains recorded +// or encoded data. After processing data in the buffer reference passed, the +// client should call RecordData() to continue recording process. +// +// The amount of data that is available is specified in +// CMMFBuffer::RequestSize(). +// +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::RecordInitL() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::RecordInitL")); + if (!iDevSoundObserver) + { + User::Leave(KErrNotReady); + } + + StartRecordDataL(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::PlayData +// Plays data in the buffer at the current volume. The client should fill +// the buffer with audio data before calling this method. The Observer gets +// reference to buffer along with callback BufferToBeFilled(). When playing of +// the audio sample is complete, successfully or otherwise, the method +// PlayError() on observer is called. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::PlayData() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::PlayData")); + ASSERT(iDevSoundObserver); + + if (iMode== EMMFStateIdle) + { + return; + } + + TInt error = KErrNone; + + if(iCMMFHwDevice) + { + if (iPaused) + { + iPaused = EFalse; + //note PlayData does not leave or return an error code so the + //Start() fails we cannot report the error back at this point + if (iCMMFHwDevice->IsActive()) + { + iCMMFHwDevice->Cancel(); + } + //restart hw device after pause + error = iCMMFHwDevice->Start(EDevDecode, EDevOutFlow); + } + else if(iMode== EMMFStatePlaying) + { + TInt len = iHwDeviceBuffer->Data().Length(); + iPlayedBytesCount += len; + if (iHwDeviceBuffer->LastBuffer()) + { + iLastBufferReceived = ETrue; + } + + // Pass the data buffer to HwDevice + if (iMode== EMMFStatePlaying) + { + error = iCMMFHwDevice->ThisHwBufferFilled(*iHwDeviceBuffer); + } + } + } + if (error != KErrNone) + { + iDevSoundObserver->PlayError(error); + } + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::RecordData +// Contine the process of recording. Once the buffer is filled with recorded +// data, the Observer gets reference to buffer along with callback +// BufferToBeEmptied(). After processing the buffer (copying over to a +// different buffer or writing to file) the client should call this +// method to continue recording process. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::RecordData() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::RecordData")); + ASSERT(iDevSoundObserver); + if(iCMMFHwDevice) + { + if(iMode == EMMFStateRecording) + { + // Fix to WAV recording issue. + // In case of real DevSound adaptation implementation, the + // CMMFSwCodecRecordDataPath sets the last buffer parameter when no + // more data is in the buffer to process. In case of the stub, this + // never gets set as the s/w codec is not involved - we are simply + // copying same fixed 4k block of data over and over again. So, on + // pause or stop we need to indicate to the data path that we no + // longer need processing of data by manually setting last buffer + // parameter and resetting requested data size to 0. + if (iPaused) + { + iHwDeviceBuffer->SetLastBuffer(ETrue); + iHwDeviceBuffer->Data().SetLength(0); + } + else + { + iHwDeviceBuffer->Data().SetLength(iHwDeviceBuffer->RequestSize()); + } + + iCMMFHwDevice->ThisHwBufferEmptied(*iHwDeviceBuffer); + } + } + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::Stop +// Stops the ongoing operation (Play, Record, TonePlay, Convert) +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::Stop() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::Stop")); + + iPaused = EFalse; + + if (iMode== EMMFStateIdle) + { + return; + } + + // For custom interface + + // Stop the hw device first - this unloads sound drivers + if(iCMMFHwDevice) + { + iCMMFHwDevice->Stop(); + } + + if ((iMode== EMMFStateTonePlaying) && (iTonePlayCompleteTimer)) + { + iTonePlayCompleteTimer->Cancel(); + } + + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::Pause +// Temporarily Stops the ongoing operation (Play, Record, TonePlay, Convert) +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::Pause() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::Pause")); + iPaused = ETrue; + + if (iMode== EMMFStateIdle) + { + return; + } + + // Pause the HW device first + if(iCMMFHwDevice) + { + iCMMFHwDevice->Pause(); + } + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::SamplesRecorded +// Returns the sample recorded so far. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::SamplesRecorded() + { + TInt samples = 0; + samples = iRecordedBytesCount; + if(NumberOfChannels() > 1) + { + samples /= NumberOfChannels(); + } + if(BytesPerAudioSample() > 1) + { + samples /= BytesPerAudioSample(); + } + return samples; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::SamplesPlayed +// Returns the sample played so far. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::SamplesPlayed() + { + TInt samples = 0; + samples = iPlayedBytesCount; + if(NumberOfChannels() > 1) + { + samples /= NumberOfChannels(); + } + + if(BytesPerAudioSample() > 1) + { + samples /= BytesPerAudioSample(); + } + return samples; //each sample is 2 bytes + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::PlayToneL +// Initializes audio device and start playing tone. Tone is played with +// frequency and for duration specified. +// +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::PlayToneL( + TInt aFrequency, + const TTimeIntervalMicroSeconds& aDuration) + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::PlayToneL")); + if (iMode!= EMMFStateTonePlaying) + { + //tone playing only supported in tone play state + User::Leave(KErrNotSupported); + } + // Check whether frequency and duration is valid or not + TInt64 zeroInt64(0); + if ((aFrequency<0) || (aDuration.Int64() < zeroInt64)) + { + User::Leave(KErrArgument); + } + if (!iDevSoundObserver) + { + User::Leave(KErrNotReady); + } + iToneGen.SetFrequencyAndDuration(aFrequency,aDuration); + + StartPlayToneL(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::PlayDualToneL +// Initializes audio device and start playing a dual tone. +// The tone consists of two sine waves of different frequencies summed together +// Dual Tone is played with specified frequencies and for specified duration. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::PlayDualToneL( + TInt aFrequencyOne, + TInt aFrequencyTwo, + const TTimeIntervalMicroSeconds& aDuration) + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::PlayDualToneL")); + + // Check whether frequencies and duration are valid or not + TInt64 zeroInt64(0); + if ((aFrequencyOne<0) || (aFrequencyTwo<0) || + (aDuration.Int64() < zeroInt64)) + { + User::Leave(KErrArgument); + } + if (!iDevSoundObserver) + { + User::Leave(KErrNotReady); + } + iDualToneGen.SetFrequencyAndDuration(aFrequencyOne, + aFrequencyTwo, + aDuration); + StartPlayDualToneL(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::PlayDTMFStringL +// Initializes audio device and start playing DTMF string aDTMFString. +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::PlayDTMFStringL( + const TDesC& aDTMFString) + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::PlayDTMFStringL")); + + if (!iDevSoundObserver) + { + User::Leave(KErrNotReady); + } + if (iMode!= EMMFStateTonePlaying) + { + //tone playing only supported in tone play state + User::Leave(KErrNotSupported); + } + iDTMFGen.SetString(aDTMFString); + StartPlayDTMFStringL(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::PlayToneSequenceL +// Initializes audio device and start playing tone sequence. +// +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::PlayToneSequenceL(const TDesC8& aData) + { + DEBPRN1( + _L("CMMFDevSoundAdaptationStub[0x%x]::CBody::PlayToneSequenceL:Length[%d]"), + aData.Length()); + + if (!iDevSoundObserver) + { + User::Leave(KErrNotReady); + } + if (iMode!= EMMFStateTonePlaying) + { + //tone playing only supported in tone play state + User::Leave(KErrNotSupported); + } + + InitializeDevSoundUtilL(); + // Check whether the sequence is valid or not + if (!iDevSoundUtil->RecognizeSequence(aData)) + { + User::Leave(KErrCorrupt); + } + + // For playing Tone sequence, we don't use PCM generator. + // We use a timer instead + // iSequenceGen.SetSequenceData(aData); + + if (!iTonePlayCompleteTimer) + { + iTonePlayCompleteTimer = + CTonePlayCompleteTimer::NewL(*iDevSoundObserver); + } + // Determine the time out based on iRepeatCount and number of notes + // in the sequence + TUint repeats = ((iRepeatCount > 0) ? iRepeatCount : 1); + TTimeIntervalMicroSeconds32 time(KToneNotePlayTime*aData.Length()*repeats); + iTonePlayCompleteTimer->SetTimeOut(time); + + StartPlayToneSequenceL(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::PlayFixedSequenceL +// Initializes audio device and start playing the specified pre-defined tone +// sequence. +// +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::PlayFixedSequenceL(TInt aSequenceNumber) + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::PlayFixedSequenceL")); + + if (!iDevSoundObserver) + { + User::Leave(KErrNotReady); + } + if (iMode!= EMMFStateTonePlaying) + { + //tone playing only supported in tone play state + User::Leave(KErrNotSupported); + } + ASSERT((aSequenceNumber >= 0) && + (aSequenceNumber < iFixedSequences->Count())); + + iFixedSequence.Set(iFixedSequences->MdcaPoint(aSequenceNumber)); + iSequenceGen.SetSequenceData(iFixedSequence); + + StartPlayToneSequenceL(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::SetToneRepeats +// Defines the number of times the audio is to be repeated during the tone +// playback operation. A period of silence can follow each playing of tone. +// The tone playing can be repeated indefinitely. +// Supported only during tone playing. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::SetToneRepeats( + TInt aRepeatCount, + const TTimeIntervalMicroSeconds& aRepeatTrailingSilence) + { + iRepeatCount = aRepeatCount; + iRepeatTrailingSilence = aRepeatTrailingSilence; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::SetDTMFLengths +// Defines the duration of tone on, tone off and tone pause to be used during the +// DTMF tone playback operation. +// Supported only during tone playing. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::SetDTMFLengths( + TTimeIntervalMicroSeconds32& aToneOnLength, + TTimeIntervalMicroSeconds32& aToneOffLength, + TTimeIntervalMicroSeconds32& aPauseLength) + { + + if(aToneOnLength.Int() < KMdaInfiniteDurationDTMFToneOnLength) + { + aToneOnLength = TTimeIntervalMicroSeconds32(0); + } + if(aToneOffLength.Int() < 0) + { + aToneOffLength = TTimeIntervalMicroSeconds32(0); + } + if(aPauseLength.Int() < 0) + { + aPauseLength = TTimeIntervalMicroSeconds32(0); + } + + iDTMFGen.SetToneDurations(aToneOnLength,aToneOffLength,aPauseLength); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::SetVolumeRamp +// Defines the period over which the volume level is to rise smoothly from +// nothing to the normal volume level. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::SetVolumeRamp( + const TTimeIntervalMicroSeconds& aRampDuration) + { + // save ramp duration for tone generator + iRampDuration = aRampDuration; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::SetPrioritySettings +// Defines the priority settings that should be used for this instance. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::SetPrioritySettings( + const TMMFPrioritySettings& /*aPrioritySettings*/) + { + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::CustomInterface +// @see sounddevice.h +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TAny* CMMFDevSoundAdaptation::CBody::CustomInterface(TUid aInterfaceId) + { +// Note: These can only be uncommented when supported by the +// MessageHandlerFactory and CustomInterfaceProxyFactory stubs. +// Will result in memory leak if re-enabled without updating of +// the proxy and message factory stubs. +// + DEBPRN1( + _L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:InterfaceId[0x%x]"), + aInterfaceId); + + if (aInterfaceId == KUidSpeechEncoderConfig) + { + TRAP_IGNORE(iSpeechEncoderConfigCI = CSpeechEncoderConfigCI::NewL()); + DEBPRN0( + _L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CSpeechEncoderConfigCI...")); + return iSpeechEncoderConfigCI; + } + else if (aInterfaceId == KUidErrorConcealmentIntfc) + { + TRAP_IGNORE(iErrorConcealmentIntfcCI = CErrorConcealmentIntfcCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CErrorConcealmentIntfcCI...")); + return iErrorConcealmentIntfcCI; + } + else if (aInterfaceId == KUidG711DecoderIntfc) + { + TRAP_IGNORE(iG711DecoderIntfcCI = CG711DecoderIntfcCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CG711DecoderIntfcCI...")); + return iG711DecoderIntfcCI; + } + else if (aInterfaceId == KUidG729DecoderIntfc) + { + TRAP_IGNORE(iG729DecoderIntfcCI = CG729DecoderIntfcCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CG729DecoderIntfcCI...")); + return iG729DecoderIntfcCI; + } + else if (aInterfaceId == KUidIlbcDecoderIntfc) + { + TRAP_IGNORE(iIlbcDecoderIntfcCI = CIlbcDecoderIntfcCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CIlbcDecoderIntfcCI...")); + return iIlbcDecoderIntfcCI; + } + else if (aInterfaceId == KUidG711EncoderIntfc) + { + TRAP_IGNORE(iG711EncoderIntfcCI = CG711EncoderIntfcCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CG711EncoderIntfcCI...")); + return iG711EncoderIntfcCI; + } + else if (aInterfaceId == KUidG729EncoderIntfc) + { + TRAP_IGNORE(iG729EncoderIntfcCI = CG729EncoderIntfcCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CG729EncoderIntfcCI...")); + return iG729EncoderIntfcCI; + } + else if (aInterfaceId == KUidIlbcEncoderIntfc) + { + TRAP_IGNORE(iIlbcEncoderIntfcCI = CIlbcEncoderIntfcCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CIlbcEncoderIntfcCI...")); + return iIlbcEncoderIntfcCI; + } + else if (aInterfaceId == KUidAudioInput) + { + CAudioInputCI* retCI(NULL); + TRAP_IGNORE(retCI = CAudioInputCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CAudioInputCI...")); + return retCI; + } + else if(aInterfaceId == KUidAudioOutput) + { + CAudioOutputCI* retCI(NULL); + TRAP_IGNORE(retCI = CAudioOutputCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CAudioOutputCI...")); + return retCI; + }/* + else if (aInterfaceId == KUidSbcEncoderIntfc) + { + TRAP_IGNORE(iSbcEncoderIntfcCI = CSbcEncoderIntfcCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CSbcEncoderIntfcCI...")); + return iSbcEncoderIntfcCI; + } + else if (aInterfaceId == KUidAudioVibraControl) + { + TRAP_IGNORE(iAudioVibraControlCI = CAudioVibraControlCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CAudioVibraControlCI...")); + return iAudioVibraControlCI; + } + else if (aInterfaceId == KUidAudioResource) + { + CAudioResourceCIStub* retCI(NULL); + TRAP_IGNORE(retCI = CAudioResourceCIStub::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CAudioResourceCIStub...")); + return retCI; + } + else if (aInterfaceId == KUidAudioEqualizerEffect) + { + CAudioEqualizerCI* retCI(NULL); + TRAP_IGNORE(retCI = CAudioEqualizerCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CAudioEqualizerCI...")); + return retCI; + } + else if (aInterfaceId == KUidEnvironmentalReverbEffect) + { + CEnvironmentalReverbCI* retCI(NULL); + TRAP_IGNORE(retCI = CEnvironmentalReverbCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CEnvironmentalReverbCI...")); + return retCI; + } + else if (aInterfaceId == KUidStereoWideningEffect) + { + CStereoWideningCI* retCI(NULL); + TRAP_IGNORE(retCI = CStereoWideningCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CStereoWideningCI...")); + return retCI; + } + else if (aInterfaceId == KUidBassBoostEffect) + { + CBassBoostCI* retCI(NULL); + TRAP_IGNORE(retCI = CBassBoostCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CBassBoostCI...")); + return retCI; + } + else if (aInterfaceId == KUidSourceDopplerEffect) + { + CSourceDopplerCI* retCI(NULL); + TRAP_IGNORE(retCI = CSourceDopplerCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CSourceDopplerCI...")); + return retCI; + } + else if (aInterfaceId == KUidListenerDopplerEffect) + { + CListenerDopplerCI* retCI(NULL); + TRAP_IGNORE(retCI = CListenerDopplerCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CListenerDopplerCI...")); + return retCI; + } + else if (aInterfaceId == KUidListenerLocationEffect) + { + CListenerLocationCI* retCI(NULL); + TRAP_IGNORE(retCI = CListenerLocationCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CListenerLocationCI...")); + return retCI; + } + else if (aInterfaceId == KUidSourceLocationEffect) + { + CSourceLocationCI* retCI(NULL); + TRAP_IGNORE(retCI = CSourceLocationCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CSourceLocationCI...")); + return retCI; + } + else if (aInterfaceId == KUidListenerOrientationEffect) + { + CListenerOrientationCI* retCI(NULL); + TRAP_IGNORE(retCI = CListenerOrientationCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CListenerOrientationCI...")); + return retCI; + } + else if (aInterfaceId == KUidSourceOrientationEffect) + { + CSourceOrientationCI* retCI(NULL); + TRAP_IGNORE(retCI = CSourceOrientationCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CSourceOrientationCI...")); + return retCI; + } + else if (aInterfaceId == KUidDistanceAttenuationEffect) + { + CDistanceAttenuationCI* retCI(NULL); + TRAP_IGNORE(retCI = CDistanceAttenuationCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CDistanceAttenuationCI...")); + return retCI; + } + else if (aInterfaceId == KUidLoudnessEffect) + { + CLoudnessCI* retCI(NULL); + TRAP_IGNORE(retCI = CLoudnessCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CLoudnessCI...")); + return retCI; + } + else if (aInterfaceId == KUidAddedDevSoundControlInterface) + { + CAddedDevSoundControlCI* retCI(NULL); + TRAP_IGNORE(retCI = CAddedDevSoundControlCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CAddedDevSoundControlCI...")); + return (MAddedDevSoundControl*)retCI; + } + else if (aInterfaceId == KUidRestrictedAudioOutput) + { + CRestrictedAudioOutputCI* retCI(NULL); + TRAP_IGNORE(retCI = CRestrictedAudioOutputCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CRestrictedAudioOutputCI...")); + return retCI; + } + else if (aInterfaceId == KUidAacDecoderConfig) + { + TRAP_IGNORE(iAacDecoderConfigCI = CAacDecoderConfigCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CAacDecoderConfigCI...")); + return iAacDecoderConfigCI; + } + else if (aInterfaceId == KUidEAacPlusDecoderIntfc) + { + TRAP_IGNORE(iEAacPlusDecoderConfigCI = CEAacPlusDecoderIntfcCI::NewL()); + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning CEAacPlusDecoderIntfcCI...")); + return iEAacPlusDecoderConfigCI; + }*/ + else + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::CustomInterface:returning NULL...")); + return NULL; + } + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::FixedSequenceCount +// Returns the number of available pre-defined tone sequences. +// This is the number of fixed sequence supported by DevSound by default. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::FixedSequenceCount() + { + return iFixedSequences->Count(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::FixedSequenceName +// Returns the name assigned to a specific pre-defined tone sequence. +// This is the number of fixed sequence supported by DevSound by default. +// The function raises a panic if sequence number specified invalid. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +const TDesC& CMMFDevSoundAdaptation::CBody::FixedSequenceName( + TInt aSequenceNumber) + { + ASSERT((aSequenceNumber >= 0) && + (aSequenceNumber < iFixedSequences->Count())); + + TRAPD(err, InitializeDevSoundUtilL()); + if (err == KErrNone) + { + return iDevSoundUtil->FixedSequenceName(aSequenceNumber); + } + else + { + return KNullDesC; + } + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::GetSupportedInputDataTypesL +// @see sounddevice.h +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::GetSupportedInputDataTypesL( + RArray& aSupportedDataTypes, + const TMMFPrioritySettings& /*aPrioritySettings*/) const + { + //aPrioritySettings not used on ref DevSound + //search for playing datatypes + InitializeDevSoundUtilL(); + iDevSoundUtil->SeekHwDevicePluginsL(aSupportedDataTypes, EMMFStatePlaying); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::GetSupportedOutputDataTypesL +// @see sounddevice.h +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::GetSupportedOutputDataTypesL( + RArray& aSupportedDataTypes, + const TMMFPrioritySettings& /*aPrioritySettings*/) const + { + //aPrioritySettings not used on ref DevSound + // search for recording datatypes + InitializeDevSoundUtilL(); + iDevSoundUtil->SeekHwDevicePluginsL(aSupportedDataTypes, + EMMFStateRecording); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::SetClientConfig +// Sets client capabilities for this instance of DevSound Adaptation. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::SetClientConfig( + const TMMFClientConfig& aClientConfig) + { + iClientConfig = aClientConfig; + } + +// ----------------------------------------------------------------------------- +// TMMFClientConfig& CMMFDevSoundAdaptation::CBody::ClientConfig +// Returns client capabilities of this instance of DevSound Adaptation. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +const TMMFClientConfig& CMMFDevSoundAdaptation::CBody::ClientConfig() const + { + return iClientConfig; + } + +/******************************************************************************** + * Implementations of Non Exported public functions begins here * + ********************************************************************************/ + +////////////////////////////////////////////////////////////////////////////////// +// Audio Policy specific implementation begins here // +////////////////////////////////////////////////////////////////////////////////// + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::StartPlayDataL +// Called by Audio Policy Server when a request to play is approved by the +// Audio Policy Server. +// +// Leaves on failure??. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::StartPlayDataL() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::StartPlayDataL")); + + ASSERT(iMode== EMMFStatePlaying); + + TInt error = KErrNone; + + if(iCMMFHwDevice) + { + // Initialize attribute values + iPlayedBytesCount = 0; + iLastBufferReceived = EFalse; + + // Start HwDevice + if (iCMMFHwDevice->IsActive()) + { + iCMMFHwDevice->Cancel(); + } + error = iCMMFHwDevice->Start(EDevDecode, EDevOutFlow); + } + else + { + error = KErrNotReady; + } + + if (error != KErrNone) + { + iDevSoundObserver->PlayError(error); + } + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::StartRecordDataL +// Called by Audio Policy Server when a request to record is approved by the +// Audio Policy Server. +// +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::StartRecordDataL() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::StartRecordDataL")); + + ASSERT(iMode== EMMFStateRecording); + + if(iCMMFHwDevice) + { + TInt error = KErrNone; + // Initialize attribute values + iRecordedBytesCount = 0; + + if (iCMMFHwDevice->IsActive()) + { + iCMMFHwDevice->Cancel(); + } + error = iCMMFHwDevice->Start(EDevEncode, EDevInFlow); + + if (iHwDeviceBuffer) + { + iHwDeviceBuffer->SetLastBuffer(EFalse); + } + if (error != KErrNone) + { + iDevSoundObserver->RecordError(error); + return; + } + } + else + { + iDevSoundObserver->RecordError(KErrNotReady); + } + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::StartPlayToneL +// Called by Audio Policy Server when a request to play tone is approved by +// the Audio Policy Server. +// +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::StartPlayToneL() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::StartPlayToneL")); + + ASSERT(iMode== EMMFStateTonePlaying); + + if(iCMMFHwDevice) + { + // Initialize attribute values + iPlayedBytesCount = 0; + + // Configure tone generator + iToneGen.Configure( + KToneSamplingRate, + KToneChannels, + iRepeatCount, + I64LOW((iRepeatTrailingSilence.Int64()*KToneSamplingRate)/1000000), + I64LOW((iRampDuration.Int64()*KToneSamplingRate)/1000000) + ); + + iCurrentGenerator = &iToneGen; + + // Start playback + DoPlayL(); + + } + else + { + iDevSoundObserver->ToneFinished(KErrNotReady); + } + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::StartPlayDualToneL +// Called by Audio Policy Server when a request to play a dual tone is approved +// by the Audio Policy Server. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::StartPlayDualToneL() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::StartPlayDualToneL")); + + ASSERT(iMode== EMMFStateTonePlaying); + + if(iCMMFHwDevice) + { + // Initialize attribute values + iPlayedBytesCount = 0; + + // Configure dual tone generator + iDualToneGen.Configure( + KToneSamplingRate, + KToneChannels, + iRepeatCount, + I64LOW((iRepeatTrailingSilence.Int64() + *KToneSamplingRate)/KOneMillionMicroSeconds), + I64LOW((iRampDuration.Int64() + *KToneSamplingRate)/KOneMillionMicroSeconds) + ); + + iCurrentGenerator = &iDualToneGen; + + // Start playback + DoPlayL(); + } + else + iDevSoundObserver->ToneFinished(KErrNotReady); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::StartPlayDTMFStringL +// Called by Audio Policy Server when a request to play DTMF String is approved +// by the Audio Policy Server. +// +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::StartPlayDTMFStringL() + { + DEBPRN0( + _L("CMMFDevSoundAdaptationStub[0x%x]::CBody::StartPlayDTMFStringL")); + + ASSERT(iMode== EMMFStateTonePlaying); + + if(iCMMFHwDevice) + { + TInt error = KErrNone; + // Initialize attribute values + iPlayedBytesCount = 0; + + iDTMFGen.Configure( + KToneSamplingRate, + KToneChannels, + iRepeatCount, + I64LOW((iRepeatTrailingSilence.Int64()*KToneSamplingRate)/1000000), + I64LOW((iRampDuration.Int64()*KToneSamplingRate)/1000000) + ); + + iCurrentGenerator = &iDTMFGen; + + // Start playback + //need to trap this as we can leave with KErrUnderflow + //if there was no data to play - the error has already + //been sent to the observer and we don't want to call RunError + TRAP(error,DoPlayL()); + if ((error != KErrUnderflow)&&(error != KErrNone)) + { + User::Leave(error); + } + } + else + { + iDevSoundObserver->ToneFinished(KErrNotReady); + } + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::StartPlayToneSequenceL +// Called by Audio Policy Server when a request to play tone sequence is +// approved by the Audio Policy Server. +// +// Leaves on failure. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::StartPlayToneSequenceL() + { + DEBPRN0( + _L("CMMFDevSoundAdaptationStub[0x%x]::CBody::StartPlayToneSequenceL")); + + ASSERT(iMode == EMMFStateTonePlaying); + + // For playing Tone sequence, we don't use PCM generator. + // We use a timer instead +/* + if(iCMMFHwDevice) + { + // Initialize attribute values + iPlayedBytesCount = 0; + + iSequenceGen.Configure( + KToneSamplingRate, + KToneChannels, + iRepeatCount, + I64LOW((iRepeatTrailingSilence.Int64()*KToneSamplingRate)/1000000), + I64LOW((iRampDuration.Int64()*KToneSamplingRate)/1000000) + ); + + iCurrentGenerator = &iSequenceGen; + + // Start playback + DoPlayL(); + } + else + iDevSoundObserver->ToneFinished(KErrNotReady); +*/ + if (iTonePlayCompleteTimer->IsActive()) + { + iTonePlayCompleteTimer->Cancel(); + } + iTonePlayCompleteTimer->Start(); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::FillThisHwBuffer +// MMMFHwDeviceObserver mixin implementation. +// The CMMFHwDevice implementation object calls this method during decoding +// (playing), when it needs the encoded data in the buffer +// aHwDataBuffer. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::FillThisHwBuffer( + CMMFBuffer& aHwDataBuffer) + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::FillThisHwBuffer")); + + TInt err = KErrNone; + // Keep a reference to this Hw data Buffer. We need to send the + // reference back to HwDevice implementation + iHwDeviceBuffer = static_cast (&aHwDataBuffer); + // Set the request length, From HwDevice this comes with buffer + // length. + TInt len = iHwDeviceBuffer->Data().MaxLength(); + // Ignore error. since buffer size = Buffer Length + TRAP(err, iHwDeviceBuffer->SetRequestSizeL(len)); + + if (iMode== EMMFStatePlaying) // Get Data from Observer + { + if (iLastBufferReceived) + { + iHwDeviceBuffer->Data().SetLength(0); + // Pass the buffer to the he device + err = iCMMFHwDevice->ThisHwBufferFilled(*iHwDeviceBuffer); + } + else + { + // Pass the buffer to the observer + iDevSoundObserver->BufferToBeFilled(&aHwDataBuffer); + } + } + else if (iMode== EMMFStateTonePlaying) + { + // Hw device will call this method right after its Start was called. + // When it calls this for the first time it hasn't played one single + // buffer yet so check that. + // In this case there's no need to set the active buffer as it's already + // waiting to be played. + if (!iFirstCallFromHwDevice) + { + SetActiveToneBuffer(); + } + + // If there is no data in the active buffer, tone play is finished. + // DevSound just have to wait for completion event from audio device. + if (iActiveToneBuffer->Data().Length() > 0) + { + len = iActiveToneBuffer->Data().Length(); + // Copy data from tone buffer to hw device buffer + Mem::Copy((TAny*)(iHwDeviceBuffer->Data().Ptr()), + (TAny*)(iActiveToneBuffer->Data().Ptr()), + len); + + iHwDeviceBuffer->Data().SetLength(len); + if (len < iHwDeviceBuffer->RequestSize()) + { + iHwDeviceBuffer->SetLastBuffer(ETrue); + } + // Play data and try to generate next data block + err = iCMMFHwDevice->ThisHwBufferFilled(*iHwDeviceBuffer); + if (err != KErrNone) + { + return err; + } + + // Check again whether this is the first call from Hw device. + // FillFreeToneBuffer assumes the iActiveToneBuffer has already + // been played. + if (!iFirstCallFromHwDevice) + { + err = FillFreeToneBuffer(); + } + else + { + iFirstCallFromHwDevice = EFalse; // Reset flag + } + } + else if (iFirstCallFromHwDevice) + { + //we have no data in the tone buffer and thus have no + //outstanding requests to play + err = KErrUnderflow; //simulate underrun + iHwDeviceBuffer->SetLastBuffer(ETrue); + // Play data and try to generate next data block + err = iCMMFHwDevice->ThisHwBufferFilled(*iHwDeviceBuffer); + if (err != KErrNone) + { + return err; + } + } + + // If there was an error filling the buffer could be corrupt data + // notify the client and stop playing.Set err to KErrNone. + if (err != KErrNone) + { + Error(err);//Updates Bytes played informs client + err = KErrNone; + iCMMFHwDevice->Stop();//unloads sound device + Stopped();//Updates policy + } + } + else + { + err = KErrGeneral; + iDevSoundObserver->PlayError(KErrGeneral); + } + return err; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::EmptyThisHwBuffer +// MMMFHwDeviceObserver mixin implementation. +// The CMMFHwDevice implementation object calls this method during encoding +// (recording), when it fills the buffer aHwDataBuffer with +// encoded data. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::EmptyThisHwBuffer( + CMMFBuffer& aHwDataBuffer) + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::EmptyThisHwBuffer")); + + TInt err = KErrNone; + if(iMode== EMMFStateRecording) + { + // Keep a reference to this Hw data Buffer. We need to send the + // reference back to HwDevice implementation + iHwDeviceBuffer = static_cast(&aHwDataBuffer); + + // Set the request length, From HwDevice this comes with buffer + // length. MMF will use RequestSize attribute of the buffer. + // We can avoid this by setting in HwDevice implemenation + TInt len = iHwDeviceBuffer->Data().Length(); + iRecordedBytesCount += len; + TRAP(err, iHwDeviceBuffer->SetRequestSizeL(len)); + + // if we're pausing (i.e. flushing) set the last buffer flag + // when we get an empty buffer from the logical driver + if(iPaused && iHwDeviceBuffer->Data().Length() == 0) + { + iPaused = EFalse; + iHwDeviceBuffer->SetLastBuffer(ETrue); + } + + // Send Data from Observer + iDevSoundObserver->BufferToBeEmptied(iHwDeviceBuffer); + } + else + { + err = KErrGeneral; + iDevSoundObserver->RecordError(KErrGeneral); + } + + return err; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::MsgFromHwDevice +// MMMFHwDeviceObserver mixin implementation. +// The CMMFHwDevice implementation object calls this method when a message from +// the hardware device implementation is received. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::MsgFromHwDevice( + TUid /*aMessageType*/, + const TDesC8& /*aMsg*/) + { + return KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::Stopped +// MMMFHwDeviceObserver mixin implementation. +// +// The CMMFHwDevice implementation object calls this method when the current +// encode or decode task is finished or stopped. The policy state is updated +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::Stopped() + { + //for swcodec wrap hw devices bytes played updated in MsgFromHwDevice + //but non Swcodec wrappers hw devices may do it differently also don't + //know if non Swcodec wrap hw device will call Stopped or Error first + iLastBufferReceived = EFalse; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::Error +// MMMFHwDeviceObserver mixin implementation +// Processes error from hw device +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::Error( + TInt aError) + { + DEBPRN1(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::Error(%d)"), aError); + + if (iMode== EMMFStatePlaying) + { + iDevSoundObserver->PlayError(aError); + } + else if (iMode== EMMFStateRecording) + { + iDevSoundObserver->RecordError(aError); + } + else if (iMode== EMMFStateTonePlaying) + { + if (aError == KErrUnderflow) + { + iDevSoundObserver->ToneFinished(KErrNone); + } + else + { + iDevSoundObserver->ToneFinished(aError); + } + } + //else can't handle error + } + +/******************************************************************************** + * Non Exported public functions ends here * + ********************************************************************************/ + + +/******************************************************************************** + * Private functions begins here * + ********************************************************************************/ + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::DoPlayL +// Creates buffer and begin playback using the specified tone generator. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::DoPlayL() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::DoPlayL")); + + // Delete any buffer from previous call and try to create maximum buffer + // size. Double Buffer the Tone data. + if (iToneBuffer1) + { + delete iToneBuffer1; + iToneBuffer1 = NULL; + } + + iToneBuffer1 = CMMFDataBuffer::NewL(KDevSoundDefaultFrameSize); + User::LeaveIfError(iCurrentGenerator->FillBuffer(iToneBuffer1->Data())); + + if (iToneBuffer2) + { + delete iToneBuffer2; + iToneBuffer2 = NULL; + } + iToneBuffer2 = CMMFDataBuffer::NewL(KDevSoundDefaultFrameSize); + User::LeaveIfError(iCurrentGenerator->FillBuffer(iToneBuffer2->Data())); + + // Assign active buffer + iActiveToneBuffer = iToneBuffer1; + + // Hw device hasn't played anything yet so don't change + // active buffer. This is checked in FillThisHwBuffer. + iFirstCallFromHwDevice = ETrue; + + // Start HwDevice to play data + if (iCMMFHwDevice->IsActive()) + { + iCMMFHwDevice->Cancel(); + } + User::LeaveIfError(iCMMFHwDevice->Start(EDevDecode, EDevOutFlow)); + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::SetActiveToneBuffer +// This method assigns the other buffer as active buffer. The tone audio +// generator should fill data in the other buffer by now. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::SetActiveToneBuffer() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::SetActiveToneBuffer")); + + if (iActiveToneBuffer == iToneBuffer1) + { + iActiveToneBuffer = iToneBuffer2; + } + else if (iActiveToneBuffer == iToneBuffer2) + { + iActiveToneBuffer = iToneBuffer1; + } + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::FillFreeToneBuffer +// This method fills data into the free buffer. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::FillFreeToneBuffer() + { + DEBPRN0(_L("CMMFDevSoundAdaptationStub[0x%x]::CBody::FillFreeToneBuffer")); + + TInt err(KErrNone); + if (iActiveToneBuffer == iToneBuffer1) + { + err = iCurrentGenerator->FillBuffer(iToneBuffer2->Data()); + } + else if (iActiveToneBuffer == iToneBuffer2) + { + err = iCurrentGenerator->FillBuffer(iToneBuffer1->Data()); + } + return err; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::InitTask +// Initializes audio device node by setting volume, and sampling rate. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::InitTask() + { + // No Implementation + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::SamplingFrequency +// Returns an integer representing Sampling Frequency the device is currently +// configured to. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::SamplingFrequency() + { + if(iDeviceConfig.iRate == EMMFSampleRate8000Hz) + { + return 8000; + } + else if(iDeviceConfig.iRate == EMMFSampleRate11025Hz) + { + return 11025; + } + else if(iDeviceConfig.iRate == EMMFSampleRate12000Hz) + { + return 12000; + } + else if(iDeviceConfig.iRate == EMMFSampleRate16000Hz) + { + return 16000; + } + else if(iDeviceConfig.iRate == EMMFSampleRate22050Hz) + { + return 22050; + } + else if(iDeviceConfig.iRate == EMMFSampleRate24000Hz) + { + return 24000; + } + else if(iDeviceConfig.iRate == EMMFSampleRate32000Hz) + { + return 32000; + } + else if(iDeviceConfig.iRate == EMMFSampleRate44100Hz) + { + return 44100; + } + else if(iDeviceConfig.iRate == EMMFSampleRate48000Hz) + { + return 48000; + } + else if(iDeviceConfig.iRate == EMMFSampleRate88200Hz) + { + return 88200; + } + else if(iDeviceConfig.iRate == EMMFSampleRate96000Hz) + { + return 96000; + } + else + { + return 8000; //default + } + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::NumberOfChannels +// Returns an integer representing number of channels the device is currently +// configured to. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::NumberOfChannels() + { + if(iDeviceConfig.iChannels == EMMFMono) + { + return 1; + } + else + { + return 2; + } + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::BytesPerAudioSample +// Returns an integer representing number of bytes in each audio sample +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMMFDevSoundAdaptation::CBody::BytesPerAudioSample() + { + TInt bytes=1; + switch (iDeviceConfig.iEncoding) + { + case EMMFSoundEncoding8BitPCM: + case EMMFSoundEncoding8BitALaw: + case EMMFSoundEncoding8BitMuLaw: + { + bytes=1; + } + break; + case EMMFSoundEncoding16BitPCM: + { + bytes=2; + } + break; + } + return bytes; + } + +// ----------------------------------------------------------------------------- +// CMMFDevSoundAdaptation::CBody::InitializeDevSoundUtilL +// Initializes DevSoundUtil object. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMMFDevSoundAdaptation::CBody::InitializeDevSoundUtilL() const + { + if (!iDevSoundUtil) + { + DEBPRN0( + _L("CMMFDevSoundAdaptationStub[0x%x]::CBody::InitializeDevSoundUtilL:ENTER")); + + iDevSoundUtil = CMMFDevSoundUtility::NewL(); + + // Initialize Fixed sequence related + DEBPRN0( + _L("CMMFDevSoundAdaptationStub[0x%x]::CBody::InitializeDevSoundUtilL")); + iDevSoundUtil->InitializeFixedSequenceL(&iFixedSequences); + + DEBPRN0( + _L("CMMFDevSoundAdaptationStub[0x%x]::CBody::InitializeDevSoundUtilL")); + } + + } + +//End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/MmfDevSoundAdaptationBody.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/MmfDevSoundAdaptationBody.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,867 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Declaration of CMMFDevSoundAdaptation::CBody. +* +*/ + + + +#ifndef MMFDEVSOUNDADAPTATIONBODY_H +#define MMFDEVSOUNDADAPTATIONBODY_H + +// INCLUDES +#include +#include +#include +//#include +#include "ToneGenerator.h" +#include "DevSoundUtility.h" + + +// CONSTANTS +const TInt KDevSoundDefaultFrameSize = 0x1000; +const TInt KDevSoundMinFrameSize = 0x800; //2K +const TInt KDevSoundMaxFrameSize = 0x4000; //16K +const TInt KDevSoundDeltaFrameSize = 0x800; //2K +const TInt KDevSoundFramesPerSecond = 4; + +// FORWARD DECLARATIONS +class CMMFHwDeviceStub; +class CTonePlayCompleteTimer; +class CBytesPlayedCIImpl; + +class CG711DecoderIntfcCI; +class CG711EncoderIntfcCI; +class CG729DecoderIntfcCI; +class CG729EncoderIntfcCI; +class CIlbcDecoderIntfcCI; +class CIlbcEncoderIntfcCI; +class CSpeechEncoderConfigCI; +class CErrorConcealmentIntfcCI; + +// CLASS DECLARATION + +/** +* Class implementing CMMFDevSoundAdaptation behaviour. +* +* @lib MmfDevSoundAdaptation_Stub.lib +* @since S60 3.0 +*/ +class CMMFDevSoundAdaptation::CBody : public CBase, + public MMMFHwDeviceObserver + { + public: // Constructors and destructor + + /** + * Constructs, and returns a pointer to, a new CBody object. + * Leaves on failure.. + * @return CBody* A pointer to newly created object. + */ + static CBody* NewL(); + + /** + * Destructor. + */ + ~CBody(); + + public: // New functions + + /** + * Initializes to raw audio data PCM16 and Sampling Rate of 8 KHz. + * On completion of Initialization, calls InitializeComplete() on + * aDevSoundObserver. + * Leaves on failure. + * @since S60 3.0 + * @param MDevSoundAdaptationObserver& aDevSoundObserver A reference + * to the DevSound adaptation observer instance. + * @param TMMFState aMode Mode for which this object will be used. + * @return void + */ + void InitializeL(MDevSoundAdaptationObserver& aDevSoundObserver, + TMMFState aMode); + + /** + * Initializes DevSound object for the mode aMode for processing audio + * data with hardware device aHWDev. + * On completion of Initialization, calls InitializeComplete() on + * aDevSoundObserver. + * Leaves on failure. + * @since S60 3.0 + * @param MDevSoundAdaptationObserver& aDevSoundObserver A reference + * to the DevSound adaptation observer instance. + * @param TUid aHWDev The CMMFHwDevice implementation identifier. + * @param TMMFState aMode The mode for which this object will be used + * @return void + */ + void InitializeL(MDevSoundAdaptationObserver& aDevSoundObserver, + TUid aHWDev, TMMFState aMode); + + /** + * Initializes DevSound object for the mode aMode for processing audio + * data with hardware device supporting FourCC aDesiredFourCC. + * Leaves on failure. + * @since S60 3.0 + * @param MDevSoundAdaptationObserver& aDevSoundObserver A reference + * to the DevSound adaptation observer instance. + * @param TFourCC aDesiredFourCC The CMMFHwDevice implementation FourCC + * code. + * @param TMMFState aMode The mode for which this object will be used + * @return KErrNone if successfull, else corresponding error code + * @return void + */ + void InitializeL(MDevSoundAdaptationObserver& aDevSoundObserver, + TFourCC aDesiredFourCC, + TMMFState aMode); + + /** + * Returns the supported Audio settings ie. encoding, sample rates, + * mono/stereo operation, buffer size etc.. + * @since S60 3.0 + * @return TMMFCapabilities The device settings. + */ + TMMFCapabilities Capabilities(); + + /** + * Returns the current device configuration. + * @since S60 3.0 + * @return TMMFCapabilities The device settings. + */ + TMMFCapabilities Config() const; + + /** + * Configure CMMFDevSound object with the settings in aConfig. Use this + * to set sampling rate, encoding and mono/stereo. + * Leaves on failure. + * @since S60 3.0 + * @param const TMMFCapabilities& aConfig The attribute values to which + * CMMFDevSound object will be configured to. + * @return void + */ + void SetConfigL(const TMMFCapabilities& aCaps); + + /** + * Returns an integer representing the maximum volume device supports. + * This is the maximum value which can be passed to + * CMMFDevSound::SetVolume. + * @since S60 3.0 + * @return TInt The maximum volume. This value is platform dependent but + * is always greater than or equal to one. + */ + TInt MaxVolume(); + + /** + * Returns an integer representing the current volume. + * @since S60 3.0 + * @return TInt The current volume level. + */ + TInt Volume(); + + /** + * Changes the current playback volume to a specified value. The volume + * can be changed before or during playback and is effective immediately. + * @since S60 3.0 + * @param TInt aVolume The volume setting. This can be any value from 0 + * to the value returned by a call to + * CMMFDevSound::MaxVolume(). If the volume is not + * within this range, the volume is automatically set + * to minimum or maximum value based on the value + * that is being passed. Setting a zero value mutes + * the sound. Setting the maximum value results in + * the loudest possible sound. + * @return void + */ + void SetVolume(TInt aVolume); + + /** + * Returns an integer representing the maximum gain the device supports. + * This is the maximum value which can be passed to CMMFDevSound::SetGain + * @since S60 3.0 + * @return TInt The maximum gain. This value is platform dependent but is + * always greater than or equal to one. + */ + TInt MaxGain(); + + /** + * Returns an integer representing the current gain. + * @since S60 3.0 + * @return TInt The current gain level. + */ + TInt Gain(); + + /** + * Changes the current recording gain to a specified value. The gain can + * be changed before or during recording and is effective immediately. + * @since S60 3.0 + * @param TInt aGain The gain setting. This can be any value from zero to + * the value returned by a call to + * CMMFDevSound::MaxGain(). If the volume + * is not within this range, the gain is automatically + * set to minimum or maximum value based on the value + * that is being passed. Setting a zero value mutes the + * sound. Setting the maximum value results in the + * loudest possible sound. + * @return void + */ + void SetGain(TInt aGain); + + /** + * Returns the speaker balance set for playing. + * Leaves on failure. + * @since S60 3.0 + * @param TInt &aLeftPercentage On return contains the left speaker + * volume percentage. + * @param TInt &aRightPercentage On return contains the right speaker + * volume percentage. + * @return void + */ + void GetPlayBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage); + + /** + * Sets the speaker balance for playing. The speaker balance can be + * changed before or during playback and is effective immediately. + * Leaves on failure. + * @since S60 3.0 + * @param TInt aLeftPercentage The left speaker volume percentage. This + * can be any value from zero to 100. Setting + * a zero value mutes the sound on left + * speaker. + * @param TInt aRightPercentage The right speaker volume percentage. + * This can be any value from zero to 100. + * Setting a zero value mutes the sound on + * right speaker. + * @return void + */ + void SetPlayBalanceL(TInt aLeftPercentage, TInt aRightPercentage); + + /** + * Returns the microphone gain balance set for recording. + * Leaves on failure. + * @since S60 3.0 + * @param TInt &aLeftPercentage On return contains the left microphone + * gain percentage. + * @param TInt &aRightPercentage On return contains the right microphone + * gain percentage. + * @return void + */ + void GetRecordBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage); + + /** + * Sets the microphone balance for recording. The microphone balance can + * be changed before or during recording and is effective immediately. + * Leaves on failure. + * @since S60 3.0 + * @param TInt aLeftPercentage The left microphone gain percentage. This + * can be any value from zero to 100. Setting + * a zero value mutes the sound from left + * microphone. + * @param TInt aRightPercentage The right microphone gain percentage. + * This can be any value from zero to 100. + * Setting a zero value mutes the sound from + * right microphone. + * @return void + */ + void SetRecordBalanceL(TInt aLeftPercentage, TInt aRightPercentage); + + /** + * Initializes the audio device and starts the play process. This + * function queries and acquires the audio policy before initializing + * audio device. If there was an error during policy initialization, + * PlayError() function will be called on the observer with error code + * KErrAccessDenied, otherwise BufferToBeFilled() function will be called + * with a buffer reference. After reading data into the buffer reference + * passed, the client should call PlayData() to play data. + * The amount of data that can be played is specified in + * CMMFBuffer::RequestSize(). Any data that is read into buffer beyond + * this size will be ignored. + * Leaves on failure. + * @since S60 3.0 + * @return void + */ + void PlayInitL(); + + /** + * Initializes the audio device and starts the record process. This + * function queries and acquires the audio policy before initializing + * audio device. If there was an error during policy initialization, + * RecordError() function will be called on the observer with error code + * KErrAccessDenied, otherwise BufferToBeEmptied() function will be + * called with a buffer reference. This buffer contains recorded or + * encoded data. After processing data in the buffer reference passed, + * the client should call RecordData() to continue recording process. + * The amount of data that is available is specified in + * CMMFBuffer::RequestSize(). + * Leaves on failure. + * @since S60 3.0 + * @return void + */ + void RecordInitL(); + + /** + * Plays data in the buffer at the current volume. + * The client should fill the buffer with audio data before calling this + * function. The observer gets a reference to the buffer along with the + * callback function BufferToBeFilled(). When playing of the audio sample + * is complete, successfully or otherwise, the function PlayError() on + * the observer is called. + * The last buffer of the audio stream being played should have the last + * buffer flag set using CMMFBuffer::SetLastBuffer(TBool). If a + * subsequent attempt to play the clip is made, this flag will need + * resetting by the client. + * @return void + */ + void PlayData(); + + /** + * Contine the process of recording. + * Once the buffer is filled with recorded data, the Observer gets a + * reference to the buffer along with the callback function + * BufferToBeEmptied(). After processing the buffer (copying over to a + * different buffer or writing to file) the client should call this + * function to continue the recording process. + * @return void + */ + void RecordData(); + + /** + * Stops the ongoing operation (Play, Record, TonePlay, Convert). + * @since S60 3.0 + * @return void + */ + void Stop(); + + /** + * Temporarily Stops the ongoing operation (Play, Record, TonePlay, + * Convert). + * @since S60 3.0 + * @return void + */ + void Pause(); + + /** + * Returns the Sample recorded so far + * @since S60 3.0 + * @return TInt Returns the samples recorded. + */ + TInt SamplesRecorded(); + + /** + * Returns the Sample played so far + * @since S60 3.0 + * @return TInt Returns the samples played. + */ + TInt SamplesPlayed(); + + /** + * Initializes the audio device and starts playing a tone. The tone is + * played with the frequency and duration specified. + * Leaves on failure. + * @since S60 3.0 + * @param TInt aFrequency The frequency at which the tone will be played. + * @param const TTimeIntervalMicroSeconds &aDuration The period over + * which the tone will be played. A zero value causes the no tone + * to be played. + * @return void + */ + void PlayToneL(TInt aFrequency, + const TTimeIntervalMicroSeconds& aDuration); + + /** + * Initializes audio device and starts playing a dual tone. Dual Tone is + * played with the specified frequencies and for the specified duration. + * Leaves on failure. + * @since S60 3.0 + * @param TInt aFrequencyOne The first frequency of dual tone. + * @param TInt aFrequencyTwo The second frequency of dual tone. + * @param const TTimeIntervalMicroSeconds &aDuration The period over + * which the tone will be played. A zero value causes the no tone + * to be played. + * @return void + */ + void PlayDualToneL(TInt aFrequencyOne, + TInt aFrequencyTwo, + const TTimeIntervalMicroSeconds& aDuration); + + /** + * Initializes the audio device and starts playing the DTMF string + * aDTMFString. + * Leaves on failure. + * @since S60 3.0 + * @param const TDesC &aDTMFString The DTMF sequence in a descriptor. + * @return void + */ + void PlayDTMFStringL(const TDesC& aDTMFString); + + /** + * Initializes the audio device and starts playing a tone sequence. + * Leaves on failure. + * @since S60 3.0 + * @param const TDesC8 &aData The tone sequence in a descriptor. + * @return void + */ + void PlayToneSequenceL(const TDesC8& aData); + + /** + * Initializes the audio device and starts playing the specified + * pre-defined tone sequence. + * Leaves on failure. + * @since S60 3.0 + * @param TInt aSequenceNumber The index identifying the specific + * pre-defined tone sequence. Index values are relative to zero. + * This can be any value from zero to the value returned by a call + * to FixedSequenceCount() - 1. The function raises a panic if the + * sequence number is not within this range. + * @return void + */ + void PlayFixedSequenceL(TInt aSequenceNumber); + + /** + * Defines the number of times the audio is to be repeated during the + * tone playback operation. A period of silence can follow each playing + * of a tone. The tone playing can be repeated indefinitely + * @since S60 3.0 + * @param TInt aRepeatCount The number of times the tone, together with + * the trailing silence, is to be repeated. If this is set to + * KMdaRepeatForever, then the tone, together with the trailing + * silence, is repeated indefinitely or until Stop() is called. + * If this is set to zero, then the tone is not repeated. + * @param const TTimeIntervalMicroSeconds &aRepeatTrailingSilence An + * interval of silence which will be played after each tone. + * Supported only during tone playing. + * @return void + */ + void SetToneRepeats( + TInt aRepeatCount, + const TTimeIntervalMicroSeconds& aRepeatTrailingSilence); + + /** + * Defines the duration of tone on, tone off and tone pause to be used + * during the DTMF tone playback operation. + * Supported only during tone playing. + * @since S60 3.0 + * @param TTimeIntervalMicroSeconds32 &aToneOnLength The period over + * which the tone will be played. If this is set to zero, then the + * tone is not played. + * @param TTimeIntervalMicroSeconds32 &aToneOffLength The period over + * which the no tone will be played. + * @param TTimeIntervalMicroSeconds32 &aPauseLength The period over which + * the tone playing will be paused. + * @return void + */ + void SetDTMFLengths(TTimeIntervalMicroSeconds32& aToneOnLength, + TTimeIntervalMicroSeconds32& aToneOffLength, + TTimeIntervalMicroSeconds32& aPauseLength); + + /** + * Defines the period over which the volume level is to rise smoothly + * from nothing to the normal volume level. + * The function is only available before playing. + * @since S60 3.0 + * @param const TTimeIntervalMicroSeconds &aRampDuration The period over + * which the volume is to rise. A zero value causes the tone + * sample to be played at the normal level for the full duration + * of the playback. A value, which is longer than the duration of + * the tone sample means that the sample never reaches its normal + * volume level. + * @return void + */ + void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration); + + /** + * Defines the priority settings that should be used for this instance. + * @since S60 3.0 + * @param const TMMFPrioritySettings &aPrioritySettings A class type + * representing the client's priority, priority preference and + * state + * @return void + */ + void SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings); + + /** + * Retrieves a custom interface to the device. + * @since S60 3.0 + * @param TUid aInterfaceId The interface UID, defined with the custom + * interface. + * @return TAny* A pointer to the interface implementation, or NULL if + * the device does not implement the interface requested. The + * return value must be cast to the correct type by the user. + */ + TAny* CustomInterface(TUid aInterfaceId); + + /** + * Returns the number of available pre-defined tone sequences. + * This is the number of fixed sequence supported by DevSound by default. + * @since S60 3.0 + * @return TInt The fixed sequence count. This value is implementation + * dependent. + */ + TInt FixedSequenceCount(); + + /** + * Returns the name assigned to a specific pre-defined tone sequence. + * This is the number of the fixed sequence supported by DevSound by + * default. + * The function raises a panic if sequence number specified is invalid. + * @since S60 3.0 + * @param TInt aSequenceNumber The index identifying the specific + * pre-defined tone sequence. Index values are relative to zero. + * This can be any value from zero to the value returned by a call + * to CMdaAudioPlayerUtility::FixedSequenceCount() - 1. The + * function raises a panic if sequence number is not within this + * range. + * @return const TDesC & A reference to a Descriptor containing the fixed + * sequence name indexed by aSequenceNumber. + */ + const TDesC& FixedSequenceName(TInt aSequenceNumber); + + /** + * Returns a list of the supported input datatypes that can be sent to + * DevSound for playing audio. The datatypes returned are those that the + * DevSound supports given the priority settings passed in + * aPrioritySettings. Note that if no supported data types are found this + * does not constitute failure, the function will return normally with no + * entries in aSupportedDataTypes. + * Leaves on failure. + * @since S60 3.0 + * @param RArray< TFourCC > &aSupportedDataTypes The array of supported + * data types that will be filled in by this function. The + * supported data types of the DevSound are in the form of an + * array of TFourCC codes. Any existing entries in the array will + * be overwritten on calling this function. If no supported data + * types are found given the priority settings, then the + * aSupportedDatatypes array will have zero entries. + * @param const TMMFPrioritySettings &aPrioritySettings The priority + * settings used to determine the supported datatypes. Note this + * does not set the priority settings. For input datatypes the + * iState member of the priority settings would be expected to be + * either EMMFStatePlaying or EMMFStatePlayingRecording. The + * priority settings may effect the supported datatypes depending + * on the audio routing. + * @return void + */ + void GetSupportedInputDataTypesL( + RArray& aSupportedDataTypesconst, + const TMMFPrioritySettings& aPrioritySettings) const; + + /** + * Returns a list of the supported output dataypes that can be received + * from DevSound for recording audio. The datatypes returned are those + * that the DevSound supports given the priority settings passed in + * aPrioritySettings. Note that if no supported data types are found this + * does not constitute failure, the function will return normally with no + * entries in aSupportedDataTypes. + * Leaves on failure. + * @since S60 3.0 + * @param RArray< TFourCC > &aSupportedDataTypes The array of supported + * data types that will be filled in by this function. The + * supported datatypes of the DevSound are in the form of an array + * of TFourCC codes. Any existing entries in the array will be + * overwritten on calling this function. If no supported datatypes + * are found given the priority settings, then the + * aSupportedDatatypes array will have zero entries. + * @param const TMMFPrioritySettings &aPrioritySettings The priority + * settings used to determine the supported data types. Note this + * does not set the priority settings. For output data types the + * iState member of the priority settings would expected to be + * either EMMFStateRecording or EMMFStatePlayingRecording. The + * priority settings may effect the supported datatypes depending + * on the audio routing. + * @return void + */ + void GetSupportedOutputDataTypesL( + RArray& aSupportedDataTypes, + const TMMFPrioritySettings& aPrioritySettings) const; + + /** + * Sets client configuration + * @since S60 3.0 + * @param TMMFClientConfig& aClientConfig A reference to client + * configuration object. + * @return void + */ + void SetClientConfig(const TMMFClientConfig& aClientConfig); + + /** + * Returns client configuration + * @since S60 3.0 + * @return const TMMFClientConfig& A constant reference to client + * configuration. + */ + const TMMFClientConfig& ClientConfig() const; + + // MMMFHwDeviceObserver implementation for CMMFHwDevice + + /** + * Callback function from CMMFHwDevice when it needs data. + * @since S60 3.0 + * @param CMMFBuffer& aHwBuffer A reference to CMMFBuffer in which the + * observer need to fill data into. + * @return TInt Error code. KErrNone if success. + */ + TInt FillThisHwBuffer(CMMFBuffer& aHwBuffer); + + /** + * Callback function from CMMFHwDevice when it has data. + * @since S60 3.0 + * @param CMMFBuffer& aHwBuffer A reference to CMMFBuffer in which the + * observer need to empty data from. + * @return TInt Error code. KErrNone if success. + */ + TInt EmptyThisHwBuffer(CMMFBuffer& aHwBuffer); + + /** + * Callback function from CMMFHwDevice. + * @since S60 3.0 + * @param TUid aMessageType A Uid identifying type of message. + * @param const TDesC8& aMsg.A reference to descriptor containing message + * information. + * @return TInt Error code. KErrNone if success. + */ + TInt MsgFromHwDevice(TUid aMessageType, const TDesC8& aMsg); + + /** + * Callback function from CMMFHwDevice when playing back/ recording is + * stopped.. + * @since S60 3.0 + * @return void + */ + void Stopped(); + + /** + * Callback function from CMMFHwDevice when there is a error during + * playback and/or recording. + * @since S60 3.0 + * @param TInt aError A systemwide error code. + * @return void + */ + void Error(TInt aError); + + // CMMFHwDevice implementation ends + + private: + + /** + * Called by Audio Policy Server when play reqeust is granted + * Leaves on failure. + * @since S60 3.0 + * @return void + */ + void StartPlayDataL(); + + /** + * Called by Audio Policy Server when record reqeust is granted + * Leaves on failure. + * @since S60 3.0 + * @return void + */ + void StartRecordDataL(); + + /** + * Called by Audio Policy Server when play tone reqeust is granted + * Leaves on failure. + * @since S60 3.0 + * @return void + */ + void StartPlayToneL(); + + /** + * Called by Audio Policy Server when play dual tone request is granted + * Leaves on failure. + * @since S60 3.0 + * @return void + */ + void StartPlayDualToneL(); + + /** + * Called by Audio Policy Server when play DTMF reqeust is granted + * Leaves on failure. + * @since S60 3.0 + * @return void + */ + void StartPlayDTMFStringL(); + + /** + * Called by Audio Policy Server when play tone sequence reqeust + * is granted. + * Leaves on failure. + * @since S60 3.0 + * @return void + */ + void StartPlayToneSequenceL(); + + /** + * Play tone + * Leaves on failure. + * @since S60 3.0 + * @return void + */ + void DoPlayL(); + + /** + * Sets active tone + * @since S60 3.0 + * @return void + */ + void SetActiveToneBuffer(); + + /** + * Fills free tone buffer with tone data + * @since S60 3.0 + * @return KErrNone if succesfull, else corresponding error code. + */ + TInt FillFreeToneBuffer(); + + + // HwDevice implementation begins + + /** + * Initialize HwDevice task. + * @since S60 3.0 + * @return KErrNone if succesfull, else corresponding error code. + */ + TInt InitTask(); + + /** + * Returns Sampling Frequency the device is currently configured to + * @since S60 3.0 + * @return KErrNone if succesfull, else corresponding error code. + */ + TInt SamplingFrequency(); + + /** + * Returns number of channels the device is currently configured to + * @since S60 3.0 + * @return KErrNone if succesfull, else corresponding error code. + */ + TInt NumberOfChannels(); + + /** + * returns the number of bytes in each audio sample + * @since S60 3.0 + * @return TInt Number of of bytes in each audio sample. + */ + TInt BytesPerAudioSample(); + + // HwDevice implementation ends + + /** + * Initializes DevSound utility + * @since S60 3.0 + * @return void + */ + void InitializeDevSoundUtilL() const; + + private: + + /** + * C++ default constructor. + */ + CBody(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(RServer2& aPolicyServerHandle); + + protected: // Data + + CG711DecoderIntfcCI* iG711DecoderIntfcCI; + CG711EncoderIntfcCI* iG711EncoderIntfcCI; + CG729DecoderIntfcCI* iG729DecoderIntfcCI; + CG729EncoderIntfcCI* iG729EncoderIntfcCI; + CIlbcDecoderIntfcCI* iIlbcDecoderIntfcCI; + CIlbcEncoderIntfcCI* iIlbcEncoderIntfcCI; + CSpeechEncoderConfigCI* iSpeechEncoderConfigCI; + CErrorConcealmentIntfcCI* iErrorConcealmentIntfcCI; + + private: // Data + + //Objects (owned or referred to): + MDevSoundAdaptationObserver* iDevSoundObserver; + + // DevSound capabilities + TMMFCapabilities iDeviceCapabilities; + // Current Configuration + TMMFCapabilities iDeviceConfig; + + // Bytes of audio data played in current play cycle + TInt iPlayedBytesCount; + // Bytes of audio data recorded in current record cycle + TInt iRecordedBytesCount; + TInt iGain; + TInt iVolume; + + //Tone Stuff: + MMdaToneSynthesis* iCurrentGenerator; + TMdaSimpleToneGenerator iToneGen; + TMdaDualToneGenerator iDualToneGen; + TMdaDTMFGenerator iDTMFGen; + TMdaSequenceGenerator iSequenceGen; // Not Supported + TInt iRepeatCount; + TTimeIntervalMicroSeconds iRepeatTrailingSilence; + TTimeIntervalMicroSeconds iRampDuration; + // Double buffer tone playing + CMMFDataBuffer* iToneBuffer1; + CMMFDataBuffer* iToneBuffer2; + // Reference to current tone buffer playing + CMMFDataBuffer* iActiveToneBuffer; + + // Hardware device implementation + CMMFHwDeviceStub* iCMMFHwDevice; + // Mode in which DevSound instance will be used for + TMMFState iMode; + // Reference to hardware buffer + CMMFDataBuffer* iHwDeviceBuffer; + + TBool iLastBufferReceived; + + // Holds true of Audio data given to DevSound needs to ramped up + mutable CMMFDevSoundUtility* iDevSoundUtil; + + // Fixed sequence related + + // Holds the fixed sequence data + mutable CPtrC8Array* iFixedSequences; + // Holds reference to current sequence + TPtrC8 iFixedSequence; + + // Balance + TInt iLeftPlayBalance; + TInt iRightPlayBalance; + TInt iLeftRecordBalance; + TInt iRightRecordBalance; + TBool iPaused; + + TUid iHwDeviceID; + + // Hardware device initialization parameters + THwDeviceInitParams iDevInfo; + + TBool iFirstCallFromHwDevice; + + // Temporary CI testing only + CBytesPlayedCIImpl* iBytesPlayedCIImpl; + // Holds clients configuration + TMMFClientConfig iClientConfig; + + // Pointer to CTonePlayCompleteTimer + CTonePlayCompleteTimer* iTonePlayCompleteTimer; + + private: // Friend classes + friend class CMMFDevSoundAdaptation; + + }; + +#endif // MMFDEVSOUNDADAPTATIONBODY_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/MmfHwDeviceStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/MmfHwDeviceStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,493 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +// INCLUDE FILES +#include "MmfHwDeviceStub.h" +#ifdef _DEBUG +#include "e32debug.h" + +#define DEBPRN0(str) RDebug::Print(str, this) +#define DEBPRN1(str, val1) RDebug::Print(str, this, val1) +#define DEBPRN2(str, val1, val2) RDebug::Print(str, this, val1, val2) +#else +#define DEBPRN0(str) +#define DEBPRN1(str, val1) +#define DEBPRN2(str, val1, val2) +#endif //_DEBUG + +// CONSTANTS +const TUint KBufferLength1 = 0x1000; +const TUint KBufferLength2 = 0x1000; +//const TUint KBufferLength2 = 0x1800; // for creating second buffer with different length than the first buffer. +const TUint KTimerDuration = 200000; + +#ifdef __WINSCW__ +_LIT(KSample1,"C:\\sample1.wav"); +#else +_LIT(KSample1,"Z:\\system\\data\\DevSoundAdaptationStub\\sample1.wav"); +#endif // __WINSCW__ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMMFHwDeviceStub::CMMFHwDeviceStub +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CMMFHwDeviceStub::CMMFHwDeviceStub() +: CActive(EPriorityNormal), iHwDeviceState(EHWDeviceIdle), iCurPlayBuffer(NULL), + iCurRecdBuffer(NULL) + { + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// CMMFHwDeviceStub::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CMMFHwDeviceStub::ConstructL() + { + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::ConstructL:BEGIN")); + // Create timer + User::LeaveIfError(iTimer.CreateLocal()); + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::ConstructL:END")); + } + +// ----------------------------------------------------------------------------- +// CMMFHwDeviceStub::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMMFHwDeviceStub* CMMFHwDeviceStub::NewL() + { + CMMFHwDeviceStub* self = new (ELeave)CMMFHwDeviceStub; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CMMFHwDeviceStub::~CMMFHwDeviceStub +// Destructor +// ----------------------------------------------------------------------------- +// +CMMFHwDeviceStub::~CMMFHwDeviceStub() + { + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::~CMMFHwDeviceStub:BEGIN")); + // Cancel A/O and close the timer + Cancel(); + iTimer.Close(); + + // Delete buffers + delete iPlayBuffer1; + delete iPlayBuffer2; + delete iRecdBuffer1; + delete iRecdBuffer2; + + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::~CMMFHwDeviceStub:END")); + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::Start +// Starts playback/record based on aFuncCmd +// (other items were commented in a header). +//----------------------------------------------------------------------------- +TInt CMMFHwDeviceStub::Start(TDeviceFunc aFuncCmd, TDeviceFlow /*aFlowCmd*/) + { + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::Start:BEGIN")); + TInt status(KErrNone); + switch(aFuncCmd) + { + case EDevDecode: + iCurPlayBuffer = NULL; + + // Initialize buffers + TRAP(status, InitializePlayBufferL()); + if (status != KErrNone) + return status; + + // Reset buffers rendered count to zero only if not pause-continue + if (iHwDeviceState == EHWDeviceIdle) + iCount = 0; + // Initialize attributes + iHwDeviceState = EHWDevicePlay; + iLastBufferReceived = EFalse; + // If not already active, launch timer + if (!IsActive()) + { + iTimer.After(iStatus,TTimeIntervalMicroSeconds32(KTimerDuration) ); + SetActive(); + } + break; + case EDevEncode: + iCurRecdBuffer = NULL; + + // Initialize buffers + TRAP(status, InitializeRecdBufferL()); + if (status != KErrNone) + return status; + + // Reset buffers rendered count to zero only if not pause-continue + if (iHwDeviceState == EHWDeviceIdle) + iCount = 0; + // Initialize attributes + iHwDeviceState = EHWDeviceRecord; + // If not already active, launch timer + if (!IsActive()) + { + iTimer.After(iStatus,TTimeIntervalMicroSeconds32(KTimerDuration) ); + SetActive(); + } + break; + default: + status = KErrNotSupported; + break; + }; + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::Start:END")); + return status; + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::Stop +// Stops current operation. +// (other items were commented in a header). +//----------------------------------------------------------------------------- +TInt CMMFHwDeviceStub::Stop() + { + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::Stop")); + TInt status(KErrNone); + // Cancel any outstanding requests + Cancel(); + // Reset attributes + iHwDeviceState = EHWDeviceIdle; + iLastBufferReceived = EFalse; + iCurPlayBuffer = NULL; + iCurRecdBuffer = NULL; + // Notify observer Stopped + iObserver->Stopped(); + return status; + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::Pause +// Pauses current operation. +// (other items were commented in a header). +//----------------------------------------------------------------------------- +TInt CMMFHwDeviceStub::Pause() + { + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::Pause")); + TInt status(KErrNone); + + // Fix to WAV recording issue. + // Proper way to stop this A/O is by letting the data path to call back + // Stop() after detecting last buffer. +// Cancel(); + return status; + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::Init +// Initializes CMMFHwDevice. +// (other items were commented in a header). +//----------------------------------------------------------------------------- +TInt CMMFHwDeviceStub::Init(THwDeviceInitParams& aDevInfo) + { + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::Init")); + TInt status(KErrNone); + iObserver = aDevInfo.iHwDeviceObserver; + return status; + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::CustomInterface +// Returns a pointer to CustomInterface. +// (other items were commented in a header). +//----------------------------------------------------------------------------- +TAny* CMMFHwDeviceStub::CustomInterface(TUid /*aInterfaceId*/) + { + return NULL; + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::ThisHwBufferFilled +// Returns a pointer to CustomInterface. +// (other items were commented in a header). +//----------------------------------------------------------------------------- +TInt CMMFHwDeviceStub::ThisHwBufferFilled(CMMFBuffer& aFillBufferPtr) + { + DEBPRN2(_L("CMMFHwDeviceStub[0x%x]::ThisHwBufferFilled:Addr[0x%x]Count[%d]"), iCurPlayBuffer, ++iCount); + TInt status(KErrNotReady); + if (iHwDeviceState == EHWDevicePlay) + { + status = KErrNone; + if (aFillBufferPtr.LastBuffer()) + { + iLastBufferReceived = ETrue; + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::ThisHwBufferFilled[LastBuffer]")); + } + + // If not already active, launch timer + if (!IsActive()) + { + iTimer.After(iStatus,TTimeIntervalMicroSeconds32(KTimerDuration) ); + SetActive(); + } + } + return status; + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::ThisHwBufferEmptied +// Called by client when data is available during recording. +// (other items were commented in a header). +//----------------------------------------------------------------------------- +TInt CMMFHwDeviceStub::ThisHwBufferEmptied(CMMFBuffer& aEmptyBufferPtr) + { + DEBPRN1(_L("CMMFHwDeviceStub[0x%x]::ThisHwBufferEmptied[%d]"), ++iCount); + TInt status(KErrNotReady); + if (iHwDeviceState == EHWDeviceRecord) + { + status = KErrNone; + + // Fix to WAV recording issue. + // In case of real DevSound adaptation implementation, the + // CMMFSwCodecRecordDataPath sets the last buffer parameter when no + // more data is in the buffer to process. In case of the stub, this + // never gets set as the s/w codec is not involved - we are simply + // copying same fixed 4k block of data over and over again. So, on + // pause or stop we need to indicate to the data path that we no + // longer need processing of data by manually setting last buffer + // parameter and resetting requested data size to 0. + if (aEmptyBufferPtr.LastBuffer()) + { + iRecdBuffer1->SetLastBuffer(ETrue); + iRecdBuffer1->SetRequestSizeL(0); + iRecdBuffer2->SetLastBuffer(ETrue); + iRecdBuffer2->SetRequestSizeL(0); + } + + // If not already active, launch timer + if (!IsActive()) + { + iTimer.After(iStatus,TTimeIntervalMicroSeconds32(KTimerDuration) ); + SetActive(); + } + } + + return status; + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::SetConfig +// Configures CMMFHwDevice. +// (other items were commented in a header). +//----------------------------------------------------------------------------- +TInt CMMFHwDeviceStub::SetConfig(TTaskConfig& /*aConfig*/) + { + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::SetConfig")); + TInt status(KErrNone); + return status; + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::StopAndDeleteCodec +// Stops and deletes codec. +// (other items were commented in a header). +//----------------------------------------------------------------------------- +TInt CMMFHwDeviceStub::StopAndDeleteCodec() + { + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::StopAndDeleteCodec")); + TInt status(KErrNone); + Stop(); + return status; + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::DeleteCodec +// Deletes codec. +// (other items were commented in a header). +//----------------------------------------------------------------------------- +TInt CMMFHwDeviceStub::DeleteCodec() + { + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::DeleteCodec")); + TInt status(KErrNone); + Stop(); + return status; + } + + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::RunL +// Called by CActive object framework when local timer times out. +// (other items were commented in a header). +//----------------------------------------------------------------------------- +void CMMFHwDeviceStub::RunL() + { + DEBPRN1(_L("CMMFHwDeviceStub[0x%x]::RunL:iHwDevState[%d]"), iHwDeviceState); + switch(iHwDeviceState) + { + case EHWDevicePlay: + // If last buffer is received, send error + if (iLastBufferReceived) + { + iObserver->Error(KErrUnderflow); + Stop(); + } + else + { + SetActivePlayBufferL(); + iObserver->FillThisHwBuffer(*iCurPlayBuffer); + } + break; + case EHWDeviceRecord: + SetActiveRecdBufferL(); + iObserver->EmptyThisHwBuffer(*iCurRecdBuffer); + break; + default: + break; + } + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::DoCancel +// From CActive. Called by Framework when this instance is active and is +// cancelled +//----------------------------------------------------------------------------- +void CMMFHwDeviceStub::DoCancel() + { + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::DoCancel")); + iTimer.Cancel(); + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::Error +// From CActive. Called by Framework when RunL Leaves +//----------------------------------------------------------------------------- +TInt CMMFHwDeviceStub::Error(TInt /*aError*/) + { + return KErrNone; + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::InitializePlayBufferL +// Initializes buffer(s) used for playback +//----------------------------------------------------------------------------- +void CMMFHwDeviceStub::InitializePlayBufferL() + { + if (!iPlayBuffer1) + { + // Create buffers + iPlayBuffer1 = CMMFDataBuffer::NewL(KBufferLength1); + } + if (!iPlayBuffer2) + { + // Create buffers + iPlayBuffer2 = CMMFDataBuffer::NewL(KBufferLength2); + } + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::InitializeRecdBufferL +// Initializes buffer(s) used for recording +//----------------------------------------------------------------------------- +void CMMFHwDeviceStub::InitializeRecdBufferL() + { + if (!iRecdBuffer1) + { + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::InitializeRecdBufferL:Creating buffer...")); + // Create buffers + iRecdBuffer1 = CMMFDataBuffer::NewL(KBufferLength1); + } + + if (!iRecdBuffer2) + { + DEBPRN0(_L("CMMFHwDeviceStub[0x%x]::InitializeRecdBufferL:Creating buffer...")); + // Create buffers + iRecdBuffer2 = CMMFDataBuffer::NewL(KBufferLength2); + } + + iPosition = 0; + + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::SetActiveRecdBufferL +// Reads data from the input file to the buffer +//----------------------------------------------------------------------------- +void CMMFHwDeviceStub::SetActiveRecdBufferL() + { + if ( !iCurRecdBuffer || ( iCurRecdBuffer == iRecdBuffer2 ) ) + { + iCurRecdBuffer = iRecdBuffer1; + } + else + { + iCurRecdBuffer = iRecdBuffer2; + } + + if ( !iCurRecdBuffer->LastBuffer() ) + { + RFs rFs; + RFile rFile; + User::LeaveIfError(rFs.Connect()); + User::LeaveIfError(rFile.Open(rFs, KSample1, EFileRead)); + + TInt size; + User::LeaveIfError(rFile.Size(size)); + TInt bufLength( iCurRecdBuffer->Data().MaxLength() ); + if (iPosition > (size - bufLength)) + { + iPosition = 0; //rewind file position index to the beginning + } + // Assumption, file size is more than iCurRecdBuffer->Data().MaxLength() + User::LeaveIfError(rFile.Read(iPosition, + iCurRecdBuffer->Data(), + bufLength) ); + iCurRecdBuffer->SetRequestSizeL(bufLength); + iCurRecdBuffer->SetLastBuffer(EFalse); + rFile.Close(); + rFs.Close(); + + iPosition += bufLength; + } + } + +//----------------------------------------------------------------------------- +// CMMFHwDeviceStub::SetActivePlayBufferL +// Reads data from the input file to the buffer +//----------------------------------------------------------------------------- +void CMMFHwDeviceStub::SetActivePlayBufferL() + { + if ( !iCurPlayBuffer || ( iCurPlayBuffer == iPlayBuffer2 ) ) + { + iCurPlayBuffer = iPlayBuffer1; + } + else + { + iCurPlayBuffer = iPlayBuffer2; + } + iCurPlayBuffer->SetRequestSizeL(iCurPlayBuffer->Data().MaxLength()); + iCurPlayBuffer->Data().SetLength(0); + iCurPlayBuffer->SetLastBuffer(EFalse); + } + +//End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/MmfHwDeviceStub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/MmfHwDeviceStub.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,232 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +#ifndef MMFHWDEVSTUB_H +#define MMFHWDEVSTUB_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION + +/** +* This class provides an stub interface for CMMFHwDevice - intended +* to provide non audio rendering support for MMFDevSoundAdaptation Stub +* +* @lib MmfDevSoundAdaptation_Stub.lib +* @since Series 60 3.0 +*/ +class CMMFHwDeviceStub : public CActive + { + public: + + /** + * Constructs, and returns a pointer to, a new CMMFHwDeviceStub object. + * Leaves on failure.. + * @since Series 60 3.0 + * @return CMMFHwDeviceStub* A pointer to newly created object. + */ + static CMMFHwDeviceStub* NewL(); + + /** + * Destructor. + */ + ~CMMFHwDeviceStub(); + + public: + // Methods from CMMFHwDevice + + /** + * Starts playback/record based on aFuncCmd. + * @since Series 60 3.0 + * @param TDeviceFunc aFuncCmd A function indicating decode or encode + * @param TDeviceFlow aFlowCmd Flow command, not used here + * @return TInt Error code. KErrNone if success. + */ + TInt Start(TDeviceFunc aFuncCmd, TDeviceFlow aFlowCmd); + + /** + * Stops current operation. + * @since Series 60 3.0 + * @return TInt Error code. KErrNone if success. + */ + TInt Stop(); + + /** + * Pauses current operation. + * @since Series 60 3.0 + * @return TInt Error code. KErrNone if success. + */ + TInt Pause(); + + /** + * Initializes CMMFHwDevice. + * @since Series 60 3.0 + * @param THwDeviceInitParams& aDevInfo A reference to device init + * params. + * @return TInt Error code. KErrNone if success. + */ + TInt Init(THwDeviceInitParams& aDevInfo); + + /** + * Returns a pointer to CustomInterface. + * @since Series 60 3.0 + * @param TUid aInterfaceId A uid that uniquely identifies the custom + * interface definition. + * @return TAny* NULL if no custom interface found, else object + * implementing custom interface + */ + TAny* CustomInterface(TUid aInterfaceId); + + /** + * Called by client when data is available during playback. + * @since Series 60 3.0 + * @param CMMFBuffer& aFillBufferPtr A pointer to buffer that was sent + * to client during callback FillThisHwBuffer() + * @return TInt Error code. KErrNone if success. + */ + TInt ThisHwBufferFilled(CMMFBuffer& aFillBufferPtr); + + /** + * Called by client when data is available during recording. + * @since Series 60 3.0 + * @param CMMFBuffer& aFillBufferPtr A pointer to buffer that was sent + * to client during callback EmptyThisHwBuffer() + * @return TInt Error code. KErrNone if success. + */ + TInt ThisHwBufferEmptied(CMMFBuffer& aEmptyBufferPtr); + + /** + * Configures CMMFHwDevice. + * @since Series 60 3.0 + * @param TTaskConfig& aConfig A reference to configuration objec. + * @return TInt Error code. KErrNone if success. + */ + TInt SetConfig(TTaskConfig& aConfig); + + /** + * Stops and deletes codec. + * @since Series 60 3.0 + * @return TInt Error code. KErrNone if success. + */ + TInt StopAndDeleteCodec(); + + /** + * Deletes codec. + * @since Series 60 3.0 + * @return TInt Error code. KErrNone if success. + */ + TInt DeleteCodec(); + + public:// From CActive + + /** + * Called by CActive object framework when local timer times out. + * @since Series 60 3.0 + * @return void + */ + virtual void RunL(); + + /** + * Called by CActive object framework when client cancels active object. + * @since Series 60 3.0 + * @return void + */ + virtual void DoCancel(); + + /** + * Called by CActive object framework when RunL leaves. + * @since Series 60 3.0 + * @param TInt aError Error code. + * @return KErrNone + */ + virtual TInt Error(TInt aError); + + private: + + /** + * C++ default constructor. + */ + CMMFHwDeviceStub(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Initialize play buffer. + * Leaves on failure. + * @since Series 60 3.0 + * @return void + */ + void InitializePlayBufferL(); + + /** + * Initialize record buffer + * Leaves on failure. + * @since Series 60 3.0 + * @return void + */ + void InitializeRecdBufferL(); + + /** + * Read data from the input file to the buffer + * @since Series 60 3.0 + * @return void + */ + void SetActiveRecdBufferL(); + + void SetActivePlayBufferL(); + + private: + // Pointer reference to HwDevice observer. + MMMFHwDeviceObserver* iObserver; + + // States this object can be at any time. + enum THwDeviceStubState + { + EHWDeviceIdle, + EHWDevicePlay, + EHWDeviceRecord + }; + // HwDevice state + THwDeviceStubState iHwDeviceState; + // Local timer object + RTimer iTimer; + // Buffers used for playback + CMMFDataBuffer *iPlayBuffer1; + CMMFDataBuffer *iPlayBuffer2; + CMMFDataBuffer *iCurPlayBuffer; + // Buffers used for recording + CMMFDataBuffer *iRecdBuffer1; + CMMFDataBuffer *iRecdBuffer2; + CMMFDataBuffer *iCurRecdBuffer; + // ETrue if last buffer is received, else EFalse + TBool iLastBufferReceived; + // Count + TInt iCount; + // Index to the position within input file + TInt iPosition; +}; + +#endif // MMFHWDEVSTUB_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/ToneGenerator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/ToneGenerator.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,993 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This file contains an implementation of the ToneGenerator interface +* that converts all tone generation requests in to sampled audio +* data to be played through the normal local sampled audio interface +* +*/ + + + +// INCLUDE FILES +#include "ToneGenerator.h" +#include +#include + +// CONSTANTS + +/****************************************************************************** +* Tone Generators +* +* The following classes are used to generate simple frequency/duration tones, +* DTMF, and SymbianOS tone sequences in a WINS environment. The below code +* should only be considered for WINS. +******************************************************************************/ + +// this defines the maximum possible amplitude allowed for TSineGen::SetFrequency() +const TInt KMaxAmplitude = 0x8000; + +// default number of samples for trailing silence following a Tone +const TInt KDefaultTrailingSilenceSamples = 20; + +const TInt KRecalculateToneLengths = KMinTInt; + +// +// Sequence constants +// + +#ifdef _DEBUG +const TInt16 KFixedSequenceSignatureOne='S'+('Q'<<8); +const TInt16 KFixedSequenceSignatureTwo='N'+('C'<<8); +#endif // _DEBUG + +const TInt KFixedSequenceFunctionReturn=-1; +const TInt KFixedSequenceFunctionStartLoop=-2; +const TInt KFixedSequenceFunctionEndLoop=-3; + +// +// Sine tone generator +// + +const TInt16 TSineGen::SineTable[KMaxSineTable] = + { + 0, 804, 1607, 2410, 3211, 4011, 4807, 5601, + 6392, 7179, 7961, 8739, 9511, 10278, 11038, 11792, + 12539, 13278, 14009, 14732, 15446, 16150, 16845, 17530, + 18204, 18867, 19519, 20159, 20787, 21402, 22004, 22594, + 23169, 23731, 24278, 24811, 25329, 25831, 26318, 26789, + 27244, 27683, 28105, 28510, 28897, 29268, 29621, 29955, + 30272, 30571, 30851, 31113, 31356, 31580, 31785, 31970, + 32137, 32284, 32412, 32520, 32609, 32678, 32727, 32757, + 32767, 32757, 32727, 32678, 32609, 32520, 32412, 32284, + 32137, 31970, 31785, 31580, 31356, 31113, 30851, 30571, + 30272, 29955, 29621, 29268, 28897, 28510, 28105, 27683, + 27244, 26789, 26318, 25831, 25329, 24811, 24278, 23731, + 23169, 22594, 22004, 21402, 20787, 20159, 19519, 18867, + 18204, 17530, 16845, 16150, 15446, 14732, 14009, 13278, + 12539, 11792, 11038, 10278, 9511, 8739, 7961, 7179, + 6392, 5601, 4807, 4011, 3211, 2410, 1607, 804, + 0, -804, -1607, -2410, -3211, -4011, -4807, -5601, + -6392, -7179, -7961, -8739, -9511,-10278,-11038,-11792, + -12539,-13278,-14009,-14732,-15446,-16150,-16845,-17530, + -18204,-18867,-19519,-20159,-20787,-21402,-22004,-22594, + -23169,-23731,-24278,-24811,-25329,-25831,-26318,-26789, + -27244,-27683,-28105,-28510,-28897,-29268,-29621,-29955, + -30272,-30571,-30851,-31113,-31356,-31580,-31785,-31970, + -32137,-32284,-32412,-32520,-32609,-32678,-32727,-32757, + -32767,-32757,-32727,-32678,-32609,-32520,-32412,-32284, + -32137,-31970,-31785,-31580,-31356,-31113,-30851,-30571, + -30272,-29955,-29621,-29268,-28897,-28510,-28105,-27683, + -27244,-26789,-26318,-25831,-25329,-24811,-24278,-23731, + -23169,-22594,-22004,-21402,-20787,-20159,-19519,-18867, + -18204,-17530,-16845,-16150,-15446,-14732,-14009,-13278, + -12539,-11792,-11038,-10278, -9511, -8739, -7961, -7179, + -6392, -5601, -4807, -4011, -3211, -2410, -1607, -804, + }; + +const TInt16 TSineGen::IncTable[KMaxSineTable] = + { + 804, 803, 803, 801, 800, 796, 794, + 791, 787, 782, 778, 772, 767, 760, 754, + 747, 739, 731, 723, 714, 704, 695, 685, + 674, 663, 652, 640, 628, 615, 602, 590, + 575, 562, 547, 533, 518, 502, 487, 471, + 455, 439, 422, 405, 387, 371, 353, 334, + 317, 299, 280, 262, 243, 224, 205, 185, + 167, 147, 128, 108, 89, 69, 49, 30, + 10, -10, -30, -49, -69, -89, -108, -128, + -147, -167, -185, -205, -224, -243, -262, -280, + -299, -317, -334, -353, -371, -387, -405, -422, + -439, -455, -471, -487, -502, -518, -533, -547, + -562, -575, -590, -602, -615, -628, -640, -652, + -663, -674, -685, -695, -704, -714, -723, -731, + -739, -747, -754, -760, -767, -772, -778, -782, + -787, -791, -794, -796, -800, -801, -803, -803, + -804, -804, -803, -803, -801, -800, -796, -794, + -791, -787, -782, -778, -772, -767, -760, -754, + -747, -739, -731, -723, -714, -704, -695, -685, + -674, -663, -652, -640, -628, -615, -602, -590, + -575, -562, -547, -533, -518, -502, -487, -471, + -455, -439, -422, -405, -387, -371, -353, -334, + -317, -299, -280, -262, -243, -224, -205, -185, + -167, -147, -128, -108, -89, -69, -49, -30, + -10, 10, 30, 49, 69, 89, 108, 128, + 147, 167, 185, 205, 224, 243, 262, 280, + 299, 317, 334, 353, 371, 387, 405, 422, + 439, 455, 471, 487, 502, 518, 533, 547, + 562, 575, 590, 602, 615, 628, 640, 652, + 663, 674, 685, 695, 704, 714, 723, 731, + 739, 747, 754, 760, 767, 772, 778, 782, + 787, 791, 794, 796, 800, 801, 803, 803, + 804 + }; + +const TUint8 KDtmfVolumeTable[4][4]= +// +// Relative strengths to assign to different DTMF tones +// +// This is only important if DTMFs are being played through a speaker +// and need to be machine-recognisable. This table compensates for frequency +// drop-off in the speaker and can boost the relative volume of some +// frequencies so they are still within tolerance. +// +// The values normally need to be determined using a frequency analyser on +// the hardware +// +// Each column == same low frequency (697, 770, 852, 941 Hz) +// Each row == same high frequency (1209, 1336, 1477, 1633 Hz) +// +// The value are interpreted as ratios: +// 0 == 100% low +// 7f == 50% low, 50% high +// ff == 100% high +// + { + {38,27,29,37}, + {46,36,36,46}, + {62,47,49,58}, + {70,56,60,68} + }; + +const TUint8 KDtmfTone697=0x0; +const TUint8 KDtmfTone770=0x1; +const TUint8 KDtmfTone852=0x2; +const TUint8 KDtmfTone941=0x3; + +const TUint8 KDtmfTone1209=0x00; +const TUint8 KDtmfTone1336=0x10; +const TUint8 KDtmfTone1477=0x20; +const TUint8 KDtmfTone1633=0x30; + +const TUint8 KDtmfToneTable[16]= + { + KDtmfTone941|KDtmfTone1336,//0 + KDtmfTone697|KDtmfTone1209,//1 + KDtmfTone697|KDtmfTone1336,//2 + KDtmfTone697|KDtmfTone1477,//3 + KDtmfTone770|KDtmfTone1209,//4 + KDtmfTone770|KDtmfTone1336,//5 + KDtmfTone770|KDtmfTone1477,//6 + KDtmfTone852|KDtmfTone1209,//7 + KDtmfTone852|KDtmfTone1336,//8 + KDtmfTone852|KDtmfTone1477,//9 + + KDtmfTone697|KDtmfTone1633,//A + KDtmfTone770|KDtmfTone1633,//B + KDtmfTone852|KDtmfTone1633,//C + KDtmfTone941|KDtmfTone1633,//D + KDtmfTone941|KDtmfTone1209,//E or * + KDtmfTone941|KDtmfTone1477,//F or # + }; + + +// ----------------------------------------------------------------------------- +// LOCAL_C void RampVolume +// Simple function to ramp down the volume of some samples +// Typically used to prevent "clicking" artifacts at the beginning/end of tones +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +LOCAL_C void RampVolume( + TInt16* aData, + TInt aCount, + TInt aStartVol, + TInt aEndVol) + { + TInt step = (aEndVol - aStartVol)/aCount; + while (aCount--) + { + TInt data = TInt(*aData) * aStartVol; + *aData++ = TInt16(data>>15); + aStartVol += step; + } + } + +// ----------------------------------------------------------------------------- +// GenerateSineTableL +// Code to generate sine table files used by tone generator +// Optionally called from InitL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- + +// #define GENERATE_SINE_TABLES 1 +#ifdef GENERATE_SINE_TABLES +LOCAL_C GenerateSineTableL() + { + _LIT(KSineFile,"sine.txt"); + _LIT(KSineIncFile,"sineinc.txt"); + + RFile file; + file.Replace(MdaManager::Fs(),KSineFile,EFileWrite); + CleanupClosePushL(file); + + RFile file2; + file2.Replace(MdaManager::Fs(),KSineIncFile,EFileWrite); + CleanupClosePushL(file2); + + const TReal pi=3.141592653589; + const TReal twopi=pi*2; + const TReal samples = 256.0; + const TReal step = twopi/samples; + + TBuf8<128> sinebuffer; + TBuf8<128> incbuffer; + TReal res; + TInt first=0; + TInt last=KMaxTInt; + TInt current; + _LIT8(KFormat,"%6d,"); + _LIT8(KNewLine,"\n"); + + for(TReal angle=0.0;angle<=(twopi-step);) // Copes with rounding errors + { + sinebuffer.Zero(); + incbuffer.Zero(); + for (int i=0;i<8;i++) + { + User::LeaveIfError(Math::Sin(res,angle)); + current = TInt(KMaxTInt16*res); + sinebuffer.AppendFormat(KFormat,current); + if (last != KMaxTInt) + incbuffer.AppendFormat(KFormat,current-last); + else + first = current; + last = current; + angle += step; + } + sinebuffer.Append(KNewLine); + incbuffer.Append(KNewLine); + file.Write(sinebuffer); + file2.Write(incbuffer); + } + + // Write fine difference to incbuffer - differnece between first and last + incbuffer.Zero(); + incbuffer.AppendFormat(KFormat,first-last); + incbuffer.Append(KNewLine); + file2.Write(incbuffer); + + CleanupStack::PopAndDestroy(file2); + CleanupStack::PopAndDestroy(file); + } +#endif + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// TSineGen::SetFrequency +// Given the frequency set iStep. +// Reset iPosition to the equivalent of 0 degrees. +// In the special case of aFrequency==4KHz set iPosition to 90 degrees. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TSineGen::SetFrequency( + TInt aFrequency, + TInt aAmplitude) + { + + if (aAmplitude>(1<<15)) + iAmplitude=(1<<15); + else if (aAmplitude<-(1<<15)) + iAmplitude=-(1<<15); + else + iAmplitude=aAmplitude; +// +// There are 256 entries in the sine table to traverse 360 degrees. +// The codec requires samples at a rate of 8000 per second. +// Thus for a 1Hz tone the step will be 256/8000 or 4/125. +// Now we need need the integer part of the result to end up in +// the MSB so we need to multiply by 2^24. This gives the formula +// step = (f*4*2^24)/125 or (f*2^26)/125. +// Our highest frequency is 4KHz so that the term (f*2^26) exceeds +// a 32 bit result by 4000/2^6 (2^6 is the number of significant bits +// left after a multiply by 2^26). i.e. 6 bits. We overcome this by +// having 6 bits less in the fraction, so the new formula becomes +// ((f*2^20)/125)*2^6. This still gives us 20 significant bits in the +// fraction. +// + + iStep=(((TUint)aFrequency<<20)/125)<<6; + iPosition=(aFrequency==4000 ? 0x40000000 : 0); + } + +// ----------------------------------------------------------------------------- +// TSineGen::NextSample +// Generate the next sample using linear interpolation +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt TSineGen::NextSample() + { + TUint pos=iPosition>>24; + TInt amp=((IncTable[pos]*((iPosition&0x00ffffff)>>20))); + amp>>=4; + amp+=SineTable[pos]; + amp=(amp*iAmplitude)>>15; + iPosition+=iStep; + return(amp); + } + +// ----------------------------------------------------------------------------- +// TSineWave::Generate +// Called when more samples need to be generated. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TSineWave::Generate( + TInt16* aDest, + TInt aCount) + { + while (aCount--) + { + *aDest++=STATIC_CAST(TInt16,iGen1.NextSample()+iGen2.NextSample()); + } + } + +// ----------------------------------------------------------------------------- +// TSineWave::SetFrequency +// Set to generate a single frequency +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TSineWave::SetFrequency( + TInt aFrequency, + TInt aAmplitude) + { + SetFrequency(aFrequency,aAmplitude,0,0); + } + +// ----------------------------------------------------------------------------- +// TSineWave::SetFrequency +// Set to generate two frequencies +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TSineWave::SetFrequency( + TInt aFrequency1, + TInt aAmplitude1, + TInt aFrequency2, + TInt aAmplitude2) + { + iGen1.SetFrequency(aFrequency1,aAmplitude1); + iGen2.SetFrequency(aFrequency2,aAmplitude2); + } + + +// +// TMdaToneGenerator +// + +// ----------------------------------------------------------------------------- +// TMdaToneGenerator::Configure +// Set up this tone generator to generate data at the desired sample rate +// and number of channels (typically mono/stereo) +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TMdaToneGenerator::Configure( + TInt aRate, + TInt aChannels, + TInt aRepeats, + TInt aSilence, + TInt aRampUp) + { + iRate = aRate; + iChannels = aChannels; + iSamplesLeft = 0; + iRampUp = ETrue; // Default ramping to on as it is normally useful + iRampDown = ETrue; + iRepeats = aRepeats; + iSilenceBetweenRepeats = aSilence; + iRampUpCount = aRampUp; + iRampUpLeft = aRampUp; + iAfterRepeatSilence = EFalse; + } + +// ----------------------------------------------------------------------------- +// TMdaToneGenerator::FillBuffer +// Fill the supplied buffer with tone data +// Sets the buffer length to zero if there is no more data to play +// The buffer must have a max length of at least one sample * channels +// e.g. 2 bytes mono, 4 bytes stereo +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt TMdaToneGenerator::FillBuffer( + TDes8& aBuffer) + { + ASSERT(aBuffer.MaxLength()>= (iChannels<<1)); + aBuffer.SetMax(); + + TBool silence; + TInt samples = 0; // + TInt used = 0; // Data used + TInt avail = aBuffer.Length(); // Data filled + TInt count = 0; // Data to be converted + TBool rampUp = EFalse; + + TMdaPtr8 fill; + fill.Set(aBuffer); // Pointer to data left to be filled + + // + // The rest of this function will loop around continually until the buffer + // is filled or there is no more data to play + // + +Restart: + silence = EFalse; // Reset + if (iSamplesLeft == 0) + { + if (iTrailingSilence == 0) + { + TInt error = GetNextTone(); + if (error) + return error; + + rampUp = ETrue; + if ((iSamplesLeft==0)&&(iTrailingSilence==0)) + { + if ((iSilenceBetweenRepeats)&&(!iAfterRepeatSilence)) + { + iTrailingSilence = iSilenceBetweenRepeats; + iAfterRepeatSilence = ETrue; + goto Restart; + } + else + { + if ((iRepeats>0)||(iRepeats==KMdaRepeatForever)) + { + iAfterRepeatSilence = EFalse; + if (iRepeats>0) + iRepeats--; + + Reset(); + goto Restart; + } + } + // No more to play + goto Finished; + } + goto Restart; + } + else + { + silence = ETrue; + samples = iTrailingSilence; + } + } + else + samples = iSamplesLeft; + + count = Min(samples,avail>>1); + fill.SetLength(count<<1); + + if (!silence) + { // Generate wave + iSineWave.Generate(REINTERPRET_CAST(TInt16*,&fill[0]),count); + if (iRampUp) + { // Ramp up volume at beginning of tone + const TInt KRampUpSamples = 50; + if (rampUp) + { // Fade in first few samples + TInt fadeInLength = Min(Min(KRampUpSamples,iSamplesLeft),(fill.Length()>>1)); + RampVolume(CONST_CAST(TInt16*,REINTERPRET_CAST(const TInt16*,(&fill[0]))), + fadeInLength,0,1<<15); + } + } + if (iRampDown) + { // Ramp down volume at end of tone + const TInt KRampDownSamples = 50; + if ((iSamplesLeft-count) < KRampDownSamples) + { // Fade out last few samples + TInt fadeOutLength = Min(Min(KRampDownSamples,iSamplesLeft),(fill.Length()>>1)); + RampVolume(CONST_CAST(TInt16*, + REINTERPRET_CAST(const TInt16*, + (&(fill.Right(fadeOutLength<<1))[0]))), + fadeOutLength,1<<15,0); + } + } + iSamplesLeft -= count; + } + else + { // Generate silence + fill.FillZ(count<<1); + iTrailingSilence -= count; + } + + used += count<<1; + avail -= count<<1; + fill.Shift(count<<1); + + if (avail>(iChannels<<1)) + goto Restart; + +Finished: + + aBuffer.SetLength(used); + + // Do any ramp up that is required + if (iRampUpLeft>0) + { + TInt words = iRampUpLeft * iChannels; + words = Min(words,used>>1); + if (words>0) // In case buffer has zero length... + { + TInt left = iRampUpLeft * iChannels; + TInt rampup = iRampUpCount * iChannels; + iRampUpLeft -= words/iChannels; + TInt16* sample = REINTERPRET_CAST(TInt16*,&aBuffer[0]); + while (words--) + { + *sample++ = STATIC_CAST(TInt16,(TInt32(*sample)*(rampup-(left--)))/rampup); + } + } + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// TMdaToneGenerator::DurationToSamples +// Convert the given duration to a sample count using the current settings +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt TMdaToneGenerator::DurationToSamples( + const TTimeIntervalMicroSeconds& aDuration) + { + const TInt64 KTInt64OneMilion = 1000000; + + // Calculate duration as samples + TInt64 microSeconds(aDuration.Int64()); // MSVC doesn't like "aDuration.Int64()" in line below + TInt64 dur = ((TInt64(iRate) * TInt64(iChannels) * microSeconds) / KTInt64OneMilion); + if (I64HIGH(dur)>0) + return KMaxTInt; + else + return I64LOW(dur); + } + +// +// TMdaSimpleToneGenerator +// + +// ----------------------------------------------------------------------------- +// TMdaSimpleToneGenerator::Reset +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TMdaSimpleToneGenerator::Reset() + { + iPlayed = EFalse; + } + +// ----------------------------------------------------------------------------- +// TMdaSimpleToneGenerator::SetFrequencyAndDuration +// Store the frequency and duration of the specified sine tone +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TMdaSimpleToneGenerator::SetFrequencyAndDuration( + TInt aFrequency, + const TTimeIntervalMicroSeconds& aDuration) + { + iFrequency = aFrequency; + iDuration = aDuration; + iPlayed = EFalse; + } + +// ----------------------------------------------------------------------------- +// TMdaSimpleToneGenerator::GetNextTone +// Simple implementation - just sets the supplied frequency and duration +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt TMdaSimpleToneGenerator::GetNextTone() + { + // This class only plays one tone for the specified duration + if (!iPlayed) + { + iSamplesLeft = I64LOW((iDuration.Int64() * TInt64(iRate))/1000000); + iSineWave.SetFrequency(iFrequency,1<<14); + iPlayed = ETrue; + iTrailingSilence = 20; // Just to stop clicking + } + return KErrNone; + } + +// +// TMdaDualToneGenerator +// + +// ----------------------------------------------------------------------------- +// TMdaDualToneGenerator::Reset +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TMdaDualToneGenerator::Reset() + { + iPlayed = EFalse; + } + +// ----------------------------------------------------------------------------- +// TMdaDualToneGenerator::SetFrequencyAndDuration +// Store the frequencies and duration of the specified dual tone +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TMdaDualToneGenerator::SetFrequencyAndDuration( + TInt aFrequencyOne, + TInt aFrequencyTwo, + const TTimeIntervalMicroSeconds& aDuration) + { + + iFrequencyOne = aFrequencyOne; + iFrequencyTwo = aFrequencyTwo; + iDuration = aDuration; + iPlayed = EFalse; + } + +// ----------------------------------------------------------------------------- +// TMdaDualToneGenerator::GetNextTone +// This is called by TMdaToneGenerator::FillBuffer() +// to calculate the number of samples (iSamplesLeft) that will be needed +// for the tone to be played and to initialize the sine wave generator. +// If the tone has already been played, then leaves iSamplesLeft +// unmodified (should be zero) to indicate that it has finished. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt TMdaDualToneGenerator::GetNextTone() + { + // This class only plays one tone for the specified duration + if (!iPlayed) + { + iSamplesLeft = I64LOW((iDuration.Int64() * TInt64(iRate))/KOneMillionMicroSeconds); + iSineWave.SetFrequency(iFrequencyOne, KMaxAmplitude/2, iFrequencyTwo, KMaxAmplitude/2); + iPlayed = ETrue; + iTrailingSilence = KDefaultTrailingSilenceSamples; // Just to stop clicking + } + return KErrNone; + } + +// +// TMdaDTMFGenerator +// + +// ----------------------------------------------------------------------------- +// TMdaDTMFGenerator::Reset +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TMdaDTMFGenerator::Reset() + { + iChar = 0; + } + +// ----------------------------------------------------------------------------- +// TMdaDTMFGenerator::SetToneDurations +// Setup the DTMF tone durations +// aOn can be == -1 indicating should play first tone indefinately +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TMdaDTMFGenerator::SetToneDurations( + const TTimeIntervalMicroSeconds32 aOn, + const TTimeIntervalMicroSeconds32 aOff, + const TTimeIntervalMicroSeconds32 aPause) + { + ASSERT(aOn.Int() >=-1); + ASSERT(aOff.Int()>=0); + ASSERT(aPause.Int()>=0); + + iOn = aOn; + iOff = aOff; + iPause = aPause; + + iOnSamples = KRecalculateToneLengths; // Must recalculate these later + } + +// ----------------------------------------------------------------------------- +// TMdaDTMFGenerator::SetString +// Store the DTMF string to be played +// No need to validate it as it will already have been checked +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TMdaDTMFGenerator::SetString( + const TDesC& aDTMFString) + { + iChar = 0; + iDTMFString = &aDTMFString; + } + +// ----------------------------------------------------------------------------- +// TMdaDTMFGenerator::GetNextTone +// Setup frequency/duration/silence settings for next DTMF tone +// Supported characters are 0-9 A-F * # , and any kind of white space +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt TMdaDTMFGenerator::GetNextTone() + { + TBool onlyPlayFirstTone = EFalse; + + if (iOnSamples == KRecalculateToneLengths) + { + // Must recalculate tone durations as samples + + // Handle special case where tone on duration negative + // - meaning play first character indefinately + if (iOn.Int()>=0) + iOnSamples = DurationToSamples(TInt64(iOn.Int())); + else + { + onlyPlayFirstTone = ETrue; + iOnSamples = -1; + } + + iOffSamples = DurationToSamples(TInt64(iOff.Int())); + iPauseSamples = DurationToSamples(TInt64(iPause.Int())); + } + + ASSERT(iDTMFString); + + if (iChar==iDTMFString->Length()) + return KErrNone; // Finished. Nothing to do + + TInt highFrequency = 0; + TInt highVolume = 0; + TInt lowFrequency = 0; + TInt lowVolume =0; + +Retry: + TChar c((*iDTMFString)[iChar++]); + if ((TUint)c=='#' || (TUint)c=='*' || c.IsHexDigit()) + { + TInt tableIndex; + switch ((TUint)c) + { + case '*': + tableIndex=14; + break; + case '#': + tableIndex=15; + break; + default: + if (c.IsDigit()) + tableIndex=(TUint)c-'0'; + else //letter + { + c.UpperCase(); + tableIndex=(TUint)c-'A'+10; + } + } + TInt high=KDtmfToneTable[tableIndex]&0xf0; + TInt low=KDtmfToneTable[tableIndex]&0x0f; + switch(high) + { + case KDtmfTone1209: + highFrequency=1209; + break; + case KDtmfTone1336: + highFrequency=1336; + break; + case KDtmfTone1477: + highFrequency=1477; + break; + default://KDtmfTone1633: + highFrequency=1633; + break; + } + switch(low) + { + case KDtmfTone697: + lowFrequency=697; + break; + case KDtmfTone770: + lowFrequency=770; + break; + case KDtmfTone852: + lowFrequency=852; + break; + default://KDtmfTone941: + lowFrequency=941; + break; + } + high>>=4; + const TUint8* dtmfVolumes=&KDtmfVolumeTable[0][0]; + TInt volume=dtmfVolumes[((low)<<2)+(high)]<<7; + highVolume = volume; + lowVolume = (1<<15)-volume; + + iTrailingSilence = iOffSamples; + iSamplesLeft = iOnSamples; + } + else if ((TUint)c==',') + { + iTrailingSilence = iPauseSamples; + iSamplesLeft = 0; + } + else if (c.IsSpace()) + { + if (iChar < iDTMFString->Length()) + goto Retry; + } + else + return KErrCorrupt; + + if (iOnSamples < 0) // Play only first character for ever + { + iTrailingSilence = 0; + iSamplesLeft = iRate * iChannels; // One second of samples + iChar = 0; // Reset so this character is played again next time + iRampDown = EFalse; + if (!onlyPlayFirstTone) + { + iRampUp = EFalse; + // This is not the first time around so we should not + // reset the tone generator - it will already have the + // correct settings and setting them again would cause + // an audible discontinuity + return KErrNone; + } + } + + iSineWave.SetFrequency(highFrequency,highVolume,lowFrequency,lowVolume); + return KErrNone; + } + +// +// TMdaSequenceGenerator +// + + +// ----------------------------------------------------------------------------- +// void TMdaSequenceGenerator::Reset() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TMdaSequenceGenerator::Reset() + { + iInstructionPtr = REINTERPRET_CAST(const TInt16*,&((*iSequenceData)[0])); + iInstructionPtr += 2; // Skip signature + iStackIndex = 0; + } + +// ----------------------------------------------------------------------------- +// TMdaSequenceGenerator::SetSequenceData +// Store the sequence data to be played +// No need to validate it as it will already have been checked +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TMdaSequenceGenerator::SetSequenceData( + const TDesC8& aSequenceData) + { + iSequenceData = &aSequenceData; + iInstructionPtr = REINTERPRET_CAST(const TInt16*,&aSequenceData[0]); + iLastInstruction = iInstructionPtr + (iSequenceData->Length()>>1) - 1; + + // These are asserts because this should not be called if signature not present + ASSERT(*iInstructionPtr == KFixedSequenceSignatureOne); + ASSERT(*(iInstructionPtr+1) == KFixedSequenceSignatureTwo); + + iInstructionPtr += 2; // Skip signature + + iStackIndex = 0; + } + +// ----------------------------------------------------------------------------- +// TMdaSequenceGenerator::GetNextTone +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt TMdaSequenceGenerator::GetNextTone() + { + ASSERT(iInstructionPtr); // Sanity check + + TInt ret = KRequestPending; + while (ret == KRequestPending) + { + if (iInstructionPtr > iLastInstruction) + ret = KErrCorrupt; + else if (*iInstructionPtr<=0) + { + switch (*iInstructionPtr) + { + case KFixedSequenceFunctionReturn: // End of sequence + ret = KErrNone; + break; + + case KFixedSequenceFunctionStartLoop: + if (iStackIndex>2) // Validate - can only nest twice + ret = KErrCorrupt; + else if ((iInstructionPtr+2) > iLastInstruction) + ret = KErrCorrupt; // Don't run off end of sequence + else + { + iStack[iStackIndex++]=(TInt)(iInstructionPtr+2); + iStack[iStackIndex++]=(TInt)*(iInstructionPtr+1); + iInstructionPtr+=2; + } + break; + + case KFixedSequenceFunctionEndLoop: + if (iStackIndex==0) // Validate - must already be nested + ret = KErrCorrupt; + else + { + if ((--iStack[iStackIndex-1])!=0) + iInstructionPtr=(TInt16*)iStack[iStackIndex-2]; + else + { + iStackIndex-=2; + iInstructionPtr++; + } + } + break; + + default: // Bad sequence + ret = KErrCorrupt; + } + } + else + { + if ((iInstructionPtr+5) > iLastInstruction) + ret = KErrCorrupt; // Don't run off end of sequence + else + { + iSamplesLeft = *iInstructionPtr++; + TInt freqOne = *iInstructionPtr++; + TInt volOne = *iInstructionPtr++; + TInt freqTwo = *iInstructionPtr++; + TInt volTwo = *iInstructionPtr++; + + if ((volOne> 1<<15)||(volTwo > 1<<15)) + ret = KErrCorrupt; + else + { + iSineWave.SetFrequency(freqOne,volOne,freqTwo,volTwo); + ret = KErrNone; + } + } + } + } + return ret; + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/ToneGenerator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/ToneGenerator.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,438 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* +*/ + + + +#ifndef TONEGENERATOR_H +#define TONEGENERATOR_H + +// INCLUDES +#include + +// CONSTANTS +const TInt KMaxSineTable = 256; +const TUint KToneBufferSize = 8192; +// one second in microseconds +const TInt KOneMillionMicroSeconds = 1000000; +const TInt KMaxSequenceStack = 6; +const TInt KBufferLength = 0x1000; + +// CLASS DECLARATION + +/** +* Utility class used by DevSound Adaptation to generage PCM data for playing +* back tone on WINSCW Reference Implementation.. +* +* @lib MmfDevSoundAdaptation.lib +* @since Series 60 3.0 +*/ +class TSineGen + { + public: + + /** + * Sets frequency and amplitude. + * @since Series 60 3.0 + * @param TInt aFrequency Frequency to generate PCM data. + * @param TInt aAmplitude Amplitude to generate PCM data. + * @return void + */ + void SetFrequency(TInt aFrequency,TInt aAmplitude); + + /** + * Returns the next sample. + * @since Series 60 3.0 + * @return TInt Sample. + */ + TInt NextSample(); + + private: + + TUint iPosition; + TUint iStep; + TInt iAmplitude; + static const TInt16 SineTable[KMaxSineTable]; + static const TInt16 IncTable[KMaxSineTable]; + }; + +/** +* Utility class used by DevSound Adaptation to generage PCM data for playing +* back tone on WINSCW Reference Implementation.. +* +* @lib MmfDevSoundAdaptation.lib +* @since Series 60 3.0 +*/ +class TSineWave + { + public: + + /** + * Generate Sine wave representing tone. + * @since Series 60 3.0 + * @param TInt16* aDest Destination + * @param TInt aCount Count + * @return void + */ + void Generate(TInt16* aDest,TInt aCount); + + /** + * Set frequency amplitude. + * @since Series 60 3.0 + * @param TInt aFrequency Frequency to generate PCM data. + * @param TInt aAmplitude Amplitude to generate PCM data. + * @return void + */ + void SetFrequency(TInt aFrequency,TInt aAmplitude); + + /** + * Set frequency amplitude. + * @since Series 60 3.0 + * @param TInt aFrequency1 Frequency to generate PCM data. + * @param TInt aAmplitude1 Amplitude to generate PCM data. + * @param TInt aFrequency2 Frequency to generate PCM data. + * @param TInt aAmplitude2 Amplitude to generate PCM data. + * @return void + */ + void SetFrequency(TInt aFrequency1,TInt aAmplitude1,TInt aFrequency2,TInt aAmplitude2); + + private: + TSineGen iGen1; + TSineGen iGen2; + }; + + +/** +* Tone synthesis interface +* Defines the abstract interface for tone synthesis +* Capable of filling buffers with audio data +* +* @lib MmfDevSoundAdaptation.lib +* @since Series 60 3.0 +*/ +class MMdaToneSynthesis + { + public: + + /** + * Allocate necessary resources for this kind of synthesis + * @since Series 60 3.0 + * @param TInt aRate Sampling rate. + * @param TInt aChannels Mono/Stereo. + * @param TInt aRepeats Tone repeats. + * @param TInt aSilence Silence duration between repetation. + * @param TInt aRampUp Volume ramping duration. + * @return void + */ + virtual void Configure(TInt aRate, + TInt aChannels, + TInt aRepeats, + TInt aSilence, + TInt aRampUp)=0; + + /** + * Reset generator + * @since Series 60 3.0 + * @return void + */ + virtual void Reset()=0; + + /** + * Fill supplied buffer with next block of 16bit PCM audio data + * @since Series 60 3.0 + * @param TDes8& aBuffer A descriptor reference to buffer where data need + * to be filled. + * @return KErrNone if successfull, else corresponding error code + */ + virtual TInt FillBuffer(TDes8& aBuffer)=0; + }; + + +/** +* Tone generator base class +* +* @lib MmfDevSoundAdaptation.lib +* @since Series 60 3.0 +*/ +class TMdaToneGenerator : public MMdaToneSynthesis + { + public: + + /** + * Configures Tone generator. + * @since Series 60 3.0 + * @param TInt aRate Sampling rate. + * @param TInt aChannels Mono/Stereo. + * @param TInt aRepeats Tone repeats. + * @param TInt aSilence Silence duration between repetation. + * @param TInt aRampUp Volume ramping duration. + * @return void + */ + virtual void Configure(TInt aRate, + TInt aChannels, + TInt aRepeats, + TInt aSilence, + TInt aRampUp); + + /** + * Fill supplied buffer with next block of 16bit PCM audio data + * @since Series 60 3.0 + * @param TDes8& aBuffer A descriptor reference to buffer where data need + * to be filled. + * @return KErrNone if successfull, else corresponding error code + */ + virtual TInt FillBuffer(TDes8& aBuffer); + + protected: + + /** + * Gets the next tone buffer + * @since Series 60 3.0 + * @return KErrNone if successfull, else corresponding error code + */ + virtual TInt GetNextTone()=0; + + /** + * Converts duration to PCM samples. + * @since Series 60 3.0 + * @param const TTimeIntervalMicroSeconds& aDuration Duration. + * @return KErrNone if successfull, else corresponding error code + */ + TInt DurationToSamples(const TTimeIntervalMicroSeconds& aDuration); + + protected: + TSineWave iSineWave; + TInt iRate; + TInt iChannels; + TInt iSamplesLeft; + TInt iTrailingSilence; + TBool iRampUp; + TBool iRampDown; + TInt iRepeats; + TInt iSilenceBetweenRepeats; + TBool iAfterRepeatSilence; + TInt iRampUpCount; + TInt iRampUpLeft; + }; + + +/** +* Simple tone synthesis +* +* @lib MmfDevSoundAdaptation.lib +* @since Series 60 3.0 +*/ +class TMdaSimpleToneGenerator : public TMdaToneGenerator + { + public: + + /** + * Sets frequency and duration for generating PCM data. + * @since Series 60 3.0 + * @param TInt aFrequency Frequency of tone to be generated. + * @param const TTimeIntervalMicroSeconds& aDuration Duration of tone to + * be generated. + * @return void + */ + void SetFrequencyAndDuration(TInt aFrequency, + const TTimeIntervalMicroSeconds& aDuration); + + /** + * Reset generator + * @since Series 60 3.0 + * @return void + */ + virtual void Reset(); + + /** + * Gets the next tone buffer + * @since Series 60 3.0 + * @return KErrNone if successfull, else corresponding error code + */ + virtual TInt GetNextTone(); + + private: + TTimeIntervalMicroSeconds iDuration; + TInt iFrequency; + TBool iPlayed; + }; + +/** +* Dual tone synthesis +* Generates a tone consisting of two sine waves of different +* frequencies summed together. +* +* @lib MmfDevSoundAdaptation.lib +* @since Series 60 3.0 +*/ +class TMdaDualToneGenerator : public TMdaToneGenerator + { + public: + + /** + * ?member_description. + * @since Series 60 3.0 + * @param ?arg1 + */ + void SetFrequencyAndDuration(TInt aFrequencyOne, + TInt aFrequencyTwo, + const TTimeIntervalMicroSeconds& aDuration); + + /** + * Reset generator + * @since Series 60 3.0 + * @return void + */ + virtual void Reset(); + + /** + * Gets the next tone buffer + * @since Series 60 3.0 + * @return KErrNone if successfull, else corresponding error code + */ + virtual TInt GetNextTone(); + + private: + TTimeIntervalMicroSeconds iDuration; + TInt iFrequencyOne; + TInt iFrequencyTwo; + TBool iPlayed; + }; + +/** +* DTMF tone synthesis +* ?other_description_lines +* +* @lib MmfDevSoundAdaptation.lib +* @since Series 60 3.0 +*/ +class TMdaDTMFGenerator : public TMdaToneGenerator + { + public: + + /** + * Reset generator + * @since Series 60 3.0 + * @return void + */ + virtual void Reset(); + + /** + * ?member_description. + * @since Series 60 3.0 + * @param ?arg1 + */ + void SetToneDurations( const TTimeIntervalMicroSeconds32 aOn, + const TTimeIntervalMicroSeconds32 aOff, + const TTimeIntervalMicroSeconds32 aPause); + + /** + * ?member_description. + * @since Series 60 3.0 + * @param ?arg1 + */ + void SetString(const TDesC& aDTMFString); + + private: + + /** + * Gets the next tone buffer + * @since Series 60 3.0 + * @return KErrNone if successfull, else corresponding error code + */ + virtual TInt GetNextTone(); + + private: + const TDesC* iDTMFString; + TTimeIntervalMicroSeconds32 iOn; + TTimeIntervalMicroSeconds32 iOff; + TTimeIntervalMicroSeconds32 iPause; + TInt iOnSamples; + TInt iOffSamples; + TInt iPauseSamples; + TInt iChar; + TBool iPlayToneOff; + }; + +/** +* Tone sequence synthesis +* ?other_description_lines +* +* @lib MmfDevSoundAdaptation.lib +* @since Series 60 3.0 +*/ +class TMdaSequenceGenerator : public TMdaToneGenerator + { + public: + + /** + * Reset generator + * @since Series 60 3.0 + * @return void + */ + virtual void Reset(); + + /** + * ?member_description. + * @since Series 60 3.0 + * @param ?arg1 + */ + void SetSequenceData(const TDesC8& aSequenceData); + + private: + + /** + * Gets the next tone buffer + * @since Series 60 3.0 + * @return KErrNone if successfull, else corresponding error code + */ + virtual TInt GetNextTone(); + + private: + const TDesC8* iSequenceData; + const TInt16* iInstructionPtr; + const TInt16* iLastInstruction; + TInt iStack[KMaxSequenceStack]; + TInt iStackIndex; + }; + + +/** +* Public Media Server includes +* ?other_description_lines +* +* @lib MmfDevSoundAdaptation.lib +* @since Series 60 3.0 +*/ +class TMdaPtr8 : public TPtr8 //needed for this WINS Impl of Tone Gen + { + public: + TMdaPtr8() + : TPtr8(0,0,0) {}; + inline void Set(const TDes8& aDes) + { TPtr8::Set((TUint8*)(aDes.Ptr()),aDes.Length(),aDes.MaxLength()); }; + inline void SetLengthOnly(const TDes8& aDes) + { TPtr8::Set((TUint8*)(aDes.Ptr()),aDes.Length(),aDes.Length()); }; + inline void Set(const TPtrC8& aDes) + { TPtr8::Set((TUint8*)(aDes.Ptr()),aDes.Length(),aDes.Length()); }; + inline void Shift(TInt aOffset) + { SetLength(Length()-aOffset); iMaxLength-=aOffset; iPtr+=aOffset; }; + }; + +#endif // TONEGENERATOR_H + +// End of File + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/TonePlayCompleteTimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/TonePlayCompleteTimer.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Utility timer object used for playing tone sequence. +* +*/ + + + +// INCLUDE FILES +#include "MmfDevSoundAdaptationBody.h" +#include "TonePlayCompleteTimer.h" + +#ifdef _DEBUG +#include "e32debug.h" + +#define DEBPRN0(str) RDebug::Print(str, this) +#define DEBPRN1(str, val1) RDebug::Print(str, this, val1) +#else +#define DEBPRN0(str) +#define DEBPRN1(str, val1) +#endif //_DEBUG + + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTonePlayCompleteTimer::CTonePlayCompleteTimer +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CTonePlayCompleteTimer::CTonePlayCompleteTimer( + MDevSoundAdaptationObserver& aObserver) : + CActive(EPriorityNormal), iObserver(aObserver) + { + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// CTonePlayCompleteTimer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CTonePlayCompleteTimer::ConstructL() + { + User::LeaveIfError(iTimer.CreateLocal()); + } + +// ----------------------------------------------------------------------------- +// CTonePlayCompleteTimer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CTonePlayCompleteTimer* CTonePlayCompleteTimer::NewL( + MDevSoundAdaptationObserver& aObserver) + { + CTonePlayCompleteTimer* self = new (ELeave)CTonePlayCompleteTimer(aObserver); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +// ----------------------------------------------------------------------------- +// CTonePlayCompleteTimer::~CTonePlayCompleteTimer +// Destructor +// ----------------------------------------------------------------------------- +// +CTonePlayCompleteTimer::~CTonePlayCompleteTimer() + { + // Cancel any outstanding requests + iTimer.Cancel(); + Cancel(); + iTimer.Close(); + } + +// ---------------------------------------------------------------------------- +// CTonePlayCompleteTimer::SetTimeOut +// Sets the timeout duration. +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +void CTonePlayCompleteTimer::SetTimeOut(TTimeIntervalMicroSeconds32& aTimeOut) + { + iTimeOut = aTimeOut; + } + +// ---------------------------------------------------------------------------- +// CTonePlayCompleteTimer::Start +// Starts the timer for timeout duration set by SetTimeOut(). +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +void CTonePlayCompleteTimer::Start() + { + if (!IsActive()) + { + SetActive(); + iTimer.After(iStatus, iTimeOut); + } + } + +// ---------------------------------------------------------------------------- +// CTonePlayCompleteTimer::RunL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +void CTonePlayCompleteTimer::RunL() + { + DEBPRN0(_L("CTonePlayCompleteTimer[0x%x]::RunL")); + iObserver.ToneFinished(KErrNone); + } + +// ---------------------------------------------------------------------------- +// CTonePlayCompleteTimer::DoCancel +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +void CTonePlayCompleteTimer::DoCancel() + { + iTimer.Cancel(); + } + +// ---------------------------------------------------------------------------- +// CTonePlayCompleteTimer::RunError +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +TInt CTonePlayCompleteTimer::RunError(TInt /*aError*/) + { + return KErrNone; + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/TonePlayCompleteTimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/TonePlayCompleteTimer.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Utility timer object used for playing tone sequence. +* +*/ + + + +#ifndef TONEPLAYCOMPLETETIMER_H +#define TONEPLAYCOMPLETETIMER_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION + +/** +* Utility timer object used for playing tone sequence. +* +* @lib MmfDevSoundAdaptation_Stub.lib +* @since Series 60 3.0 +*/ +class CTonePlayCompleteTimer : public CActive + { + public: // Constructors and destructor + + /** + * Constructs, and returns a pointer to, a new CTonePlayCompleteTimer + * object. + * Leaves on failure.. + * @since Series 60 3.0 + * @return CTonePlayCompleteTimer* A pointer to newly created object. + */ + static CTonePlayCompleteTimer* NewL(MDevSoundAdaptationObserver& + aDevSoundObserver); + + /** + * Destructor. + */ + ~CTonePlayCompleteTimer(); + + public: // New functions + + /** + * Sets the timeout duration. + * @since Series 60 3.0 + * @return void + */ + void SetTimeOut(TTimeIntervalMicroSeconds32& aTimeOut); + + /** + * Starts the timer for timeout duration set by SetTimeOut(). + * @since Series 60 3.0 + * @return void + */ + void Start(); + + protected: // Functions from base classes + + /** + * Called by CActive object framework when local timer times out. + * @since Series 60 3.0 + * @return void + */ + void RunL(); + + /** + * Called by CActive object framework when client cancels active object. + * @since Series 60 3.0 + * @return void + */ + void DoCancel(); + + /** + * Called by CActive object framework when RunL leaves. + * @since Series 60 3.0 + * @param TInt aError Error code. + * @return KErrNone + */ + TInt RunError(TInt aError); + + private: + + /** + * C++ default constructor. + */ + CTonePlayCompleteTimer(MDevSoundAdaptationObserver& + aDevSoundObserver); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + // Pointer reference to HwDevice observer. + MDevSoundAdaptationObserver& iObserver; + // Time out duration + TTimeIntervalMicroSeconds32 iTimeOut; + // Local timer object + RTimer iTimer; + + }; + +#endif // TONEPLAYCOMPLETETIMER_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/restrictedaudiooutputcistub/BWINS/RestrictedAudioOutputCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/restrictedaudiooutputcistub/BWINS/RestrictedAudioOutputCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?NewL@CRestrictedAudioOutputCI@@SAPAV1@XZ @ 1 NONAME ; class CRestrictedAudioOutputCI * CRestrictedAudioOutputCI::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/restrictedaudiooutputcistub/EABI/RestrictedAudioOutputCIu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/restrictedaudiooutputcistub/EABI/RestrictedAudioOutputCIu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,5 @@ +EXPORTS + _ZN24CRestrictedAudioOutputCI4NewLEv @ 1 NONAME + _ZTI24CRestrictedAudioOutputCI @ 2 NONAME ; ## + _ZTV24CRestrictedAudioOutputCI @ 3 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/restrictedaudiooutputcistub/Group/RestrictedAudioOutputCIStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/restrictedaudiooutputcistub/Group/RestrictedAudioOutputCIStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - +* Version : %version: bh1mmcf#2.1.8 % +* +*/ + + +#include + +TARGET RestrictedAudioOutputCI_stub.dll +TARGETTYPE DLL +UID 0x1000008D 0x10207B94 +VENDORID VID_DEFAULT + + +CAPABILITY CAP_GENERAL_DLL + + +SOURCEPATH ../src +SOURCE RestrictedAudioOutputCIStub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE /epoc32/include/mmf/common +SYSTEMINCLUDE /epoc32/include/mmf/server +SYSTEMINCLUDE /epoc32/include/drivers + +LIBRARY euser.lib +LIBRARY mmfserverbaseclasses.lib +LIBRARY RestrictedAudioOutput.lib +start wins +win32_library kernel32.lib +end + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY RestrictedAudioOutputCI.lib + +LINKAS RestrictedAudioOutputCI.dll diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/restrictedaudiooutputcistub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/restrictedaudiooutputcistub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project build file for adaptation custom interface +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +RestrictedAudioOutputCIStub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/restrictedaudiooutputcistub/inc/RestrictedAudioOutputCIStub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/restrictedaudiooutputcistub/inc/RestrictedAudioOutputCIStub.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - This is the definition of the RestrictedAudioOutput Custom Interface class. +* This serves as an example of how adaptation might define the +* custom interface class. +* The CRestrictedAudioOutputCI object is typically instantiated by a DevSound +* instance and return to the client when the CustomInterface() +* method is invoked. +* +* +*/ + +#ifndef RESTRICTEDAUDIOOUTPUTCI_H +#define RESTRICTEDAUDIOOUTPUTCI_H + +#include +#include +# +class CMMFDevSound; + +class CRestrictedAudioOutputCI : public CRestrictedAudioOutput + + { + public: // Constructor and Destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CRestrictedAudioOutputCI* NewL(); + + /** + * Destructor. + */ + virtual ~CRestrictedAudioOutputCI(); + + public: // From Base Class + + /** + * + * + * @since 3.2 + */ + virtual TInt Commit(); + + private: + + /** + * By default Symbian 2nd phase constructor is private. + */ + // static void ConstructL(); + /** + * C++ default constructor. + */ + + CRestrictedAudioOutputCI(); + + private: // Data + + + }; +#endif //RESTRICTEDAUDIOOUTPUTCI_H diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/devsoundextensions_stubs/restrictedaudiooutputcistub/src/RestrictedAudioOutputCIStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/devsoundextensions_stubs/restrictedaudiooutputcistub/src/RestrictedAudioOutputCIStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Stubs - Project definition file for project ?myapp +* +*/ + + +#ifdef _DEBUG +#include // Needed for RDebug Prints +#endif +#include +#include "RestrictedAudioOutputCIStub.h" +#include + +// ----------------------------------------------------------------------------- +// CRestrictedAudioOutput::NewL +// Static function for creating an instance of the CRestrictedAudioOutputCI object. +// ----------------------------------------------------------------------------- +// + +EXPORT_C CRestrictedAudioOutputCI* CRestrictedAudioOutputCI::NewL() + { +#ifdef _DEBUG + RDebug::Print(_L("CRestrictedAudioOutputCI::NewL")); +#endif + CRestrictedAudioOutputCI* self = new(ELeave) CRestrictedAudioOutputCI(); + CleanupStack::PushL(self); + self->ConstructL(); // will call base class ConstructL + CleanupStack::Pop(self); + return self; + } + + +CRestrictedAudioOutputCI::CRestrictedAudioOutputCI() + { + + } + +// Destructor + +CRestrictedAudioOutputCI::~CRestrictedAudioOutputCI() + { +#ifdef _DEBUG + RDebug::Print(_L("CRestrictedAudioOutputCI::~CRestrictedAudioOutputCI")); +#endif + + } + +// ----------------------------------------------------------------------------- +// CRestrictedAudioOutputCI::Commit +// +// Sets Observer for DevSound. +// ----------------------------------------------------------------------------- + +TInt CRestrictedAudioOutputCI::Commit() + { +#ifdef _DEBUG + RDebug::Print(_L("CRestrictedAudioOutputCI::Commit")); +#endif + return KErrNone; + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/fmradiotunercontrolstub/Bwins/FMRadioTunerControlU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/fmradiotunercontrolstub/Bwins/FMRadioTunerControlU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?NewL@CFMRadioTunerControl@@SAPAV1@AAVMFMRadioTunerControlObserver@@@Z @ 1 NONAME ; class CFMRadioTunerControl * CFMRadioTunerControl::NewL(class MFMRadioTunerControlObserver &) + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/fmradiotunercontrolstub/EABI/FMRadioTunerControlU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/fmradiotunercontrolstub/EABI/FMRadioTunerControlU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,5 @@ +EXPORTS + _ZN20CFMRadioTunerControl4NewLER28MFMRadioTunerControlObserver @ 1 NONAME + _ZTI11CAdaptation @ 2 NONAME ; ## + _ZTV11CAdaptation @ 3 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/fmradiotunercontrolstub/Group/FMRadioTunerControlStub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/fmradiotunercontrolstub/Group/FMRadioTunerControlStub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for RadioServer Console Test +* +*/ + + +#include + +TARGET FMRadioTunerControl.dll +CAPABILITY CAP_GENERAL_DLL +TARGETTYPE DLL +UID 0x1000008d 0x2000C0C0 +VENDORID VID_DEFAULT + +SOURCEPATH ../Src +SOURCE FMRadioTunerControlStub.cpp + +USERINCLUDE ../Src + +OS_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/fmradiotunercontrolstub/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/fmradiotunercontrolstub/Group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project build file for FMRadioTunerControlStub +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +PRJ_MMPFILES +FMRadioTunerControlStub.mmp + + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/fmradiotunercontrolstub/Src/FMRadioTunerControlStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/fmradiotunercontrolstub/Src/FMRadioTunerControlStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1400 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Contains implementation of the CAdaptation class. +* Which holds RadioServer Console Test. +* +*/ + + + +// INCLUDE FILES +#include +#include "FMRadioTunerControlStub.h" + +// CONSTANTS +const TInt KReqTunerOn = 1; +const TInt KReqTunerOff = 2; +const TInt KReqSetFrequencyRange = 3; +const TInt KReqSetFrequency = 4; +const TInt KReqStationSeek = 5; +const TInt KReqAudioMode = 6; +const TInt KReqSetAudioMode = 7; +const TInt KReqMaxSignalStrength = 8; +const TInt KReqSignalStrength = 9; +const TInt KReqSquelch = 10; +const TInt KReqSetSquelch = 11; +//--------------------------------------- +const TInt KReqStationSeekByPTY = 12; +const TInt KReqStationSeekByTA = 13; +const TInt KReqStationSeekByTP = 14; +const TInt KReqGetFreqByPTY = 15; +const TInt KReqGetFreqByTA = 16; +const TInt KReqGetPSByPTY = 17; +const TInt KReqGetPSByTA = 18; + +const TInt KEuroAmericaMin = 87500000; +const TInt KEuroAmericaMax = 108000000; +const TInt KJapanMin = 76000000; +const TInt KJapanMax = 90000000; + +/* +KCBI 90.9 PTY = KRdsPtyReligion +KLTY 94.9 PTY = KRdsPtyReligion +KVIL 103.7 PTY = KRdsPtyLightClassical +KHKS 106.1 PTY = KRdsPtyRockMusic +*/ + +const TInt KFrequency1 = 90900000; // TA, TP +const TInt KFrequency2 = 94900000; // Alternate Frequency of KFrequency1 +const TInt KFrequency3 = 103700000; +const TInt KFrequency4 = 106100000; // TP + +// DATA TYPES +struct TRadioMessageRequestData + { + TSglQueLink iLink; + TInt iRequest; + TInt iError; + }; + +// ============================= LOCAL FUNCTIONS =============================== + +/** +* Class CTuner +* @lib FMRadioTunerControlStub.lib +* @since Series 60 3.0 +*/ +class CTuner : public CTimer + { + public: + static CTuner* NewL( MFMRadioTunerControlObserver& aObserver ) + { + CTuner* self = new( ELeave ) CTuner(aObserver); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + }; + + virtual ~CTuner() + { + iFreqList.Close(); + iPsList.Close(); + iRTplusTags.Close(); + if ( IsActive() ) + { + Cancel(); + } + TRadioMessageRequestData* data; + while ( !iRequestQue.IsEmpty() ) + { + data = iRequestQue.First(); + iRequestQue.Remove(*data); + delete data; + } + }; + + void CompleteRequest( TInt aRequest, TInt aError ) + { + TRadioMessageRequestData *data = new (ELeave) TRadioMessageRequestData; + data->iRequest = aRequest; + data->iError = aError; + // Add it to the queue + iRequestQue.AddLast(*data); + if ( !IsActive() ) + { + After(500000); // 0.5 sec by default + } + }; + + void Reset() + { + iTunerOn = EFalse; + iRange = EFMRadioFrequencyEuroAmerica; + iFrequency = KEuroAmericaMin; + iSigStrength = 0; + iMode = EFMRadioAudioStereo; + iSquelch = ETrue; + ResetRds(); + }; + + void ResetRds() + { + iNotifyOn = EFalse; + iRdsSignal = EFalse; + iRdsData = 0; + iAutoSwitch = EFalse; + iFreqList.Reset(); + iPsList.Reset(); + iPi = 0; + iPty = KRdsPtyNone; + iPs = _L8(""); + iRt = _L8(""); + iRTplusTags.Reset(); + // Hardcoded to 2007/11/10 7:35 + iCt.Set(2007,ENovember,10,7,35,0,0); + }; + + void SendRdsData() + { + // Make sure we are still in RDS channel + if ( !iRdsSignal || !iNotifyOn ) + { + return; + } + + if( iRdsData & ERdsProgrammeIdentification ) + { + iRdsObserver->RdsDataPI(iPi); + } + if( iRdsData & ERdsProgrammeType ) + { + iRdsObserver->RdsDataPTY(iPty); + } + if( iRdsData & ERdsProgrammeService ) + { + iRdsObserver->RdsDataPS(iPs); + } + if( iRdsData & ERdsRadioText ) + { + iRdsObserver->RdsDataRT(iRt, iRTplusTags); + } + if( iRdsData & ERdsClockTime ) + { + iRdsObserver->RdsDataCT(iCt); + } + }; + + void SendRdsAf(TBool aBegin) + { + if (aBegin) + { + iRdsObserver->RdsSearchBeginAF(); + } + else + { + iFrequency = KFrequency2; + iSigStrength = 2; + iPs = _L8("KLTY"); + iRdsObserver->RdsSearchEndAF(iError, iFrequency); + } + }; + + + private: + void DoCancel() + {}; + + void RunL() + { + TRadioMessageRequestData* data; + data = iRequestQue.First(); + iRequestQue.Remove(*data); + iRequest = data->iRequest; + iError = data->iError; + delete data; + + switch (iRequest) + { + case KReqTunerOn: + iObserver->TunerOnComplete(iError); + break; + case KReqTunerOff: + iObserver->TunerOffComplete(iError); + break; + case KReqSetFrequencyRange: + iObserver->SetFrequencyRangeComplete(iError); + break; + case KReqSetFrequency: + iObserver->SetFrequencyComplete(iError); + break; + case KReqStationSeek: + iObserver->StationSeekComplete(iError, iFrequency); + break; + case KReqAudioMode: + iObserver->AudioModeComplete(iError, iMode); + break; + case KReqSetAudioMode: + iObserver->SetAudioModeComplete(iError); + break; + case KReqMaxSignalStrength: + iObserver->MaxSignalStrengthComplete(iError, 15); + break; + case KReqSignalStrength: + iObserver->SignalStrengthComplete(iError, iSigStrength); + break; + case KReqSquelch: + iObserver->SquelchComplete(iError, iSquelch); + break; + case KReqSetSquelch: + iObserver->SetSquelchComplete(iError); + break; +// ----------------------------------------------------------------------------- +// RDS + case KReqStationSeekByPTY: + iRdsObserver->StationSeekByPTYComplete(iError, iFrequency); + break; + case KReqStationSeekByTA: + iRdsObserver->StationSeekByTAComplete(iError, iFrequency); + break; + case KReqStationSeekByTP: + iRdsObserver->StationSeekByTPComplete(iError, iFrequency); + break; + case KReqGetFreqByPTY: + iRdsObserver->GetFreqByPTYComplete(iError, iFreqList); + break; + case KReqGetFreqByTA: + iRdsObserver->GetFreqByTAComplete(iError, iFreqList); + break; + case KReqGetPSByPTY: + iRdsObserver->GetPSByPTYComplete(iError, iPsList); + break; + case KReqGetPSByTA: + iRdsObserver->GetPSByTAComplete(iError, iPsList); + break; +// RDS +// ----------------------------------------------------------------------------- + default: + break; + } + + // Process the next item in the queue if any + if ( !iRequestQue.IsEmpty() ) + { + // there is at least one element in the linked list + After(100000); // 0.1 sec by default + } + }; + + private: + CTuner( MFMRadioTunerControlObserver& aObserver ) + : CTimer(EPriorityStandard), + iObserver(&aObserver), + iRdsObserver(NULL), + iRequestQue(_FOFF( TRadioMessageRequestData, iLink )) + {}; + + void ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add(this); + Reset(); + }; + + private: // Data + // Tuner observer + MFMRadioTunerControlObserver* iObserver; + // Rds observer + MRdsControlObserver* iRdsObserver; + // Request queue + TSglQue iRequestQue; + // Outstanding request + TInt iRequest; + TInt iError; + + // Tuner data + TBool iTunerOn; + TFMRadioFrequencyRange iRange; + TInt iFrequency; + TInt iSigStrength; + TFMRadioAudioMode iMode; + TBool iSquelch; + + // RDS data + TBool iNotifyOn; + TBool iRdsSignal; + TUint32 iRdsData; + TBool iAutoSwitch; + RArray iFreqList; + RArray iPsList; + TInt iPi; + TRdsProgrammeType iPty; + TRdsPSName iPs; + TRdsRadioText iRt; + RArray iRTplusTags; + TDateTime iCt; + + private: // Friend classes + friend class CAdaptation; + friend class CRdsGenerator; + }; + +/** +* Class CRdsGenerator +* @lib FMRadioTunerControlStub.lib +* @since Series 60 3.2 +*/ +class CRdsGenerator : public CTimer + { + public: + static CRdsGenerator* NewL(CTuner& aTuner) + { + CRdsGenerator* self = new( ELeave ) CRdsGenerator(aTuner); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + }; + + virtual ~CRdsGenerator() + { + if ( IsActive() ) + { + Cancel(); + } + }; + + void Start() + { + if ( IsActive() ) + { + Cancel(); + } + After(1000000); // 1 sec + }; + + private: + void DoCancel() + {}; + + void RunL() + { + iTuner->SendRdsData(); + }; + + private: + CRdsGenerator( CTuner& aTuner ) + : CTimer(EPriorityStandard), + iTuner(&aTuner) + {}; + + void ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add(this); + }; + + private: // Data + // Tuner + CTuner* iTuner; + }; + +/** +* Class CAfSwitcher +* @lib FMRadioTunerControlStub.lib +* @since Series 60 3.2 +*/ +class CAfSwitcher : public CTimer + { + public: + static CAfSwitcher* NewL(CTuner& aTuner) + { + CAfSwitcher* self = new( ELeave ) CAfSwitcher(aTuner); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + }; + + virtual ~CAfSwitcher() + { + if ( IsActive() ) + { + Cancel(); + } + }; + + void Start() + { + if ( IsActive() ) + { + Cancel(); + } + iBegin = ETrue; + After(3000000); // 3 sec + }; + + private: + void DoCancel() + {}; + + void RunL() + { + iTuner->SendRdsAf(iBegin); + if (iBegin) + { + iBegin = EFalse; + After(2000000); // 2 sec + } + }; + + private: + CAfSwitcher( CTuner& aTuner ) + : CTimer(EPriorityStandard), + iTuner(&aTuner), + iBegin(EFalse) + {}; + + void ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add(this); + }; + + private: // Data + // Tuner + CTuner* iTuner; + TBool iBegin; + }; + +EXPORT_C CFMRadioTunerControl* CFMRadioTunerControl::NewL( + MFMRadioTunerControlObserver& aObserver ) + { + return CAdaptation::NewL(aObserver); + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CAdaptation::CAdaptation +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CAdaptation::CAdaptation() + : iTuner(NULL), + iRds(NULL), + iRdsAf(NULL) + { + } + +// ----------------------------------------------------------------------------- +// CAdaptation::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CAdaptation::ConstructL( + MFMRadioTunerControlObserver& aObserver ) + { + iTuner = CTuner::NewL(aObserver); + iRds = CRdsGenerator::NewL(*iTuner); + iRdsAf = CAfSwitcher::NewL(*iTuner); + } + +// ----------------------------------------------------------------------------- +// CAdaptation::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CAdaptation* CAdaptation::NewL( + MFMRadioTunerControlObserver& aObserver ) + { + CAdaptation* self = new( ELeave ) CAdaptation(); + CleanupStack::PushL( self ); + self->ConstructL(aObserver); + CleanupStack::Pop(); + return self; + } + +// Destructor +CAdaptation::~CAdaptation() + { + delete iRdsAf; + delete iRds; + delete iTuner; + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::TunerOn( + TFMRadioFrequencyRange aRange, + TInt aFrequency ) + { + if ( ValidFrequency(aRange, aFrequency) ) + { + iTuner->iTunerOn = ETrue; + iTuner->iRange = aRange; + SetFrequencySettings(aFrequency); + iTuner->CompleteRequest(KReqTunerOn, KErrNone); + } + else + { + iTuner->CompleteRequest(KReqTunerOn, KFMRadioErrFrequencyOutOfBandRange); + } + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelTunerOn() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::TunerOff() + { + iTuner->Reset(); + iTuner->CompleteRequest(KReqTunerOff, KErrNone); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelTunerOff() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::SetFrequencyRange( + TFMRadioFrequencyRange aRange ) + { + iTuner->iRange = aRange; + iTuner->CompleteRequest(KReqSetFrequencyRange, KErrNone); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelSetFrequencyRange() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::SetFrequency( + TInt aFrequency ) + { + if ( !iTuner->iTunerOn ) + { + iTuner->CompleteRequest(KReqSetFrequency, KFMRadioErrNotPermittedInCurrentState); + return; + } + + if ( ValidFrequency(iTuner->iRange, aFrequency) ) + { + SetFrequencySettings(aFrequency); + iTuner->CompleteRequest(KReqSetFrequency, KErrNone); + } + else + { + iTuner->CompleteRequest(KReqTunerOn, KFMRadioErrFrequencyNotValid); + } + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelSetFrequency() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::StationSeek( + TFMRadioSeekDirection aDirection ) + { + if ( !iTuner->iTunerOn ) + { + iTuner->CompleteRequest(KReqStationSeek, KFMRadioErrNotPermittedInCurrentState); + return; + } + + if ( aDirection == EFMRadioSeekUp ) + { + if ( iTuner->iFrequency < KFrequency1 ) + { + SetFrequencySettings(KFrequency1); + } + else if ( (iTuner->iFrequency >= KFrequency1) && (iTuner->iFrequency < KFrequency2) ) + { + SetFrequencySettings(KFrequency2); + } + else if ( (iTuner->iFrequency >= KFrequency2) && (iTuner->iFrequency < KFrequency3) ) + { + SetFrequencySettings(KFrequency3); + } + else if ( (iTuner->iFrequency >= KFrequency3) && (iTuner->iFrequency < KFrequency4) ) + { + SetFrequencySettings(KFrequency4); + } + else // iTuner->iFrequency >= KFrequency4 + { + SetFrequencySettings(KFrequency1); + } + } + else + { + if ( iTuner->iFrequency > KFrequency4 ) + { + SetFrequencySettings(KFrequency4); + } + else if ( (iTuner->iFrequency <= KFrequency4) && (iTuner->iFrequency > KFrequency3) ) + { + SetFrequencySettings(KFrequency3); + } + else if ( (iTuner->iFrequency <= KFrequency3) && (iTuner->iFrequency > KFrequency2) ) + { + SetFrequencySettings(KFrequency2); + } + else if ( (iTuner->iFrequency <= KFrequency2) && (iTuner->iFrequency > KFrequency1) ) + { + SetFrequencySettings(KFrequency1); + } + else // iTuner->iFrequency < KFrequency1 + { + SetFrequencySettings(KFrequency4); + } + } + + iTuner->CompleteRequest(KReqStationSeek, KErrNone); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelStationSeek() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::AudioMode() + { + iTuner->CompleteRequest(KReqAudioMode, KErrNone); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelAudioMode() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::SetAudioMode( + TFMRadioAudioMode aMode ) + { + iTuner->iMode = aMode; + iTuner->CompleteRequest(KReqSetAudioMode, KErrNone); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelSetAudioMode() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::MaxSignalStrength() + { + iTuner->CompleteRequest(KReqMaxSignalStrength, KErrNone); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelMaxSignalStrength() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::SignalStrength() + { + iTuner->CompleteRequest(KReqSignalStrength, KErrNone); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelSignalStrength() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::Squelch() + { + iTuner->CompleteRequest(KReqSquelch, KErrNone); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelSquelch() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::SetSquelch( + TBool aEnabled ) + { + iTuner->iSquelch = aEnabled; + iTuner->CompleteRequest(KReqSetSquelch, KErrNone); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelSetSquelch() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::BufferToBeFilled( + TDes8& /*aBuffer*/ ) + { + // Not used. + } + +// ----------------------------------------------------------------------------- +// +TFMRadioCapabilities CAdaptation::Capabilities() + { + TFMRadioCapabilities cap; + cap.iSampleRate = EFMRadioSampleRate48000Hz; + cap.iChannels = EFMRadioAudioMono | EFMRadioAudioStereo; + //const TUint32 KMMFFourCCCodePCM16 = 0x36315020; //(' ', 'P', '1', '6') + cap.iEncoding = 0x36315020; + + cap.iTunerBands = EFMRadioFrequencyEuroAmerica | EFMRadioFrequencyJapan; + //cap.iTunerFunctions = ETunerAvailableInOfflineMode | ETunerRdsSupport; + cap.iTunerFunctions = 0x01 | 0x02; + return cap; + } + +/********************************************************************* +* RD_FM_RADIO_ENHANCEMENTS +**********************************************************************/ +#ifdef RD_FM_RADIO_ENHANCEMENTS + +// ----------------------------------------------------------------------------- +// +MRdsControl* CAdaptation::RdsControl( + MRdsControlObserver& aObserver ) + { + iTuner->iRdsObserver = &aObserver; + return this; + } + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::GetFrequencyRange( + TFMRadioFrequencyRange& aRange, + TInt& aMinFreq, + TInt& aMaxFreq ) const + { + aRange = iTuner->iRange; + if ( aRange == EFMRadioFrequencyEuroAmerica ) + { + aMinFreq = KEuroAmericaMin; + aMaxFreq = KEuroAmericaMax; + } + else // aRange = EFMRadioFrequencyJapan; + { + aMinFreq = KJapanMin; + aMaxFreq = KJapanMax; + } + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::GetCapabilities( + TRdsCapabilities& aCaps ) const + { + aCaps.iRdsFunctions = ERdsProgrammeIdentification | ERdsProgrammeType | ERdsProgrammeService + | ERdsRadioText | ERdsClockTime | ERdsAlternateFrequency; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::GetRdsSignalStatus( + TBool& aRdsSignal ) const + { + aRdsSignal = iTuner->iRdsSignal; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::NotifyRdsDataChange( + TRdsData aRdsData ) + { + iTuner->iRdsData = aRdsData.iRdsFunctions; + // We'll only generate events for ERdsProgrammeIdentification, ERdsProgrammeType, + // ERdsProgrammeService for now. + if ( (aRdsData.iRdsFunctions & ERdsProgrammeIdentification) || + (aRdsData.iRdsFunctions & ERdsProgrammeType) || + (aRdsData.iRdsFunctions & ERdsProgrammeService) ) + { + iTuner->iNotifyOn = ETrue; + } + + if ( (iTuner->iRdsSignal) && (iTuner->iNotifyOn) ) + { + iRds->Start(); + } + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelNotifyRdsDataChange() + { + iTuner->iRdsData = 0; + iTuner->iNotifyOn = EFalse; + iRds->Cancel(); + } + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::SetAutomaticSwitching( + TBool aAuto ) + { + iTuner->iAutoSwitch = aAuto; + if ( aAuto && (iTuner->iFrequency == KFrequency1) ) + { + iRdsAf->Start(); + } + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::GetAutomaticSwitching( + TBool& aAuto ) + { + aAuto = iTuner->iAutoSwitch; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelAFSearch() + { + } + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::SetAutomaticTrafficAnnouncement( + TBool /*aAuto*/ ) + { + return KErrNotSupported; + }; + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::GetAutomaticTrafficAnnouncement( + TBool& aAuto ) + { + aAuto = EFalse; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::StationSeekByPTY( + TRdsProgrammeType aPty, + TBool aSeekUp ) + { + if ( !iTuner->iTunerOn ) + { + iTuner->CompleteRequest(KReqStationSeekByPTY, KRdsErrNotPermittedInCurrentState); + return; + } + + TInt err = KErrNone; + switch ( aPty ) + { + case KRdsPtyReligion: + if ( aSeekUp ) + { + if ( iTuner->iFrequency < KFrequency1 ) + { + SetFrequencySettings(KFrequency1); + } + else if ( (iTuner->iFrequency >= KFrequency1) && (iTuner->iFrequency < KFrequency2) ) + { + SetFrequencySettings(KFrequency2); + } + else // iTuner->iFrequency >= KFrequency2 + { + SetFrequencySettings(KFrequency1); + } + } + else + { + if ( iTuner->iFrequency > KFrequency2 ) + { + SetFrequencySettings(KFrequency2); + } + else if ( (iTuner->iFrequency <= KFrequency2) && (iTuner->iFrequency > KFrequency1) ) + { + SetFrequencySettings(KFrequency1); + } + else // iTuner->iFrequency < KFrequency1 + { + SetFrequencySettings(KFrequency2); + } + } + break; + case KRdsPtyLightClassical: + SetFrequencySettings(KFrequency3); + break; + case KRdsPtyRockMusic: + SetFrequencySettings(KFrequency4); + break; + default: + err = KErrNotFound; + break; + } + iTuner->CompleteRequest(KReqStationSeekByPTY, err); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::StationSeekByTA( + TBool aSeekUp ) + { + if ( !iTuner->iTunerOn ) + { + iTuner->CompleteRequest(KReqStationSeekByTA, KRdsErrNotPermittedInCurrentState); + return; + } + + // Just for testing purpose, if aSeekUp return KFrequency1, else return KErrNotFound. + if ( aSeekUp ) + { + SetFrequencySettings(KFrequency1); + iTuner->CompleteRequest(KReqStationSeekByTA, KErrNone); + } + else + { + iTuner->CompleteRequest(KReqStationSeekByTA, KErrNotFound); + } + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::StationSeekByTP( + TBool aSeekUp ) + { + if ( !iTuner->iTunerOn ) + { + iTuner->CompleteRequest(KReqStationSeekByTP, KRdsErrNotPermittedInCurrentState); + return; + } + + if ( aSeekUp ) + { + if ( iTuner->iFrequency < KFrequency1 ) + { + SetFrequencySettings(KFrequency1); + } + else if ( (iTuner->iFrequency >= KFrequency1) && (iTuner->iFrequency < KFrequency4) ) + { + SetFrequencySettings(KFrequency4); + } + else // iTuner->iFrequency >= KFrequency4 + { + SetFrequencySettings(KFrequency1); + } + } + else + { + if ( iTuner->iFrequency > KFrequency4 ) + { + SetFrequencySettings(KFrequency4); + } + else if ( (iTuner->iFrequency <= KFrequency4) && (iTuner->iFrequency > KFrequency1) ) + { + SetFrequencySettings(KFrequency1); + } + else // iTuner->iFrequency < KFrequency1 + { + SetFrequencySettings(KFrequency4); + } + } + + iTuner->CompleteRequest(KReqStationSeekByTP, KErrNone); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelRdsStationSeek() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::GetFreqByPTY( + TRdsProgrammeType aPty ) + { + if ( !iTuner->iTunerOn ) + { + iTuner->CompleteRequest(KReqGetFreqByPTY, KRdsErrNotPermittedInCurrentState); + return; + } + + TInt err = KErrNone; + iTuner->iFreqList.Reset(); + switch ( aPty ) + { + case KRdsPtyReligion: + iTuner->iFreqList.Append(KFrequency1); + iTuner->iFreqList.Append(KFrequency2); + break; + case KRdsPtyLightClassical: + iTuner->iFreqList.Append(KFrequency3); + break; + case KRdsPtyRockMusic: + iTuner->iFreqList.Append(KFrequency4); + break; + default: + err = KErrNotFound; + break; + } + iTuner->CompleteRequest(KReqGetFreqByPTY, err); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelGetFreqByPTY() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::GetFreqByTA() + { + if ( !iTuner->iTunerOn ) + { + iTuner->CompleteRequest(KReqGetFreqByTA, KRdsErrNotPermittedInCurrentState); + return; + } + + iTuner->iFreqList.Reset(); + iTuner->iFreqList.Append(KFrequency1); + iTuner->CompleteRequest(KReqGetFreqByTA, KErrNone); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelGetFreqByTA() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::GetPSByPTY + ( TRdsProgrammeType aPty ) + { + if ( !iTuner->iTunerOn ) + { + iTuner->CompleteRequest(KReqGetPSByPTY, KRdsErrNotPermittedInCurrentState); + return; + } + + TInt err = KErrNone; + iTuner->iPsList.Reset(); + switch ( aPty ) + { + case KRdsPtyReligion: + iTuner->iPsList.Append(_L8("KCBI")); + iTuner->iPsList.Append(_L8("KLTY")); + break; + case KRdsPtyLightClassical: + iTuner->iPsList.Append(_L8("KVIL")); + break; + case KRdsPtyRockMusic: + iTuner->iPsList.Append(_L8("KHKS")); + break; + default: + err = KErrNotFound; + break; + } + iTuner->CompleteRequest(KReqGetPSByPTY, err); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelGetPSByPTY() + { + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::GetPSByTA() + { + if ( !iTuner->iTunerOn ) + { + iTuner->CompleteRequest(KReqGetPSByTA, KRdsErrNotPermittedInCurrentState); + return; + } + + iTuner->iPsList.Reset(); + iTuner->iPsList.Append(_L8("KCBI")); + iTuner->CompleteRequest(KReqGetPSByTA, KErrNone); + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::CancelGetPSByTA() + { + } + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::GetProgrammeIdentification( + TInt& aPi ) + { + if ( !iTuner->iTunerOn ) + { + return KRdsErrNotPermittedInCurrentState; + } + + if ( iTuner->iRdsSignal ) + { + aPi = iTuner->iPi; + return KErrNone; + } + else + { + return KErrNotFound; + } + } + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::GetProgrammeType( + TRdsProgrammeType& aPty ) + { + if ( !iTuner->iTunerOn ) + { + return KRdsErrNotPermittedInCurrentState; + } + + if ( iTuner->iRdsSignal ) + { + aPty = iTuner->iPty; + return KErrNone; + } + else + { + return KErrNotFound; + } + } + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::GetProgrammeService( + TRdsPSName& aPs ) + { + if ( !iTuner->iTunerOn ) + { + return KRdsErrNotPermittedInCurrentState; + } + + if ( iTuner->iRdsSignal ) + { + aPs = iTuner->iPs; + return KErrNone; + } + else + { + return KErrNotFound; + } + } + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::GetRadioText( + TRdsRadioText& aRt, + RArray& /*aRTplusTags*/ ) + { + if ( !iTuner->iTunerOn ) + { + return KRdsErrNotPermittedInCurrentState; + } + + if ( iTuner->iRdsSignal ) + { + aRt = iTuner->iRt; + return KErrNone; + } + else + { + return KErrNotFound; + } + } + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::GetClockTime( + TDateTime& aCt ) + { + if ( !iTuner->iTunerOn ) + { + return KRdsErrNotPermittedInCurrentState; + } + + if ( iTuner->iRdsSignal ) + { + // Hardcoded to 2007/11/10 7:35 + aCt.Set(2007,ENovember,10,7,35,0,0); + return KErrNone; + } + else + { + return KErrNotFound; + } + } + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::GetTrafficAnnouncementStatus( + TBool& aTaStatus ) + { + if ( !iTuner->iTunerOn ) + { + return KRdsErrNotPermittedInCurrentState; + } + + if ( iTuner->iFrequency == KFrequency1 ) + { + aTaStatus = ETrue; + return KErrNone; + } + else if ( iTuner->iFrequency == KFrequency4 ) + { + aTaStatus = EFalse; + return KErrNone; + } + else + { + return KErrNotFound; + + } + } + +// ----------------------------------------------------------------------------- +// +TInt CAdaptation::GetTrafficProgrammeStatus( + TBool& aTpStatus ) + { + if ( !iTuner->iTunerOn ) + { + return KRdsErrNotPermittedInCurrentState; + } + + if ( (iTuner->iFrequency == KFrequency1) || (iTuner->iFrequency == KFrequency4) ) + { + aTpStatus = ETrue; + return KErrNone; + } + else if ( (iTuner->iFrequency == KFrequency2) || (iTuner->iFrequency == KFrequency3) ) + { + aTpStatus = EFalse; + return KErrNone; + } + else + { + return KErrNotFound; + } + } + +#endif //#ifdef RD_FM_RADIO_ENHANCEMENTS + +// ----------------------------------------------------------------------------- +// +TBool CAdaptation::ValidFrequency( + TFMRadioFrequencyRange aRange, + TInt aFrequency ) + { + if ( aRange == EFMRadioFrequencyEuroAmerica ) + { + if ( (aFrequency < KEuroAmericaMin) || (aFrequency > KEuroAmericaMax) ) + { + return EFalse; + } + } + else // aRange = EFMRadioFrequencyJapan; + { + if ( (aFrequency < KJapanMin) || (aFrequency > KJapanMax) ) + { + return EFalse; + } + } + return ETrue; + } + +// ----------------------------------------------------------------------------- +// +void CAdaptation::SetFrequencySettings( + TInt aFrequency ) + { + iTuner->iFrequency = aFrequency; + switch ( aFrequency ) + { + case KFrequency1: + iTuner->iSigStrength = 1; + iTuner->iRdsSignal = ETrue; + iTuner->iPi = 1000; + iTuner->iPty = KRdsPtyReligion; + iTuner->iPs = _L8("KCBI"); + iTuner->iRt = _L8("Hail to the King"); + if ( iTuner->iAutoSwitch ) + { + iRdsAf->Start(); + } + break; + case KFrequency2: + iTuner->iSigStrength = 2; + iTuner->iRdsSignal = ETrue; + iTuner->iPi = 1000; + iTuner->iPty = KRdsPtyReligion; + iTuner->iPs = _L8("KLTY"); + iTuner->iRt = _L8("He Knows My Name"); + break; + case KFrequency3: + iTuner->iSigStrength = 3; + iTuner->iRdsSignal = ETrue; + iTuner->iPi = 2000; + iTuner->iPty = KRdsPtyLightClassical; + iTuner->iPs = _L8("KVIL"); + iTuner->iRt = _L8("Power of Love"); + break; + case KFrequency4: + iTuner->iSigStrength = 4; + iTuner->iRdsSignal = ETrue; + iTuner->iPi = 3000; + iTuner->iPty = KRdsPtyRockMusic; + iTuner->iPs = _L8("KHKS"); + iTuner->iRt = _L8("The Reason"); + break; + default: + iTuner->iSigStrength = 5; + iTuner->iRdsSignal = EFalse; + break; + } + if ( (iTuner->iRdsSignal) && (iTuner->iNotifyOn) ) + { + iRds->Start(); + } + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + +// End of File + diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/fmradiotunercontrolstub/Src/FMRadioTunerControlStub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/fmradiotunercontrolstub/Src/FMRadioTunerControlStub.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,138 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This header specifies the implementation of CFMRadioTunerControl. +* +*/ + + + +#ifndef FMRADIOTUNERCONTROLSTUB_H +#define FMRADIOTUNERCONTROLSTUB_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class CTuner; +class CRdsGenerator; +class CAfSwitcher; + +// CLASS DECLARATION + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib FMRadioTunerControlStub.lib +* @since Series 60 3.0 +*/ +class CAdaptation : public CFMRadioTunerControl +#ifdef RD_FM_RADIO_ENHANCEMENTS + ,public MRdsControl +#endif // RD_FM_RADIO_ENHANCEMENTS + { + public: // New functions + static CAdaptation* NewL( MFMRadioTunerControlObserver& aObserver ); + virtual ~CAdaptation(); + + public: // From base class CFMRadioTunerControl + void TunerOn( TFMRadioFrequencyRange aRange, TInt aFrequency ); + void CancelTunerOn(); + void TunerOff(); + void CancelTunerOff(); + void SetFrequencyRange( TFMRadioFrequencyRange aRange ); + void CancelSetFrequencyRange(); + void SetFrequency( TInt aFrequency ); + void CancelSetFrequency(); + void StationSeek( TFMRadioSeekDirection aDirection ); + void CancelStationSeek(); + void AudioMode(); + void CancelAudioMode(); + void SetAudioMode( TFMRadioAudioMode aMode ); + void CancelSetAudioMode(); + void MaxSignalStrength(); + void CancelMaxSignalStrength(); + void SignalStrength(); + void CancelSignalStrength(); + void Squelch(); + void CancelSquelch(); + void SetSquelch( TBool aEnabled ); + void CancelSetSquelch(); + void BufferToBeFilled( TDes8& aBuffer ); + TFMRadioCapabilities Capabilities(); + +#ifdef RD_FM_RADIO_ENHANCEMENTS + MRdsControl* RdsControl( MRdsControlObserver& aObserver ) ; + TInt GetFrequencyRange( TFMRadioFrequencyRange& aRange, TInt& aMinFreq, TInt& aMaxFreq ) const; + + public: // From base class MRdsControl + TInt GetCapabilities( TRdsCapabilities& aCaps ) const; + TInt GetRdsSignalStatus( TBool& aRdsSignal ) const; + TInt NotifyRdsDataChange( TRdsData aRdsData ); + void CancelNotifyRdsDataChange(); + TInt SetAutomaticSwitching( TBool aAuto ); + TInt GetAutomaticSwitching( TBool& aAuto ); + void CancelAFSearch(); + TInt SetAutomaticTrafficAnnouncement( TBool aAuto ); + TInt GetAutomaticTrafficAnnouncement( TBool& aAuto ); + void StationSeekByPTY( TRdsProgrammeType aPty, TBool aSeekUp ); + void StationSeekByTA( TBool aSeekUp ); + void StationSeekByTP( TBool aSeekUp ); + void CancelRdsStationSeek(); + void GetFreqByPTY( TRdsProgrammeType aPty ); + void CancelGetFreqByPTY(); + void GetFreqByTA(); + void CancelGetFreqByTA(); + void GetPSByPTY( TRdsProgrammeType aPty ); + void CancelGetPSByPTY(); + void GetPSByTA(); + void CancelGetPSByTA(); + TInt GetProgrammeIdentification( TInt& aPi ); + TInt GetProgrammeType( TRdsProgrammeType& aPty ); + TInt GetProgrammeService( TRdsPSName& aPs ); + TInt GetRadioText( TRdsRadioText& aRt, RArray& aRTplusTags ); + TInt GetClockTime( TDateTime& aCt ); + TInt GetTrafficAnnouncementStatus( TBool& aTaStatus ); + TInt GetTrafficProgrammeStatus( TBool& aTpStatus ); + +#endif // RD_FM_RADIO_ENHANCEMENTS + + private: + + TBool ValidFrequency( TFMRadioFrequencyRange aRange, TInt aFrequency ); + void SetFrequencySettings( TInt aFrequency ); + + /** + * C++ default constructor. + */ + CAdaptation(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( MFMRadioTunerControlObserver& aObserver ); + + private: // Data + // Tuner + CTuner* iTuner; + CRdsGenerator* iRds; + CAfSwitcher* iRdsAf; + }; + +#endif // FMRADIOTUNERCONTROLSTUB_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project build file for adaptation DirectX Driver +* +*/ + + +PRJ_PLATFORMS + +PRJ_EXPORTS + +PRJ_MMPFILES + + +//DevSound Stub +#include "../devsoundextensions_stubs/group/bld.inf" + +//FM Radio Tuner Control +#include "../fmradiotunercontrolstub/Group/bld.inf" + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/layers.sysdef.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,22 @@ + + +]> + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 audiostubs/sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audiostubs/sysdef_1_4_0.dtd Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 btaudioadaptation_stub/EABI/btaudioadaptationU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btaudioadaptation_stub/EABI/btaudioadaptationU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,10 @@ +EXPORTS + _ZN23CBTAudioStreamInputBase4NewLER22MBTAudioStreamObserverR21MBTAudioErrorObserver @ 1 NONAME + _ZN29CBTAudioStreamInputAdaptation10DisconnectEv @ 2 NONAME + _ZN29CBTAudioStreamInputAdaptation13BufferEmptiedERK6TDesC8 @ 3 NONAME + _ZN29CBTAudioStreamInputAdaptation16EncoderInterfaceE4TUid @ 4 NONAME + _ZN29CBTAudioStreamInputAdaptation4StopEv @ 5 NONAME + _ZN29CBTAudioStreamInputAdaptation5StartEv @ 6 NONAME + _ZN29CBTAudioStreamInputAdaptation7ConnectEv @ 7 NONAME + _ZN29CBTAudioStreamInputAdaptation9SetFormatE7TFourCC @ 8 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 btaudioadaptation_stub/bwins/btaudioadaptationU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btaudioadaptation_stub/bwins/btaudioadaptationU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,10 @@ +EXPORTS + ?NewL@CBTAudioStreamInputBase@@SAPAV1@AAVMBTAudioStreamObserver@@AAVMBTAudioErrorObserver@@@Z @ 1 NONAME ; class CBTAudioStreamInputBase * CBTAudioStreamInputBase::NewL(class MBTAudioStreamObserver &, class MBTAudioErrorObserver &) + ?BufferEmptied@CBTAudioStreamInputAdaptation@@UAEXABVTDesC8@@@Z @ 2 NONAME ; void CBTAudioStreamInputAdaptation::BufferEmptied(class TDesC8 const &) + ?Connect@CBTAudioStreamInputAdaptation@@UAEHXZ @ 3 NONAME ; int CBTAudioStreamInputAdaptation::Connect(void) + ?Disconnect@CBTAudioStreamInputAdaptation@@UAEXXZ @ 4 NONAME ; void CBTAudioStreamInputAdaptation::Disconnect(void) + ?EncoderInterface@CBTAudioStreamInputAdaptation@@UAEPAXVTUid@@@Z @ 5 NONAME ; void * CBTAudioStreamInputAdaptation::EncoderInterface(class TUid) + ?SetFormat@CBTAudioStreamInputAdaptation@@UAEHVTFourCC@@@Z @ 6 NONAME ; int CBTAudioStreamInputAdaptation::SetFormat(class TFourCC) + ?Start@CBTAudioStreamInputAdaptation@@UAEHXZ @ 7 NONAME ; int CBTAudioStreamInputAdaptation::Start(void) + ?Stop@CBTAudioStreamInputAdaptation@@UAEXXZ @ 8 NONAME ; void CBTAudioStreamInputAdaptation::Stop(void) + diff -r 000000000000 -r 0ce1b5ce9557 btaudioadaptation_stub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btaudioadaptation_stub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project btaudioadaptation_stub +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +#if defined __BT_STEREO_AUDIO + +PRJ_MMPFILES +../group/btaudiostreaminputadaptation.mmp + +#endif // __BT_STEREO_AUDIO diff -r 000000000000 -r 0ce1b5ce9557 btaudioadaptation_stub/group/btaudiostreaminputadaptation.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btaudioadaptation_stub/group/btaudiostreaminputadaptation.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project btaudioadaptation_stub +* +*/ + + +#include + +#if defined(WINS) || defined(WINSCW) +TARGET btaudioadaptation.dll +#else +TARGET btaudioadaptation_stub.dll +#endif + +CAPABILITY CAP_GENERAL_DLL +TARGETTYPE DLL +UID 0x1000008d 0x10208977 + +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE btaudiostreaminputadaptation.cpp + +USERINCLUDE ../inc + +OS_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib // user library + +DEBUGLIBRARY flogger.lib // file logging services + +EXPORTLIBRARY btaudioadaptation.lib +LINKAS btaudioadaptation.dll diff -r 000000000000 -r 0ce1b5ce9557 btaudioadaptation_stub/inc/btaudioadaptationdebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btaudioadaptation_stub/inc/btaudioadaptationdebug.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,150 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Debug definitions for BT Audio Adaptation +* +*/ + + +#ifndef BT_AUDIO_ADAPTATION_DEBUG_H +#define BT_AUDIO_ADAPTATION_DEBUG_H + +#include + + +#ifdef _DEBUG + +// Print options + +#define KPRINTERROR 0x00000001 // Print error +#define KPRINTFTRACE 0x00000002 // Print function trace +#define KPRINTSTATE 0x00000004 // Print state machine infos + +const TInt KDebugMask = KPRINTERROR | KPRINTFTRACE | KPRINTSTATE ; + + +// Un-comment/comment this definition to enable/disable memory tracing +//#define MEMTRACE + +#ifdef __WINS__ + +// File logging for WINS +#define __FLOGGING__ + +#else + +// Logging with RDebug for target HW +#define __CLOGGING__ + +#endif //__WINS__ + +#endif // _DEBUG + + +// ================================================================== +// File logging +// ================================================================== +// +#if defined(__FLOGGING__) + +#include + +_LIT(KLogFile,"BTAudioAdaptationLog.txt"); +_LIT(KLogDirFullName,"c:\\logs\\bt\\"); +_LIT(KLogDir,"BT"); + +#include +#include + +#define FLOG(a) { FPrint(a); } + +#define FTRACE(a) { a; } + +#define BT_AUDIO_ADAPTATION_TRACE_OPT(a,p) {if((KDebugMask)&(a))p;} + + + + +inline void FPrint(const TRefByValue aFmt, ...) + { + VA_LIST list; + VA_START(list,aFmt); + RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); +#ifdef MEMTRACE + TInt size; + User::Heap().AllocSize(size); + RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, _L("[BTAudioAdaptation]\t MEM\tAllocated from heap: %d B. Total heap size: %d B"), size, User::Heap().Size()); +#endif + } + + +inline void FHex(const TUint8* aPtr, TInt aLen) + { + RFileLogger::HexDump(KLogDir, KLogFile, EFileLoggingModeAppend, 0, 0, aPtr, aLen); + } + + +inline void FHex(const TDesC8& aDes) + { + FHex(aDes.Ptr(), aDes.Length()); + } + + +// ================================================================== +// RDebug logging +// ================================================================== +// +#elif defined(__CLOGGING__) + +#include + +#define FLOG(a) { RDebug::Print(a); } + +#define FHex(a) + +#define FTRACE(a) { a; } + +#define BT_AUDIO_ADAPTATION_TRACE_OPT(a,p) {if((KDebugMask)&(a))p;} + + +inline void FPrint(const TRefByValue aFmt, ...) + { + VA_LIST list; + VA_START(list,aFmt); + TInt tmpInt = VA_ARG(list, TInt); + TInt tmpInt2 = VA_ARG(list, TInt); + TInt tmpInt3 = VA_ARG(list, TInt); + VA_END(list); + RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3); + } + + +// ================================================================== +// No loggings --> Reduced binary size +// ================================================================== +// +#else // if no __FLOGGING__ and no __CLOGGING__ + +#define FLOG(a) + +#define FTRACE(a) + +#define FHex(a) + +#define BT_AUDIO_ADAPTATION_TRACE_OPT(a,p) + +#endif // ...loggings + +#endif // BTAUDIOADAPTATION_DEBUG_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 btaudioadaptation_stub/inc/btaudiostreaminputadaptation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btaudioadaptation_stub/inc/btaudiostreaminputadaptation.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This header specifies the implementation of BT Audio Adaptation API. +* +*/ + + +#ifndef __BTAUDIOSTREAMINPUTADAPTATION_H__ +#define __BTAUDIOSTREAMINPUTADAPTATION_H__ + +#include +#include +#include "btaudiostreaminputbase.h" + +/** + * This class implements the interface specified by CBTAudioStreamInputBase. + * + * This class contains the stub implementation of the CAudioStreamInputAdaptation, + * that inherits from CBTAudioStreamInputBase. + * + * To the user it seems as if he's operating with the base class, because he calls, + * but in practice the class he uses is an instance of this class. + * + * @lib btaudioadaptation.lib + * @since S60 v3.1 + */ +NONSHARABLE_CLASS(CBTAudioStreamInputAdaptation) : public CBTAudioStreamInputBase + { + public: + static CBTAudioStreamInputAdaptation* NewL( MBTAudioStreamObserver& aStreamObserver, MBTAudioErrorObserver& aErrorObserver ); + virtual ~CBTAudioStreamInputAdaptation(); + + public: + /** + * From CBTAudioStreamInputBase. + * This method is called when the client has processed the buffer it got + * from the Receive method. + * + * See BT Audio Adaptation API and BT Audio Adaptation Design specifications + * for detailed explanation. + * + * @since S60 v3.1 + * @param aBuffer refers to the buffer that was received earlier in the Receive method. + * @return void + */ + IMPORT_C void BufferEmptied( const TDesC8& aBuffer ); + + /** + * From CBTAudioStreamInputBase. + * This method is for connecting to the audio subsystem. + * + * See BT Audio Adaptation API and BT Audio Adaptation Design specifications + * for detailed explanation. + * + * @since S60 v3.1 + * @param void. + * @return a Symbian OS wide error code. + */ + IMPORT_C TInt Connect(); + + /** + * From CBTAudioStreamInputBase. + * This method is for disconnecting from the audio subsystem. + * + * See BT Audio Adaptation API and BT Audio Adaptation Design specifications + * for detailed explanation. + * + * @since S60 v3.1 + * @param void. + * @return void + */ + IMPORT_C void Disconnect(); + + /** + * From CBTAudioStreamInputBase. + * This method is for passing the custom interfaces that are + * needed sometimes for configuring the hardware encoder. + * + * See BT Audio Adaptation API and BT Audio Adaptation Design specifications + * for detailed explanation. + * + * @since S60 v3.1 + * @param aInterfaceId specifies the id of custom interface that the client + * wants to get. + * @return A pointer to the requested interface. Client must cast it into a correct class. + */ + IMPORT_C TAny* EncoderInterface(TUid aInterfaceId); + + /** + * From CBTAudioStreamInputBase. + * This method is for choosing the encoder for the audio data. + * + * See BT Audio Adaptation API and BT Audio Adaptation Design specifications + * for detailed explanation. + * + * @since S60 v3.1 + * @param aDesiredFourCC specifies the encoder that the client wants to use. + * @return a Symbian OS wide error code. + */ + IMPORT_C TInt SetFormat(TFourCC aDesiredFourCC); + + /** + * From CBTAudioStreamInputBase. + * This method is for starting the recording from the audio subsystem. + * + * See BT Audio Adaptation API and BT Audio Adaptation Design specifications + * for detailed explanation. + * + * @since S60 v3.1 + * @param void. + * @return a Symbian OS wide error code. + */ + IMPORT_C TInt Start(); + + /** + * From CBTAudioStreamInputBase. + * This method is for stopping the recording from the audio subsystem. + * + * See BT Audio Adaptation API and BT Audio Adaptation Design specifications + * for detailed explanation. + * + * @since S60 v3.1 + * @param void. + * @return a Symbian OS wide error code. + */ + IMPORT_C void Stop(); + + private: + CBTAudioStreamInputAdaptation(MBTAudioStreamObserver& aStreamObserver, MBTAudioErrorObserver& aErrorObserver); + void ConstructL(); + void RunL(); + void DoCancel(); + }; + +#endif diff -r 000000000000 -r 0ce1b5ce9557 btaudioadaptation_stub/layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btaudioadaptation_stub/layers.sysdef.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,14 @@ + + +]> + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 btaudioadaptation_stub/rom/btaudioadaptation.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btaudioadaptation_stub/rom/btaudioadaptation.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __BTAUDIOADAPTATION_IBY__ +#define __BTAUDIOADAPTATION_IBY__ + +file=ABI_DIR\BUILD_DIR\btaudioadaptation_stub.dll SHARED_LIB_DIR\btaudioadaptation.dll + +#endif diff -r 000000000000 -r 0ce1b5ce9557 btaudioadaptation_stub/src/btaudiostreaminputadaptation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btaudioadaptation_stub/src/btaudiostreaminputadaptation.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,150 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains stub implementation of CBTAudioStreamInputAdaptation class, +* which implements BT Audio Adaptation API. +* +*/ + + +#include + +#include "btaudiostreaminputadaptation.h" +#include "btaudioadaptationdebug.h" + +CBTAudioStreamInputAdaptation::CBTAudioStreamInputAdaptation(MBTAudioStreamObserver& /*aStreamObserver*/, MBTAudioErrorObserver& /*aErrorObserver*/) + { + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::CBTAudioStreamInputAdaptation() ->"))); + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::CBTAudioStreamInputAdaptation() <-"))); + } + +void CBTAudioStreamInputAdaptation::ConstructL() + { + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::ConstructL() ->"))); + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::ConstructL() <-"))); + } + +// --------------------------------------------------------------------------- +// Static factory method for the abstract base class. +// This just calls the factory method of the concrete implementation class. +// --------------------------------------------------------------------------- +// +EXPORT_C CBTAudioStreamInputBase* CBTAudioStreamInputBase::NewL(MBTAudioStreamObserver& aStreamObserver, MBTAudioErrorObserver& aErrorObserver) + { + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioInput::NewL() ->"))); + CBTAudioStreamInputBase* audioInput = (CBTAudioStreamInputAdaptation::NewL(aStreamObserver, aErrorObserver)); + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioInput::NewL() <-"))); + return audioInput; + } + +// --------------------------------------------------------------------------- +// Static factory method. +// --------------------------------------------------------------------------- +// +CBTAudioStreamInputAdaptation* CBTAudioStreamInputAdaptation::NewL(MBTAudioStreamObserver& aStreamObserver, MBTAudioErrorObserver& aErrorObserver) + { + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::NewL() ->"))); + CBTAudioStreamInputAdaptation* self = new (ELeave) CBTAudioStreamInputAdaptation(aStreamObserver, aErrorObserver); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::NewL() <-"))); + return self; + } + +CBTAudioStreamInputAdaptation::~CBTAudioStreamInputAdaptation() + { + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::~CBTAudioStreamInputAdaptation() ->"))); + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::~CBTAudioStreamInputAdaptation() <-"))); + } + +// --------------------------------------------------------------------------- +// From class CBTAudioStreamInputBase. +// Returns KErrNotSupported always - this is the stub implementation. +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CBTAudioStreamInputAdaptation::Start() + { + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::Start() ->"))); + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::Start() <-"))); + return KErrNotSupported; + } + +// --------------------------------------------------------------------------- +// From class CBTAudioStreamInputBase. +// Returns a NULL pointer always - this is the stub implementation. +// --------------------------------------------------------------------------- +// +EXPORT_C TAny* CBTAudioStreamInputAdaptation::EncoderInterface(TUid /*aInterfaceId*/) + { + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::EncoderInterface() ->"))); + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::EncoderInterface() <-"))); + return (TAny *) 0; + } + +// --------------------------------------------------------------------------- +// From class CBTAudioStreamInputBase. +// Doesn't do anything - this is the stub implementation. +// --------------------------------------------------------------------------- +// +EXPORT_C void CBTAudioStreamInputAdaptation::BufferEmptied( const TDesC8& /*aBuffer*/ ) + { + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::BufferEmptied() ->"))); + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::BufferEmptied() <-"))); + } + +// --------------------------------------------------------------------------- +// From class CBTAudioStreamInputBase. +// Doesn't do anything - this is the stub implementation. +// --------------------------------------------------------------------------- +// +EXPORT_C void CBTAudioStreamInputAdaptation::Stop() + { + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::Stop() ->"))); + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::Stop() <-"))); + } + +// --------------------------------------------------------------------------- +// From class CBTAudioStreamInputBase. +// Returns KErrNotSupported always - this is the stub implementation. +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CBTAudioStreamInputAdaptation::SetFormat(TFourCC /*aDesiredFourCC*/) + { + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::SetFormat() ->"))); + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::SetFormat() <-"))); + return KErrNotSupported; + } + +// --------------------------------------------------------------------------- +// From class CBTAudioStreamInputBase. +// Returns KErrNotSupported always - this is the stub implementation. +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CBTAudioStreamInputAdaptation::Connect() + { + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::Connect() ->"))); + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::Connect() <-"))); + return KErrNotSupported; + } + +// --------------------------------------------------------------------------- +// From class CBTAudioStreamInputBase. +// Doesn't do anything - this is the stub implementation. +// --------------------------------------------------------------------------- +// +EXPORT_C void CBTAudioStreamInputAdaptation::Disconnect() + { + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::Disconnect() ->"))); + BT_AUDIO_ADAPTATION_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioAdaptation]\t CBTAudioStreamInputAdaptation::Disconnect() <-"))); + } diff -r 000000000000 -r 0ce1b5ce9557 btaudioadaptation_stub/sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btaudioadaptation_stub/sysdef_1_4_0.dtd Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/drm_stubs/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build file for WM DRM Keystorage +* +*/ + + +#include + +PRJ_EXPORTS + +#if (defined __WINDOWS_MEDIA_DRM) + +../wmdrmkeystorage/armv5/urel/wmdrmkeystorage.dll /epoc32/release/armv5/urel/wmdrmkeystorage.dll +../wmdrmkeystorage/armv5/udeb/wmdrmkeystorage.dll /epoc32/release/armv5/udeb/wmdrmkeystorage.dll +../wmdrmkeystorage/armv5/lib/wmdrmkeystorage.lib /epoc32/release/armv5/lib/wmdrmkeystorage.lib +../wmdrmkeystorage/armv5/lib/wmdrmkeystorage.dso /epoc32/release/armv5/lib/wmdrmkeystorage.dso +../wmdrmkeystorage/armv5/lib/wmdrmkeystorage{000a0000}.dso /epoc32/release/armv5/lib/wmdrmkeystorage{000a0000}.dso + +../wmdrmkeystorage/winscw/urel/wmdrmkeystorage.dll /epoc32/release/winscw/urel/wmdrmkeystorage.dll +../wmdrmkeystorage/winscw/udeb/wmdrmkeystorage.dll /epoc32/release/winscw/udeb/wmdrmkeystorage.dll +../wmdrmkeystorage/winscw/udeb/wmdrmkeystorage.lib /epoc32/release/winscw/udeb/wmdrmkeystorage.lib + + +../wmdrmpd/armv5/urel/wmdrmpd.dll /epoc32/release/armv5/urel/wmdrmpd.dll +../wmdrmpd/armv5/udeb/wmdrmpd.dll /epoc32/release/armv5/udeb/wmdrmpd.dll +../wmdrmpd/armv5/lib/wmdrmpd.lib /epoc32/release/armv5/lib/wmdrmpd.lib +../wmdrmpd/armv5/lib/wmdrmpd.dso /epoc32/release/armv5/lib/wmdrmpd.dso +../wmdrmpd/armv5/lib/wmdrmpd{000a0000}.dso /epoc32/release/armv5/lib/wmdrmpd{000a0000}.dso + +../wmdrmpd/winscw/urel/wmdrmpd.dll /epoc32/release/winscw/urel/wmdrmpd.dll +../wmdrmpd/winscw/udeb/wmdrmpd.dll /epoc32/release/winscw/udeb/wmdrmpd.dll +../wmdrmpd/winscw/udeb/wmdrmpd.lib /epoc32/release/winscw/udeb/wmdrmpd.lib + +// WM DRM agent +../wmdrmpd/data/resource/plugins/wmdrmagent.rsc /epoc32/data/z/resource/plugins/wmdrmagent.rsc +../wmdrmpd/data/resource/plugins/wmdrmagent.rsc /epoc32/release/winscw/udeb/z/resource/plugins/wmdrmagent.rsc +../wmdrmpd/data/resource/plugins/wmdrmagent.rsc /epoc32/release/winscw/urel/z/resource/plugins/wmdrmagent.rsc + +../wmdrmpd/winscw/udeb/wmdrmagent.dll /epoc32/release/winscw/udeb/wmdrmagent.dll +../wmdrmpd/winscw/urel/wmdrmagent.dll /epoc32/release/winscw/urel/wmdrmagent.dll + +../wmdrmpd/armv5/udeb/wmdrmagent.dll /epoc32/release/armv5/udeb/wmdrmagent.dll +../wmdrmpd/armv5/urel/wmdrmagent.dll /epoc32/release/armv5/urel/wmdrmagent.dll + +../wmdrmpd/armv5/urel/cameseutility.dll /epoc32/release/armv5/urel/cameseutility.dll +../wmdrmpd/armv5/udeb/cameseutility.dll /epoc32/release/armv5/udeb/cameseutility.dll +../wmdrmpd/armv5/lib/cameseutility.lib /epoc32/release/armv5/lib/cameseutility.lib +../wmdrmpd/armv5/lib/cameseutility.dso /epoc32/release/armv5/lib/cameseutility.dso +../wmdrmpd/armv5/lib/cameseutility{000a0000}.dso /epoc32/release/armv5/lib/cameseutility{000a0000}.dso +../wmdrmpd/armv5/lib/cameseutility{000a0000}.lib /epoc32/release/armv5/lib/cameseutility{000a0000}.lib + +../wmdrmpd/winscw/urel/cameseutility.dll /epoc32/release/winscw/urel/cameseutility.dll +../wmdrmpd/winscw/udeb/cameseutility.dll /epoc32/release/winscw/udeb/cameseutility.dll +../wmdrmpd/winscw/udeb/cameseutility.lib /epoc32/release/winscw/udeb/cameseutility.lib + +../wmdrmpd/armv5/urel/wmdrmdla.dll /epoc32/release/armv5/urel/wmdrmdla.dll +../wmdrmpd/armv5/udeb/wmdrmdla.dll /epoc32/release/armv5/udeb/wmdrmdla.dll +../wmdrmpd/armv5/lib/wmdrmdla.lib /epoc32/release/armv5/lib/wmdrmdla.lib +../wmdrmpd/armv5/lib/wmdrmdla.dso /epoc32/release/armv5/lib/wmdrmdla.dso +../wmdrmpd/armv5/lib/wmdrmdla{000a0000}.dso /epoc32/release/armv5/lib/wmdrmdla{000a0000}.dso +../wmdrmpd/armv5/lib/wmdrmdla{000a0000}.lib /epoc32/release/armv5/lib/wmdrmdla{000a0000}.lib + +../wmdrmpd/winscw/urel/wmdrmdla.dll /epoc32/release/winscw/urel/wmdrmdla.dll +../wmdrmpd/winscw/udeb/wmdrmdla.dll /epoc32/release/winscw/udeb/wmdrmdla.dll +../wmdrmpd/winscw/udeb/wmdrmdla.lib /epoc32/release/winscw/udeb/wmdrmdla.lib + +// iby files + +../rom/wmdrmpd_dist.iby CORE_MW_LAYER_IBY_EXPORT_PATH( wmdrmpd_dist.iby ) +../rom/wmdrmkeystorage_dist.iby CORE_MW_LAYER_IBY_EXPORT_PATH( wmdrmkeystorage_dist.iby ) + +#endif // __WINDOWS_MEDIA_DRM + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/drm_stubs/layers.sysdef.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,15 @@ + + +]> + + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/rom/wmdrmkeystorage_dist.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/drm_stubs/rom/wmdrmkeystorage_dist.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: IBY file +* +*/ + +#ifndef WMDRMKEYSTORAGE_DIST_IBY +#define WMDRMKEYSTORAGE_DIST_IBY + +#include + +#if (defined __WINDOWS_MEDIA_DRM) +file=ABI_DIR\BUILD_DIR\wmdrmkeystorage.dll SHARED_LIB_DIR\wmdrmkeystorage.dll +#endif // __WINDOWS_MEDIA_DRM + +#endif // WMDRMKEYSTORAGE_DIST_IBY diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/rom/wmdrmpd_dist.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/drm_stubs/rom/wmdrmpd_dist.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: IBY file +* +*/ + +#ifndef WMDRMPD_DIST_IBY +#define WMDRMPD_DIST_IBY + +#include + +#if (defined __WINDOWS_MEDIA_DRM) + +file=ABI_DIR\BUILD_DIR\cameseutility.dll SHARED_LIB_DIR\cameseutility.dll +ECOM_PLUGIN(wmdrmagent.dll,10205CB6.rsc) +file=ABI_DIR\BUILD_DIR\wmdrmdla.dll SHARED_LIB_DIR\wmdrmdla.dll +file=ABI_DIR\BUILD_DIR\wmdrmpd.dll SHARED_LIB_DIR\wmdrmpd.dll + +#endif // __WINDOWS_MEDIA_DRM + +#endif // WMDRMPD_DIST_IBY diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/drm_stubs/sysdef_1_4_0.dtd Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmkeystorage/armv5/lib/wmdrmkeystorage.dso Binary file drm_stubs/wmdrmkeystorage/armv5/lib/wmdrmkeystorage.dso has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmkeystorage/armv5/lib/wmdrmkeystorage.lib Binary file drm_stubs/wmdrmkeystorage/armv5/lib/wmdrmkeystorage.lib has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmkeystorage/armv5/lib/wmdrmkeystorage{000a0000}.dso Binary file drm_stubs/wmdrmkeystorage/armv5/lib/wmdrmkeystorage{000a0000}.dso has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmkeystorage/armv5/udeb/wmdrmkeystorage.dll Binary file drm_stubs/wmdrmkeystorage/armv5/udeb/wmdrmkeystorage.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmkeystorage/armv5/urel/wmdrmkeystorage.dll Binary file drm_stubs/wmdrmkeystorage/armv5/urel/wmdrmkeystorage.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmkeystorage/winscw/udeb/wmdrmkeystorage.dll Binary file drm_stubs/wmdrmkeystorage/winscw/udeb/wmdrmkeystorage.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmkeystorage/winscw/udeb/wmdrmkeystorage.lib Binary file drm_stubs/wmdrmkeystorage/winscw/udeb/wmdrmkeystorage.lib has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmkeystorage/winscw/urel/wmdrmkeystorage.dll Binary file drm_stubs/wmdrmkeystorage/winscw/urel/wmdrmkeystorage.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/lib/cameseutility.dso Binary file drm_stubs/wmdrmpd/armv5/lib/cameseutility.dso has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/lib/cameseutility.lib Binary file drm_stubs/wmdrmpd/armv5/lib/cameseutility.lib has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/lib/cameseutility{000a0000}.dso Binary file drm_stubs/wmdrmpd/armv5/lib/cameseutility{000a0000}.dso has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/lib/cameseutility{000a0000}.lib Binary file drm_stubs/wmdrmpd/armv5/lib/cameseutility{000a0000}.lib has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/lib/wmdrmdla.dso Binary file drm_stubs/wmdrmpd/armv5/lib/wmdrmdla.dso has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/lib/wmdrmdla.lib Binary file drm_stubs/wmdrmpd/armv5/lib/wmdrmdla.lib has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/lib/wmdrmdla{000a0000}.dso Binary file drm_stubs/wmdrmpd/armv5/lib/wmdrmdla{000a0000}.dso has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/lib/wmdrmdla{000a0000}.lib Binary file drm_stubs/wmdrmpd/armv5/lib/wmdrmdla{000a0000}.lib has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/lib/wmdrmpd.dso Binary file drm_stubs/wmdrmpd/armv5/lib/wmdrmpd.dso has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/lib/wmdrmpd.lib Binary file drm_stubs/wmdrmpd/armv5/lib/wmdrmpd.lib has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/lib/wmdrmpd{000a0000}.dso Binary file drm_stubs/wmdrmpd/armv5/lib/wmdrmpd{000a0000}.dso has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/udeb/cameseutility.dll Binary file drm_stubs/wmdrmpd/armv5/udeb/cameseutility.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/udeb/wmdrmagent.dll Binary file drm_stubs/wmdrmpd/armv5/udeb/wmdrmagent.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/udeb/wmdrmdla.dll Binary file drm_stubs/wmdrmpd/armv5/udeb/wmdrmdla.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/udeb/wmdrmpd.dll Binary file drm_stubs/wmdrmpd/armv5/udeb/wmdrmpd.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/urel/cameseutility.dll Binary file drm_stubs/wmdrmpd/armv5/urel/cameseutility.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/urel/wmdrmagent.dll Binary file drm_stubs/wmdrmpd/armv5/urel/wmdrmagent.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/urel/wmdrmdla.dll Binary file drm_stubs/wmdrmpd/armv5/urel/wmdrmdla.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/armv5/urel/wmdrmpd.dll Binary file drm_stubs/wmdrmpd/armv5/urel/wmdrmpd.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/data/resource/plugins/wmdrmagent.rsc Binary file drm_stubs/wmdrmpd/data/resource/plugins/wmdrmagent.rsc has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/winscw/udeb/cameseutility.dll Binary file drm_stubs/wmdrmpd/winscw/udeb/cameseutility.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/winscw/udeb/cameseutility.lib Binary file drm_stubs/wmdrmpd/winscw/udeb/cameseutility.lib has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/winscw/udeb/wmdrmagent.dll Binary file drm_stubs/wmdrmpd/winscw/udeb/wmdrmagent.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/winscw/udeb/wmdrmdla.dll Binary file drm_stubs/wmdrmpd/winscw/udeb/wmdrmdla.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/winscw/udeb/wmdrmdla.lib Binary file drm_stubs/wmdrmpd/winscw/udeb/wmdrmdla.lib has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/winscw/udeb/wmdrmpd.dll Binary file drm_stubs/wmdrmpd/winscw/udeb/wmdrmpd.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/winscw/udeb/wmdrmpd.lib Binary file drm_stubs/wmdrmpd/winscw/udeb/wmdrmpd.lib has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/winscw/urel/cameseutility.dll Binary file drm_stubs/wmdrmpd/winscw/urel/cameseutility.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/winscw/urel/wmdrmagent.dll Binary file drm_stubs/wmdrmpd/winscw/urel/wmdrmagent.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/winscw/urel/wmdrmdla.dll Binary file drm_stubs/wmdrmpd/winscw/urel/wmdrmdla.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 drm_stubs/wmdrmpd/winscw/urel/wmdrmpd.dll Binary file drm_stubs/wmdrmpd/winscw/urel/wmdrmpd.dll has changed diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/BWINS/ocrsrvU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/BWINS/ocrsrvU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?CreateOCREngineL@OCREngineFactory@@SAPAVMOCREngineInterface@@AAVMOCREngineObserver@@VTOcrEngineEnv@@W4TEngineType@1@@Z @ 1 NONAME ; class MOCREngineInterface * OCREngineFactory::CreateOCREngineL(class MOCREngineObserver &, class TOcrEngineEnv, enum OCREngineFactory::TEngineType) + ?ReleaseOCREngine@OCREngineFactory@@SAXPAVMOCREngineInterface@@@Z @ 2 NONAME ; void OCREngineFactory::ReleaseOCREngine(class MOCREngineInterface *) + diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/EABI/ocrsrvU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/EABI/ocrsrvU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,18 @@ +EXPORTS + _ZN16OCREngineFactory16CreateOCREngineLER18MOCREngineObserver13TOcrEngineEnvNS_11TEngineTypeE @ 1 NONAME + _ZN16OCREngineFactory16ReleaseOCREngineEP19MOCREngineInterface @ 2 NONAME + _ZTI10COCREngine @ 3 NONAME ; ## + _ZTI10CShareData @ 4 NONAME ; ## + _ZTI14CEngineAdaptor @ 5 NONAME ; ## + _ZTI14COCREngineList @ 6 NONAME ; ## + _ZTI18COCREngineImplBase @ 7 NONAME ; ## + _ZTI24COCREngineRecognizeBlock @ 8 NONAME ; ## + _ZTI25COCREngineLayoutRecognize @ 9 NONAME ; ## + _ZTV10COCREngine @ 10 NONAME ; ## + _ZTV10CShareData @ 11 NONAME ; ## + _ZTV14CEngineAdaptor @ 12 NONAME ; ## + _ZTV14COCREngineList @ 13 NONAME ; ## + _ZTV18COCREngineImplBase @ 14 NONAME ; ## + _ZTV24COCREngineRecognizeBlock @ 15 NONAME ; ## + _ZTV25COCREngineLayoutRecognize @ 16 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Component definition file used for building the WLAN HW Init +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +ocrsrvstub.mmp diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/group/ocrsrvstub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/group/ocrsrvstub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project ocrsrv +* +*/ + + +#include +#include + +TARGET ocrsrv.dll +TARGETTYPE dll +UID 0x1000008D 0x0F41E102 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH . +SOURCE ../src/ocrstubdllmain.cpp +SOURCE ../src/ocrstubfactory.cpp + +USERINCLUDE ../inc + +// This is a SYSTEMINCLUDE macro containing the middleware +// layer specific include directories +MW_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE ../inc + +LIBRARY euser.lib + +LANG SC + +// End Of File diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/inc/language.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/inc/language.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,407 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: language manager definitions +* +*/ + + +#ifndef OCRLANGUAGE_H +#define OCRLANGUAGE_H + +// INCLUDES FILES +#include "languageconvertor.h" +#include "ocrthread.h" +#include +#include + +// CONSTANTS +const TInt KFileNameLength = 128; + +/** Pathes where the engine marks stores */ +_LIT(KDataPathZ, "z:\\resource\\ocrsrv\\*.dat"); +_LIT(KDataPathC, "c:\\resource\\ocrsrv\\*.dat"); + +_LIT( KExtend, "dll" ); + +/** Language Definitions */ +const TInt KEngineLangInvalid ( 0 ); +const TInt KEngineLangChineseSimp ( 1 ); +const TInt KEngineLangChineseTrad ( 2 ); +const TInt KEngineLangJapanese ( 3 ); +const TInt KEngineLangEnglish ( 101 ); +const TInt KEngineLangFinish ( 102 ); + +/** + * Internal Language Structure + * + * Map one language instance with an engine id + * + * @lib ocrsrv.lib + * @since S60 v3.1 + */ +class TOCRLanguage + { +public: + + /** + * Eninge id + */ + TInt iEngineId; + + /** + * Language + */ + TLanguage iLanguage; + }; + +/** + * Internal Language Structure + * + * Map two combined languages with an engine ID + * + * @lib ocrsrv.lib + * @since S60 v3.1 + */ +class TOCRCombinedLanguage + { +public: + + /** + * Eninge id + */ + TInt iEngineId; + + /** + * Eastern language that the engine supports + */ + TLanguage iLanguageEast; + + /** + * Western language that the engine supports + */ + TLanguage iLanguageWest; + }; + +/** + * OCR Engine Wrapper class + * + * OCR Engine wrapper which offers the abstruct of all + * OCR engines + * + * @lib ocrsrv.lib + * @since S60 v3.1 + */ +class COCREngine : public CBase + { +public: + + /** + * Default C++ Destructor + */ + virtual ~COCREngine(); + + /** + * Symbian Two-phased constructor + */ + static COCREngine* NewL(const TDesC& aEnginePathAndName,const TInt aEngineId); + + /** + * Initialize the analyze engine + * @since S60 v3.1 + * @return None + */ + void AnalyzeEngineL(); + + /** + * Empty data of current engine + * @since S60 v3.1 + * @return none + */ + void EmptyData(); + + /** + * Get engine Id + * @since S60 v3.1 + * @return Engine id + */ + inline const TInt GetEngineId() const ; + + /** + * Get unique engine name + * @since S60 v3.1 + * @param aEngineName A new engine name + * @return None + */ + void GetEngineName(TDes& aEngineName) const ; + + /** + * Get languages the engine support + * @since S60 v3.1 + * @return Supported language list + */ + inline const RArray& GetSupportLanguage() const ; + + /** + * Get language combinations the engine support + * @since S60 v3.1 + * @return Supported language combination list + */ + inline const RArray& GetSupportCombinedLanguage() const; + +private: + + /** + * By default Symbian 2nd phase constructor is private + * @since S60 v3.1 + * @param aEngineName Engine name to be constructed + * @param aEngineId Engine Id to be constructed + * @return None + */ + void ConstructL(const TDesC& aEngineName,const TInt aEngineId); + + /** + * Justify if given language is an eastern language + * @since S60 v3.1 + * @param aLanguage A language to be tested + * @return ETrue if it's an eastern language + */ + inline TBool IsEast(const TLanguage aLanguage) const; + + /** + * Combine eastern and western languages + * @since S60 v3.1 + * @param aEast eastern language to be combined + * @param aWest western language to be combined + * @param aDestination An array which holds the result + * @return None + */ + void CombineLanguage(const RArray& aEast, + const RArray& aWest, + RArray& aDestination); + + /** + * C++ default constructor + */ + COCREngine(); + +private: + + /** + * Engine id + */ + TInt iEngineId; + + /** + * Enigne name + */ + TBuf iEngineName; + + /** + * Languages that the engine support + */ + RArray iLanguageList; + + /** + * Language combinations that the engine support + */ + RArray iCombinedLanguageList; + }; + +/** + * OCR Engine Wrapper list + * + * List of all loaded engines + * + * @lib ocrsrv.lib + * @since S60 v3.1 + */ +class COCREngineList : public CBase + { +public: + + /** + * Symbian Two-phased constructor + */ + static COCREngineList* NewL(); + + /** + * Default C++ destructor + */ + virtual ~COCREngineList(); + + /** + * Justify if the language is supported + * @since S60 v3.1 + * @param aLanguage A language to be tested + * @return ETrue if supported + */ + TBool IsSupportLanguage(const TLanguage aLanguage); + + /** + * Get all supported languages + * @since S60 v3.1 + * @param aLanguages A list which holds all supported languages + * @return None + */ + void GetALLSupportLanguage(RArray &aLanguages); + + /** + * Refresh language databases, this method shall be always called + * whenever databases changed + * @since S60 v3.1 + * @return None + */ + void RefreshL(); + + /** + * Get supported engine numbers + * @since S60 v3.1 + * @return Num of engine detected + */ + inline TInt GetEngineCount() const; + + /** + * Get engine name by a given language + * @since S60 v3.1 + * @param aLanguage A language supported by the engine + * @param aEngineName The name of the engine + * @return KErrNone if no error, otherwise system level error raised + */ + TInt GetEngineName(const TLanguage aLanguage, TDes& aEngineName); + + /** + * Get engine name by language combination + * @since S60 v3.1 + * @param aLanguageFirst A language supported by the engine + * @param aLanguageSecond Another language supported by the engine + * @param aEngineName The name of the engine + * @return KErrNone if no error, otherwise system level error raised + */ + TInt GetEngineName(const TLanguage aLanguageFirst, + const TLanguage aLanguageSecond, + TDes& aEngineName); + +private: + + /** + * Empty data of the engine + * @since S60 v3.1 + * @return None + */ + void EmptyData(); + + /** + * Analyze engines information + * @since S60 v3.1 + * @return None + */ + void DoAnalyzeEnginesInfoL(); + + /** + * Set engines information + * @since S60 v3.1 + * @param aDir A directory information array + * @param aCount A number of dirs of the array + * @return None + */ + void SetEngineInfoL(const CDir* aDir, const TInt aCount); + + /** + * Default Symbian 2nd phase constructor + * @since S60 v3.1 + * @return None + */ + void ConstructL(); + + /** + * Add language array + * @since S60 v3.1 + * @param aSource A src language array + * @param aDestination A tar language array + * @return None + */ + void AddLanguageArray(const RArray& aSource, RArray& aDestination); + + /** + * Add language combination array + * @since S60 v3.1 + * @param aSource A src language array + * @param aDestination A tar language array + * @return None + */ + void AddCombinedLanguageArray(const RArray& aSource, + RArray& aDestination); + + /** + * Test if the language is within one array + * @since S60 v3.1 + * @param aLanguage A language to be tested + * @param aArray An array to be tested + * @return ETrue if the language is in language list + */ + TBool IsHaveLanguage(const TLanguage aLanguage, const RArray& aArray) const; + + /** + * Test if the language is within one combined array + * @since S60 v3.1 + * @param aLanguageFirst A language to be tested + * @param aLanguageSecond Another language to be tested + * @param aArray An array to be tested + * @return ETrue if the language is in language list + */ + TBool IsHaveCombinedLanguage(const TLanguage aLanguageFirst, + const TLanguage aLanguageSecond, + const RArray& aArray) const; + + /** + * C++ default constructor + */ + COCREngineList(); + +private: + + /** + * Pathes for searching the ocr libraries + */ + RPointerArray iPathes; + + /** + * List of all supported lanugages + */ + RArray iLanguageList; + + /** + * List of all combined languages, this generated from iLanguageList + * e.g. if we support English and Japanese, then the iCombinedLanguageList + * would have English, Japanese and EnglishJapanese languages. Note that + * only one western language and one eastern language would be combined + */ + RArray iCombinedLanguageList; + + /** + * List of all loaded OCR engine instances + */ + RPointerArray iOCREngineList; + + /** + * File session + */ + RFs iFs; + }; + +#include "language.inl" + +#endif // OCRLANGUAGE_H + +// End Of File diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/inc/language.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/inc/language.inl Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Inline functions for language mgr +* +*/ + + +// ----------------------------------------------------------------------------- +// Get the id of the engine +// ----------------------------------------------------------------------------- +// +inline const TInt COCREngine::GetEngineId() const + { + return iEngineId; + } + +// ----------------------------------------------------------------------------- +// Get supported languages +// ----------------------------------------------------------------------------- +// +inline const RArray& COCREngine::GetSupportLanguage() const + { + return iLanguageList; + } + +// ----------------------------------------------------------------------------- +// Get supported language list +// ----------------------------------------------------------------------------- +// +inline const RArray& COCREngine::GetSupportCombinedLanguage() const + { + return iCombinedLanguageList; + } + +// ----------------------------------------------------------------------------- +// Test if the language is a eastern language +// ----------------------------------------------------------------------------- +// +inline TBool COCREngine::IsEast(const TLanguage aLanguage) const + { + return ((aLanguage == ELangPrcChinese) || + (aLanguage == ELangJapanese) || + (aLanguage == ELangHongKongChinese) || + (aLanguage == ELangTaiwanChinese)); + } + +// ----------------------------------------------------------------------------- +// ?implementation_description +// ----------------------------------------------------------------------------- +// +inline TInt COCREngineList::GetEngineCount() const + { + return iOCREngineList.Count(); + } + +// End Of File diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/inc/languageconvertor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/inc/languageconvertor.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Language convertor definitions +* +*/ + + +#ifndef OCRLANGUAGECONVERTOR_H +#define OCRLANGUAGECONVERTOR_H + +// INCLUDE FILES +#include + +/** + * Language utils + * + * Offering language utilities + * + * @lib ocrsrv.lib + * @since S60 v3.1 + */ +class ConvertLanguage + { + public: + + /** + * Convert vendor language defination to Symbian's language definitions + * @since S60 v3.1 + * @param aLanguage A language to be converted + * @return The language converted + */ + static TLanguage ConvertToSymbian(const TInt aLanguage); + + /** + * Convert Symbian language defination to Vendor's language definitions + * @since S60 v3.1 + * @param aLanguage A language to be converted + * @return The language converted + */ + static TInt ConvertToVendor(const TLanguage aLanguage); + + /** + * Test if the language refer to multiple symbian's language definitions + * @since S60 v3.1 + * @param aLanguage A language to be tested + * @return ETrue if it is + */ + static TBool IsForMutiLanguage(const TInt aLanguage); + + /** + * Get symbian's full language list for the language + * @since S60 v3.1 + * @param aLanguage A language to be specified + * @param aArray Symbian's full language list + * @return None + */ + static void GetMutiLanguage(const TInt aLanguage, RArray& aArray); + }; + +#endif // OCRLANGUAGECONVERTOR_H + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/inc/ocradaptor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/inc/ocradaptor.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,220 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ocradapter definitions +* +*/ + + +#ifndef OCRADAPTOR_H +#define OCRADAPTOR_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CShareData; +enum TEngineCmd; + +// CLASS DECLARATION + +/** + * Adaptor for engines + * + * Implement concrete operation with child thread either send request + * to child thread or receive operation result from child thread + * + * @lib ocrsrv.lib + * @since S60 v3.1 + */ +class CEngineAdaptor : public CActive + { + public: + + /** + * Symbian Two-phased constructor + */ + static CEngineAdaptor* NewL(MOCREngineObserver& aObserver, + const TFileName& aTargetDll, + const TOcrEngineEnv aEngineEnv); + + /** + * C++ Default Destructor + */ + virtual ~CEngineAdaptor(); + + public: + + /** + * Issue request to child thread + * @since S60 v3.1 + * @param aCmd A command that is issued + * @return KErrNone if no error + */ + TInt IssueRequest(const TEngineCmd aCmd); + + /** + * Set image handle to be processed + * @since S60 v3.1 + * @param aHandle Handle to the image + * @return None + */ + void SetImage(const TInt aHandle); + + /** + * Set the setting for layout + * @since S60 v3.1 + * @param aSettings Layout settings + * @return None + */ + void SetLayoutSetting(const TOCRLayoutSetting& aSettings); + + /** + * Set Layout block information + * @since S60 v3.1 + * @param aSettings Layout block information + * @return None + */ + void SetLayoutBlockInfo(const TOCRLayoutBlockInfo& aLayoutInfo); + + /** + * Set special region information + * @since S60 v3.1 + * @param aSettings Special region information + * @return None + */ + void SetSpecialRegionInfo(const TRegionInfo& aRegionInfo); + + /** + * Set recognition setting + * @since S60 v3.1 + * @param aSettings Recognize settings + * @return None + */ + void SetRecognizeSetting(const TOCRRecognizeSetting& aSettings); + + /** + * Set blocks to be recognized + * @since S60 v3.1 + * @param aRecognizedBlock Blocks to be recognized + * @return None + */ + void SetRecognizeBlocksL(const RArray& aRecognizedBlock); + + /** + * Set active languages + * @since S60 v3.1 + * @param aActiveLanguage Languages to be recognized + * @return None + */ + void SetActiveLangL(const RArray& aActiveLanguage); + + /** + * Cancel the operation + * @since S60 v3.1 + * @return None + */ + void CancelOperation(); + + /** + * Test if the engine is active or not + * @since S60 v3.1 + * @return None + */ + TBool IsEngineActive() const; + + protected: // From CActive + + /** + * AO callback function + * @since S60 v3.1 + * @return None + */ + void RunL(); + + /** + * AO callback function + * @since S60 v3.1 + * @return None + */ + TInt RunError(TInt aError); + + /** + * AO callback function + * @since S60 v3.1 + * @return None + */ + void DoCancel(); + + protected: + + /** + * Send the command to exit and kill the thread + * @since S60 v3.1 + * @return None + */ + void SendExitCmd(); + + /** + * Get the current CPU tick of the thread + * @since S60 v3.1 + * @param aThreadName Name of the thread + * @return None + */ + static void GetThreadName(TDes& aThreadName); + + /** + * Test if the current thread is alive + * @since S60 v3.1 + * @return ETrue if the thread is alive + */ + TBool IsThreadAlive() const; + + private: + + /** + * C++ default constructor + */ + CEngineAdaptor(MOCREngineObserver& aObserver); + + /** + * Default Symbian 2nd phase constructor + */ + void ConstructL(const TFileName& aTargetDll, const TOcrEngineEnv aEngineEnv); + + private: // Data + + /** + * Handle of the child thread + */ + RThread iThread; + + /** + * Engine observer + */ + MOCREngineObserver& iObserver; + + /** + * Pointer to the shared data (Own) + */ + CShareData* iShareData; + + /** + * Request Status + */ + TRequestStatus iRequestStatus; + }; + +#endif // OCRADAPTOR_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/inc/ocrengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/inc/ocrengine.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,342 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ocrengine definitions +* +*/ + + +#ifndef OCRENGINE_H +#define OCRENGINE_H + +// INCLUDES +#include "language.h" +#include + +/** Activate language selection */ +enum TLanguageSelected + { + /** One language selected to be active */ + ESignleLanguageSelected = 1, + + /** Two languages selected to be active */ + ETwoLanguageSelected = 2 + }; + +// FORWARD DECLARATIONS +class CEngineAdaptor; +class COCREngineImplBase; + +// CLASS DECLARATION + +/** + * Ocr engine wrapper implementation base + * + * Abstruct for ocr engines + * + * @lib ocrsrv.lib + * @since S60 v3.1 + */ +class COCREngineImplBase : public MOCREngineBase, + public CBase + { +public: + + /** + * Symbian Two-phased constructor. + */ + static COCREngineImplBase* NewL(MOCREngineObserver& aObserver, const TOcrEngineEnv aEngineEnv); + + /** + * Default C++ Destructor + */ + virtual ~COCREngineImplBase(); + +public: // From MOCREngineInterface + + /** + * Cancel recognition operation + * @since S60 v3.1 + * @return None + */ + virtual void CancelOperation(); + + /** + * Get the version of the ocrsrv component + * @since S60 v3.1 + * @return The version of the module + */ + virtual TVersion GetVersion() const; + + /** + * Refresh installed language databases + * @since S60 v3.1 + * @return None + */ + virtual void RefreshInstalledLanguageL(); + + /** + * Set the language for recognition + * @since S60 v3.1 + * @param aActiveLanguage A languages to be activated + * @return None + */ + virtual void SetActiveLanguageL(const RArray& aActiveLanguage); + + /** + * Get the installed file directory + * @since S60 v3.1 + * @param aLanguages Get installed languages + * @return None + */ + virtual void GetInstalledLanguage(RArray& aLanguages) const; + + /** + * Test if the language is supported + * @since S60 v3.1 + * @param aLanguage A language to be tested + * @return ETrue if it's supported + */ + virtual TBool IsLanguageSupported(const TLanguage aLanguage); + + /** + * Release the engine instance + * @since S60 v3.1 + * @return None + */ + void Release(); + + /** + * Get adaptor object + * @since S60 v3.1 + * @return Pointer to the adaptor object + */ + inline CEngineAdaptor* GetAdaptor() const; + + /** + * Test if the engine is active or not + * @since S60 v3.1 + * @return None + */ + virtual TBool IsEngineActive() const; + +protected: + + /** + * Default Symbian 2nd phase constructor + */ + void ConstructL(MOCREngineObserver& aObserver, const TOcrEngineEnv aEngineEnv); + +private: + + /** + * Reset adaptor when active language(s) is changed + * @since S60 v3.1 + * @param aActiveLanguage New language to be activated + * @return None + */ + void ResetAdaptorL(const RArray& aActiveLanguage); + +private: + + /** + * Pointer to the adaptor instance (Own) + */ + CEngineAdaptor* iAdaptor; + + /** + * Pointer to the engine observer (Not Own) + */ + MOCREngineObserver* iObserver; + + /** + * Pointer to the current engine (Own) + */ + COCREngineList* iLanguageEngine; + + /** + * File name of the current loaded Dll + */ + TFileName iCurrentDll; + + /** + * Settings of the engine working aera + */ + TOcrEngineEnv iEngineEnv; + }; + +/** + * Ocr engine wrapper for recognition with layout analysis + * + * Abstruct for ocr engines with layout analysis + * + * @lib ocrsrv.lib + * @since S60 v3.1 + */ +class COCREngineLayoutRecognize : public MOCREngineLayoutRecognize, + public CBase + { + friend class OCREngineFactory; + +public: + /** + * Symbian Two-phased constructor. + */ + static COCREngineLayoutRecognize* NewL(MOCREngineObserver& aObserver, + const TOcrEngineEnv aEngineEnv); + +public: // From MOCREngineWithLayout + + /** + * Layout analysis method + * @since S60 v3.1 + * @param aBitmapHandle An image to analyzed + * @param aSettings Setting for layout analysis + * @return None + */ + virtual void LayoutAnalysisL(const TInt aBitmapHandle, const TOCRLayoutSetting aSettings); + + /** + * Text recognition method + * @since S60 v3.1 + * @param aSetting Setting for recognition + * @param aBlock Block Ids to be recognized + * @return None + */ + virtual void RecognizeL(const TOCRRecognizeSetting aSettings, const RArray& aBlock); + + /** + * Provide base functions + * @since S60 v3.1 + * @return Pointer to the base engine instance + */ + MOCREngineBase* Base() const; + +private: + + /** + * Default Symbian 2nd phase constructor + */ + void ConstructL(MOCREngineObserver& aObserver, const TOcrEngineEnv aEngineEnv); + +protected: + + /** + * Default C++ Destructor + */ + virtual ~COCREngineLayoutRecognize(); + +private: + + /** + * Pointer to the engine base instance (Own) + */ + COCREngineImplBase* iBase; + + /** + * Pointer to the adaptor instance (Not Own) + */ + CEngineAdaptor* iAdaptor; + }; + +/** + * Ocr engine wrapper for recognition with block recognition + * + * Abstruct for ocr engines with block recognition + * + * @lib ocrsrv.lib + * @since S60 v3.1 + */ +class COCREngineRecognizeBlock : public MOCREngineRecognizeBlock, + public CBase + { + friend class OCREngineFactory; + +public: + /** + * Description: Two-phased constructor. + */ + static COCREngineRecognizeBlock* NewL(MOCREngineObserver& aObserver, + const TOcrEngineEnv aEngineEnv); + +public: // From MOCREngineWithoutLayout + + /** + * Recognize block without layout analysis + * @since S60 v3.1 + * @param aBitmapHandle An image to analyzed + * @param aLayoutInfo Layout information + * @return None + */ + virtual void RecognizeBlockL(const TInt aBitmapHandle, + const TOCRLayoutBlockInfo aLayoutInfo); + + /** + * Recognize special region + * @since S60 v3.1 + * @param aBitmapHandle An image to analyzed + * @param aRegionInfo Region information + * @return None + */ + virtual void RecognizeSpecialRegionL(const TInt aBitmapHandle, + const TRegionInfo aRegionInfo); + + /** + * Provide base functions + * @since S60 v3.1 + * @return Pointer to the base engine instance + */ + MOCREngineBase* Base() const; + +private: + + /** + * Default Symbian 2nd phase constructor + */ + void ConstructL(MOCREngineObserver& aObserver, const TOcrEngineEnv aEngineEnv); + + /** + * Check the validity of the given rect + * If the range is invalid, a leave will be raised with KErrArgument + * @since S60 v3.1 + * @param aBitmapHandle A bitmap handle + * @param aRange A given range + * @return None + */ + void CheckRangeL(const TInt aBitmapHandle, const TRect aRange); + +protected: + + /** + * Default C++ Destructor + */ + virtual ~COCREngineRecognizeBlock(); + +private: + + /** + * Pointer to the engine base instance (Own) + */ + COCREngineImplBase* iBase; + + /** + * Pointer to the adaptor instance (Not Own) + */ + CEngineAdaptor* iAdaptor; + }; + +#include "ocrengine.inl" + +#endif // OCRENGINE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/inc/ocrengine.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/inc/ocrengine.inl Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Inline functions for engine adaptor +* +*/ + + +// ----------------------------------------------------------------------------- +// Get the pointer to the instance of the engine adaptor +// ----------------------------------------------------------------------------- +// +inline CEngineAdaptor* COCREngineImplBase::GetAdaptor() const + { + return iAdaptor; + } + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/inc/ocrsharedata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/inc/ocrsharedata.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,246 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Shared data definitions +* +*/ + + +#ifndef OCRSHAREDATA_H +#define OCRSHAREDATA_H + +// INCLUDES FILES +#include + +// DATA TYPES + +/** Request definitions between main thread and child thread */ +enum TEngineCmd + { + ECmdInvalid = 0, // Invalid + ECmdLayout, // Layout + ECmdRecognize, // Recognize + ECmdRecognizeBlock, // Recognize block + ECmdRecognizeSpecialRegion, // Recognize special region + ECmdSetLanguage, // Set language + ECmdGetLanguage, // Get language + ECmdRefresh, // Refresh + ECmdExit, // Exit + ECmdLayoutComplete, // Layout complete + ECmdRecognizeComplete, // Recognize complete + ECmdRecognizeBlockComplete, // Recognize block complete + ECmdRecognizeSpecialRegionComplete, // Recognize special region complete + ECmdRecogProcess, // Recognize progress + ECmdIsLanguageSupported // Just if supporting the language + }; + +// FORWARD DECLARATIONS +class CEngineAdaptor; +class EngineThread; + +// CLASS DECLARATION + +/** + * Shared data between threads + * + * Wrapper class for share data between main thread and child thread + * + * @lib ocrsrv.lib + * @since S60 v3.1 + */ +class CShareData : public CBase + { + friend class CEngineAdaptor; + friend class EngineThread; + +public: // Constructors and destructor + + /** + * Symbian Two-phased constructor. + */ + static CShareData* NewL(); + + /** + * C++ Default Destructor. + */ + virtual ~CShareData(); + +public: // New functions + + /** + * Enter Share Section + * @since S60 v3.1 + * @return None + */ + inline void EnterShareSection(); + + /** + * Leave Share Section + * @since S60 v3.1 + * @return None + */ + inline void LeaveShareSection(); + +private: + + /** + * C++ default constructor + */ + CShareData(); + + /** + * Default Symbian 2nd phase constructor + */ + void ConstructL(); + +private: // Data + + /** + * Share data mutex + */ + RMutex iShareMutex; + + /** + * Notifier for the shared data + */ + RSemaphore iNotifier; + + /** + * Save active language information + */ + RArray iActiveLanguage; + + /** + * Save installed language information + */ + RArray iInstalledLanguage; + + /** + * Command sent to child thread + */ + TEngineCmd iCmd; + + /** + * Command sent from child thread to main thread + */ + TEngineCmd iCmdRet; + + /** + * Recognized first block's pointer (Own) + */ + TOCRBlockInfo* iFirstBlock; + + /** + * Information of selected blocks + */ + TOCRBlockInfo* iSelectedBlocks; + + /** + * Information of text region + */ + TOCRTextRgnInfo* iTextRgnInfo; + + /** + * Number of blocks recognized + */ + TInt iBlockCount; + + /** + * OCR binary image (Own) + */ + HBufC8* iBinaryImage; + + /** + * Handle to the image + */ + TInt iImageHandle; + + /** + * Layout setting + */ + TOCRLayoutSetting iLayoutSettings; + + /** + * Recognzie setting + */ + TOCRRecognizeSetting iRecognizeSettings; + + /** + * Layout block information + */ + TOCRLayoutBlockInfo iLayoutInfo; + + /** + * Region information + */ + TRegionInfo iRegionInfo; + + /** + * Cancel flag + */ + TBool iCanceled; + + /** + * Main thread id + */ + TThreadId iMainThreadId; + + /** + * Percent of the progress + */ + TUint iPercent; + + /** + * Error code from the engine + */ + TInt iError; + + /** + * Pointer to Active object's status variable (Not Own) + */ + TRequestStatus* iActiveStatus; + + /** + * Pointer to normal status variable (Not Own) + */ + TRequestStatus* iRequestStatus; + + /** + * Name of the target dll + */ + TFileName iTargetDll; + }; + +// ----------------------------------------------------------------------------- +// CShareData::EnterShareSection +// Description : Enter share section +// ----------------------------------------------------------------------------- +// +inline void CShareData::EnterShareSection() + { + iShareMutex.Wait(); + } + +// ----------------------------------------------------------------------------- +// CShareData::LeaveShareSection +// Description : Leave share section +// ----------------------------------------------------------------------------- +// +inline void CShareData::LeaveShareSection() + { + iShareMutex.Signal(); + } + +#endif // OCRSHAREDATA_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/inc/ocrthread.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/inc/ocrthread.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,267 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ocr engine thread definitions +* +*/ + + +#ifndef OCRTHREAD_H +#define OCRTHREAD_H + +// INCLUDES FILES +#include "ocrsharedata.h" + +class CFbsBitmap; + +/** Global function type definitions */ +typedef TBool (*IsCanceled)( void ); +typedef TBool (*RecogProgress)(TUint aPercentage); + +/** Internal error code definition */ +const TInt KErrEngineOK ( 0 ); //no error +const TInt KErrEngineBadImage ( -1001 ); //bad image or unsupported format +const TInt KErrEngineBadLanguage ( -1002 ); //unsupported language +const TInt KErrEngineBadRgn ( -1003 ); //bad layout region +const TInt KErrEngineNoMemory ( -1004 ); //no enough memory +const TInt KErrEngineBadParam ( -1005 ); //wrong parameter +const TInt KErrEngineNotSetLang ( -1006 ); //not set any language +const TInt KErrEngineBadDicFile ( -1007 ); //bad dictionary files +const TInt KErrEngineGeneral ( -1100 ); //the other errors + +/** Number of interfaces defined in the engine DLLs */ +const TInt KNumOfInterfaces ( 14 ); + +/** Implementation interfaces definitions */ +enum TImplementationIds + { + EExitEngine = 1, + EFreeBinImage, + EFreeBlocks, + EGetInstalledLanguages, + EGetVersion, + EInitEngine, + ELayoutAnalysis, + ERecognizeWithLayout, + ERecognizeBlock, + ERefresh, + ESetActiveLanguage, + ERecognizeSpecialRegion, + EIsLanguageSupported, + EFreeTextRgns + }; + +/** + * Version of 3rd party ocr engines + * + * @lib ocrsrv.lib + * @since S60 v3.1 + */ +class TEngineVersion + { +public: + + /** + * Major version + */ + TInt8 iMajor; + + /** + * Minor version + */ + TInt8 iMinor; + + /** + * Build number + */ + TInt16 iBuild; + }; + +/** type definition of the interfaces */ +typedef TInt (*TLibFuncInitEngine)(IsCanceled aFuncIsCanceled, TAny* aParam); +typedef void (*TLibFuncExitEngine)( void ); + +typedef TInt (*TLibFuncLayout)(const CFbsBitmap* aImage, const TOCRLayoutSetting aSettings, HBufC8** aBinImage, TOCRBlockInfo** aBlock, TInt* aBlockCount); +typedef TInt (*TLibFuncRecognize)(HBufC8* aBinImage, const TOCRRecognizeSetting aSettings, TOCRBlockInfo* aBlock, const TInt aBlockCount, TOCRTextRgnInfo** aTextRgn, RecogProgress aFuncRecogProgress); + +typedef void (*TLibFuncFreeBinImage)(HBufC8* aBinImage); +typedef void (*TLibFuncFreeBlocks)(TOCRBlockInfo* aBlock); +typedef void (*TLibFuncFreeTextRgns)(TOCRTextRgnInfo *aTextRgn,const TInt aBlockCount); + +typedef TEngineVersion (*TLibFuncGetVersion)( void ); +typedef TInt (*TLibFuncSetActiveLanguage)(RArray iLanguages); +typedef TInt (*TLibFuncGetInstalledLanguages)(RArray& aLanguages); +typedef TInt (*TLibFuncRefresh)( void ); +typedef TBool (*TLibFuncIsLanguageSupported)(const TLanguage aLanguage); + +typedef TInt (*TLibFuncRecognizeBlock)(const CFbsBitmap* aImage, TOCRLayoutBlockInfo aLayoutInfo, TOCRTextRgnInfo** aTextRgn, RecogProgress aFuncRecogProgress); +typedef TInt (*TLibFuncRecognizeSpecialRegion)(const CFbsBitmap* aImage, TRegionInfo aRegionInfo, TOCRTextRgnInfo** aTextRgn, RecogProgress aFuncRecogProgress); + +// CLASS DECLARATION + +/** + * Thread for Ocr process + * + * Definition of the child thread of the engine + * + * @lib ocrsrv.lib + * @since S60 v3.1 + */ +class EngineThread + { +public: + + /** + * Thread entry function + * @since S60 v3.1 + * @param aData Thread parameter + * @return KErrNone if no error + */ + static TInt ThreadFunction(TAny* aData); + +private: + + /** + * Request Processor + * @since S60 v3.1 + * @param aShareData Pointer to the shared data + * @return None + */ + static void ProcessRequestL(CShareData* aShareData); + + /** + * Inform main thread that request is completed + * @since S60 v3.1 + * @param aShareData Pointer to the shared data + * @param aCmd A specified command + * @param aErrCode An error code + * @return None + */ + static void CompleteRequest(CShareData* aShareData, TEngineCmd aCmd, TInt aErrCode); + + /** + * Reset the vendor engine and release all memory allocated + * @since S60 v3.1 + * @param aShareData Pointer to the shared data + * @param aLibrary A reference to the loaded library + * @return None + */ + static void ResetVendorEngine(CShareData* aShareData, const RLibrary& aLibrary); + + /** + * Get the cancel flag + * @since S60 v3.1 + * @return ETrue if cancal flag is on; otherwise EFalse + */ + static TBool GetCancelFlag(); + + /** + * Get the progress information from the engine + * @since S60 v3.1 + * @param aPercentage A percentage of recognition progress + * @return KErrNone if no error + */ + static TInt RecognizeProgress(TUint aPercentage); + + /** + * Check and convert the engine error to system level error msg + * @since S60 v3.1 + * @param aError Vendor error code + * @return None + */ + static void CheckError(TInt& aError); + + /** + * Handle engine command + * @since S60 v3.1 + * @param aLibrary A handle to the engine library + * @param aCommand A command to be handled + * @param aData Pointer to the shared data + * @return None + */ + static TBool HandleCommandL(const RLibrary& aLibrary, TEngineCmd aCommand, CShareData* aData); + + /** + * Handle engine command - Layout Analysis + * @since S60 v3.1 + * @param aLibrary A handle to the engine library + * @param aCommand A command to be handled + * @param aData Pointer to the shared data + * @return None + */ + static void HandleLayoutAnalysis(const RLibrary& aLibrary, CShareData* aData); + + /** + * Handle engine command - Recognition + * @since S60 v3.1 + * @param aLibrary A handle to the engine library + * @param aCommand A command to be handled + * @param aData Pointer to the shared data + * @return None + */ + static void HandleRecognition(const RLibrary& aLibrary, CShareData* aData); + + /** + * Handle engine command - Block Recognition + * @since S60 v3.1 + * @param aLibrary A handle to the engine library + * @param aCommand A command to be handled + * @param aData Pointer to the shared data + * @return None + */ + static void HandleBlockRecognition(const RLibrary& aLibrary, CShareData* aData); + + /** + * Handle engine command - Special Region Recognition + * @since S60 v3.1 + * @param aLibrary A handle to the engine library + * @param aCommand A command to be handled + * @param aData Pointer to the shared data + * @return None + */ + static void HandleSpecialRegionRecognition(const RLibrary& aLibrary, CShareData* aData); + + /** + * Handle engine command - Getting Language + * @since S60 v3.1 + * @param aLibrary A handle to the engine library + * @param aCommand A command to be handled + * @param aData Pointer to the shared data + * @return None + */ + static void HandleGettingLanguage(const RLibrary& aLibrary, CShareData* aData); + + /** + * Handle engine command - Setting Language + * @since S60 v3.1 + * @param aLibrary A handle to the engine library + * @param aCommand A command to be handled + * @param aData Pointer to the shared data + * @return None + */ + static void HandleSettingLanguage(const RLibrary& aLibrary, CShareData* aData); + + /** + * Handle engine command - Refresh Database + * @since S60 v3.1 + * @param aLibrary A handle to the engine library + * @param aCommand A command to be handled + * @param aData Pointer to the shared data + * @return None + */ + static void HandleRefreshDatabase(const RLibrary& aLibrary, CShareData* aData); + }; + +#endif // OCRTHREAD_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/layers.sysdef.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,14 @@ + + +]> + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/src/ocrstubdllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/src/ocrstubdllmain.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2200 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dll main entry +* +*/ + + +// INCLUDE FILES +#include + +#if !defined(EKA2) + +// requirement for E32 DLLs +EXPORT_C TInt E32Dll(TDllReason) + { + return KErrNone; + } + +#endif // EKA2 + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/src/ocrstubfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/src/ocrstubfactory.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,313 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Engine factory implementation +* +*/ + + +// INCLUDE FILES +#include "ocrsharedata.h" +#include "ocradaptor.h" +#include "ocrengine.h" +#include "language.h" +#include + +// ================= MEMBER FUNCTIONS ======================= + +// ---------------------------------------------------------- +// OCREngineFactory::ReleaseOCREngine +// Description : Release engine +// ---------------------------------------------------------- +// +EXPORT_C void OCREngineFactory::ReleaseOCREngine(MOCREngineInterface* /*aEngine*/) + { + } + +// ---------------------------------------------------------- +// OCREngineFactory::CreateOCREngineL +// Description : Create engine +// ---------------------------------------------------------- +// +EXPORT_C MOCREngineInterface* OCREngineFactory::CreateOCREngineL(MOCREngineObserver& /*aObserver*/, + const TOcrEngineEnv /*aEngineEnv*/, + TEngineType /*aEngineType*/) + { + User::Leave(KErrNotSupported); + return NULL; + } + +OCREngineFactory::OCREngineFactory() + { + } + +// --------------------------------------------------------------- +// COCREngine::COCREngine +// Description : self-construct +// --------------------------------------------------------------- +// +COCREngine::COCREngine() + { + } + +// --------------------------------------------------------------- +// COCREngine::~COCREngine +// Description : Destruct +// --------------------------------------------------------------- +// +COCREngine::~COCREngine() + { + } + +// ----------------------------------------------------------------------------- +// CShareData::CShareData +// Description : C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CShareData::CShareData() + { + } + +// ----------------------------------------------------------------------------- +// CShareData::~CShareData +// Description : destructor. +// ----------------------------------------------------------------------------- +// +CShareData::~CShareData() + { + } + +// ----------------------------------------------------------------------------- +// CEngineAdaptor::CEngineAdaptor +// Description : C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CEngineAdaptor::CEngineAdaptor(MOCREngineObserver& aObserver) + : CActive(EPriorityNormal), iObserver(aObserver) + { + } + +// ----------------------------------------------------------------------------- +// CEngineAdaptor::~CEngineAdaptor +// Description : Destructor +// ----------------------------------------------------------------------------- +// +CEngineAdaptor::~CEngineAdaptor() + { + } + +// --------------------------------------------------------- +// CEngineAdaptor::RunL() +// Description : callback function for request complete, +// either layout analysis complete, +// or recognize complete +// or recognize process information is given +// --------------------------------------------------------- +// +void CEngineAdaptor::RunL() + { + } + +// --------------------------------------------------------- +// CEngineAdaptor::RunError(...) +// Description : Deal with errors from RunL() +// --------------------------------------------------------- +// +TInt CEngineAdaptor::RunError(TInt /*aError*/) + { + return KErrNone; + } + +// ---------------------------------------------------------- +// CEngineAdaptor::DoCancel +// Description : from CActive +// ---------------------------------------------------------- +// +void CEngineAdaptor::DoCancel() + { + } + +// --------------------------------------------------------------- +// COCREngineList::COCREngineList +// Description : self-construct +// --------------------------------------------------------------- +// +COCREngineList::COCREngineList() + { + } + +// --------------------------------------------------------------- +// COCREngineList::~COCREngineList +// Description : destruct +// --------------------------------------------------------------- +// +COCREngineList::~COCREngineList() + { + } + +// --------------------------------------------------------------- +// COCREngineImplBase::~COCREngineImplBase +// Description : Destructor. +// --------------------------------------------------------------- +// +COCREngineImplBase::~COCREngineImplBase() + { + } + +// --------------------------------------------------------------- +// COCREngineImplBase::CancelRecognition() +// Description : Cancel recognition operation +// ------------------------------------------------------------- +// +TBool COCREngineImplBase::IsEngineActive() const + { + return EFalse; + } + +// --------------------------------------------------------------- +// COCREngineImplBase::IsLanguageSupported +// Description : IsLanguageSupported +// ------------------------------------------------------------- +// +TBool COCREngineImplBase::IsLanguageSupported(const TLanguage /*aLanguage*/) + { + return EFalse; + } + +// --------------------------------------------------------------- +// COCREngineImplBase::CancelRecognition() +// Description : Cancel recognition operation +// ------------------------------------------------------------- +// +void COCREngineImplBase::CancelOperation() + { + } + +// ------------------------------------------------------------- +// COCREngineImplBase::GetInstalledLanguageL +// Description : Get installed language information +// ------------------------------------------------------------- +// +void COCREngineImplBase::GetInstalledLanguage(RArray& /*aLanguages*/) const + { + } + +// ------------------------------------------------------------- +// COCREngineImplBase::SetActiveLanguageL +// Description : Set active language +// ------------------------------------------------------------- +// +void COCREngineImplBase::SetActiveLanguageL(const RArray& /*aActiveLanguage*/) + { + } + +// --------------------------------------------------------------- +// COCREngineImplBase::RefreshInstalledLanguageL +// Description : Refresh installed language +// ------------------------------------------------------------- +// +void COCREngineImplBase::RefreshInstalledLanguageL() + { + } + +// --------------------------------------------------------------- +// COCREngineImplBase::CancelRecognition() +// Description : Cancel recognition operation +// ------------------------------------------------------------- +// +TVersion COCREngineImplBase::GetVersion() const + { + return (TVersion(1, 0, 0)); + } + +// --------------------------------------------------------------- +// COCREngineRecognizeBlock::~COCREngineRecognizeBlock +// Description : Destructor +// --------------------------------------------------------------- +// +COCREngineRecognizeBlock::~COCREngineRecognizeBlock() + { + } + +// ------------------------------------------------------------- +// COCREngineRecognizeBlock::RecognizeBlockL +// Description : Recognize a specified block +// ------------------------------------------------------------- +// +void COCREngineRecognizeBlock::RecognizeBlockL(const TInt /*aBitmapHandle*/, + const TOCRLayoutBlockInfo /*aLayoutInfo*/) + { + } + +// --------------------------------------------------------------- +// COCREngineRecognizeBlock::Base +// Description : Provide base functions to be called +// --------------------------------------------------------------- +// +MOCREngineBase* COCREngineRecognizeBlock::Base() const + { + return NULL; + } + +// ------------------------------------------------------------- +// COCREngineRecognizeBlock::RecognizeSpecialregionL +// Description : Recognize a special region +// ------------------------------------------------------------- +// +void COCREngineRecognizeBlock::RecognizeSpecialRegionL(const TInt /*aBitmapHandle*/, + const TRegionInfo /*aRegionInfo*/) + { + } + +// --------------------------------------------------------------- +// COCREngineLayoutRecognize::~COCREngineLayoutRecognize +// Description : Destructor +// --------------------------------------------------------------- +// +COCREngineLayoutRecognize::~COCREngineLayoutRecognize() + { + } + +// --------------------------------------------------------------- +// COCREngineLayoutRecognize::LayoutAnalysisL +// Description : Layout analysis +// ------------------------------------------------------------- +// +void COCREngineLayoutRecognize::LayoutAnalysisL(const TInt /*aBitmapHandle*/, + const TOCRLayoutSetting /*aSettings*/) + { + } + +// ------------------------------------------------------------- +// COCREngineLayoutRecognize::RecognizeL +// Description : Recognize text +// ------------------------------------------------------------- +// +void COCREngineLayoutRecognize::RecognizeL(const TOCRRecognizeSetting /*aSettings*/, + const RArray& /*aBlock*/) + { + } + +// --------------------------------------------------------------- +// COCREngineLayoutRecognize::Base +// Description : Provide base functions to be called +// --------------------------------------------------------------- +// +MOCREngineBase* COCREngineLayoutRecognize::Base() const + { + return NULL; + } + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 ocrsrv_stub/sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocrsrv_stub/sysdef_1_4_0.dtd Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/data/e4d7b7c9.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/data/e4d7b7c9.rss Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description:Resource file +* +*/ + + +#include + + +RESOURCE REGISTRY_INFO theInfo + { + // UID for the DLL. + dll_uid = 0xE4D7B7C9; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x20026773; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0xE4D72222; + version_no = 1; + display_name = "StubV01"; + default_data = "asnnokia"; + opaque_data =""; + } + }; + } + }; + } diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/group/asnimplementation.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/group/asnimplementation.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition for plugin implementation +* +*/ + +#include + +TARGET AsnImplementation.dll +TARGETTYPE PLUGIN +UID 0x10009d8d 0xE4D7B7C9 + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +START RESOURCE ../data/E4D7B7C9.rss + TARGET asnimplementation.rsc +END + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src + +SOURCE asnimplementation.cpp +SOURCE asnimplementationdllmain.cpp asnimplementationbase.cpp + + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY epos_csuplutils.lib +LIBRARY estlib.lib +LIBRARY eposomasuplposmessageplugin.lib +LIBRARY epos_comasuplasnplugin.lib + +#ifdef ENABLE_ABIV2_MODE +DEBUGGABLE_UDEBONLY +#endif + +SOURCE cstubsuplstart.cpp cstubsuplresponse.cpp cstubsuplposinit.cpp cstubsuplpos.cpp cstubsuplinit.cpp cstubsuplend.cpp cstubsuplauthresponse.cpp cstubsuplauthrequest.cpp diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information for ASN plugin +* +*/ + +PRJ_PLATFORMS +WINSCW + +PRJ_EXPORTS + + +PRJ_MMPFILES +AsnImplementation.mmp diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/inc/asnimplementation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/inc/asnimplementation.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ASN plugin +* +*/ + +// This file defines the API for AsnImplementation.dll + +#ifndef __ASNIMPLEMENTATION_H__ +#define __ASNIMPLEMENTATION_H__ + +// Include Files + +#include // CBase +#include // TBuf +#include + +// Constants + +const TInt KAsnImplementationBufferLength = 15; +typedef TBuf TAsnImplementationExampleString; + +// Class Definitions + +class CAsnImplementation : public CBase + { +public: + // new functions + IMPORT_C static CAsnImplementation* NewL(); + IMPORT_C static CAsnImplementation* NewLC(); + IMPORT_C ~CAsnImplementation(); + +public: + // new functions, example API + IMPORT_C TVersion Version() const; + IMPORT_C void ExampleFuncAddCharL(const TChar& aChar); + IMPORT_C void ExampleFuncRemoveLast(); + IMPORT_C const TPtrC ExampleFuncString() const; + +private: + // new functions + CAsnImplementation(); + void ConstructL(); + +private: + // data + TAsnImplementationExampleString* iString; + }; + +#endif // __ASNIMPLEMENTATION_H__ + diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/inc/asnimplementation.pan --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/inc/asnimplementation.pan Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ASN plugin +* +*/ + +#ifndef __ASNIMPLEMENTATION_PAN__ +#define __ASNIMPLEMENTATION_PAN__ + +// Data Types + +enum TAsnImplementationPanic + { + EAsnImplementationNullPointer + }; + +// Function Prototypes + +GLREF_C void Panic(TAsnImplementationPanic aPanic); + +#endif // __ASNIMPLEMENTATION_PAN__ + diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/inc/asnimplementationbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/inc/asnimplementationbase.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Asn ImplementationBase +* +*/ + + +#ifndef ASNIMPLEMENTATIONBASE_H_ +#define ASNIMPLEMENTATIONBASE_H_ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" + + +class COMASuplAsnMessageBase; +class COMASuplAsnHandlerBase; +class CStubSuplStart; +class CStubSuplResponse; +class CStubSuplPosInit; +class CStubSuplPos; +class CStubSuplInit; +class CStubSuplEnd; +class CStubSuplAuthRequest; +class CStubSuplAuthResponse; + +class CAsnImplementationBase : public COMASuplAsnHandlerBase + { + +public: + /** + * Instanitates an object.. + */ + IMPORT_C static CAsnImplementationBase* NewL(); + + virtual HBufC8* EncodeL(COMASuplAsnMessageBase*, TInt& aErrorCode); + + virtual COMASuplAsnMessageBase* DecodeL(const TPtrC8& aPacket,TInt& aErrorCode,TInt& aUnConsumedBytes ); + + virtual COMASuplAsnMessageBase* CreateOMASuplMessageL(COMASuplAsnMessageBase::TSuplMessageType aOMASuplMessageType); + + + virtual TOMASuplVersion GetSuplMessageVersionL(TInt& aErrorCode, + const TPtrC8& aSuplAsnMessage); + /** + * Destructor + */ + IMPORT_C ~CAsnImplementationBase(); + +protected: + /** + * Constructor + */ + CAsnImplementationBase(); + /** + * Two phase construction + */ + void ConstructL(); + + +private: + + /** + * By default, prohibit copy constructor + */ + + CAsnImplementationBase( const CAsnImplementationBase& ); + + /** + * By default, Prohibit assigment operator + */ + + CAsnImplementationBase& operator= ( const CAsnImplementationBase& ); + + + }; + +#endif /* ASNIMPLEMENTATIONBASE_H_ */ diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/inc/cstubsuplauthrequest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/inc/cstubsuplauthrequest.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: authrequest +* +*/ + + +#ifndef CSTUBSUPLAUTHREQUEST_H_ +#define CSTUBSUPLAUTHREQUEST_H_ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplauthrequest.h" +#include "asnimplementationbase.h" + +class CStubSuplAuthRequest : public COMASuplAuthRequest + { +public: + /** + * Factory function that instantiates a new object of CStubSuplAuthRequest + * + */ + IMPORT_C static CStubSuplAuthRequest* NewL(); + /** + * Destructor + */ + IMPORT_C ~CStubSuplAuthRequest(); + /** + * Method for Encoding... + */ + virtual HBufC8* EncodeL(TInt& aErrorCode); +private: + /** + * Default C++ Constructor + */ + CStubSuplAuthRequest(); + + void ConstructL(); + }; + +#endif /* CSTUBSUPLSTARTIMPLE_H_ */ diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/inc/cstubsuplauthresponse.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/inc/cstubsuplauthresponse.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: AuthResponse +* +*/ + + +#ifndef CSTUBSUPLAUTHRESPONSE_H_ +#define CSTUBSUPLAUTHRESPONSE_H_ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplresponse.h" +#include "asnimplementationbase.h" + +class CStubSuplAuthResponse : public COMASuplAuthResponse + { +public: + /** + * Factory function that instantiates a new object of CStubSuplAuthResponse + * + */ + IMPORT_C static CStubSuplAuthResponse* NewL(); + /** + * Destructor + */ + IMPORT_C ~CStubSuplAuthResponse(); + /** + * Method for Encoding... + */ + virtual HBufC8* EncodeL(TInt& aErrorCode); +private: + /** + * Default C++ Constructor + */ + CStubSuplAuthResponse(); + + void ConstructL(); + }; + +#endif /* CSTUBSUPLSTARTIMPLE_H_ */ diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/inc/cstubsuplend.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/inc/cstubsuplend.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Supl End +* +*/ + + +#ifndef CSTUBSUPLEND_H_ +#define CSTUBSUPLEND_H_ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplend.h" +#include "asnimplementationbase.h" + +class CStubSuplEnd : public COMASuplEnd + { +public: + /** + * Factory function that instantiates a new object of CStubSuplEnd + * + */ + IMPORT_C static CStubSuplEnd* NewL(); + /** + * Destructor + */ + IMPORT_C ~CStubSuplEnd(); + /** + * Method for Encoding... + */ + virtual HBufC8* EncodeL(TInt& aErrorCode); + +private: + void InitializeL(); + + void InitializePosition(); + + void InitializePositionEstimate(TOMASuplPositionEstimate& posEstimate); + + void InitializeTime(const TOMASuplUtcTime aUtcTime); + + void IntializeHorizVelocity(const COMASuplHorizVelocity* aVelocity); + + void IntializeHorizAndVertVelocity(const COMASuplHorizVelocity* aVelocity); + + void IntializeHorizUncertVelocity(const COMASuplHorizVelocity* aVelocity); + + void IntializeHorizVertUncertVelocity(const COMASuplHorizVelocity* aVelocity); +private: + /** + * Default C++ Constructor + */ + CStubSuplEnd(); + + void ConstructL(); + }; + +#endif /* CSTUBSUPLSTARTIMPLE_H_ */ diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/inc/cstubsuplinit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/inc/cstubsuplinit.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description:Supl Init +* +*/ + + +#ifndef CSTUBSUPLINIT_H_ +#define CSTUBSUPLINIT_H_ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplinit.h" +#include "AsnImplementationBase.h" + +class CStubSuplInit : public COMASuplInit + { +public: + /** + * Factory function that instantiates a new object of CStubSuplInit + * + */ + IMPORT_C static CStubSuplInit* NewL(); + /** + * Destructor + */ + IMPORT_C ~CStubSuplInit(); + /** + * Method for Encoding... + */ + virtual HBufC8* EncodeL(TInt& aErrorCode); +private: + /** + * Default C++ Constructor + */ + CStubSuplInit(); + + void ConstructL(); + }; + +#endif /* CSTUBSUPLSTARTIMPLE_H_ */ diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/inc/cstubsuplpos.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/inc/cstubsuplpos.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description:SuplPos +* +*/ + + +#ifndef CSTUBSUPLPOS_H_ +#define CSTUBSUPLPOS_H_ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplpos.h" +#include "epos_comasuplposinit.h" +#include "asnimplementationbase.h" + +class CStubSuplPos : public COMASuplPos + { +public: + /** + * Factory function that instantiates a new object of CStubSuplPos + * + */ + IMPORT_C static CStubSuplPos* NewL(); + /** + * Destructor + */ + IMPORT_C ~CStubSuplPos(); + /** + * Method for Encoding... + */ + virtual HBufC8* EncodeL(TInt& aErrorCode); + +private: + void InitializeL(); + + void IntializeHorizVelocity(const COMASuplHorizVelocity* aVelocity); + + void IntializeHorizAndVertVelocity(const COMASuplHorizVelocity* aVelocity); + + void IntializeHorizUncertVelocity(const COMASuplHorizVelocity* aVelocity); + + void IntializeHorizVertUncertVelocity(const COMASuplHorizVelocity* aVelocity); + +private: + /** + * Default C++ Constructor + */ + CStubSuplPos(); + + void ConstructL(); + }; + +#endif /* CSTUBSUPLSTARTIMPLE_H_ */ diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/inc/cstubsuplposinit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/inc/cstubsuplposinit.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description:SuplPosInit +* +*/ + + +#ifndef CSTUBSUPLPOSINIT_H_ +#define CSTUBSUPLPOSINIT_H_ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplposinit.h" +#include "asnimplementationbase.h" + + +class CStubSuplPosInit : public COMASuplPosInit + { +public: + /** + * Factory function that instantiates a new object of CStubSuplPosInit + * + */ + IMPORT_C static CStubSuplPosInit* NewL(); + /** + * Destructor + */ + IMPORT_C ~CStubSuplPosInit(); + /** + * Method for Encoding... + */ + virtual HBufC8* EncodeL(TInt& aErrorCode); + +private: + + void InitializeL(); + + void InitializeRequestData(); + + void InitializePosition(); + + void InitializePositionEstimate(TOMASuplPositionEstimate& posEstimate); + + void InitializeTime(const TOMASuplUtcTime aUtcTime); + + void InitializePosPayLoad(); + + void IntializeHorizVelocity(const COMASuplHorizVelocity* aVelocity); + + void IntializeHorizAndVertVelocity(const COMASuplHorizVelocity* aVelocity); + + void IntializeHorizUncertVelocity(const COMASuplHorizVelocity* aVelocity); + + void IntializeHorizVertUncertVelocity(const COMASuplHorizVelocity* aVelocity); + + /** + * Initialize SetCapabilities + */ + void InitializeSetCapabilities(); + /** + * Initialize LocationId + */ + void InitializeLocationId(); + /** + * Initialize Qop + */ + void InitializeECellId(); + /** + * Initialize GSM ECellId + */ + void InitializeGSMECellId(); + /** + * Initialize WCDMA ECellId + */ + void InitializeWCDMAECellId(); + + TInt FillFrequencyInfo(TOMASuplFrequencyInfo& aOMASuplFrequencyInfo); + + TInt FillMeasuredResultsList(TOMASuplNetworkMeasureReport aNwkMeasureReport[]); + + TInt FillCellMeasuredResult(TOMASuplCellMeasuredResult aCellMeasuredResult[]); + + TInt FillModeSpecificInfo(TOMASuplCellMeasuredResult& aCellMeasuredResult); + + void FillFrequencyInfoULInfo(TInt aFddUL,TInt& aRetErrorCode); + + void FillFrequencyInfoDT(TInt aTddDt,TInt& aRetErrorCode); +private: + /** + * Default C++ Constructor + */ + CStubSuplPosInit(); + + void ConstructL(); + + + }; + +#endif /* CSTUBSUPLSTARTIMPLE_H_ */ diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/inc/cstubsuplresponse.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/inc/cstubsuplresponse.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description:SuplResponse Class +* +*/ + + +#ifndef CSTUBSUPLRESPONSE_H_ +#define CSTUBSUPLRESPONSE_H_ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplresponse.h" +#include "asnimplementationbase.h" + +class CStubSuplResponse : public COMASuplResponse + { +public: + /** + * Factory function that instantiates a new object of CStubSuplResponse + * + */ + IMPORT_C static CStubSuplResponse* NewL(); + /** + * Destructor + */ + IMPORT_C ~CStubSuplResponse(); + /** + * Method for Encoding... + */ + virtual HBufC8* EncodeL(TInt& aErrorCode); +private: + /** + * Default C++ Constructor + */ + CStubSuplResponse(); + + void ConstructL(); + }; + +#endif /* CSTUBSUPLSTARTIMPLE_H_ */ diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/inc/cstubsuplstart.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/inc/cstubsuplstart.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: SuplStart +* +*/ + + +#ifndef CSTUBSUPLSTARTIMPLE_H_ +#define CSTUBSUPLSTARTIMPLE_H_ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplstart.h" +#include "asnimplementationbase.h" + +class CStubSuplStart : public COMASuplStart + { +public: + /** + * Factory function that instantiates a new object of CStubSuplStart + * + */ + IMPORT_C static CStubSuplStart* NewL(); + /** + * Destructor + */ + IMPORT_C ~CStubSuplStart(); + /** + * Method for Encoding... + */ + virtual HBufC8* EncodeL(TInt& aErrorCode); + /** + * initialize memory management stack + * allocate memory for structure + */ + +private: + void InitializeL(); + /** + * Initialize SetCapabilities + */ + void InitializeSetCapabilities(); + /** + * Initialize LocationId + */ + void InitializeLocationId(); + /** + * Initialize Qop + */ + void InitializeQop(); + /** + * Initialize ECellId + */ + void InitializeECellId(); + /** + * Initialize GSM ECellId + */ + void InitializeGSMECellId(); + /** + * Initialize WCDMA ECellId + */ + void InitializeWCDMAECellId(); + + TInt FillFrequencyInfo(TOMASuplFrequencyInfo& aOMASuplFrequencyInfo); + + TInt FillMeasuredResultsList(TOMASuplNetworkMeasureReport aNwkMeasureReport[]); + + TInt FillCellMeasuredResult(TOMASuplCellMeasuredResult aCellMeasuredResult[]); + + TInt FillModeSpecificInfo(TOMASuplCellMeasuredResult& aCellMeasuredResult); + + void FillFrequencyInfoULInfo(TInt aFddUL,TInt& aRetErrorCode); + + void FillFrequencyInfoDT(TInt aTddDt,TInt& aRetErrorCode); + +private: + /** + * Default C++ Constructor + */ + CStubSuplStart(); + /* + * 2 phase construction + */ + void ConstructL(); + }; + +#endif /* CSTUBSUPLSTARTIMPLE_H_ */ diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/layers.sysdef.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,14 @@ + + +]> + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/src/asnimplementation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/src/asnimplementation.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of ASN plugin +* +*/ + +// Include Files + +#include "asnimplementation.h" // CAsnImplementation +#include "asnimplementation.pan" // panic codes +#include +#include "asnimplementationBase.h" + +// Member Functions + +EXPORT_C CAsnImplementation* CAsnImplementation::NewLC() + { + CAsnImplementation* self = new (ELeave) CAsnImplementation; + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +EXPORT_C CAsnImplementation* CAsnImplementation::NewL() + { + CAsnImplementation* self = CAsnImplementation::NewLC(); + CleanupStack::Pop(self); + return self; + } + +CAsnImplementation::CAsnImplementation() +// note, CBase initialises all member variables to zero + { + } + +void CAsnImplementation::ConstructL() + { + // second phase constructor, anything that may leave must be constructed here + iString = new (ELeave) TAsnImplementationExampleString; + } + +EXPORT_C CAsnImplementation::~CAsnImplementation() + { + delete iString; + } + +EXPORT_C TVersion CAsnImplementation::Version() const + { + // Version number of example API + const TInt KMajor = 1; + const TInt KMinor = 0; + const TInt KBuild = 1; + return TVersion(KMajor, KMinor, KBuild); + } + +EXPORT_C void CAsnImplementation::ExampleFuncAddCharL(const TChar& aChar) + { + __ASSERT_ALWAYS(iString != NULL, Panic(EAsnImplementationNullPointer)); + + if (iString->Length() >= KAsnImplementationBufferLength) + { + User::Leave(KErrTooBig); + } + + iString->Append(aChar); + } + +EXPORT_C void CAsnImplementation::ExampleFuncRemoveLast() + { + __ASSERT_ALWAYS(iString != NULL, Panic(EAsnImplementationNullPointer)); + + if (iString->Length() > 0) + { + iString->SetLength(iString->Length() - 1); + } + } + +EXPORT_C const TPtrC CAsnImplementation::ExampleFuncString() const + { + __ASSERT_ALWAYS(iString != NULL, Panic(EAsnImplementationNullPointer)); + return *iString; + } + +const TImplementationProxy ImplementationTable[] = + { + + #ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY(0xE4D72222, CAsnImplementationBase::NewL) + #else + { { 0xE4D72222 }, CAsnImplementationBase::NewL} + #endif + + }; + +// Exported proxy for instantiation method resolution. +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/src/asnimplementationbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/src/asnimplementationbase.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,184 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of ASN plugin +* +*/ + +#include "asnimplementationbase.h" +#include +#include "epos_comasuplstart.h" +#include "epos_comasuplresponse.h" +#include "epos_comasuplposinit.h" +#include "epos_comasuplpos.h" +#include "epos_comasuplinit.h" +#include "epos_comasuplend.h" +#include "epos_comasuplauthrequest.h" +#include "epos_comasuplauthresponse.h" +#include "cstubsuplstart.h" +#include "cstubsuplresponse.h" +#include "cstubsuplposinit.h" +#include "cstubsuplpos.h" +#include "cstubsuplinit.h" +#include "cstubsuplend.h" +#include "cstubsuplauthrequest.h" +#include "cstubsuplauthresponse.h" + +CAsnImplementationBase::CAsnImplementationBase() + { + + } +// ----------------------------------------------------------------------------- +// CAsnImplementationBase::NewL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CAsnImplementationBase* CAsnImplementationBase::NewL() + { + CAsnImplementationBase* self = new (ELeave) CAsnImplementationBase; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } +// ----------------------------------------------------------------------------- +// CAsnImplementationBase::EncodeL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +HBufC8* CAsnImplementationBase::EncodeL(COMASuplAsnMessageBase* asnMessage, TInt& aErrorCode) + { + //Initialize your library for encoding... + + //Encoding operations to be done here!! + HBufC8* encodedBuffer; + if ( asnMessage ) + encodedBuffer = asnMessage->EncodeL(aErrorCode); + else + encodedBuffer = NULL; + + return encodedBuffer; + } +// ----------------------------------------------------------------------------- +// CAsnImplementationBase::DecodeL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +COMASuplAsnMessageBase* CAsnImplementationBase::DecodeL(const TPtrC8& /*aPacket*/,TInt& aErrorCode,TInt& aUnConsumedBytes ) + { + COMASuplAsnMessageBase* self = NULL; + aErrorCode = 0; + aUnConsumedBytes = 0; + + //Decoding operations to be done here!!! + //Here you will have to decode the buffer using your own ASN library and return the object of appropriate SUPL message class. + //e.g. if you finds that decoded message is SUPL_RESPONSE,create object of SUPL_RESPONSE class and call appropriate set methods to fill its all mandatory + //and optional methods. For demostration purpose, here are some set methods for SUPL_RESPONSE + // + //CStubSuplResponse* lOMASuplResponse = CStubSuplResponse::NewL(); + //CleanupStack::PushL(lOMASuplResponse); + //TOMASuplVersion lVersion; + //TInt lMajor = 1; + //TInt lMinor = 0; + //TInt lServInd; = 0; + //lVersion.SetSuplVersion(lMajor,lMinor,lServInd); + //COMASuplSessionID* lSessionId = COMASuplSessionID::NewL();//Set all parameters needed for session id. + //lOMASuplResponse->SetMessageBase(lVersion, lSessionId); + //lOMASuplResponse->SetMessageLength(20); + //TInt lPosMethod = 1; + //lOMASuplResponse->SetSuplResponse((TOMASuplPosMethod)lPosMethod); + //CleanupStack::Pop(); + //aErrorCode = KErrNone; + //aUnConsumedBytes = 0; + // return lOMASuplResponse; + + return self; + } +// ----------------------------------------------------------------------------- +// CAsnImplementationBase::CreateOMASuplMessageL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +COMASuplAsnMessageBase* CAsnImplementationBase::CreateOMASuplMessageL(COMASuplAsnMessageBase::TSuplMessageType aOMASuplMessageType) + { + COMASuplAsnMessageBase* suplMsg = NULL; + // Creating operations!! + switch ( aOMASuplMessageType ) + { + case COMASuplAsnMessageBase::ESUPL_START : + { + suplMsg = CStubSuplStart::NewL(); + break; + } + case COMASuplAsnMessageBase::ESUPL_RESPONSE : + { + suplMsg = CStubSuplResponse::NewL(); + break; + } + case COMASuplAsnMessageBase::ESUPL_POSINIT : + { + suplMsg = CStubSuplPosInit::NewL(); + break; + } + case COMASuplAsnMessageBase::ESUPL_POS : + { + suplMsg = CStubSuplPos::NewL(); + break; + } + case COMASuplAsnMessageBase::ESUPL_INIT : + { + suplMsg = CStubSuplInit::NewL(); + break; + } + case COMASuplAsnMessageBase::ESUPL_END : + { + suplMsg = CStubSuplEnd::NewL(); + break; + } + case COMASuplAsnMessageBase::ESUPL_AUTH_REQ : + { + suplMsg = CStubSuplAuthRequest::NewL(); + break; + } + case COMASuplAsnMessageBase::ESUPL_AUTH_RESP : + { + suplMsg = CStubSuplAuthResponse::NewL(); + break; + } + default : break ; + } + return suplMsg; + } +// ----------------------------------------------------------------------------- +// CAsnImplementationBase::~CAsnImplementationBase +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +CAsnImplementationBase::~CAsnImplementationBase() + { + + } +// ----------------------------------------------------------------------------- +// CAsnImplementationBase::ConstructL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CAsnImplementationBase::ConstructL() + { + } + +TOMASuplVersion CAsnImplementationBase::GetSuplMessageVersionL(TInt& aErrorCode,const TPtrC8& aSuplAsnMessage) + { + TOMASuplVersion version; + return version; + } \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/src/asnimplementationdllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/src/asnimplementationdllmain.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of Main +* +*/ + +// Include Files + +#include // GLDEF_C +#include "asnimplementation.pan" // panic codes + +// Global Functions + +GLDEF_C void Panic(TAsnImplementationPanic aPanic) +// Panics the thread with given panic code + { + User::Panic(_L("AsnImplementation"), aPanic); + } + +// Exported Functions + +#ifndef EKA2 // for EKA1 only +EXPORT_C TInt E32Dll(TDllReason /*aReason*/) +// Called when the DLL is loaded and unloaded. Note: have to define +// epoccalldllentrypoints in MMP file to get this called in THUMB. + { + return KErrNone; + } +#endif + diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/src/cstubsuplauthrequest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/src/cstubsuplauthrequest.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Auth request +* +*/ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplauthrequest.h" +#include "cstubsuplauthrequest.h" + +// ----------------------------------------------------------------------------- +// CStubSuplAuthRequest::NewL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplAuthRequest* CStubSuplAuthRequest::NewL() + { + CStubSuplAuthRequest* self = new (ELeave) CStubSuplAuthRequest; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } +// ----------------------------------------------------------------------------- +// CStubSuplAuthRequest::~CStubSuplAuthRequest +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplAuthRequest::~CStubSuplAuthRequest() + { + + } +// ----------------------------------------------------------------------------- +// CStubSuplAuthRequest::ConstructL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplAuthRequest::ConstructL() + { + COMASuplAuthRequest::ConstructL(); + //Allocate memory for internal usage.... + } +// ----------------------------------------------------------------------------- +// CStubSuplAuthRequest::EncodeL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +HBufC8* CStubSuplAuthRequest::EncodeL(TInt& aErrorCode) + { + aErrorCode = 0; + HBufC8* encodedBuffer = NULL; + // Do actual encoding here and return encoded buffer and put appropriate error code in aErrorCode + return encodedBuffer; + } +// ----------------------------------------------------------------------------- +// CStubSuplAuthRequest::CStubSuplAuthRequest +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +CStubSuplAuthRequest::CStubSuplAuthRequest() + { + } diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/src/cstubsuplauthresponse.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/src/cstubsuplauthresponse.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Auth Response +* +*/ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplauthresponse.h" +#include "cstubsuplauthresponse.h" + +// ----------------------------------------------------------------------------- +// CStubSuplAuthResponse::NewL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplAuthResponse* CStubSuplAuthResponse::NewL() + { + CStubSuplAuthResponse* self = new (ELeave) CStubSuplAuthResponse; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } +// ----------------------------------------------------------------------------- +// CStubSuplAuthResponse::~CStubSuplAuthResponse +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplAuthResponse::~CStubSuplAuthResponse() + { + + } +// ----------------------------------------------------------------------------- +// CStubSuplAuthResponse::ConstructL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplAuthResponse::ConstructL() + { + COMASuplAuthResponse::ConstructL(); + //Allocate memory for internal usage.... + } +// ----------------------------------------------------------------------------- +// CStubSuplAuthResponse::EncodeL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +HBufC8* CStubSuplAuthResponse::EncodeL(TInt& aErrorCode) + { + aErrorCode = 0; + HBufC8* encodedBuffer = NULL; + // Do actual encoding here and return encoded buffer and put appropriate error code in aErrorCode + return encodedBuffer; + } +// ----------------------------------------------------------------------------- +// CStubSuplAuthResponse::CStubSuplAuthResponse +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +CStubSuplAuthResponse::CStubSuplAuthResponse() + { + } diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/src/cstubsuplend.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/src/cstubsuplend.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,352 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Supl End + * + */ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplend.h" +#include "cstubsuplend.h" +#include "lbs/epos_comasuplreqasstdata.h" +#include "lbs/epos_comasuplposition.h" +#include "lbs/epos_comasuplvelocity.h" +#include "lbs/epos_comasuplsetcapabilities.h" +#include "lbs/epos_comasuplpospayload.h" +#include "epos_comasuplpos.h" +#include "epos_comasuplsessionid.h" +#include "epos_comasupllocationid.h" +// ----------------------------------------------------------------------------- +// CStubSuplEnd::NewL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplEnd* CStubSuplEnd::NewL() + { + CStubSuplEnd* self = new (ELeave) CStubSuplEnd; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } +// ----------------------------------------------------------------------------- +// CStubSuplEnd::ConstructL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplEnd::ConstructL() + { + COMASuplEnd::ConstructL(); + //Allocate memory for internal usage.... + } +// ----------------------------------------------------------------------------- +// CStubSuplEnd::~CStubSuplEnd +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplEnd::~CStubSuplEnd() + { + + } +// ----------------------------------------------------------------------------- +// CStubSuplEnd::EncodeL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +HBufC8* CStubSuplEnd::EncodeL(TInt& aErrorCode) + { + aErrorCode = 0; + HBufC8* encodedBuffer = NULL ; + InitializeL(); + // Do actual encoding here and return encoded buffer and put appropriate error code in aErrorCode + return encodedBuffer; + } +// ----------------------------------------------------------------------------- +// CStubSuplEnd::CStubSuplEnd +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +CStubSuplEnd::CStubSuplEnd() + { + } +void CStubSuplEnd::InitializeL() + { + if (iPosition) //This parameter is optional in asn + { + InitializePosition(); + } + } +void CStubSuplEnd::InitializePosition() + { + // Retrieve mandatory parameters of Position + // Retrieve mandatory parameters of Position + TOMASuplUtcTime utcTime; + TOMASuplPositionEstimate posEstimate; + + iPosition->GetPosition(utcTime,posEstimate ); + + TInt error = 0; + + //Initialize Time + InitializeTime(utcTime); + + InitializePositionEstimate(posEstimate); + + if(error) + { + return; + } + else + { + COMASuplVelocity* velocity = NULL; + error = iPosition->GetVelocity(velocity); + if(error) + { + //return error + } + else + { + + TOMASuplVelocityType velocityType = velocity->VelType(); + COMASuplHorizVelocity* horizVelocity = velocity->Velocity(); + if(horizVelocity) + { + switch(velocityType) + { + case EHorizVelocity: + { + //Initialize Horizontal velocity + IntializeHorizVelocity(horizVelocity); + break; + } + case EHorizAndVertVelocity: + { + //Initialize Horizontal and Vertical velocity + IntializeHorizAndVertVelocity(horizVelocity); + break; + } + case EHorizUncertVelocity: + { + //Initialize Horizontal Uncert velocity + IntializeHorizUncertVelocity(horizVelocity); + break; + } + case EHorizAndVertUncertVelocity: + { + //Initialize Horizontal Vertical Uncert velocity + IntializeHorizVertUncertVelocity(horizVelocity); + break; + } + default: + { + //error + return; + } + } + } + else + { + //error + return; + } + } + } + } + +void CStubSuplEnd::IntializeHorizVelocity(const COMASuplHorizVelocity* aVelocity) + { + TUint16 bearing; + TUint16 horSpeed; + + aVelocity->GetHorizVel(bearing,horSpeed); + + //Initialize bearing,horSpeed + } + +void CStubSuplEnd::IntializeHorizAndVertVelocity(const COMASuplHorizVelocity* aVelocity) + { + TUint16 bearing; + TUint16 horSpeed; + TUint8 verDirect; + TUint8 verSpeed; + + COMASuplHorizAndVertVelocity* horizVertVel = (COMASuplHorizAndVertVelocity*)aVelocity; + + horizVertVel->GetHorizAndVertVel(bearing,horSpeed,verDirect,verSpeed); + + //Initialize bearing,horSpeed,verDirect,verSpeed + } + +void CStubSuplEnd::IntializeHorizUncertVelocity(const COMASuplHorizVelocity* aVelocity) + { + TUint16 bearing; + TUint16 horSpeed; + TUint8 uncertSpeed; + + COMASuplHorizUncertVelocity* horizUncertVel = (COMASuplHorizUncertVelocity*)aVelocity; + + horizUncertVel->GetHorizUncertVel(bearing,horSpeed,uncertSpeed); + //Initialize bearing,horSpeed,uncertSpeed + } + +void CStubSuplEnd::IntializeHorizVertUncertVelocity(const COMASuplHorizVelocity* aVelocity) + { + TUint16 bearing; + TUint16 horSpeed; + TUint8 verDirect; + TUint8 verSpeed; + TUint8 horizUncertSpeed; + TUint8 vertUncertSpeed; + + COMASuplHorizAndVertUncertVelocity* horizVertUncertVel = (COMASuplHorizAndVertUncertVelocity*)aVelocity; + + horizVertUncertVel->GetHorizVertUncertVel(bearing,horSpeed,verDirect,verSpeed, + horizUncertSpeed,vertUncertSpeed); + //Initialize bearing,horSpeed,verDirect,verSpeed,horizUncertSpeed,vertUncertSpeed + } + +void CStubSuplEnd::InitializePositionEstimate(TOMASuplPositionEstimate& aPosEstimate) + { + TInt error; + + // Retrieve mandatory parametrs of Position Estimate + TOMASuplPositionEstimate::TOMASuplLatitudeSign latSign; + TInt latitude; + TInt longitude; + aPosEstimate.GetPositionEstimate(latSign,latitude,longitude); + + // Set Position Estimate + if(KLatitudeMin <= latitude && latitude <= KLatitudeMax) + { + //Initialize + } + else + { + //error + } + + if(KLongitudeMin <= longitude && longitude <= KLongitudeMax) + { + //Initialize + } + else + { + //error + } + + //Initialize + + // Retrieve optional parametrs of Position Estimate + // Retrieve Uncertainity + TOMASuplUncertainty uncertainty; + error = aPosEstimate.GetUncertainty(uncertainty); + if(!error) + { + TInt uncertSemiMajor; + TInt uncertSemiMinor; + TInt orientMajorAxis; + uncertainty.GetUncertainty(uncertSemiMajor,uncertSemiMinor,orientMajorAxis); + if((KUncertSemiMajorMin <= uncertSemiMajor && uncertSemiMajor<= KUncertSemiMajorMax) + && (KUncertSemiMinorMin <= uncertSemiMinor && uncertSemiMinor<= KUncertSemiMinorMax) + && (KOrientMajorAxisMin <= orientMajorAxis && orientMajorAxis<= KOrientMajorAxisMax)) + { + //Initialize + } + else + { + //error + } + } + else + { + //return error + } + + // Retrieve Confidence + TInt confidence; + error = aPosEstimate.GetConfidence(confidence); + if(!error) + { + + if(KConfidenceMin <= confidence && confidence <= KConfidenceMax) + { + //Initialize + } + else + { + //error + } + } + else + { + //return error + } + + // Retrieve AltitudeInfo + TOMASuplAltitudeInfo altitudeInfo; + error = aPosEstimate.GetAltitudeInfo(altitudeInfo); + if(!error) + { + + TOMASuplAltitudeInfo::TOMASuplAltitudeDirection altDirection; + TInt altitude; + TInt altUncert; + altitudeInfo.GetAltitudeInfo(altDirection,altitude,altUncert); + if((KAltitudeMin <= altitude && altitude<= KAltitudeMax) && (KAltitudeUncertMin <= altUncert && altUncert<= KAltitudeUncertMax)) + { + //Initialize + } + else + { + //error + } + } + else + { + //return error + } + + } + +void CStubSuplEnd::InitializeTime(const TOMASuplUtcTime aUtcTime) + { + + TDateTime lDateTime; + TInt zoneCode; + TInt zone; + + aUtcTime.GetUtcTime(lDateTime,zoneCode,zone); + + TInt year = lDateTime.Year(); + TMonth month = lDateTime.Month(); + TInt day = lDateTime.Day(); + TInt hour = lDateTime.Hour(); + TInt minute = lDateTime.Minute(); + TInt second = lDateTime.Second(); + TInt microsec = lDateTime.MicroSecond(); + + if(0 == zoneCode || 1 == zoneCode) + { + //Initialize + } + else + { + //error + } + + + } diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/src/cstubsuplinit.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/src/cstubsuplinit.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Supl Init +* +*/ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplinit.h" +#include "cstubsuplinit.h" + +// ----------------------------------------------------------------------------- +// CStubSuplInit::NewL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplInit* CStubSuplInit::NewL() + { + CStubSuplInit* self = new (ELeave) CStubSuplInit; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } +// ----------------------------------------------------------------------------- +// CStubSuplInit::~CStubSuplInit +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplInit::~CStubSuplInit() + { + + } +// ----------------------------------------------------------------------------- +// CStubSuplInit::ConstructL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplInit::ConstructL() + { + COMASuplInit::ConstructL(); + //Allocate memory for internal usage.... + } +// ----------------------------------------------------------------------------- +// CStubSuplInit::EncodeL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +HBufC8* CStubSuplInit::EncodeL(TInt& aErrorCode) + { + aErrorCode = KErrNotSupported; + //Encoding of SuplInit is not handled by client.. + return NULL; + } +// ----------------------------------------------------------------------------- +// CStubSuplInit::CStubSuplInit +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +CStubSuplInit::CStubSuplInit() + { + } diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/src/cstubsuplpos.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/src/cstubsuplpos.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: SuplPos + * + */ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplposinit.h" +#include "epos_comasuplpos.h" +#include "cstubsuplpos.h" +#include "lbs/epos_comasuplreqasstdata.h" +#include "lbs/epos_comasuplposition.h" +#include "lbs/epos_comasuplvelocity.h" +#include "lbs/epos_comasuplsetcapabilities.h" +#include "lbs/epos_comasuplpospayload.h" +#include "epos_comasuplpos.h" +#include "epos_comasuplsessionid.h" +#include "epos_comasupllocationid.h" + +// ----------------------------------------------------------------------------- +// CStubSuplPos::NewL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplPos* CStubSuplPos::NewL() + { + CStubSuplPos* self = new (ELeave) CStubSuplPos; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } +// ----------------------------------------------------------------------------- +// CStubSuplPos::~CStubSuplPos +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplPos::~CStubSuplPos() + { + + } +// ----------------------------------------------------------------------------- +// CStubSuplPos::ConstructL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplPos::ConstructL() + { + COMASuplPos::ConstructL(); + //Allocate memory for internal usage.... + } +// ----------------------------------------------------------------------------- +// CStubSuplPos::EncodeL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +HBufC8* CStubSuplPos::EncodeL(TInt& aErrorCode) + { + aErrorCode = 0; + HBufC8* encodedBuffer = NULL; + InitializeL(); + // Do actual encoding here and return encoded buffer and put appropriate error code in aErrorCode + return encodedBuffer; + } +// ----------------------------------------------------------------------------- +// CStubSuplPos::CStubSuplPos +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +CStubSuplPos::CStubSuplPos() + { + } +void CStubSuplPos::InitializeL() + { + //Initialize your library + + if(iPayload) + { + HBufC8* payloadData = NULL; + COMASuplPosPayload::TOMASuplPosPayloadType payloadType; + iPayload->GetPosPayload(payloadData,payloadType); + + if(!payloadData) + { + //error + } + + TPtr8 ptr = payloadData->Des(); + + TInt len = payloadData->Length(); + + const char* lTemp = (const char *)ptr.Ptr(); + + switch(payloadType) + { + case COMASuplPosPayload::ETIA801: + { + //initialize pospayload for TIA + break; + } + case COMASuplPosPayload::ERRC: + { + //initialize pospayload for RRC + break; + } + case COMASuplPosPayload::ERRLP: + { + //initialize pospayload for RRLP + break; + } + default: + { + + } + } + + } + else + { + //error + + } + + if(iOptionalMask & (1<<(0))) //means velocity has been set + { + TOMASuplVelocityType velocityType = iVelocity->VelType(); + COMASuplHorizVelocity* horizVelocity = iVelocity->Velocity(); + if(horizVelocity) + { + switch(velocityType) + { + case EHorizVelocity: + { + //Initialize + IntializeHorizVelocity(horizVelocity); + break; + } + case EHorizAndVertVelocity: + { + //Initialize + IntializeHorizAndVertVelocity(horizVelocity); + break; + } + case EHorizUncertVelocity: + { + //Initialize + IntializeHorizUncertVelocity(horizVelocity); + break; + } + case EHorizAndVertUncertVelocity: + { + //Initialize + IntializeHorizVertUncertVelocity(horizVelocity); + break; + } + default: + { + //error + + } + } + } + else + { + //error + + } + } + else + { + //return error + } + + + } +void CStubSuplPos::IntializeHorizVelocity(const COMASuplHorizVelocity* aVelocity) + { + TUint16 bearing; + TUint16 horSpeed; + + aVelocity->GetHorizVel(bearing,horSpeed); + + //Initialize bearing,horSpeed + } + +void CStubSuplPos::IntializeHorizAndVertVelocity(const COMASuplHorizVelocity* aVelocity) + { + TUint16 bearing; + TUint16 horSpeed; + TUint8 verDirect; + TUint8 verSpeed; + + COMASuplHorizAndVertVelocity* horizVertVel = (COMASuplHorizAndVertVelocity*)aVelocity; + + horizVertVel->GetHorizAndVertVel(bearing,horSpeed,verDirect,verSpeed); + + //Initialize bearing,horSpeed,verDirect,verSpeed + } + +void CStubSuplPos::IntializeHorizUncertVelocity(const COMASuplHorizVelocity* aVelocity) + { + TUint16 bearing; + TUint16 horSpeed; + TUint8 uncertSpeed; + + COMASuplHorizUncertVelocity* horizUncertVel = (COMASuplHorizUncertVelocity*)aVelocity; + + horizUncertVel->GetHorizUncertVel(bearing,horSpeed,uncertSpeed); + //Initialize bearing,horSpeed,uncertSpeed + } + +void CStubSuplPos::IntializeHorizVertUncertVelocity(const COMASuplHorizVelocity* aVelocity) + { + TUint16 bearing; + TUint16 horSpeed; + TUint8 verDirect; + TUint8 verSpeed; + TUint8 horizUncertSpeed; + TUint8 vertUncertSpeed; + + COMASuplHorizAndVertUncertVelocity* horizVertUncertVel = (COMASuplHorizAndVertUncertVelocity*)aVelocity; + + horizVertUncertVel->GetHorizVertUncertVel(bearing,horSpeed,verDirect,verSpeed, + horizUncertSpeed,vertUncertSpeed); + //Initialize bearing,horSpeed,verDirect,verSpeed,horizUncertSpeed,vertUncertSpeed + } diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/src/cstubsuplposinit.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/src/cstubsuplposinit.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,892 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Supl PosInit + * + */ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplposinit.h" +#include "cstubsuplposinit.h" +#include "cstubsuplstart.h" +#include "lbs/epos_comasuplreqasstdata.h" +#include "lbs/epos_comasuplposition.h" +#include "lbs/epos_comasuplvelocity.h" +#include "lbs/epos_comasuplsetcapabilities.h" +#include "lbs/epos_comasuplpospayload.h" +#include "epos_comasuplpos.h" +#include "epos_comasuplsessionid.h" +#include "epos_comasupllocationid.h" + +// ----------------------------------------------------------------------------- +// CStubSuplPosInit::NewL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplPosInit* CStubSuplPosInit::NewL() + { + CStubSuplPosInit* self = new (ELeave) CStubSuplPosInit; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CStubSuplPosInit::~CStubSuplPosInit +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplPosInit::~CStubSuplPosInit() + { + + } +// ----------------------------------------------------------------------------- +// CStubSuplPosInit::ConstructL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplPosInit::ConstructL() + { + COMASuplPosInit::ConstructL(); + //Allocate memory for internal usage.... + } +// ----------------------------------------------------------------------------- +// CStubSuplPosInit::EncodeL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +HBufC8* CStubSuplPosInit::EncodeL(TInt& aErrorCode) + { + aErrorCode = 0; + HBufC8* encodedBuffer = NULL; + InitializeL(); + // Do actual encoding here and return encoded buffer and put appropriate error code in aErrorCode + return encodedBuffer; + } +// ----------------------------------------------------------------------------- +// CStubSuplPosInit::CStubSuplPosInit +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +CStubSuplPosInit::CStubSuplPosInit() + { + } +// ----------------------------------------------------------------------------- +// CStubSuplPosInit::InitializeL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplPosInit::InitializeL() + { + if (iReqAsstData) //This parameter is optional in asn + { + InitializeRequestData(); + } + if (iPosition) //This parameter is optional in asn + { + InitializePosition(); + } + if (iPosPayload) //This parameter is optional in asn + { + InitializePosPayLoad(); + } + if (iSETCapabilities) //This parameter is mandatory in asn + { + InitializeSetCapabilities(); + } + if (iLocationId) //This parameter is mandatory in asn + { + InitializeLocationId(); + } + if (ieCID) //This parameter is optional in asn + { + InitializeECellId(); + } + } +void CStubSuplPosInit::InitializeRequestData() + { + TBool almanac; + TBool utc; + TBool ionos; + TBool dgps; + TBool ref; + TBool refTime; + TBool acq; + TBool realTime; + iReqAsstData->GetReqAsstData(almanac,utc,ionos,dgps,ref,refTime,acq,realTime); + //Initialize structure here... + } +void CStubSuplPosInit::InitializePosition() + { + // Retrieve mandatory parametrs of Position + // Retrieve mandatory parametrs of Position + TOMASuplUtcTime utcTime; + TOMASuplPositionEstimate posEstimate; + + iPosition->GetPosition(utcTime,posEstimate ); + + TInt error = 0; + + //Initialize Time + InitializeTime(utcTime); + //InitializePositionEstimate + + InitializePositionEstimate(posEstimate); + + if(error) + { + return; + } + else + { + COMASuplVelocity* velocity = NULL; + error = iPosition->GetVelocity(velocity); + if(error) + { + + } + else + { + + TOMASuplVelocityType velocityType = velocity->VelType(); + COMASuplHorizVelocity* horizVelocity = velocity->Velocity(); + if(horizVelocity) + { + switch(velocityType) + { + case EHorizVelocity: + { + //Initialize Horizontal velocity + IntializeHorizVelocity(horizVelocity); + break; + } + case EHorizAndVertVelocity: + { + //Initialize Horizontal and Vertical velocity + IntializeHorizAndVertVelocity(horizVelocity); + break; + } + case EHorizUncertVelocity: + { + //Initialize Horizontal Uncert velocity + IntializeHorizUncertVelocity(horizVelocity); + break; + } + case EHorizAndVertUncertVelocity: + { + //Initialize Horizontal Vertical Uncert velocity + IntializeHorizVertUncertVelocity(horizVelocity); + break; + } + default: + { + //error + return; + } + } + } + else + { + //error + return; + } + } + } + } + +void CStubSuplPosInit::IntializeHorizVelocity(const COMASuplHorizVelocity* aVelocity) + { + TUint16 bearing; + TUint16 horSpeed; + + aVelocity->GetHorizVel(bearing,horSpeed); + + //Initialize bearing,horSpeed + } + +void CStubSuplPosInit::IntializeHorizAndVertVelocity(const COMASuplHorizVelocity* aVelocity) + { + TUint16 bearing; + TUint16 horSpeed; + TUint8 verDirect; + TUint8 verSpeed; + + COMASuplHorizAndVertVelocity* horizVertVel = (COMASuplHorizAndVertVelocity*)aVelocity; + + horizVertVel->GetHorizAndVertVel(bearing,horSpeed,verDirect,verSpeed); + + //Initialize bearing,horSpeed,verDirect,verSpeed + } + +void CStubSuplPosInit::IntializeHorizUncertVelocity(const COMASuplHorizVelocity* aVelocity) + { + TUint16 bearing; + TUint16 horSpeed; + TUint8 uncertSpeed; + + COMASuplHorizUncertVelocity* horizUncertVel = (COMASuplHorizUncertVelocity*)aVelocity; + + horizUncertVel->GetHorizUncertVel(bearing,horSpeed,uncertSpeed); + //Initialize bearing,horSpeed,uncertSpeed + } + +void CStubSuplPosInit::IntializeHorizVertUncertVelocity(const COMASuplHorizVelocity* aVelocity) + { + TUint16 bearing; + TUint16 horSpeed; + TUint8 verDirect; + TUint8 verSpeed; + TUint8 horizUncertSpeed; + TUint8 vertUncertSpeed; + + COMASuplHorizAndVertUncertVelocity* horizVertUncertVel = (COMASuplHorizAndVertUncertVelocity*)aVelocity; + + horizVertUncertVel->GetHorizVertUncertVel(bearing,horSpeed,verDirect,verSpeed, + horizUncertSpeed,vertUncertSpeed); + //Initialize bearing,horSpeed,verDirect,verSpeed,horizUncertSpeed,vertUncertSpeed + } + +void CStubSuplPosInit::InitializePosPayLoad() + { + // Retrieve mandatory parametrs of PosMessage + COMASuplPosPayload::TOMASuplPosPayloadType payloadType; + HBufC8* payloadData = NULL; + + iPosPayload->GetPosPayload(payloadData,payloadType); + + if(!payloadData) + { + //error + return; + } + + TPtr8 ptr = payloadData->Des(); + + TInt len = payloadData->Length(); + + const char* lTemp = (const char *)ptr.Ptr(); + + + switch(payloadType) + { + case COMASuplPosPayload::ETIA801: + { + //initialize pospayload for TIA + break; + } + case COMASuplPosPayload::ERRC: + { + //initialize pospayload for RRC + break; + } + case COMASuplPosPayload::ERRLP: + { + //initialize pospayload for RRLP + break; + } + default: + { + //error + return; + } + } + + } +void CStubSuplPosInit::InitializeSetCapabilities() + { + TOMASuplPosTechnology lPosTechnology; + COMASuplSETCapabilities::TOMASuplPrefMethod lPrefMethod; + TOMASuplPosProtocol lPosProtocol; + + iSETCapabilities->GetSETCapabilities(lPosTechnology,lPrefMethod,lPosProtocol); + + TBool lSETAssist; + TBool lGpsSETBased; + TBool lAuto; + TBool lFLT; + TBool leOTD; + TBool loTDOA; + + lPosTechnology.GetPosTechnology(lSETAssist,lGpsSETBased,lAuto, + lFLT,leOTD,loTDOA); + + //Initialize structure accordingly from here... + } +// ----------------------------------------------------------------------------- +// CStubSuplPosInit::InitializeLocationId +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplPosInit::InitializeLocationId() + { + COMASuplLocationId::TOMASuplCellInfoType lChoice = iLocationId->SuplCellInfoType(); + + switch(lChoice) + { + case COMASuplLocationId::EGSM : + { + COMASuplGSMCellInfo* lCellInfo = NULL; + COMASuplLocationId::TOMASuplStatus lStatus; + iLocationId->SuplLocationId(lCellInfo,lStatus); + if(lCellInfo) + { + TInt lRefMNC; + TInt lRefMCC; + TInt lRefLAC; + TInt lRefCI; + lCellInfo->SuplGSMCellInfo(lRefMNC,lRefMCC,lRefCI,lRefLAC); + } + } + case COMASuplLocationId::EWCDMA: + { + COMASuplCellInfo* lCellInfo = NULL; + COMASuplLocationId::TOMASuplStatus lStatus; + iLocationId->SuplLocationId(lCellInfo,lStatus); + if(lCellInfo) + { + TInt lRefMNC; + TInt lRefMCC; + TInt lRefUC; + lCellInfo->SuplCellInfo(lRefMNC,lRefMCC,lRefUC); + if((KMncMin<=lRefMNC && lRefMNC<=KMncMax) && (KMccMin<=lRefMCC && lRefMCC<=KMccMax) && + (KRefUcMin<=lRefUC && lRefUC<=KRefUcMax)) + { + //Initialize + } + } + else + { + //error + } + + } + } + //Initialize structure accordingly from here... + } + +// ----------------------------------------------------------------------------- +// CStubSuplPosInit::InitializeECellId +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplPosInit::InitializeECellId() + { + TOMASuplNwMode nwMode = iMmCellInfo.NetworkMode(); + + if (nwMode == EOMASuplGSM) + { + InitializeGSMECellId(); + } + else + { + InitializeWCDMAECellId(); + } + //Initialize structure accordingly... + } +// ----------------------------------------------------------------------------- +// CStubSuplPosInit::InitializeGSMECellId +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplPosInit::InitializeGSMECellId() + { + TOMASuplGSMCellinfo omaSuplGSMCellinfo; + iMmCellInfo.GSMCellInfo(omaSuplGSMCellinfo); + if(KOMASuplOptionalParamNotSet != omaSuplGSMCellinfo.iTA) + { + if(KTAMin <= omaSuplGSMCellinfo.iTA && omaSuplGSMCellinfo.iTA <= KTAMax) + { + //Initialize + } + else + { + //error + } + } + else + { + } + + TOMASuplNmr Nmr; + TInt ARFCN; + TInt BSIC; + TInt RxLEV; + + for(TInt i = 0; i < KOMASUPLMaxNmrAmount; i++) + { + Nmr = omaSuplGSMCellinfo.iNmr[i]; + ARFCN = Nmr.iARFCN; // 0 to 1023 + BSIC = Nmr.iBSIC; // 0 to 63 + RxLEV = Nmr.iRxLEV; // 0 to 63 + + if(ARFCN == KOMASuplOptionalParamNotSet && BSIC == KOMASuplOptionalParamNotSet && RxLEV == KOMASuplOptionalParamNotSet ) + { + //error + return; + } + + if(KARFCNMin <= ARFCN && ARFCN <= KARFCNMax && + KBSICMin <= BSIC && BSIC <= KBSICMax && + KRxLEVMin <= RxLEV && RxLEV <= KRxLEVMax) + { + //initialize + } + else + { + //error + return; + } + + } + } +// ----------------------------------------------------------------------------- +// CStubSuplPosInit::InitializeWCDMAECellId +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplPosInit::InitializeWCDMAECellId() + { + TOMASuplWCDMACellinfo omaSuplWCDMACellinfo; + iMmCellInfo.WCDMACellInfo(omaSuplWCDMACellinfo); + if(KOMASuplOptionalParamNotSet != omaSuplWCDMACellinfo.iPrimaryScrambilingCode) // means PrimaryScrambilingCode is filled + { + if(KPrimaryScrambilingCodeMin <= omaSuplWCDMACellinfo.iPrimaryScrambilingCode && omaSuplWCDMACellinfo.iPrimaryScrambilingCode <= KPrimaryScrambilingCodeMax) + { + //Initialize + } + else + { + //error + } + } + else + { + //error + } + + FillFrequencyInfo(omaSuplWCDMACellinfo.iFrequencyInfo); + + FillMeasuredResultsList(omaSuplWCDMACellinfo.iNwkMeasureReport); + } + +TInt CStubSuplPosInit::FillFrequencyInfo(TOMASuplFrequencyInfo& aOMASuplFrequencyInfo) + { + TInt FddUL = aOMASuplFrequencyInfo.iFddUL; // 0..16383 In case of fdd( iFddUL, iFddDL), + TInt FddDL = aOMASuplFrequencyInfo.iFddDL; // 0..16383 iFddUL is optional while iFddDL is mandatory. + TInt TddDt = aOMASuplFrequencyInfo.iTddNt; // 0..16383 + + TInt retError = KErrNone; + + if(FddDL != KOMASuplOptionalParamNotSet ) //means FddDL is provided... + { + if(KFddDLMin <= FddDL && FddDL <= KFddDLMax) + { + //Initialize here.. + } + else + { + //error + } + } + else + { + //error + } + + FillFrequencyInfoULInfo(FddUL,retError); + + FillFrequencyInfoDT(TddDt,retError); + + return 0; + } + +void CStubSuplPosInit::FillFrequencyInfoULInfo(TInt aFddUL,TInt& aRetErrorCode) + { + if(aFddUL != KOMASuplOptionalParamNotSet && aRetErrorCode == KErrNone ) + { + if(KFddULMin <= aFddUL && aFddUL <= KFddULMax) + { + //set to message + aRetErrorCode = KErrNone; + } + else + { + //error + } + } + } + +void CStubSuplPosInit::FillFrequencyInfoDT(TInt aTddDt,TInt& aRetErrorCode) + { + if(aTddDt != KOMASuplOptionalParamNotSet ) //means TddDt is provided... + { + if(KTddDtMin <= aTddDt && aTddDt <= KTddDtMax) + { + //Initialize + } + else + { + //error + } + } + else + { + //error + } + aRetErrorCode = KErrNone; + } + +TInt CStubSuplPosInit::FillMeasuredResultsList(TOMASuplNetworkMeasureReport aNwkMeasureReport[]) + { + + + for(TInt i = 0; i < KOMASUPLMaxNetworkMeasureReports; i++ ) + { + TOMASuplNetworkMeasureReport NwkMeasureReport = aNwkMeasureReport[i]; + TInt err = FillFrequencyInfo(NwkMeasureReport.iFrequencyInfo); + + if(KOMASuplOptionalParamNotSet != NwkMeasureReport.iCarrierRSSI) // means iCarrierRSSI is filled + { + if(KCarrierRSSIMin <= NwkMeasureReport.iCarrierRSSI && NwkMeasureReport.iCarrierRSSI <= KCarrierRSSIMax) + { + //initialize + } + else + { + //error + } + } + + err = FillCellMeasuredResult(NwkMeasureReport.iCellMeasuredResult); + } + return 0; + } + +TInt CStubSuplPosInit::FillCellMeasuredResult(TOMASuplCellMeasuredResult aCellMeasuredResult[]) + { + + TInt eleCount = 0; + for(TInt i = 0; i < KOMASUPLMaxCellMeasuredResults; i++ ) + { + TOMASuplCellMeasuredResult CellMeasuredResult = aCellMeasuredResult[i]; + TInt err = FillModeSpecificInfo(CellMeasuredResult); + if( err == KErrNone) + { + //Initialize + + if(CellMeasuredResult.iCID != KOMASuplOptionalParamNotSet) // CID is present + { + if(KCIDMin <= CellMeasuredResult.iCID && CellMeasuredResult.iCID <= KCIDMax) + { + //Set to message + } + else + { + //error + } + } + else + { + //error + } + eleCount++; + } + } + + + if(eleCount != 0 ) + return KErrNone; + else + return KErrArgument; + } + +TInt CStubSuplPosInit::FillModeSpecificInfo(TOMASuplCellMeasuredResult& aCellMeasuredResult) + { + + TOMASuplFddInfo FddInfo = aCellMeasuredResult.iFddInfo; + TOMASuplTddInfo TddInfo = aCellMeasuredResult.iTddInfo; + + if(FddInfo.iPrimaryCPICH != KOMASuplOptionalParamNotSet) // iPrimaryCPICH is present + { + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + if(KPrimaryCPICHMin <= FddInfo.iPrimaryCPICH && FddInfo.iPrimaryCPICH <= KPrimaryCPICHMax) + { + //Set to message + //initialize + } + else + { + //error + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + if(FddInfo.iCpichEcN0 != KOMASuplOptionalParamNotSet) // iCpichEcN0 is present + { + if(KCpichEcN0Min <= FddInfo.iCpichEcN0 && FddInfo.iCpichEcN0 <= KCpichEcN0Max) + { + //Set to message + } + else + { + //error + } + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + if(FddInfo.iCichRscp != KOMASuplOptionalParamNotSet) // iCichRscp is present + { + if(KCichRscpMin <= FddInfo.iCichRscp && FddInfo.iCichRscp <= KCichRscpMax) + { + //Set to message + } + else + { + //error + } + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + if(FddInfo.iPathloss != KOMASuplOptionalParamNotSet) // iPathloss is present + { + if(KPathlossMin <= FddInfo.iPathloss && FddInfo.iPathloss <= KPathlossMax) + { + //Set to message + } + else + { + //error + } + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + return KErrNone; + } + else + { + //error + } + + if(TddInfo.iCellParamID != KOMASuplOptionalParamNotSet) // iCellParamID is present + { + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + if(KCellParamIDMin <= TddInfo.iCellParamID && TddInfo.iCellParamID <= KCellParamIDMax) + { + //Set to message + } + else + { + //error + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + if(TddInfo.iProposedTGSN != KOMASuplOptionalParamNotSet) // iProposedTGSN is present + { + if(KProposedTGSNMin <= TddInfo.iProposedTGSN && TddInfo.iProposedTGSN <= KProposedTGSNMax) + { + //Set to message + } + else + { + //error + } + } + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + if(TddInfo.iPrimaryCcpchRscp != KOMASuplOptionalParamNotSet) // iPrimaryCcpchRscp is present + { + if(KPrimaryCcpchRscpMin <= TddInfo.iPrimaryCcpchRscp && TddInfo.iPrimaryCcpchRscp <= KPrimaryCcpchRscpMax) + { + //Set to message + } + else + { + //error + } + } + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + if(TddInfo.iPathloss != KOMASuplOptionalParamNotSet) // iPathloss is present + { + if(KPathlossMin <= TddInfo.iPathloss && TddInfo.iPathloss <= KPathlossMax) + { + //Set to message + } + else + { + //error + } + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + TInt eleCount = 0; + for(TInt i = 0; i < KOMASUPLMaxTimeSlotIscpAmount; i++) + { + if(TddInfo.iTimeslotISCP[i] != KOMASuplOptionalParamNotSet && KTimeslotISCPMin <= TddInfo.iTimeslotISCP[i] && TddInfo.iTimeslotISCP[i] <= KTimeslotISCPMax) + { + //Set to message + //Set to message that its not optional + eleCount++; + } + else + { + //error + } + + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // + return KErrNone; + } + else + { + //error + } + return 0; + } + +void CStubSuplPosInit::InitializePositionEstimate(TOMASuplPositionEstimate& aPosEstimate) + { + TInt error; + + // Retrieve mandatory parametrs of Position Estimate + TOMASuplPositionEstimate::TOMASuplLatitudeSign latSign; + TInt latitude; + TInt longitude; + aPosEstimate.GetPositionEstimate(latSign,latitude,longitude); + + // Set Position Estimate + if(KLatitudeMin <= latitude && latitude <= KLatitudeMax) + { + //Initialize + } + else + { + //error + } + + if(KLongitudeMin <= longitude && longitude <= KLongitudeMax) + { + //Initialize + } + else + { + //error + } + + //Initialize + + // Retrieve optional parametrs of Position Estimate + // Retrieve Uncertainity + TOMASuplUncertainty uncertainty; + error = aPosEstimate.GetUncertainty(uncertainty); + if(!error) + { + TInt uncertSemiMajor; + TInt uncertSemiMinor; + TInt orientMajorAxis; + uncertainty.GetUncertainty(uncertSemiMajor,uncertSemiMinor,orientMajorAxis); + if((KUncertSemiMajorMin <= uncertSemiMajor && uncertSemiMajor<= KUncertSemiMajorMax) + && (KUncertSemiMinorMin <= uncertSemiMinor && uncertSemiMinor<= KUncertSemiMinorMax) + && (KOrientMajorAxisMin <= orientMajorAxis && orientMajorAxis<= KOrientMajorAxisMax)) + { + //Initialize + } + else + { + //error + } + } + else + { + //return error + } + + // Retrieve Confidence + TInt confidence; + error = aPosEstimate.GetConfidence(confidence); + if(!error) + { + + if(KConfidenceMin <= confidence && confidence <= KConfidenceMax) + { + //Initialize + } + else + { + //error + } + } + else + { + //return error + } + + // Retrieve AltitudeInfo + TOMASuplAltitudeInfo altitudeInfo; + error = aPosEstimate.GetAltitudeInfo(altitudeInfo); + if(!error) + { + + TOMASuplAltitudeInfo::TOMASuplAltitudeDirection altDirection; + TInt altitude; + TInt altUncert; + altitudeInfo.GetAltitudeInfo(altDirection,altitude,altUncert); + if((KAltitudeMin <= altitude && altitude<= KAltitudeMax) && (KAltitudeUncertMin <= altUncert && altUncert<= KAltitudeUncertMax)) + { + //Initialize + } + else + { + //error + } + } + else + { + //return error + } + } + +void CStubSuplPosInit::InitializeTime(const TOMASuplUtcTime aUtcTime) + { + + TDateTime lDateTime; + TInt zoneCode; + TInt zone; + + aUtcTime.GetUtcTime(lDateTime,zoneCode,zone); + + TInt year = lDateTime.Year(); + TMonth month = lDateTime.Month(); + TInt day = lDateTime.Day(); + TInt hour = lDateTime.Hour(); + TInt minute = lDateTime.Minute(); + TInt second = lDateTime.Second(); + TInt microsec = lDateTime.MicroSecond(); + + if(0 == zoneCode || 1 == zoneCode) + { + //Initialize + } + else + { + //error + } + + + } diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/src/cstubsuplresponse.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/src/cstubsuplresponse.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description:Supl Response +* +*/ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplresponse.h" +#include "cstubsuplresponse.h" + +// ----------------------------------------------------------------------------- +// CStubSuplResponse::NewL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplResponse* CStubSuplResponse::NewL() + { + CStubSuplResponse* self = new (ELeave) CStubSuplResponse; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } +// ----------------------------------------------------------------------------- +// CStubSuplResponse::~CStubSuplResponse +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplResponse::~CStubSuplResponse() + { + + } +// ----------------------------------------------------------------------------- +// CStubSuplResponse::ConstructL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplResponse::ConstructL() + { + COMASuplResponse::ConstructL(); + //Allocate memory for internal usage.... + } +// ----------------------------------------------------------------------------- +// CStubSuplResponse::EncodeL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +HBufC8* CStubSuplResponse::EncodeL(TInt& aErrorCode) + { + aErrorCode = KErrNotSupported; + //Encoding of SuplResponse is not done on SET side... + return NULL; + } +// ----------------------------------------------------------------------------- +// CStubSuplResponse::CStubSuplResponse +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +CStubSuplResponse::CStubSuplResponse() + { + } diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/src/cstubsuplstart.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/src/cstubsuplstart.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,645 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description:Supl Start + * + */ + +#include +#include +#include +#include "epos_comasuplasnbase.h" +#include "epos_comasuplasnmessagebase.h" +#include "epos_comasuplstart.h" +#include "cstubsuplstart.h" +#include "lbs/epos_comasuplsetcapabilities.h" +#include "epos_comasupllocationid.h" + +// ----------------------------------------------------------------------------- +// CStubSuplStart::NewL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplStart* CStubSuplStart::NewL() + { + CStubSuplStart* self = new (ELeave) CStubSuplStart; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } +// ----------------------------------------------------------------------------- +// CStubSuplStart::~CStubSuplStart +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +EXPORT_C CStubSuplStart::~CStubSuplStart() + { + + } +// ----------------------------------------------------------------------------- +// CStubSuplStart::EncodeL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +HBufC8* CStubSuplStart::EncodeL(TInt& aErrorCode) + { + aErrorCode = 0; + HBufC8* encodedBuffer = NULL; + InitializeL(); + // Do actual encoding here and return encoded buffer and put appropriate error code in aErrorCode + return encodedBuffer; + } +// ----------------------------------------------------------------------------- +// CStubSuplStart::CStubSuplStart +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +CStubSuplStart::CStubSuplStart() + { +//delete all member variables here... + } +// ----------------------------------------------------------------------------- +// CStubSuplStart::ConstructL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplStart::ConstructL() + { + COMASuplStart::ConstructL(); + //Allocate memmory for internal usage.... + } +// ----------------------------------------------------------------------------- +// CStubSuplStart::InitializeL +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplStart::InitializeL() + { + + if(iSETCapabilities) //This parameter is mandatory in asn + { + InitializeSetCapabilities(); + } + if(iLocationId) //This parameter is mandatory in asn + { + InitializeLocationId(); + } + if (iQopSet) //This parameter is optional in asn + { + InitializeQop(); + } + if(ieCID) //This parameter is optional in asn + { + InitializeECellId(); + } + } +// ----------------------------------------------------------------------------- +// CStubSuplStart::InitializeSetCapabilities +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplStart::InitializeSetCapabilities() + { + TOMASuplPosTechnology lPosTechnology; + COMASuplSETCapabilities::TOMASuplPrefMethod lPrefMethod; + TOMASuplPosProtocol lPosProtocol; + + iSETCapabilities->GetSETCapabilities(lPosTechnology,lPrefMethod,lPosProtocol); + + TBool lSETAssist; + TBool lGpsSETBased; + TBool lAuto; + TBool lFLT; + TBool leOTD; + TBool loTDOA; + + lPosTechnology.GetPosTechnology(lSETAssist,lGpsSETBased,lAuto, + lFLT,leOTD,loTDOA); + + //Initialize structure accordingly from here... + } +// ----------------------------------------------------------------------------- +// CStubSuplStart::InitializeLocationId +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplStart::InitializeLocationId() + { + COMASuplLocationId::TOMASuplCellInfoType lChoice = iLocationId->SuplCellInfoType(); + + switch(lChoice) + { + case COMASuplLocationId::EGSM : + { + COMASuplGSMCellInfo* lCellInfo = NULL; + COMASuplLocationId::TOMASuplStatus lStatus; + iLocationId->SuplLocationId(lCellInfo,lStatus); + if(lCellInfo) + { + TInt lRefMNC; + TInt lRefMCC; + TInt lRefLAC; + TInt lRefCI; + lCellInfo->SuplGSMCellInfo(lRefMNC,lRefMCC,lRefCI,lRefLAC); + + //Use lRefMNC,lRefMCC,lRefCI,lRefLAC for filling asn structs for encoding. + } + break; + } + case COMASuplLocationId::EWCDMA: + { + COMASuplCellInfo* lCellInfo = NULL; + COMASuplLocationId::TOMASuplStatus lStatus; + iLocationId->SuplLocationId(lCellInfo,lStatus); + if(lCellInfo) + { + TInt lRefMNC; + TInt lRefMCC; + TInt lRefUC; + lCellInfo->SuplCellInfo(lRefMNC,lRefMCC,lRefUC); + if((KMncMin<=lRefMNC && lRefMNC<=KMncMax) && (KMccMin<=lRefMCC && lRefMCC<=KMccMax) && + (KRefUcMin<=lRefUC && lRefUC<=KRefUcMax)) + { + //Initialize + //Use RefMNC,lRefMCC,lRefUC for filling asn structs for encoding. + } + } + else + { + //error + } + break; + } + } + //Initialize structure accordingly from here... + } +// ----------------------------------------------------------------------------- +// CStubSuplStart::InitializeQop +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplStart::InitializeQop() + { + TInt horizAccuracy = iSuplQop.SuplQop(); + if(KHorizAccuracyMin <= horizAccuracy && horizAccuracy <= KHorizAccuracyMax) + { + //initialize here + } + else + { + //error...return with error + } + + TInt vertAccuracy; + TInt error = iSuplQop.VerticalAccuracy(vertAccuracy); + if(!error) + { + if(KVertAccuracyMin <= vertAccuracy && vertAccuracy <= KVertAccuracyMax) + { + //initialize + } + else + { + //return error + + } + } + else + { + //initialize + } + + TInt maxLocAge; + error = iSuplQop.MaxLocationAge(maxLocAge); + if(!error) + { + //initialize + if(KMaxLocationAgeMin <= maxLocAge && maxLocAge <= KMaxLocationAgeMax) + { + //initialize + } + else + { + //error + return; + } + } + else + { + //initialize + } + + TInt delay; + error = iSuplQop.Delay(delay); + if(!error) + { + if(KDelayMin <= delay && delay <= KDelayMax) + { + //initialize + } + else + { + //error + return; + } + } + else + { + //initialize + } + //Initialize structure accordingly... + } +// ----------------------------------------------------------------------------- +// CStubSuplStart::InitializeECellId +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplStart::InitializeECellId() + { + TOMASuplNwMode nwMode = iMmCellInfo.NetworkMode(); + + if (nwMode == EOMASuplGSM) + { + InitializeGSMECellId(); + } + else + { + InitializeWCDMAECellId(); + } + //Initialize structure accordingly... + } +// ----------------------------------------------------------------------------- +// CStubSuplStart::InitializeGSMECellId +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplStart::InitializeGSMECellId() + { + // In E-Cell id structs, if any of the data field contains -1 as a value, it means that no data is available for that field. + TOMASuplGSMCellinfo omaSuplGSMCellinfo; + iMmCellInfo.GSMCellInfo(omaSuplGSMCellinfo); + if(KOMASuplOptionalParamNotSet != omaSuplGSMCellinfo.iTA) + { + if(KTAMin <= omaSuplGSMCellinfo.iTA && omaSuplGSMCellinfo.iTA <= KTAMax) + { + //Initialize + } + else + { + //error + } + } + else + { + } + + TOMASuplNmr Nmr; + TInt ARFCN; + TInt BSIC; + TInt RxLEV; + + for(TInt i = 0; i < KOMASUPLMaxNmrAmount; i++) + { + Nmr = omaSuplGSMCellinfo.iNmr[i]; + ARFCN = Nmr.iARFCN; // 0 to 1023 + BSIC = Nmr.iBSIC; // 0 to 63 + RxLEV = Nmr.iRxLEV; // 0 to 63 + + if(ARFCN == KOMASuplOptionalParamNotSet && BSIC == KOMASuplOptionalParamNotSet && RxLEV == KOMASuplOptionalParamNotSet ) + { + //initialize + } + + if(KARFCNMin <= ARFCN && ARFCN <= KARFCNMax && + KBSICMin <= BSIC && BSIC <= KBSICMax && + KRxLEVMin <= RxLEV && RxLEV <= KRxLEVMax) + { + //initialize + } + else + { + //error + } + + } + } +// ----------------------------------------------------------------------------- +// CStubSuplStart::InitializeWCDMAECellId +// Other Items were commented in a header +// ----------------------------------------------------------------------------- +// +void CStubSuplStart::InitializeWCDMAECellId() + { + // In E-Cell id structs, if any of the data field contains -1 as a value, it means that no data is available for that field. + TOMASuplWCDMACellinfo omaSuplWCDMACellinfo; + iMmCellInfo.WCDMACellInfo(omaSuplWCDMACellinfo); + if(KOMASuplOptionalParamNotSet != omaSuplWCDMACellinfo.iPrimaryScrambilingCode) // means PrimaryScrambilingCode is filled + { + if(KPrimaryScrambilingCodeMin <= omaSuplWCDMACellinfo.iPrimaryScrambilingCode && omaSuplWCDMACellinfo.iPrimaryScrambilingCode <= KPrimaryScrambilingCodeMax) + { + //Initialize + } + else + { + //error + } + } + else + { + //error + } + + FillFrequencyInfo(omaSuplWCDMACellinfo.iFrequencyInfo); + + FillMeasuredResultsList(omaSuplWCDMACellinfo.iNwkMeasureReport); + } + +TInt CStubSuplStart::FillFrequencyInfo(TOMASuplFrequencyInfo& aOMASuplFrequencyInfo) + { + TInt FddUL = aOMASuplFrequencyInfo.iFddUL; // 0..16383 In case of fdd( iFddUL, iFddDL), + TInt FddDL = aOMASuplFrequencyInfo.iFddDL; // 0..16383 iFddUL is optional while iFddDL is mandatory. + TInt TddDt = aOMASuplFrequencyInfo.iTddNt; // 0..16383 + + TInt retError = KErrNone; + + if(FddDL != KOMASuplOptionalParamNotSet ) //means FddDL is provided... + { + if(KFddDLMin <= FddDL && FddDL <= KFddDLMax) + { + //Initialize here.. + } + else + { + //error + } + } + else + { + //error + } + + FillFrequencyInfoULInfo(FddUL,retError); + + FillFrequencyInfoDT(TddDt,retError); + + return retError; + } + +void CStubSuplStart::FillFrequencyInfoULInfo(TInt aFddUL,TInt& aRetErrorCode) + { + if(aFddUL != KOMASuplOptionalParamNotSet && aRetErrorCode == KErrNone ) + { + if(KFddULMin <= aFddUL && aFddUL <= KFddULMax) + { + //set to message + aRetErrorCode = KErrNone; + } + else + { + //error + } + } + } + +void CStubSuplStart::FillFrequencyInfoDT(TInt aTddDt,TInt& aRetErrorCode) + { + if(aTddDt != KOMASuplOptionalParamNotSet ) //means TddDt is provided... + { + if(KTddDtMin <= aTddDt && aTddDt <= KTddDtMax) + { + //Initialize + } + else + { + //error + } + } + else + { + //error + } + aRetErrorCode = KErrNone; + } + +TInt CStubSuplStart::FillMeasuredResultsList(TOMASuplNetworkMeasureReport aNwkMeasureReport[]) + { + + + for(TInt i = 0; i < KOMASUPLMaxNetworkMeasureReports; i++ ) + { + TOMASuplNetworkMeasureReport NwkMeasureReport = aNwkMeasureReport[i]; + TInt err = FillFrequencyInfo(NwkMeasureReport.iFrequencyInfo); + + if(KOMASuplOptionalParamNotSet != NwkMeasureReport.iCarrierRSSI) // means iCarrierRSSI is filled + { + if(KCarrierRSSIMin <= NwkMeasureReport.iCarrierRSSI && NwkMeasureReport.iCarrierRSSI <= KCarrierRSSIMax) + { + //initialize + } + else + { + //error + } + } + + err = FillCellMeasuredResult(NwkMeasureReport.iCellMeasuredResult); + } + return 0; + //Own error code can be set... + } + +TInt CStubSuplStart::FillCellMeasuredResult(TOMASuplCellMeasuredResult aCellMeasuredResult[]) + { + + TInt eleCount = 0; + for(TInt i = 0; i < KOMASUPLMaxCellMeasuredResults; i++ ) + { + TOMASuplCellMeasuredResult CellMeasuredResult = aCellMeasuredResult[i]; + TInt err = FillModeSpecificInfo(CellMeasuredResult); + if( err == KErrNone) + { + //Initialize + + if(CellMeasuredResult.iCID != KOMASuplOptionalParamNotSet) // CID is present + { + if(KCIDMin <= CellMeasuredResult.iCID && CellMeasuredResult.iCID <= KCIDMax) + { + //Set to message + } + else + { + //error + } + } + else + { + //error + } + eleCount++; + } + } + + + if(eleCount != 0 ) + return KErrNone; + else + return KErrArgument; + } + +TInt CStubSuplStart::FillModeSpecificInfo(TOMASuplCellMeasuredResult& aCellMeasuredResult) + { + + TOMASuplFddInfo FddInfo = aCellMeasuredResult.iFddInfo; + TOMASuplTddInfo TddInfo = aCellMeasuredResult.iTddInfo; + + if(FddInfo.iPrimaryCPICH != KOMASuplOptionalParamNotSet) // iPrimaryCPICH is present + { + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + if(KPrimaryCPICHMin <= FddInfo.iPrimaryCPICH && FddInfo.iPrimaryCPICH <= KPrimaryCPICHMax) + { + //Set to message + //initialize + } + else + { + //error + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + if(FddInfo.iCpichEcN0 != KOMASuplOptionalParamNotSet) // iCpichEcN0 is present + { + if(KCpichEcN0Min <= FddInfo.iCpichEcN0 && FddInfo.iCpichEcN0 <= KCpichEcN0Max) + { + //Set to message + } + else + { + //error + } + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + if(FddInfo.iCichRscp != KOMASuplOptionalParamNotSet) // iCichRscp is present + { + if(KCichRscpMin <= FddInfo.iCichRscp && FddInfo.iCichRscp <= KCichRscpMax) + { + //Set to message + } + else + { + //error + } + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + if(FddInfo.iPathloss != KOMASuplOptionalParamNotSet) // iPathloss is present + { + if(KPathlossMin <= FddInfo.iPathloss && FddInfo.iPathloss <= KPathlossMax) + { + //Set to message + } + else + { + //error + } + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + return KErrNone; + } + else + { + //error + } + + if(TddInfo.iCellParamID != KOMASuplOptionalParamNotSet) // iCellParamID is present + { + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + if(KCellParamIDMin <= TddInfo.iCellParamID && TddInfo.iCellParamID <= KCellParamIDMax) + { + //Set to message + } + else + { + //error + } + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + if(TddInfo.iProposedTGSN != KOMASuplOptionalParamNotSet) // iProposedTGSN is present + { + if(KProposedTGSNMin <= TddInfo.iProposedTGSN && TddInfo.iProposedTGSN <= KProposedTGSNMax) + { + //Set to message + } + else + { + //error + } + } + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + if(TddInfo.iPrimaryCcpchRscp != KOMASuplOptionalParamNotSet) // iPrimaryCcpchRscp is present + { + if(KPrimaryCcpchRscpMin <= TddInfo.iPrimaryCcpchRscp && TddInfo.iPrimaryCcpchRscp <= KPrimaryCcpchRscpMax) + { + //Set to message + } + else + { + //error + } + } + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + if(TddInfo.iPathloss != KOMASuplOptionalParamNotSet) // iPathloss is present + { + if(KPathlossMin <= TddInfo.iPathloss && TddInfo.iPathloss <= KPathlossMax) + { + //Set to message + } + else + { + //error + } + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + TInt eleCount = 0; + for(TInt i = 0; i < KOMASUPLMaxTimeSlotIscpAmount; i++) + { + if(TddInfo.iTimeslotISCP[i] != KOMASuplOptionalParamNotSet && KTimeslotISCPMin <= TddInfo.iTimeslotISCP[i] && TddInfo.iTimeslotISCP[i] <= KTimeslotISCPMax) + { + //Set to message + //Set to message that its not optional + eleCount++; + } + else + { + //error + } + + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // + return KErrNone; + } + else + { + //error + } + return 0; + //Own error code can be set... + } diff -r 000000000000 -r 0ce1b5ce9557 omasuplasnconverterstubimpl/sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omasuplasnconverterstubimpl/sysdef_1_4_0.dtd Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 posmsgpluginreferenceimpl/data/1027509D.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/posmsgpluginreferenceimpl/data/1027509D.rss Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 1027 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file +* +*/ + + +#include + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x1027509D; + interfaces = + { + INTERFACE_INFO + { + // OMA SUPL POS Message Plugin Interface UID + interface_uid = 0x102073D4; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x1027509C; + version_no = 1; + display_name = "Reference implementation"; + default_data = ""; + opaque_data =""; + } + }; + } + }; + } diff -r 000000000000 -r 0ce1b5ce9557 posmsgpluginreferenceimpl/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/posmsgpluginreferenceimpl/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building the +* OMA SUPL POS Message plug-in API Dll +* +*/ + + +PRJ_PLATFORMS +DEFAULT + + +PRJ_MMPFILES +epos_omasuplposmessageplugin_ref.mmp diff -r 000000000000 -r 0ce1b5ce9557 posmsgpluginreferenceimpl/group/epos_omasuplposmessageplugin_ref.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/posmsgpluginreferenceimpl/group/epos_omasuplposmessageplugin_ref.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for POS Message plugin reference implementation +* +*/ + +#include + +TARGET eposomasuplposrefapp.dll +TARGETTYPE PLUGIN +UID 0x10009d8d 0x1027509D + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE epos_comasuplposhandler.cpp +SOURCE epos_comasuplpossession.cpp +SOURCE epos_comasuplposhandlerproxy.cpp +SOURCE epos_comasuplposhandlermain.cpp +SOURCE epos_tomasuplposutility.cpp + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc + +//SYSTEMINCLUDE /epoc32/include +//SYSTEMINCLUDE /epoc32/include/ecom + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY eposomasuplposmessageplugin.lib + + +START RESOURCE ../data/1027509D.rss + #ifdef SYMBIAN_SECURE_ECOM + TARGET eposomasuplposrefapp.rsc + #endif +END diff -r 000000000000 -r 0ce1b5ce9557 posmsgpluginreferenceimpl/inc/epos_comasuplposhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/posmsgpluginreferenceimpl/inc/epos_comasuplposhandler.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,88 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of COMASuplPosHandlerBase +* +*/ + + +#ifndef C_COMASUPLPOSHANDLER_H +#define C_COMASUPLPOSHANDLER_H + + +#include + + +// Forward Declaration +class COMASuplPosSession; + +/** +* Reference implementation of COMASuplPosHandlerBase +* @since Series 60 3.1u +*/ +class COMASuplPosHandler : public COMASuplPosHandlerBase + { + + public: // Constructors and destructor + + /** + * Factory function that instantiates a new object of COMASuplPosHandler + * + * @since S60 v3.0 + */ + static COMASuplPosHandlerBase* NewL(); + + /** + * Destructor + * + * @since S60 v3.0 + */ + ~COMASuplPosHandler(); + + public: // New functions + + /** + * From COMASuplPosHandlerBase + * Initializes the instance of COMASuplPosHandler + * @since S60 v3.1u + */ + void InitializeL( TRequestStatus &aStatus ); + + /** + * From COMASuplPosHandlerBase + * Cancels an outstanding request to initialize + * @since S60 v3.1u + */ + void CancelInitialize(); + + /** + * From COMASuplPosHandlerBase + * Factory function to create a new instance of COMASuplPosSession + * @since S60 v3.1u + */ + COMASuplPosSessionBase* CreateNewSessionL( + MOMASuplObserver *aSuplObserver ); + + private: + + /** + * Constructor + * + * @since S60 v3.1u + */ + COMASuplPosHandler(); + + }; + + +#endif // C_COMASUPLPOSHANDLER_H diff -r 000000000000 -r 0ce1b5ce9557 posmsgpluginreferenceimpl/inc/epos_comasuplpossession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/posmsgpluginreferenceimpl/inc/epos_comasuplpossession.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,207 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of COMASuplPosSessionBase +* +*/ + + +#ifndef C_COMASUPLPOSSESSION_H +#define C_COMASUPLPOSSESSION_H + + +#include + + +/** +* Reference implementation of COMASuplPosSessionBase +* @since S60 3.1u +*/ +class COMASuplPosSession : public COMASuplPosSessionBase + , public virtual CActive + { + + public: // Constructors and destructor + + /** + * Factory function that instantiates a new object of COMASuplPosSession + * + * @since S60 v3.1u + */ + static COMASuplPosSessionBase* NewL( MOMASuplObserver* aSuplObserver ); + + /** + * Destructor + * + * @since S60 v3.0 + */ + ~COMASuplPosSession(); + + public: + + /** + * From COMASuplPosSessionBase + * Initializes the instance of COMASuplPosSession + * @since S60 v3.1u + */ + void InitializeL( const TInt aRequestID, TRequestStatus &aStatus ); + + /** + * From COMASuplPosSessionBase + * Cancels an outstanding request to initialize + * @since S60 v3.1u + */ + void CancelInitialize(); + + /** + * From COMASuplPosSessionBase + * Handles SUPL POS payload + * @since S60 v3.1u + */ + void HandleSuplPosMessageL( const COMASuplPosPayload *aPosPayload ); + + /** + * From COMASuplPosSessionBase + * Provides different POS parameters to the SUPL FW + * @since S60 v3.1u + */ + void GetSuplInfoL( COMASuplInfoRequestList *aInfoRequestList, + TRequestStatus &aStatus ); + + /** + * From COMASuplPosSessionBase + * Cancels an outstanding request to GetSuplInfoL + * @since S60 v3.1u + */ + void CancelSuplInfoRequest(); + + /** + * From COMASuplPosSessionBase + * Provides position estimates to the SUPL FW + * @since S60 v3.1u + */ + void GetPositionL( TRequestStatus &aStatus, + COMASuplPosition* aPosition ); + + /** + * From COMASuplPosSessionBase + * Cancels an outstanding request to GetPositionL + * @since S60 v3.1u + */ + void CancelGetPosition(); + + /** + * From COMASuplPosSessionBase + * Terminates a SUPL POS Session + * @since S60 v3.1u + */ + void SessionEnd(); + + + private: + + /** + * Creates an IPC connection with the SUPL gateway, forwards + * the request and terminates the connection + * @since S60 v3.1u + */ + COMASuplPosSession( MOMASuplObserver* aSuplObserver ); + + /** + * From CActive + * Request completion event handler + * @since S60 v3.1u + */ + void RunL(); + + /** + * From CActive + * Called to cancel outanding requests + * @since S60 v3.1u + */ + void DoCancel(); + + /** + * From CActive + * Called to handle leave in RunL + * @since S60 v3.1u + */ + TInt RunError(TInt aError); + /** + * Completes an asynchronous request with KErrNone + * @since S60 v3.1u + */ + void IdleComplete(); + + /** + * Cancels an outstanding request + * @since S60 v3.1u + */ + void CancelRequest(); + + private: + + /** + * State information of an instance of COMASuplPosSession + */ + enum TPosSessionState + { + EInitialize, + EGetSuplInfo, + EGetPosition + }; + + /** + * Contains the client request status + */ + TRequestStatus* iClientStatus; + + /** + * Contains the request ID + */ + TInt iRequestID; + + /** + * A flag field to determine if the instance of COMASuplPosSession + * was initialized + */ + TBool iIsInitialized; + + /** + * Data field to hold the state information + */ + TPosSessionState iState; + + /** + * Data field to hold the position estimates. The ownership of this + * object is not taken. + */ + COMASuplPosition* iPosition; + + /** + * Data field to hold the SUPL Info Request List. The ownership + * of this object is not taken. + */ + COMASuplInfoRequestList* iSuplInfoReqList; + + /** + * Data field to hold the payload information. The instance of + * COMASuplPosSession instantiates this object and also takes + * ownership of the same. + */ + COMASuplPosPayload* iPosPayload; + + }; + + +#endif // C_COMASUPLPOSSESSION_H diff -r 000000000000 -r 0ce1b5ce9557 posmsgpluginreferenceimpl/inc/epos_tomasuplposutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/posmsgpluginreferenceimpl/inc/epos_tomasuplposutility.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Helper class used to obtain supl information +* +*/ + + +#ifndef T_TOMASUPLPOSUTILITY_H +#define T_TOMASUPLPOSUTILITY_H + + +class COMASuplInfoRequest; + + +/** +* An utility class that is used by an instance of COMASuplPosSession to +* determine POS parameters +*/ +class TOmaSuplPosUtility + { + + public: + + /** + * Provides the position estimates. This is method is invoked by an + * instance of COMASuplPosSession + */ + static void GetPositionEstimatesL( COMASuplPosition*& aPosition ); + + /** + * Provides the requested POS parameters. This is method is invoked by an + * instance of COMASuplPosSession + */ + static void GetPosParametersL( COMASuplInfoRequestList*& aInfoRequestList ); + + private: + + /** + * Provides the requested assistance data + */ + static void GetRequestedAsstData( COMASuplInfoRequest*& aReqElement ); + + /** + * Provides velocity information + */ + static void GetVelocityL( COMASuplInfoRequest*& aReqElement ); + + /** + * Provides SET capabilities + */ + static void GetSetCapabilities( COMASuplInfoRequest*& aReqElement ); + + /** + * Provides the POS payload + */ + static void GetPosPayloadL( COMASuplInfoRequest*& aReqElement ); + + /** + * Provides the position estimates + */ + static void GetPositionL( COMASuplInfoRequest*& aReqElement ); + + }; + + +#endif // T_TOMASUPLPOSUTILITY_H diff -r 000000000000 -r 0ce1b5ce9557 posmsgpluginreferenceimpl/install/refimpl.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/posmsgpluginreferenceimpl/install/refimpl.pkg Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,38 @@ +; +; Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: Package file for project eposomasuplposrefapp +; + +;RefImpl.pkg + +;languages +&EN + +;packet-header (name, uid, major, minor, build, type) +#{"SuplPosRefImpl"},(0x1027509D),1,0,1,TYPE=SY + +; Localised Vendor name +%{"Nokia-EN"} + +; Unique Vendor name +:"Nokia" + +;Supports Series 60 v 1.0 +(0x101f7962), 0, 0, 0, {"Series60ProductID"} + +; For Pos Tester +"\Epoc32\release\armv5\urel\eposomasuplposrefapp.dll" - "c:\sys\bin\eposomasuplposrefapp.dll" +"\Epoc32\data\Z\Resource\plugins\eposomasuplposrefapp.rsc" - "c:\resource\plugins\eposomasuplposrefapp.rsc" + +;ENDIF \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 posmsgpluginreferenceimpl/layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/posmsgpluginreferenceimpl/layers.sysdef.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,14 @@ + + +]> + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 posmsgpluginreferenceimpl/src/epos_comasuplposhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/posmsgpluginreferenceimpl/src/epos_comasuplposhandler.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Provides the reference implementation for the POS message +* plugin +* +*/ + + + +#include +#include "epos_comasuplposhandler.h" +#include "epos_comasuplpossession.h" + + +// ----------------------------------------------------------------------------- +// COMASuplPosHandler::NewL +// Factory function to instantiate an object of COMASuplPosHandler +// ----------------------------------------------------------------------------- +// +COMASuplPosHandlerBase* COMASuplPosHandler::NewL() + { + return new ( ELeave ) COMASuplPosHandler; + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosHandler::~COMASuplPosHandler +// Destructor +// ----------------------------------------------------------------------------- +// +COMASuplPosHandler::~COMASuplPosHandler() + { + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosHandler::InitializeL +// Initializes the instance of COMASuplPosHandler +// ----------------------------------------------------------------------------- +// +void COMASuplPosHandler::InitializeL( TRequestStatus& aStatus ) + { + // Initialization operations to be done + TRequestStatus* status = &aStatus; + User::RequestComplete( status, KErrNone ); + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosHandler::CancelInitialize +// Cancels an outstanding request to initialize +// ----------------------------------------------------------------------------- +// +void COMASuplPosHandler::CancelInitialize() + { + + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosHandler::CreateNewSessionL +// Factory function to create a new instance of COMASuplPosSession +// ----------------------------------------------------------------------------- +// +COMASuplPosSessionBase* COMASuplPosHandler::CreateNewSessionL( + MOMASuplObserver* aSuplObserver ) + { + return COMASuplPosSession::NewL( aSuplObserver ); + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosHandler::COMASuplPosHandler +// Constructor +// ----------------------------------------------------------------------------- +// +COMASuplPosHandler::COMASuplPosHandler():COMASuplPosHandlerBase() + { + + } diff -r 000000000000 -r 0ce1b5ce9557 posmsgpluginreferenceimpl/src/epos_comasuplposhandlermain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/posmsgpluginreferenceimpl/src/epos_comasuplposhandlermain.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: DLL entry function +* +*/ + + + +#include + + +#ifndef EKA2 +GLDEF_C TInt E32Dll( /*TDllReason aReason*/ ) + { + return( KErrNone ); + } +#endif diff -r 000000000000 -r 0ce1b5ce9557 posmsgpluginreferenceimpl/src/epos_comasuplposhandlerproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/posmsgpluginreferenceimpl/src/epos_comasuplposhandlerproxy.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Provides Implementation table for ECom +* +*/ + + + +#include +#include +#include "epos_comasuplposhandler.h" + + +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x1027509C, COMASuplPosHandler::NewL ) + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + return ImplementationTable; + } diff -r 000000000000 -r 0ce1b5ce9557 posmsgpluginreferenceimpl/src/epos_comasuplpossession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/posmsgpluginreferenceimpl/src/epos_comasuplpossession.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,277 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Provides the reference implementation for POS message plugin +* +*/ + + + +#include +#include +#include +#include +#include "epos_comasuplpossession.h" +#include "epos_tomasuplposutility.h" + + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::NewL +// Factory function to instantiate an object of COMASuplPosSession +// ----------------------------------------------------------------------------- +// +COMASuplPosSessionBase* COMASuplPosSession::NewL( + MOMASuplObserver* aSuplObserver ) + { + return new ( ELeave ) COMASuplPosSession( aSuplObserver ); + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::~COMASuplPosSession +// Destructor. Removes the object from the active scheduler's list +// ----------------------------------------------------------------------------- +// +COMASuplPosSession::~COMASuplPosSession() + { + delete iPosPayload; + Deque(); + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::COMASuplPosSession +// Constructor +// ----------------------------------------------------------------------------- +// +COMASuplPosSession::COMASuplPosSession( MOMASuplObserver* aSuplObserver ): + CActive( EPriorityStandard ) + , COMASuplPosSessionBase( aSuplObserver ) + { + iIsInitialized = EFalse; + iRequestID = 0; + CActiveScheduler::Add( this ); + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::InitializeL +// Initializes the instance of COMASuplPosSession +// ----------------------------------------------------------------------------- +// +void COMASuplPosSession::InitializeL( const TInt aRequestID, + TRequestStatus& aStatus ) + { + aStatus = KRequestPending; + iRequestID = aRequestID; + iClientStatus = &aStatus; + iState = EInitialize; + if ( iPosPayload ) + { + delete iPosPayload; + iPosPayload = NULL; + } + IdleComplete(); + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::CancelInitialize +// Cancels an outstanding request to initialize +// ----------------------------------------------------------------------------- +// +void COMASuplPosSession::CancelInitialize() + { + iIsInitialized = EFalse; + CancelRequest(); + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::HandleSuplPosMessageL +// Handles SUPL POS payload +// ----------------------------------------------------------------------------- +// +void COMASuplPosSession::HandleSuplPosMessageL( + const COMASuplPosPayload* aPosPayload ) + { + __ASSERT_ALWAYS( iIsInitialized, User::Leave( KErrOMASuplPosInActive ) ); + + // Delete any existing memory + if ( iPosPayload ) + { + delete iPosPayload; + iPosPayload = NULL; + } + + iPosPayload = static_cast( aPosPayload->CloneL() ); + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::GetSuplInfoL +// Provides different POS parameters to the SUPL FW +// ----------------------------------------------------------------------------- +// +void COMASuplPosSession::GetSuplInfoL( + COMASuplInfoRequestList* aInfoRequestList, + TRequestStatus& aStatus ) + { + TRequestStatus* status = &aStatus; + if(!iIsInitialized) + { + User::RequestComplete(status, KErrOMASuplPosInActive ); + return; + } + aStatus = KRequestPending; + iClientStatus = &aStatus; + iSuplInfoReqList = aInfoRequestList; + iState = EGetSuplInfo; + IdleComplete(); + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::CancelSuplInfoRequest +// Cancels an outstanding request to GetSuplInfoL +// ----------------------------------------------------------------------------- +// +void COMASuplPosSession::CancelSuplInfoRequest() + { + CancelRequest(); + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::GetPositionL +// Provides position estimates to the SUPL FW +// ----------------------------------------------------------------------------- +// +void COMASuplPosSession::GetPositionL( TRequestStatus& aStatus, + COMASuplPosition* aPosition ) + { + TRequestStatus* status = &aStatus; + if(!iIsInitialized) + { + User::RequestComplete(status, KErrOMASuplPosInActive ); + return; + } + aStatus = KRequestPending; + iClientStatus = &aStatus; + iPosition = aPosition; + iState = EGetPosition; + IdleComplete(); + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::CancelGetPosition +// Cancels an outstanding request to GetPositionL +// ----------------------------------------------------------------------------- +// +void COMASuplPosSession::CancelGetPosition() + { + CancelRequest(); + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::SessionEnd +// Terminates a SUPL POS Session +// ----------------------------------------------------------------------------- +// +void COMASuplPosSession::SessionEnd() + { + CancelRequest(); + iIsInitialized = EFalse; + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::RunL +// Inherited from CActive - called when object is active. +// ----------------------------------------------------------------------------- +// +void COMASuplPosSession::RunL() + { + switch( iState ) + { + case EInitialize: + iIsInitialized = ETrue; + User::RequestComplete( iClientStatus, KErrNone ); + // CActiveScheduler::Stop(); + break; + + case EGetSuplInfo: + TOmaSuplPosUtility::GetPosParametersL( iSuplInfoReqList ); + User::RequestComplete( iClientStatus, KErrNone ); + // CActiveScheduler::Stop(); + break; + + case EGetPosition: + TOmaSuplPosUtility::GetPositionEstimatesL( iPosition ); + User::RequestComplete( iClientStatus, KErrNone ); + // CActiveScheduler::Stop(); + break; + + default: + break; + } + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::DoCancel +// Inherited from CActive - called to cancel outanding requests +// ----------------------------------------------------------------------------- +// +void COMASuplPosSession::DoCancel() + { + // Cancel any outstanding requests to asynchronous service providers + TBool isActive = IsActive(); + if ( isActive ) + { + User::RequestComplete( iClientStatus, KErrCancel ); + } + } + +TInt COMASuplPosSession::RunError(TInt /*aError*/) + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::IdleComplete +// Completes an asynchronous request with KErrNone +// ----------------------------------------------------------------------------- +// +void COMASuplPosSession::IdleComplete() + { + TRequestStatus* pS = &iStatus; + User::RequestComplete( pS, KErrNone ); + if ( !IsActive() ) + { + SetActive(); + } + } + + +// ----------------------------------------------------------------------------- +// COMASuplPosSession::CancelRequest +// Cancels an outstanding request if any with KErrCancel +// ----------------------------------------------------------------------------- +// +void COMASuplPosSession::CancelRequest() + { + Cancel(); + } diff -r 000000000000 -r 0ce1b5ce9557 posmsgpluginreferenceimpl/src/epos_tomasuplposutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/posmsgpluginreferenceimpl/src/epos_tomasuplposutility.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,182 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Helper class that provides SUPL information +* +*/ + + + +#include +#include +#include +#include +#include +#include +#include +#include "epos_tomasuplposutility.h" + + +// ----------------------------------------------------------------------------- +// TOmaSuplPosUtility::GetPositionEstimatesL +// Determines the position estimates +// ----------------------------------------------------------------------------- +// +void TOmaSuplPosUtility::GetPositionEstimatesL( COMASuplPosition*& aPosition ) + { + TDateTime dateTime( 2006, EJanuary, 5, 00, 00, 00, 000000); + TOMASuplUtcTime utcTime; + TInt zoneCode = 0; + TInt zone = 23; + + utcTime.SetUtcTime( dateTime, zoneCode, zone); + + TOMASuplPositionEstimate posEstimate; + + TInt latitude = 100; + TInt longitude = 100; + posEstimate.SetPositionEstimate( TOMASuplPositionEstimate::ENorth, latitude, + longitude); + aPosition->SetPosition( utcTime, posEstimate ); + COMASuplInfoRequest* req = COMASuplVelocity::NewL(); + GetVelocityL(req); + aPosition->SetSuplVelocity(STATIC_CAST(COMASuplVelocity*,req)); + } + + +// ----------------------------------------------------------------------------- +// TOmaSuplPosUtility::GetPosParametersL +// Determines the POS parameters +// ----------------------------------------------------------------------------- +// +void TOmaSuplPosUtility::GetPosParametersL( COMASuplInfoRequestList*& aInfoRequestList ) + { + TInt count = aInfoRequestList->GetCount(); + for ( TInt index = 0; index < count; index ++ ) + { + // Determine the type of the element + COMASuplInfoRequest *reqElement = aInfoRequestList->GetElement( index ); + COMASuplInfoRequest::TOMASuplInfoType infoReqType = reqElement->Type(); + + // Fill up the element with appropriate values + switch( infoReqType ) + { + case COMASuplInfoRequest::EOMASuplReqAsstData: + GetRequestedAsstData( reqElement ); + break; + + case COMASuplInfoRequest::EOMASuplVelocity: + TRAPD( err, GetVelocityL( reqElement ) ); + if ( KErrNone != err ) + { + reqElement->SetStatus( KErrOMASuplParamNotSet ); + } + break; + + case COMASuplInfoRequest::EOMASuplSETCapabilities: + GetSetCapabilities( reqElement ); + break; + + case COMASuplInfoRequest::EOMASuplPosPayload: + TRAP( err, GetPosPayloadL( reqElement ) ); + if ( KErrNone != err ) + { + reqElement->SetStatus( KErrOMASuplParamNotSet ); + } + else + { + reqElement->SetStatus( KErrOMASuplLastPosMsg ); + } + break; + + case COMASuplInfoRequest::EOMASuplPosition: + GetPositionL( reqElement ); + break; + + default: + reqElement->SetStatus( KErrOMASuplParamNotSet ); + break; + } + } + } + + +// ----------------------------------------------------------------------------- +// TOmaSuplPosUtility::GetRequestedAsstData +// Determines the requested assistance data +// ----------------------------------------------------------------------------- +// +void TOmaSuplPosUtility::GetRequestedAsstData( COMASuplInfoRequest*& aReqElement ) + { + COMASuplReqAsstData* reqAsstData = static_cast(aReqElement); + + reqAsstData->SetReqAsstData( ETrue, ETrue, ETrue, ETrue, ETrue, ETrue, + ETrue, ETrue ); + } + + +// ----------------------------------------------------------------------------- +// TOmaSuplPosUtility::GetVelocity +// Determines the velocity +// ----------------------------------------------------------------------------- +// +void TOmaSuplPosUtility::GetVelocityL( COMASuplInfoRequest*& aReqElement ) + { + COMASuplVelocity* velocity = static_cast( aReqElement ); + COMASuplHorizVelocity* horizVel = COMASuplHorizVelocity::NewL(); + horizVel->SetHorizVel(1,2); + velocity->SetVelocity( horizVel ); + } + + +// ----------------------------------------------------------------------------- +// TOmaSuplPosUtility::GetSetCapabilities +// Determines the SET capabilities +// ----------------------------------------------------------------------------- +// +void TOmaSuplPosUtility::GetSetCapabilities( COMASuplInfoRequest*& aReqElement ) + { + COMASuplSETCapabilities* setCap = static_cast( aReqElement ); + TOMASuplPosTechnology posTech; + posTech.SetPosTechnology( ETrue, ETrue, ETrue, ETrue, ETrue, ETrue ); + TOMASuplPosProtocol suplProtocol; + suplProtocol.SetPosProtocol( ETrue, ETrue, ETrue ); + setCap->SetSETCapabilities( + posTech, COMASuplSETCapabilities::EOMANoPreferred, suplProtocol ); + } + + +// ----------------------------------------------------------------------------- +// TOmaSuplPosUtility::GetPosPayload +// Determines the POS payload +// ----------------------------------------------------------------------------- +// +void TOmaSuplPosUtility::GetPosPayloadL( COMASuplInfoRequest*& aReqElement ) + { + COMASuplPosPayload* payload = static_cast( aReqElement ); + HBufC8* payloadData = HBufC8::NewL(20); + payloadData->Des().Copy( _L8( "PayLoadData" ) ); + payload->SetPosPayload( payloadData, COMASuplPosPayload::ETIA801 ); + } + + +// ----------------------------------------------------------------------------- +// TOmaSuplPosUtility::GetPositionL +// Determines the position estimates +// ----------------------------------------------------------------------------- +// +void TOmaSuplPosUtility::GetPositionL( COMASuplInfoRequest*& aReqElement ) + { + COMASuplPosition* position = static_cast( aReqElement ); + GetPositionEstimatesL( position ); + } diff -r 000000000000 -r 0ce1b5ce9557 posmsgpluginreferenceimpl/sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/posmsgpluginreferenceimpl/sysdef_1_4_0.dtd Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 power_save_display_mode_stub/BWINS/power_save_display_modeU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/power_save_display_mode_stub/BWINS/power_save_display_modeU.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,11 @@ +EXPORTS + ??1CPowerSaveDisplayMode@@UAE@XZ @ 1 NONAME ; CPowerSaveDisplayMode::~CPowerSaveDisplayMode(void) + ?Exit@CPowerSaveDisplayMode@@QAEHXZ @ 2 NONAME ; int CPowerSaveDisplayMode::Exit(void) + ?MaxLines@CPowerSaveDisplayMode@@QAEIXZ @ 3 NONAME ; unsigned int CPowerSaveDisplayMode::MaxLines(void) + ?NewL@CPowerSaveDisplayMode@@SAPAV1@H@Z @ 4 NONAME ; class CPowerSaveDisplayMode * CPowerSaveDisplayMode::NewL(int) + ?Set@CPowerSaveDisplayMode@@QAEHIIH@Z @ 5 NONAME ; int CPowerSaveDisplayMode::Set(unsigned int, unsigned int, int) + ?Status@CPowerSaveDisplayMode@@QAEHXZ @ 6 NONAME ; int CPowerSaveDisplayMode::Status(void) + ?Set@CPowerSaveDisplayMode@@QAEHIIPAGH@Z @ 7 NONAME ; int CPowerSaveDisplayMode::Set(unsigned int, unsigned int, unsigned short *, int) + ?SetPowerSaveLevel@CPowerSaveDisplayMode@@QAEHW4TPowerSaveLevel@1@@Z @ 8 NONAME ; int CPowerSaveDisplayMode::SetPowerSaveLevel(enum CPowerSaveDisplayMode::TPowerSaveLevel) + ?GetPowerSaveLevel@CPowerSaveDisplayMode@@QAE?AW4TPowerSaveLevel@1@XZ @ 9 NONAME ; enum CPowerSaveDisplayMode::TPowerSaveLevel CPowerSaveDisplayMode::GetPowerSaveLevel(void) + diff -r 000000000000 -r 0ce1b5ce9557 power_save_display_mode_stub/EABI/power_save_display_modeU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/power_save_display_mode_stub/EABI/power_save_display_modeU.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,15 @@ +EXPORTS + _ZN21CPowerSaveDisplayMode3SetEjji @ 1 NONAME + _ZN21CPowerSaveDisplayMode4ExitEv @ 2 NONAME + _ZN21CPowerSaveDisplayMode4NewLEi @ 3 NONAME + _ZN21CPowerSaveDisplayMode6StatusEv @ 4 NONAME + _ZN21CPowerSaveDisplayMode8MaxLinesEv @ 5 NONAME + _ZN21CPowerSaveDisplayModeD0Ev @ 6 NONAME + _ZN21CPowerSaveDisplayModeD1Ev @ 7 NONAME + _ZN21CPowerSaveDisplayModeD2Ev @ 8 NONAME + _ZTI21CPowerSaveDisplayMode @ 9 NONAME ; ## + _ZTV21CPowerSaveDisplayMode @ 10 NONAME ; ## + _ZN21CPowerSaveDisplayMode17GetPowerSaveLevelEv @ 11 NONAME + _ZN21CPowerSaveDisplayMode17SetPowerSaveLevelENS_15TPowerSaveLevelE @ 12 NONAME + _ZN21CPowerSaveDisplayMode3SetEjjPti @ 13 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 power_save_display_mode_stub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/power_save_display_mode_stub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/power_save_display_mode.h OS_LAYER_PLATFORM_EXPORT_PATH(power_save_display_mode.h) + +PRJ_MMPFILES +power_save_display_mode.mmp diff -r 000000000000 -r 0ce1b5ce9557 power_save_display_mode_stub/group/power_save_display_mode.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/power_save_display_mode_stub/group/power_save_display_mode.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#include + +// Create dll with _stub name to avoid confusion +TARGET power_save_display_mode_stub.dll +TARGETTYPE dll +UID 0x1000008D 0x101f6e00 + +VENDORID VID_DEFAULT + +CAPABILITY CAP_GENERAL_DLL + +// This is a SYSTEMINCLUDE macro containing the osextensions +// layer specific include directories +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +SOURCEPATH ../src + +SOURCE power_save_display_mode.cpp + +LIBRARY euser.lib + +DEFFILE power_save_display_mode.def + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY power_save_display_mode.lib + +// On ROM dll name is without the _stub part so that it can easily be +// replaced with the real deal +LINKAS power_save_display_mode.dll diff -r 000000000000 -r 0ce1b5ce9557 power_save_display_mode_stub/inc/power_save_display_mode.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/power_save_display_mode_stub/inc/power_save_display_mode.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Defines an API used by Series 60 to access the power save display mode +* features. +* +* +*/ + +#ifndef __POWER_SAVE_DISPLAY_MODE_H__ +#define __POWER_SAVE_DISPLAY_MODE_H__ + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* Adaptation API for power save display mode use +* +* @since Series 60 3.0 +*/ +class CPowerSaveDisplayMode : public CBase + { +public: + /** + * Power save levels define how much power should be saved. + * Note: higher settings result in lower image quality. + */ + enum TPowerSaveLevel + { + ENone = 0, //!< No power saving allowed + ELow = 1, //!< Minimal saving with high quality (default) + EMedium = 2, //!< High saving with medium quality + EHigh = 3, //!< Maximum saving with low quality + }; + + /// Destructor + IMPORT_C ~CPowerSaveDisplayMode(); + + /** + * Creates object and connects to display. + * @param aDisplayNumber Which display to connect to, default is primary display. + * @return new CPowerSaveDisplayMode, NULL on error + */ + IMPORT_C static CPowerSaveDisplayMode* NewL(TInt aDisplayNumber = 0); + + /** + * Enables power save mode. Sets lines between given parameters visible, + * other display lines are turned off and not shown. + * @pre Image to display must be drawn in videobuffer before calling Set(). + * @param aStartRow First visible line, starting from 0 + * @param aEndRow Last visible line + * @param aFullColors Full color mode if ETrue and hw supports that + * Note: full color mode consumes more power + * @return KErrNone on success + */ + IMPORT_C TInt Set(TUint aStartRow, TUint aEndRow, TBool aFullColors = EFalse); + + /** + * Enables power save mode. Sets lines between given parameters visible, + * other display lines are turned off and not shown. + * @pre Image to display must be drawn in videobuffer before calling Set(). + * @param aStartRow First visible line, starting from 0 + * @param aEndRow Last visible line + * @param aPixels Pointer to array of color of each pixel + * @param aFullColors Full color mode if ETrue and hw supports that + * Note: full color mode consumes more power + * @return KErrNone on success + */ + IMPORT_C TInt Set(TUint aStartRow, TUint aEndRow, TUint16* aPixels, TBool aFullColors = EFalse); + + /** + * Returns max number of lines that display supports in power save mode + * (e.g.50 lines or full screen). + * @return Number of supported power save mode lines. + */ + IMPORT_C TUint MaxLines(); + + /** + * Returns status of power save mode. + * @return ETrue = Enabled (on), EFalse = disabled (off, normal display) + */ + IMPORT_C TBool Status(); + + /** Turns off power save mode. All lines on display will be shown normally. + * @return KErrNone on success. + */ + IMPORT_C TInt Exit(); + + /** + * Changes the current power save level. + * @param aVal New power save level + * @return KErrNone operation succeeded, + * KErrNotSupported feature is not available. + */ + IMPORT_C TInt SetPowerSaveLevel(CPowerSaveDisplayMode::TPowerSaveLevel aVal); + + /** + * Return the current power save level. + * @return TPowerSaveLevel + */ + IMPORT_C CPowerSaveDisplayMode::TPowerSaveLevel GetPowerSaveLevel(); + +private: + /// Default constructor + CPowerSaveDisplayMode(); + + /// Second phase constructor + void ConstructL(TInt aDisplayNumber); + +private: + /// Display driver pointer + TAny* iDisplayDriver; + }; + +#endif // POWER_SAVE_DISPLAY_MODE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 power_save_display_mode_stub/layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/power_save_display_mode_stub/layers.sysdef.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,14 @@ + + +]> + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 power_save_display_mode_stub/rom/power_save_display_mode.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/power_save_display_mode_stub/rom/power_save_display_mode.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __POWER_SAVE_DISPLAY_MODE_IBY__ +#define __POWER_SAVE_DISPLAY_MODE_IBY__ + +file = ABI_DIR\BUILD_DIR\power_save_display_mode.dll sys\bin\power_save_display_mode.dll + +#endif //__POWER_SAVE_DISPLAY_MODE_IBY__ + diff -r 000000000000 -r 0ce1b5ce9557 power_save_display_mode_stub/rom/power_save_display_mode_stub.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/power_save_display_mode_stub/rom/power_save_display_mode_stub.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __POWER_SAVE_DISPLAY_MODE_STUB_IBY__ +#define __POWER_SAVE_DISPLAY_MODE_STUB_IBY__ + +file = ABI_DIR\BUILD_DIR\power_save_display_mode_stub.dll sys\bin\power_save_display_mode.dll + +#endif //__POWER_SAVE_DISPLAY_MODE_STUB_IBY__ + diff -r 000000000000 -r 0ce1b5ce9557 power_save_display_mode_stub/src/power_save_display_mode.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/power_save_display_mode_stub/src/power_save_display_mode.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,214 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Defines an API used by Series 60 to access the power save display mode +* features. +* +* +*/ + + + +// INCLUDE FILES +#include "power_save_display_mode.h" +#include + +// CONSTANTS +// Stub uses a constant value for power save size +const TInt KMaxPowerSaveLinesStub = 50; + + +// ============================ MEMBER FUNCTIONS =============================== + +/** + * @see power_save_display_mode.h + */ +CPowerSaveDisplayMode::CPowerSaveDisplayMode() : + CBase(), + iDisplayDriver(NULL) + { + } + + +/** + * @see power_save_display_mode.h + */ +EXPORT_C CPowerSaveDisplayMode* CPowerSaveDisplayMode::NewL(TInt aDisplayNumber) + { + CPowerSaveDisplayMode* result = new(ELeave) CPowerSaveDisplayMode; + + CleanupStack::PushL(result); + result->ConstructL(aDisplayNumber); + CleanupStack::Pop(); + + return result; + } + + +/** + * @see power_save_display_mode.h + */ +void CPowerSaveDisplayMode::ConstructL(TInt /* aDisplayNumber */) + { + /* + * ADAPTATION IMPLEMENTATION NEEDED + * + * Create and initialize all the member variables that are needed + * in order to complete the tasks assigned to this class here. + * Note that this function may leave. + */ + } + + +/** + * @see power_save_display_mode.h + */ +EXPORT_C CPowerSaveDisplayMode::~CPowerSaveDisplayMode() + { + /* + * ADAPTATION IMPLEMENTATION NEEDED + * + * Destroy all member variables that have been created by + * ConstructL(). Close open connections. + */ + } + + +/** + * @see power_save_display_mode.h + */ +EXPORT_C TBool CPowerSaveDisplayMode::Status() + { + /* + * ADAPTATION IMPLEMENTATION NEEDED + * + * Return ETrue if the power save mode is activated, otherwise EFalse + */ + return EFalse; + } + + +/** + * @see power_save_display_mode.h + */ +EXPORT_C TInt CPowerSaveDisplayMode::Exit() + { + /* + * ADAPTATION IMPLEMENTATION NEEDED + * + * Instruct the display driver to exit power save mode. + * Return KErrNone on success, or an error code. + */ + + return KErrNone; + } + + +/** + * @see power_save_display_mode.h + */ +EXPORT_C TUint CPowerSaveDisplayMode::MaxLines() + { + /* + * ADAPTATION IMPLEMENTATION NEEDED + * + * Return the maximum number of screen display lines supported in + * power save mode. This should be queried from the display driver. + */ + return KMaxPowerSaveLinesStub; + } + + +/** + * @see power_save_display_mode.h + */ +EXPORT_C TInt CPowerSaveDisplayMode::Set( + TUint aStartRow, + TUint aEndRow, + TBool /* aFullColors */) + { + /* + * ADAPTATION IMPLEMENTATION NEEDED + * + * Instruct the display driver to enter power save mode starting from + * row "aStartRow" (0-based) and finishing at row "aEndRow". The image + * to be displayed should already be drawn in display buffer. + */ + + // Sanity-check params + if (aEndRow <= aStartRow) + { + return KErrArgument; + } + else + { + return KErrNone; + } + } + + +/** + * @see power_save_display_mode.h + */ +EXPORT_C TInt CPowerSaveDisplayMode::Set( + TUint aStartRow, + TUint aEndRow, + TUint16* aPixels, + TBool /* aFullColors */) + { + /* + * ADAPTATION IMPLEMENTATION NEEDED + * + * Instruct the display driver to enter power save mode starting from + * row "aStartRow" (0-based) and finishing at row "aEndRow". The image + * to be displayed should already be drawn in display buffer. + */ + + // Sanity-check params + if (aEndRow <= aStartRow || aPixels == NULL) + { + return KErrArgument; + } + else + { + return KErrNone; + } + } + + +/** + * @see power_save_display_mode.h + */ +EXPORT_C TInt CPowerSaveDisplayMode::SetPowerSaveLevel(CPowerSaveDisplayMode::TPowerSaveLevel aVal) + { + if ( aVal >= ENone && aVal <= EHigh ) + { + return KErrNone; + } + else + { + return KErrNotSupported; + } + } + + +/** + * @see power_save_display_mode.h + */ +EXPORT_C CPowerSaveDisplayMode::TPowerSaveLevel CPowerSaveDisplayMode::GetPowerSaveLevel() + { + return CPowerSaveDisplayMode::ELow; + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 power_save_display_mode_stub/sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/power_save_display_mode_stub/sysdef_1_4_0.dtd Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 power_save_display_mode_stub/systemDefinition.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/power_save_display_mode_stub/systemDefinition.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,33 @@ + + + + + + + + +]> + + + +&layer_file; + + +&targetDefinition_file; + + + + +&defaultbuild_file; + + + + + +&defaultclean_file; + + + + diff -r 000000000000 -r 0ce1b5ce9557 power_save_display_mode_stub/systemDefinitionLayer.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/power_save_display_mode_stub/systemDefinitionLayer.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,7 @@ + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/adaptationhwdevice/bwins/asrsadaptationhwdeviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/adaptationhwdevice/bwins/asrsadaptationhwdeviceu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,14 @@ +EXPORTS + ??1CASRSAdaptHwDevice@@UAE@XZ @ 1 NONAME ; CASRSAdaptHwDevice::~CASRSAdaptHwDevice(void) + ??1CASRSHwDevice@@UAE@XZ @ 2 NONAME ; CASRSHwDevice::~CASRSHwDevice(void) + ?CancelAdaptation@CASRSAdaptHwDevice@@QAEXXZ @ 3 NONAME ; void CASRSAdaptHwDevice::CancelAdaptation(void) + ?Clear@CASRSAdaptHwDevice@@UAEXXZ @ 4 NONAME ; void CASRSAdaptHwDevice::Clear(void) + ?Clear@CASRSHwDevice@@UAEXXZ @ 5 NONAME ; void CASRSHwDevice::Clear(void) + ?CustomInterface@CASRSAdaptHwDevice@@UAEPAXVTUid@@@Z @ 6 NONAME ; void * CASRSAdaptHwDevice::CustomInterface(class TUid) + ?CustomInterface@CASRSHwDevice@@UAEPAXVTUid@@@Z @ 7 NONAME ; void * CASRSHwDevice::CustomInterface(class TUid) + ?InitializeL@CASRSAdaptHwDevice@@UAEXXZ @ 8 NONAME ; void CASRSAdaptHwDevice::InitializeL(void) + ?InitializeL@CASRSHwDevice@@UAEXXZ @ 9 NONAME ; void CASRSHwDevice::InitializeL(void) + ?NewL@CASRSAdaptHwDevice@@SAPAV1@AAVMASRAdaptationHwDeviceObserver@@@Z @ 10 NONAME ; class CASRSAdaptHwDevice * CASRSAdaptHwDevice::NewL(class MASRAdaptationHwDeviceObserver &) + ?NewL@CASRSHwDevice@@SAPAV1@XZ @ 11 NONAME ; class CASRSHwDevice * CASRSHwDevice::NewL(void) + ?StartAdaptationL@CASRSAdaptHwDevice@@QAEXABVTDesC8@@AAVCSIModelBank@@AAVCSIPronunciation@@W4TLanguage@@@Z @ 12 NONAME ; void CASRSAdaptHwDevice::StartAdaptationL(class TDesC8 const &, class CSIModelBank &, class CSIPronunciation &, enum TLanguage) + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/adaptationhwdevice/eabi/asrsadaptationhwdeviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/adaptationhwdevice/eabi/asrsadaptationhwdeviceu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,22 @@ +EXPORTS + _ZN13CASRSHwDevice11InitializeLEv @ 1 NONAME + _ZN13CASRSHwDevice15CustomInterfaceE4TUid @ 2 NONAME + _ZN13CASRSHwDevice4NewLEv @ 3 NONAME + _ZN13CASRSHwDevice5ClearEv @ 4 NONAME + _ZN13CASRSHwDeviceD0Ev @ 5 NONAME + _ZN13CASRSHwDeviceD1Ev @ 6 NONAME + _ZN13CASRSHwDeviceD2Ev @ 7 NONAME + _ZN18CASRSAdaptHwDevice11InitializeLEv @ 8 NONAME + _ZN18CASRSAdaptHwDevice15CustomInterfaceE4TUid @ 9 NONAME + _ZN18CASRSAdaptHwDevice16CancelAdaptationEv @ 10 NONAME + _ZN18CASRSAdaptHwDevice16StartAdaptationLERK6TDesC8R12CSIModelBankR16CSIPronunciation9TLanguage @ 11 NONAME + _ZN18CASRSAdaptHwDevice4NewLER30MASRAdaptationHwDeviceObserver @ 12 NONAME + _ZN18CASRSAdaptHwDevice5ClearEv @ 13 NONAME + _ZN18CASRSAdaptHwDeviceD0Ev @ 14 NONAME + _ZN18CASRSAdaptHwDeviceD1Ev @ 15 NONAME + _ZN18CASRSAdaptHwDeviceD2Ev @ 16 NONAME + _ZTI13CASRSHwDevice @ 17 NONAME ; ## + _ZTI18CASRSAdaptHwDevice @ 18 NONAME ; ## + _ZTV13CASRSHwDevice @ 19 NONAME ; ## + _ZTV18CASRSAdaptHwDevice @ 20 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/adaptationhwdevice/group/asradaptationhwdevicestub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/adaptationhwdevice/group/asradaptationhwdevicestub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for AdaptationHwDeviceStub +* +*/ + + + + +#include + +#if defined( WINS ) || defined( WINSCW ) +TARGET asrsadaptationhwdevice.dll +#else +TARGET asrsadaptationhwdevice_stub.dll +#endif + +TARGETTYPE DLL +UID 0x1000008D 0x101FF938 // UID: + +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE asrsadaptationhwdevice.cpp + +SOURCEPATH ../../common/src +SOURCE asrshwdevice.cpp + +USERINCLUDE ../inc ../src +USERINCLUDE ../../common/inc + +// This is a SYSTEMINCLUDE macro containing the middleware +// layer specific include directories +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE ../../common/inc + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY asrsadaptationhwdevice.lib + +// On ROM dll name is without the _stub part so that it can easily be +// replaced with the real dll +LINKAS asrsadaptationhwdevice.dll + +CAPABILITY CAP_GENERAL_DLL diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/adaptationhwdevice/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/adaptationhwdevice/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for AdaptationHwDeviceStub +* +*/ + + + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +asradaptationhwdevicestub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/adaptationhwdevice/src/asrsadaptationhwdevice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/adaptationhwdevice/src/asrsadaptationhwdevice.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,157 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: SIND hardware device for model adaptation +* +*/ + + + + + + +// INCLUDE FILES +#include "asrsadaptationhwdevice.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CASRSAdaptHwDevice::CASRSAdaptHwDevice +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// + +CASRSAdaptHwDevice::CASRSAdaptHwDevice( + MASRAdaptationHwDeviceObserver& anObserver + ) +: iObserver( anObserver ), + iAlgorithm( NULL ), + iIsInitialised( EFalse ), + iReserved( 0 ) + { + // Nothing + } + +// ----------------------------------------------------------------------------- +// CASRSAdaptHwDevice::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CASRSAdaptHwDevice::ConstructL(void) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSAdaptHwDevice::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CASRSAdaptHwDevice* CASRSAdaptHwDevice::NewL( + MASRAdaptationHwDeviceObserver& anObserver ) // The observer + { + CASRSAdaptHwDevice* self = new( ELeave ) CASRSAdaptHwDevice( anObserver ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CASRSAdaptHwDevice::~CASRSAdaptHwDevice +// Destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CASRSAdaptHwDevice::~CASRSAdaptHwDevice() + { + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// CustomInterface +// Provides clients with an interface, given an UID. +// Returns: NULL - No custom interface with that UID +// ----------------------------------------------------------------------------- +// +EXPORT_C TAny* CASRSAdaptHwDevice::CustomInterface( + TUid /*aInterfaceId*/ ) // UID of the interface + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// InitializeL +// Initializes the device. Subsequent calls reset the device. +// Returns: none +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSAdaptHwDevice::InitializeL(void) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// Clear +// Clears the device +// Returns: None +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSAdaptHwDevice::Clear(void) + { + } + +// ----------------------------------------------------------------------------- +// Start the adaptation. It will adapt the acoustic models given the feature vector set and phoneme sequences +// of a correctly recognized utterance +// +// Returns: None +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSAdaptHwDevice::StartAdaptationL ( const TDesC8& /*aAdaptationData*/, + CSIModelBank& /*aModelBank*/, + CSIPronunciation& /*aPronunciation*/, + TLanguage /*aLanguage*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CancelAdaptation +// Cancels Adaptation . No callback is sent to the client. +// Returns: None +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSAdaptHwDevice::CancelAdaptation() + { + } + + + +// ================================ OTHER EXPORTED FUNCTIONS =============================== + +// for DLL goodness +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason /*aReason*/ ) + { + return KErrNone; + } +#endif + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/adaptationhwdevice/src/asrsadaptationhwdevice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/adaptationhwdevice/src/asrsadaptationhwdevice.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,216 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ARM hardware device for grammar compiling +* +*/ + + + + + + +#ifndef ASRADAPTATIONHWDEVICE_H +#define ASRADAPTATIONHWDEVICE_H + +// INCLUDES +#include +#include + +// Implementation +class CAsrAdaptationAlgorithm; + +// CLASS DECLARATION +/** +* Callback class for adaptation. +* +* !!@lib asrsadaptationhwdevice.lib +* @since 2.8 +*/ +class MASRAdaptationHwDeviceObserver + { +public: + /**!!! + * + * @since 2.8 + * @param none + * @return + */ + + virtual void MaahdAdaptationComplete(TInt aError) = 0; +}; + + + +/** +* Adaptation class +* +* !!@lib asrsadaptationhwdevice.lib +* @since 2.8 +*/ +class CASRSAdaptHwDevice : public CASRSHwDevice + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CASRSAdaptHwDevice* NewL( + MASRAdaptationHwDeviceObserver& aObserver ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CASRSAdaptHwDevice(); + + public: // New functions + + /** + * Retrieve a custom interface + * @since 2.8 + * @param none + * @return Pointer to a custom interface + */ + IMPORT_C TAny* CustomInterface(TUid aInterfaceId); + + /** + * Initializes the device. Subsequent calls reset the device. + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C void InitializeL(); + + /** + * Clears the device. + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C void Clear(); + + + /** + * Start the adaptation. It will adapt the acoustic models given the feature vector set and phoneme sequences + * of a correctly recognized utterance + * @since 2.8 + * @param aAdaptationData: Buffer that stores data(feature vector) for the speaker adaptation. + * @param aModelBank: Model bank, which is the acoustic model to be adapted. + * @param aPronunciation: Pronunciation of the adaptation utterance. + * @param aLanguage : adaptation language + * @return none + */ + IMPORT_C void StartAdaptationL(const TDesC8& aAdaptationData, + CSIModelBank& aModelBank, + CSIPronunciation& aPronunciation,TLanguage aLanguage); + + + + /** + * Cancel the Adaptation process. No callback is sent to the client. + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C void CancelAdaptation(); + + /** + * Cancels adaptation. No callback is sent to the client. + * @since 2.8 + * @param none + * @return none + */ +/* IMPORT_C void CancelCombination();*/ + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CASRSAdaptHwDevice(MASRAdaptationHwDeviceObserver& anObserver); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + + + + // Prohibit copy constructor if not deriving from CBase. + // CASRGrCompilerHwDevice( const CASRGrCompilerHwDevice& ); + // Prohibit assigment operator if not deriving from CBase. + // CASRGrCompilerHwDevice& operator=( const CASRGrCompilerHwDevice& ); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // pronunciation tree builder algorithm + // CPTBAlgorithm* iPtb; + + // The observer + MASRAdaptationHwDeviceObserver& iObserver; + + // Implementation-specific functions and data + CAsrAdaptationAlgorithm *iAlgorithm; + + // Has Initialize() been called + TBool iIsInitialised; + + // Reserved pointer for future extension. + TAny* iReserved; + + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; +#endif // ?INCLUDE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/common/inc/asrshwdevice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/common/inc/asrshwdevice.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,149 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: TTP hardware device +* +*/ + + + + + + +#ifndef ASRHWDEVICE_H +#define ASRHWDEVICE_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* Base class for all hw devices +* +* +* @lib asrsadaptationhwdevice.lib +* @since 2.8 +*/ +class CASRSHwDevice : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CASRSHwDevice* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CASRSHwDevice(); + + public: // New functions + + /** + * Use to initilize HW device + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C virtual void InitializeL(); + + /** + * Use to clear HW device + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C virtual void Clear(); + + /** + * Use to get custom interface + * @since 2.8 + * @param aInterfaceId Identifier of the intercace implementation + * @return Pointer to the interface implementation or NULL. + */ + IMPORT_C virtual TAny* CustomInterface( TUid aInterfaceId ); + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + + + /** + * C++ default constructor. + */ + CASRSHwDevice(); + + private: + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + // Reserved pointer for future extension + //TAny* iReserved; + + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; + +#endif // ?INCLUDE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/common/inc/nsssispeechrecognitiondataclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/common/inc/nsssispeechrecognitiondataclient.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,213 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains definition of the SISpeechRecognitionDataClient structure and API. +* +*/ + + + + + +#ifndef __SRSSIDATA_CLIENT_H__ +#define __SRSSIDATA_CLIENT_H__ + +// INCLUDES +#include + + +// FORWARD DECLARATION +class CSIResultSet; + + +// CLASS DECLARATION + +/** +* Class to encapsulate a client recognition result. +* The result is formulated for client consumption. +* +* @lib nsssispeechrecognitiondata.lib +* @since 2.5 +*/ + +class CSIClientResult : public CBase +{ +public: // Constructors and destructor + /** + * Destructor. + */ + IMPORT_C ~CSIClientResult(); + /** + * Two-phased constructor. + */ + IMPORT_C static CSIClientResult* NewL(); + IMPORT_C static CSIClientResult* NewLC(); + IMPORT_C static CSIClientResult* NewL(TSIGrammarID aGrammarID, TSIRuleID aRuleID); + IMPORT_C static CSIClientResult* NewLC(TSIGrammarID aGrammarID, TSIRuleID aRuleID); + + /** + * Use to set the grammar Id on the result. + * @since 2.5 + * @param aGrammarID - grammar identifier. + * @return None. + */ + IMPORT_C void SetGrammarID(TSIGrammarID aGrammarID); + + /** + * Use to retrieve the grammar Id of the result. + * @since 2.5 + * @param None. + * @return Grammar identifier. + */ + IMPORT_C TSIGrammarID GrammarID() const; + + /** + * Use to set the rule Id of the result. + * @since 2.5 + * @param aRuleID - rule identifier. + * @return None. + */ + IMPORT_C void SetRuleID(TSIRuleID aRuleID); + + /** + * Use to retrieve the rule Id of the result. + * @since 2.5 + * @param None. + * @return Rule identifier. + */ + IMPORT_C TSIRuleID RuleID() const; + +private: + void ConstructL(); + CSIClientResult(); + CSIClientResult(TSIGrammarID aGrammarID, TSIRuleID aRuleID); + +private: + TSIGrammarID iGrammarID; + TSIRuleID iRuleID; +}; + + +/** +* Class to encapsulate a client recogntion result set +* This is a lightweight result set formulated for client consumption +* +* @lib nsssispeechrecognitiondata.lib +* @since 2.5 +*/ + +class CSIClientResultSet : public CBase +{ +public: // Constructors and destructor + /** + * Destructor. + */ + IMPORT_C ~CSIClientResultSet(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CSIClientResultSet* NewL(); + IMPORT_C static CSIClientResultSet* NewLC(); + + /** + * Use to add a result to the result set. + * @since 2.5 + * @param aResult - reference to the result object to be added. + * @return KErrNone, if the insertion is successful, otherwise one of the system wide error codes. + */ + IMPORT_C void AddL( const CSIClientResult* aResult); + + + /** + * Use to delete a result to the result set. + * @since 2.5 + * @param aIndex Index of . + * @return + */ + IMPORT_C void DeleteL(TInt aIndex) ; + /** + * Sets the maximum number of best matches (N-best) expected in the recognition result after recognition. + * @since 2.5 + * @param aMaxResults - the maximum number of matches expected in the recognition result. + * @return None. + */ + IMPORT_C void SetMaxResultsL(TInt aMaxResults); + + /** + * Use to retrieve the current value of the max number of expected after recognition. + * @since 2.5 + * @param None. + * @return The maximum number of best matches (N-best) expected in the recognition result. + */ + IMPORT_C TInt MaxResults() const; + + /** + * Use to retrieve a result at a given index within the result set. + * @since 2.5 + * @param None. + * @return Pointer to CSIClientResult object. + */ + IMPORT_C const CSIClientResult& AtL(TInt anIndex) const; + + /** + * Use to set the number of results actually returned after recogntion. + * @since 2.5 + * @param aResultCount - number of results returned by the recognizer. + * @return None. + */ + IMPORT_C void SetResultCount(TInt aResultCount); + + /** + * Use to retrieve the number of results actually returned after recogntion. + * @since 2.5 + * @param None. + * @return Number of results actually returned after recogntion. + */ + IMPORT_C TInt ResultCount() const; + + + IMPORT_C CSIResultSet& SIResultSet() const; + + + IMPORT_C void SetSIResultSet(CSIResultSet* aSIResultSet); + + /** + * Internalize to a data stream + * @since 2.8 + * @param aStream Data stream + * @return None + */ + IMPORT_C virtual void InternalizeL( RReadStream& aStream ); + + /** + * Externalize from a data stream + * @since 2.8 + * @param None + * @return aStream Data stream + */ + IMPORT_C virtual void ExternalizeL( RWriteStream& aStream ) const; + +private: + void ConstructL(); + CSIClientResultSet(); + +private: + TInt iMaxResults; + TInt iResultCount; + RPointerArray iResultArray; + CSIResultSet* iSIResultSet; +}; + +#endif + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/common/inc/nsssispeechrecognitiondatacommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/common/inc/nsssispeechrecognitiondatacommon.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,228 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains common data shared between SISpeechRecognitionDataClient +* %version: 10 % +* and SISpeechRecognitionDataDevASR. +* +* Copyright © 2002-2006 Nokia Corporation. +*/ + + + + + +#ifndef NSSSISPEECHRECOGNITIONDATACOMMON_H +#define NSSSISPEECHRECOGNITIONDATACOMMON_H + +// INCLUDES +#include + +// For externalize/internalize +#include +// For +#include + +// TYPEDEFS +typedef TUint16 TSIModelBankID; +typedef TUint16 TSIModelID; + +typedef TUint16 TSILexiconID; +typedef TUint32 TSIPronunciationID; + +typedef TUint16 TSIGrammarID; +typedef TUint32 TSIRuleID; +typedef TUint8 TSIRuleVariantID; + +typedef RArray TSIPronunciationIDSequence; + +// Language array which is used as an element of another RArray +typedef RArray RLanguageArray; + +// CONSTANTS +const TSIPronunciationID KUndefinedPronounciationID = 0x0; + +const TSIModelBankID KInvalidModelBankID = 0x7fff; +const TSIModelID KInvalidModelID = 0x7fff; +const TSILexiconID KInvalidLexiconID = 0x7fff; +const TSIPronunciationID KInvalidPronunciationID=0x7fffffff; +const TSIGrammarID KInvalidGrammarID = 0x7fff; +const TSIRuleID KInvalidRuleID = 0x7fffffff; +const TSIRuleVariantID KInvalidRuleVariantID = 0x7f; + +// ASCII phonemes can't be longer than this. +const TInt KMaxPhonemeLength = 7; + +const TUint8 KPhonemeSeparator = '-'; + + + +// CONSTANTS +const TInt KUidAsrEventTrainReadyVal = 0x101FBF9E; +const TInt KUidAsrEventTrainVal = 0x101FBF9F; +const TInt KUidAsrEventAddPronunciationVal = 0x101FBFA0; +const TInt KUidAsrEventAddRuleVal = 0x101FBFA1; +const TInt KUidAsrEventLoadModelsVal = 0x101FBFA2; +const TInt KUidAsrEventLoadLexiconVal = 0x101FBFA3; +const TInt KUidAsrEventLoadGrammarVal = 0x101FBFA4; +const TInt KUidAsrEventRecognitionReadyVal = 0x101FBFA5; +const TInt KUidAsrEventRecognitionVal = 0x101FBFA6; +const TInt KUidAsrEventUnloadRuleVal = 0x101FBFA7; +const TInt KUidAsrEventRecordStartedVal = 0x101FBFA8; +const TInt KUidAsrEventRecordVal = 0x101FBFA9; +const TInt KUidAsrEventEouDetectedVal = 0x101FBFAA; +const TInt KUidAsrEventPlayStartedVal = 0x101FBFAB; +const TInt KUidAsrEventPlayVal = 0x101FBFAC; +const TInt KUidAsrEventCreateGrammarVal = 0x101FBFAD; +const TInt KUidAsrEventCreateLexiconVal = 0x101FBFAE; +const TInt KUidAsrEventCreateModelBankVal = 0x101FBFAF; +const TInt KUidAsrEventRemoveGrammarVal = 0x101FBFB0; +const TInt KUidAsrEventRemoveLexiconVal = 0x101FBFB1; +const TInt KUidAsrEventRemoveModelBankVal = 0x101FBFB2; +const TInt KUidAsrEventRemoveRuleVal = 0x101FBFB3; +const TInt KUidAsrEventRemovePronunciationVal = 0x101FBFB4; +const TInt KUidAsrEventRemoveModelVal = 0x101FBFB5; +const TInt KUidAsrEventGetAvailableStorageVal = 0x101FBFB6; +const TInt KUidAsrEventGetRuleValidityVal = 0x101FBFB7; +const TInt KUidAsrEventGetUtteranceDurationVal = 0x101FBFB8; +const TInt KUidAsrEventGetModelCountVal = 0x101FBFB9; +const TInt KUidAsrEventGetAllRuleIDsVal = 0x101FBFBA; +const TInt KUidAsrEventGetAllPronunciationIDsVal = 0x101FBFBB; +const TInt KUidAsrEventGetAllModelIDsVal = 0x101FBFBC; +const TInt KUidAsrEventGetAllClientGrammarIDsVal = 0x101FBFBD; +const TInt KUidAsrEventGetAllClientLexiconIDsVal = 0x101FBFBE; +const TInt KUidAsrEventGetAllClientModelBankIDsVal = 0x101FBFBF; +const TInt KUidAsrEventGetAllGrammarIDsVal = 0x101FBFC0; +const TInt KUidAsrEventGetAllLexiconIDsVal = 0x101FBFC1; +const TInt KUidAsrEventGetAllModelBankIDsVal = 0x101FBFC2; + +// SI event values +// !!!! There are not unique! Just successors of SD numbers. +const TInt KUidAsrEventAdaptVal = 0x101FBFC3; +const TInt KUidAsrEventAddVoiceTagVal = 0x101FBFC4; +const TInt KUidAsrEventAddVoiceTagsVal = 0x101FBFC5; +const TInt KUidAsrEventSIRecognitionVal = 0x101FBFC6; +const TInt KUidAsrEventAddRuleVariantVal= 0x101FBFC7; +const TInt KUidAsrEventCreateRuleVal = 0x101FBFC8; +const TInt KUidAsrEventEndRecordVal = 0x101FBFC9; +const TInt KUidAsrEventUnloadGrammarVal = 0x101FBFCA; + + +const TInt KUidAsrEventUpdateGrammarAndLexiconVal = 0x101FBFCB; +const TInt KUidAsrEventActivateGrammarVal = 0x101FBFCC; +const TInt KUidAsrEventDeactivateGrammarVal = 0x101FBFCD; +const TInt KUidAsrEventRemoveRulesVal = 0x101FBFCE; + +const TInt KUidAsrEventGetPronunciationCountVal = 0x101FBFCF; +const TInt KUidAsrEventGetRuleCountVal = 0x101FBFD0; + +const TInt KUidAsrEventPreStartSamplingVal = 0x101FBFD1; + +const TUid KUidAsrEventTrainReady = {KUidAsrEventTrainReadyVal}; +const TUid KUidAsrEventTrain = {KUidAsrEventTrainVal}; +const TUid KUidAsrEventAddPronunciation = {KUidAsrEventAddPronunciationVal}; +const TUid KUidAsrEventAddRule = {KUidAsrEventAddRuleVal}; +const TUid KUidAsrEventLoadModels = {KUidAsrEventLoadModelsVal}; +const TUid KUidAsrEventLoadLexicon = {KUidAsrEventLoadLexiconVal}; +const TUid KUidAsrEventLoadGrammar = {KUidAsrEventLoadGrammarVal}; +const TUid KUidAsrEventRecognitionReady = {KUidAsrEventRecognitionReadyVal}; +const TUid KUidAsrEventRecognition = {KUidAsrEventRecognitionVal}; +const TUid KUidAsrEventUnloadRule = {KUidAsrEventUnloadRuleVal}; +const TUid KUidAsrEventRecordStarted = {KUidAsrEventRecordStartedVal}; +const TUid KUidAsrEventRecord = {KUidAsrEventRecordVal}; +const TUid KUidAsrEventEouDetected = {KUidAsrEventEouDetectedVal}; +const TUid KUidAsrEventPlayStarted = {KUidAsrEventPlayStartedVal}; +const TUid KUidAsrEventPlay = {KUidAsrEventPlayVal}; +const TUid KUidAsrEventCreateGrammar = {KUidAsrEventCreateGrammarVal}; +const TUid KUidAsrEventCreateLexicon = {KUidAsrEventCreateLexiconVal}; +const TUid KUidAsrEventCreateModelBank = {KUidAsrEventCreateModelBankVal}; +const TUid KUidAsrEventRemoveGrammar = {KUidAsrEventRemoveGrammarVal}; +const TUid KUidAsrEventRemoveLexicon = {KUidAsrEventRemoveLexiconVal}; +const TUid KUidAsrEventRemoveModelBank = {KUidAsrEventRemoveModelBankVal}; +const TUid KUidAsrEventRemoveRule = {KUidAsrEventRemoveRuleVal}; +const TUid KUidAsrEventRemovePronunciation = {KUidAsrEventRemovePronunciationVal}; +const TUid KUidAsrEventRemoveModel = {KUidAsrEventRemoveModelVal}; +const TUid KUidAsrEventGetAvailableStorage = {KUidAsrEventGetAvailableStorageVal}; +const TUid KUidAsrEventGetRuleValidity = {KUidAsrEventGetRuleValidityVal}; +const TUid KUidAsrEventGetUtteranceDuration = {KUidAsrEventGetUtteranceDurationVal}; + +const TUid KUidAsrEventGetModelCount = {KUidAsrEventGetModelCountVal}; +const TUid KUidAsrEventGetPronunciationCount = {KUidAsrEventGetPronunciationCountVal}; +const TUid KUidAsrEventGetRuleCount = {KUidAsrEventGetRuleCountVal}; + +const TUid KUidAsrEventGetAllRuleIDs = {KUidAsrEventGetAllRuleIDsVal}; +const TUid KUidAsrEventGetAllPronunciationIDs = {KUidAsrEventGetAllPronunciationIDsVal}; +const TUid KUidAsrEventGetAllModelIDs = {KUidAsrEventGetAllModelIDsVal}; +const TUid KUidAsrEventGetAllClientGrammarIDs = {KUidAsrEventGetAllClientGrammarIDsVal}; +const TUid KUidAsrEventGetAllClientLexiconIDs = {KUidAsrEventGetAllClientLexiconIDsVal}; +const TUid KUidAsrEventGetAllClientModelBankIDs = {KUidAsrEventGetAllClientModelBankIDsVal}; +const TUid KUidAsrEventGetAllGrammarIDs = {KUidAsrEventGetAllGrammarIDsVal}; +const TUid KUidAsrEventGetAllLexiconIDs = {KUidAsrEventGetAllLexiconIDsVal}; +const TUid KUidAsrEventGetAllModelBankIDs = {KUidAsrEventGetAllModelBankIDsVal}; + +// SI event UIDs +const TUid KUidAsrEventAdapt = {KUidAsrEventAdaptVal}; +const TUid KUidAsrEventAddVoiceTag = {KUidAsrEventAddVoiceTagVal}; +const TUid KUidAsrEventAddVoiceTags = {KUidAsrEventAddVoiceTagsVal}; +const TUid KUidAsrEventSIRecognition = {KUidAsrEventSIRecognitionVal}; +const TUid KUidAsrEventAddRuleVariant= {KUidAsrEventAddRuleVariantVal}; +const TUid KUidAsrEventCreateRule = {KUidAsrEventCreateRuleVal}; +const TUid KUidAsrEventEndRecord = {KUidAsrEventEndRecordVal}; +const TUid KUidAsrEventUnloadGrammar = {KUidAsrEventUnloadGrammarVal}; +const TUid KUidAsrEventUpdateGrammarAndLexicon = {KUidAsrEventUpdateGrammarAndLexiconVal}; + +const TUid KUidAsrEventActivateGrammar = {KUidAsrEventActivateGrammarVal}; +const TUid KUidAsrEventDeactivateGrammar = {KUidAsrEventDeactivateGrammarVal}; +const TUid KUidAsrEventRemoveRules = {KUidAsrEventRemoveRulesVal}; + +const TInt KUidMediaTypeSIVal = 0x101FF932; +const TUid KUidMediaTypeSI = {KUidMediaTypeSIVal}; + +const TUid KUidAsrEventPreStartSampling = {KUidAsrEventPreStartSamplingVal}; + +// Speech Recognition Errors +const TInt KErrAsrNoSpeech = -12050; +const TInt KErrAsrSpeechTooEarly = -12051; +const TInt KErrAsrSpeechTooLong = -12052; +const TInt KErrAsrSpeechTooShort = -12053; +const TInt KErrAsrNoMatch = -12054; +const TInt KErrAsrDataRightViolation = -12055; +const TInt KErrAsrNotRegisted = -12056; +const TInt KErrAsrInvalidState = -12057; +const TInt KErrAsrInitializationFailure = -12058; + +// Pre-defined Engine Parameter Identifiers starts from index 0x01 +// User-define Engine Parameter Identifiers starts from index 0x10000 and end at index KMaxTInt. +const TInt KRecognizerMode = 0x01; +const TInt KGrammarSupport = 0x02; +const TInt KLoadMultipleGrammars = 0x03; +const TInt KLoadMultipleLexicons = 0x04; +const TInt KLoadMultipleModelBanks = 0x05; +const TInt KModelStorageCapacity = 0x06; +const TInt KMaxLoadableModels = 0x07; +const TInt KMaxFrontEndBackEndDelay = 0x08; +const TInt KSamplingRate = 0x09; +const TInt KBitsPerSample = 0x0A; + +// Lexicon reference counter identifier +const TInt KLexiconReferenceCounter = 0x0B; + + +enum TNSSRecognitionMode +{ + ENSSSdMode, + ENSSSiMode, + ENSSSdSiMode +}; + +#endif // NSSSISPEECHRECOGNITIONDATACOMMON_H diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/common/inc/nsssispeechrecognitiondatadevasr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/common/inc/nsssispeechrecognitiondatadevasr.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1303 @@ +/* +* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains definition of the SISpeechRecognitionDataDevASR structure and API. +* +*/ + + + + + +#ifndef __SRSIDATA_DEVASR_H__ +#define __SRSIDATA_DEVASR_H__ + +// INCLUDES +#include + +// FORWARD DECLARATION +class CSILexicon; +class CSICompiledGrammar; + + +// CLASS DECLARATION + +/** +* Class to encapsulate a user defined parameters +* +* @lib nsssispeechrecognitiondata.lib +* @since 2.8 +*/ +class CSIParameters : public CBase + { + public: // Constructors and destructor + /** + * Destructor. + */ + IMPORT_C virtual ~CSIParameters(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CSIParameters* NewL(); + + IMPORT_C static CSIParameters* NewLC(); + public: // New functions + + /** + * Use to set an internal parameter. + * @since 2.8 + * @param aParameterIndex Parameter index + * @param aParameter Parameter value + * @return None. + */ + IMPORT_C virtual void SetParameterL( const TInt aParameterID, const TInt aParameterValue ); + + /** + * Use to retrieve an internal parameter. + * @since 2.8 + * @param aParameterIndex Parameter index + * @return Parameter value. + */ + IMPORT_C virtual TInt ParameterL( const TInt aParameterID ) const; + + /** + * Internalize to a data stream + * @since 2.8 + * @param aStream Data stream + * @return None + */ + IMPORT_C virtual void InternalizeL(RReadStream& aStream ); + + /** + * Externalize from a data stream + * @since 2.8 + * @param None + * @return aStream Data stream + */ + IMPORT_C virtual void ExternalizeL(RWriteStream& aStream ) const; + + /** + * Returns all set parameters and their values. + * @since 2.8 + * @param "RArray& aParameterIDs" This array will contain parameter IDs after call. + * @param "RArray& aParameterValues" This array will contain parameter values after call. + */ + IMPORT_C virtual void ListParametersL( RArray& aParameterIDs, RArray& aParameterValues ) const; + + protected: + IMPORT_C virtual void ConstructL(); + IMPORT_C CSIParameters(); + + private: + RArray iParameterIDs; + RArray iParameterValues; + }; + +/** +* Class to encapsulate a Speaker Independent Rule variant +* +* @lib nsssispeechRecognitionData.lib +* @since 2.8 +*/ +class CSIRuleVariant : public CSIParameters + { + public: // Constructors and destructor + /** + * Destructor. + */ + IMPORT_C virtual ~CSIRuleVariant(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CSIRuleVariant* NewL( const TSIRuleVariantID aRuleVariantID, + const TSILexiconID aLexiconID); + IMPORT_C static CSIRuleVariant* NewLC( const TSIRuleVariantID aRuleVariantID, + const TSILexiconID aLexiconID); + + public: // New functions + + /** + * Use to get the pronunciation Ids. + * @since 2.8 + * @param None. + * @return Pronunciation identifier. + */ + IMPORT_C virtual void GetPronunciationIDsL( TSIPronunciationIDSequence& aPronunciationIDs ) const; + + /** + * Use to set the pronunciation Ids. + * @since 2.8 + * @param Pronunciation identifier . + */ + IMPORT_C virtual void SetPronunciationIDsL( const TSIPronunciationIDSequence& aPronunciationIDs ); + + /** + * Get Language of the rule variant + * @since 2.8 + * @return Language of the rule variant + */ + IMPORT_C virtual TLanguage Language() const; + + /** + * Set Language of the rule variant + * @since 2.8 + * @param Language of the rule variant + * @return None + */ + IMPORT_C virtual void SetLanguage(TLanguage aLanguage); + + + /** + * Use to retrieve the lexicon Id. + * @since 2.8 + * @param None. + * @return Lexicon identifier. + */ + IMPORT_C virtual TSILexiconID LexiconID() const; + + /** + * Use to retrieve the rule variant Id. + * @since 2.8 + * @param None. + * @return Rule identifier. + */ + IMPORT_C virtual TSIRuleVariantID RuleVariantID() const; + + + + + protected: + IMPORT_C virtual void ConstructL(); + IMPORT_C CSIRuleVariant( const TSIRuleVariantID aRuleVariantID, + const TSILexiconID aLexiconID ); + + private: + TSIRuleVariantID iRuleVariantID; + TSIPronunciationIDSequence iPronunciationIDs; + TSILexiconID iLexiconID; + TLanguage iLanguage; + TInt* iParameterArray; + TInt iNParameters; + TAny* iReserved; + }; + +/** +* Class to encapsulate a Speaker Independent Rule +* +* @lib nsssispeechrecognitiondata.lib +* @since 2.8 +*/ +class CSIRule : public CBase + { + public:// Constructors and destructor + /** + * Destructor. + */ + IMPORT_C virtual ~CSIRule(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CSIRule* NewL( const TSIRuleID aRuleID ); + IMPORT_C static CSIRule* NewLC( const TSIRuleID aRuleID ); + + public: // New functions + /** + * Use to retrieve the rule Id. + * @since 2.8 + * @param None. + * @return Rule identifier. + */ + IMPORT_C virtual TSIRuleID RuleID() const; + /** + * Use to retrieve number of rule variants. + * @since 2.8 + * @param None. + * @return Number of rule variants. + */ + IMPORT_C virtual TInt Count() const; + + /** + * Use to retrieve the rule variant based on index. + * @since 2.8 + * @param aIndex Index of rule variant. + * @return Rule variant. + */ + IMPORT_C virtual CSIRuleVariant& AtL(TInt aIndex) const; + + + /** + * Use to add new rule variant. + * @since 2.8 + * @param aRuleVariant New rule variant. + * @return None. + */ + IMPORT_C virtual void AddL(CSIRuleVariant* aRuleVariant); + + /** + * Use to retrieve the rule variant index based on Id. + * @since 2.8 + * @param aRuleVariantID Identifier of rule variant. + * @return Rule variant. + */ + IMPORT_C virtual TInt Find(TSIRuleVariantID aRuleVariantID) const; + + + IMPORT_C virtual CSIRuleVariant& RuleVariantL(TSIRuleVariantID aRuleVariantID) const; + + /** + * Use to delete rule variant. + * @since 2.8 + * @param aRuleVariant Rule variant identifier. + * @return None. + */ + IMPORT_C virtual void DeleteL(TSIRuleVariantID aRuleVariantID); + + /** + * Compares two CSIRule objects. + * Returns 0 if rule ids are equal. + * Returns -1 if first id is smaller. + * Returns 1 if second id is smaller. + * + * @param "const CSIRule& aFirst" First rule to compare + * @param "const CSIRule& aSecond" Second rule to compare + * @return 0, -1 or 1 + */ + static TInt Compare( const CSIRule& aFirst, const CSIRule& aSecond ); + + protected: + IMPORT_C virtual void ConstructL(); + IMPORT_C CSIRule( const TSIRuleID aRuleID ); + + private: + TSIRuleID iRuleID; + RPointerArray iRuleVariantArray; + TAny* iReserved; + }; + + +/** +* Class to encapsulate a Speaker Independent Grammar +* A grammar consist of a list of rules +* +* @lib nsssispeechrecognitiondata.lib +* @since 2.8 +*/ +class CSIGrammar : public CBase + { + public:// Constructors and destructor + /** + * Destructor. + */ + IMPORT_C virtual ~CSIGrammar(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CSIGrammar* NewL(const TSIGrammarID aGrammarID); + IMPORT_C static CSIGrammar* NewLC(const TSIGrammarID aGrammarID); + + public: // New functions + + /** + * Use to add a rule to the grammar. + * @since 2.8 + * @param aRule - reference to CSIRule object. + * @return KErrNone, if the insertion is successful, otherwise one of the system wide error codes. + */ + IMPORT_C virtual void AddL(CSIRule* aRule); + + + /** + * Use to return a rule based at an index. + * @since 2.8 + * @param aIndex: an index. Value must not be negative and must not be greater than the number of rules currently in the grammar, otherwise it raises a USER-130 panic. + * @return Reference to CSIRule object. + */ + IMPORT_C virtual CSIRule& AtL(TInt aIndex) const; + + /** + * Use to delete a rule to the grammar. + * @since 2.8 + * @param aRuleID - rule identifier. + * @return None. + */ + IMPORT_C virtual void DeleteL(const TSIRuleID aRuleID); + + /** + * Use to get the number of rules in the grammar + * @since 2.8 + * @param None. + * @return Number of rules. + */ + IMPORT_C virtual TInt Count() const; + + /** + * Use to retrieve the grammar Id of the result. + * @since 2.8 + * @param None. + * @return Grammar identifier. + */ + IMPORT_C virtual TSIGrammarID GrammarID() const; + + /** + * Use to find a rule in the grammar based on rule Id. + * @since 2.8 + * @param aRuleID - rule identifier. + * @return The index of the first matching rule within the grammar. KErrNotFound, if no matching rule can be found. + */ + + IMPORT_C virtual TInt Find(const TSIRuleID aRuleID) const; + + IMPORT_C virtual CSIRule& RuleL(TSIRuleID aRuleID) const; + + /** + * Internalize to a data stream + * @since 2.8 + * @param aStream Data stream + * @return None + */ + IMPORT_C virtual void InternalizeL(RReadStream& aStream ); + + /** + * Externalize from a data stream + * @since 2.8 + * @param None + * @return aStream Data stream + */ + IMPORT_C virtual void ExternalizeL(RWriteStream& aStream ) const; + + protected: + + IMPORT_C virtual void ConstructL(); + IMPORT_C CSIGrammar(const TSIGrammarID aGrammarID); + + private: + TSIGrammarID iGrammarID; + RPointerArray iRuleArray; + TAny* iReserved; + }; + +/** +* Class to encapsulate a compiled grammar (ready for recognition) +* +* @lib nsssispeechrecognitiondata.lib +* @since 2.8 +*/ +class CSICompiledGrammar : public CSIGrammar + { + public:// Constructors and destructor + /** + * Destructor. + */ + IMPORT_C virtual ~CSICompiledGrammar(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CSICompiledGrammar* NewL(const TSIGrammarID aGrammarID); + + IMPORT_C static CSICompiledGrammar* NewLC(const TSIGrammarID aGrammarID); + public: // New functions + + + /** + * Use to delete a rule to the grammar. + * @since 2.8 + * @param aRuleID - rule identifier. + * @return None. + */ + IMPORT_C virtual void DeleteL(const TSIRuleID aRuleID); + /** + * Use to add a rule to the grammar. + * @since 2.8 + * @param aRule - reference to CSIRule object. + * @return KErrNone, if the insertion is successful, otherwise one of the system wide error codes. + */ + IMPORT_C virtual void AddL(CSIRule* aRule); + + + /** + * Use to retrieve the recognition data. + * @since 2.8 + * @param None. + * @return Reference to the recognition data. + */ + IMPORT_C virtual void SetCompiledData( HBufC8* aCompilerData); + + /** + * Function to get compiler data + * @since 2.8 + * @param None + * @return Pointer to data + */ + IMPORT_C virtual TDesC8& CompiledData() const; + + /** + * Internalize to a data stream + * @since 2.8 + * @param aStream Data stream + * @return None + */ + IMPORT_C virtual void InternalizeL(RReadStream& aStream ); + + /** + * Externalize from a data stream + * @since 2.8 + * @param None + * @return aStream Data stream + */ + IMPORT_C virtual void ExternalizeL(RWriteStream& aStream ) const; + + protected: + IMPORT_C virtual void ConstructL(); + + IMPORT_C CSICompiledGrammar(const TSIGrammarID aGrammarID); + + private: + // is compiled data valid + TBool iValidData; + + // data of grammar compiler + HBufC8* iGrammarCompilerData; + TAny* iReserved; + + protected: + + }; + +/** +* Class to define rule variant info +* +* @lib nsssispeechrecognitiondata.lib +* @since 2.8 +*/ +class TSIRuleVariantInfo + { + public: // Constructors and destructor + + /** + * C++ default constructor. + */ + IMPORT_C TSIRuleVariantInfo( const TSIGrammarID aGrammarID, + const TSIRuleID aRuleID, + const TSIRuleVariantID aRuleVariantID ); + + /** + * Destructor. + */ + IMPORT_C virtual ~TSIRuleVariantInfo(); + + public: // New functions + + /** + * Use to get Grammar ID + * @since 2.8 + * @return Identifier of Grammar + */ + IMPORT_C virtual TSIGrammarID GrammarID() const; + + + /** + * Use to get rule ID + * @since 2.8 + * @return Identifier of rule + */ + IMPORT_C virtual TSIRuleID RuleID() const; + + /** + * Use to get rule variant ID + * @since 2.8 + * @return Identifier of rule variant + */ + IMPORT_C virtual TSIRuleVariantID RuleVariantID() const; + + protected: // Data + + + // rule identifier + const TSIGrammarID iGrammarID; + // rule identifier + const TSIRuleID iRuleID; + + // rule variant identifier + const TSIRuleVariantID iRuleVariantID; + + }; + +/** +* Class to encapsulate a Speaker Independent Pronunciation +* +* @lib nsssispeechrecognitiondata.lib +* @since 2.8 +*/ +class CSIPronunciation : public CSIParameters + { + public:// Constructors and destructor + /** + * Destructor. + */ + IMPORT_C virtual ~CSIPronunciation(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CSIPronunciation* NewL(const TSIPronunciationID aPronunciationID, + const TSIModelBankID aModelBankID ); + IMPORT_C static CSIPronunciation* NewLC(const TSIPronunciationID aPronunciationID, + const TSIModelBankID aModelBankID ); + + public: // New functions + /** + * Use to retrieve the model bank Id of the model bank. + * @since 2.8 + * @param None. + * @return Model bank identifier. + */ + IMPORT_C virtual TSIModelBankID ModelBankID() const; + /** + * Use to set the pronunciation Id of this lexicon entry. + * @since 2.8 + * @param Pronunciation identifier. + * @return None. + */ + IMPORT_C virtual void SetPronunciationID(TSIPronunciationID aPronunciationID); + + + /** + * Use to retrieve the pronunciation Id of this lexicon entry. + * @since 2.8 + * @param None. + * @return Pronunciation identifier. + */ + IMPORT_C virtual TSIPronunciationID PronunciationID() const; + /** + * Use to set phoneme sequence. + * @since 2.8 + * @param aPhonemeSequence Phoneme sequence. + * @return None. + */ + IMPORT_C virtual void SetPhonemeSequenceL( const TDesC8& aPhonemeSequence ); + + + /** + * Use to retrieve the phoneme sequence. + * @since 2.8 + * @param None. + * @return Phoneme sequence. + */ + IMPORT_C virtual const TDesC8& PhonemeSequence() const; + + /** + * Compares two CSIPronunciation objects. + * Returns 0 if prununciation ids are equal. + * Returns -1 if first id is smaller. + * Returns 1 if second id is smaller. + * + * @param "const CSIPronunciation& aFirst" First pronunciation to compare + * @param "const CSIPronunciation& aSecond" Second pronunciation to compare + * @return 0, -1 or 1 + */ + static TInt Compare( const CSIPronunciation& aFirst, const CSIPronunciation& aSecond ); + + /** + * Compares two CSIPronunciation objects. + * Returns 0 if phoneme sequences are equal. + * Returns -1 if first phoneme sequence is smaller. + * Returns 1 if second phoneme sequence is smaller. + * + * @param "const CSIPronunciation& aFirst" First pronunciation to compare + * @param "const CSIPronunciation& aSecond" Second pronunciation to compare + * @return 0, -1 or 1 + */ + static TInt ComparePhonemes( const CSIPronunciation& aFirst, const CSIPronunciation& aSecond ); + + + protected: + IMPORT_C virtual void ConstructL(); + IMPORT_C CSIPronunciation(const TSIPronunciationID aPronunciationID, + const TSIModelBankID aModelBankID ); + + private: + TSIPronunciationID iPronunciationID; + TSIModelBankID iModelBankID; + HBufC8* iPhonemeSequence; + TAny* iReserved; + }; + + +/** +* Class to encapsulate a Speaker Independent Lexicon +* +* @lib nsssispeechrecognitiondata.lib +* @since 2.8 +*/ +class CSILexicon : public CBase + { + public:// Constructors and destructor + + /** + * Destructor. + */ + IMPORT_C virtual ~CSILexicon(); + + /** + * Two-phased constructor. + * @param aLexiconID Lexicon ID + * @return Created instance + */ + IMPORT_C static CSILexicon* NewL( const TSILexiconID aLexiconID ); + IMPORT_C static CSILexicon* NewLC( const TSILexiconID aLexiconID ); + + public: // New functions + + /** + * Use to add a lexicon entry to the lexicon. + * Leaves with KErrNoMemory if maximal allowed amount of pronunciations + * is already stored in this lexicon + * @since 2.8 + * @param aPronunciation pointer to CSIPronunciation object. + */ + IMPORT_C virtual void AddL( CSIPronunciation* aPronunciation ); + + /** + * Use to return a pronunciation based at an index. + * @since 2.8 + * @param aIndex Value must not be negative and must not be greater than + * the number of pronunciations currently in the lexicon. + * @return Reference to CSIPronunciation object. + */ + IMPORT_C virtual CSIPronunciation& AtL( TInt aIndex ) const; + + /** + * Deletes a pronunciation based on identifier. + * @since 2.8 + * @param aPronunciationID pronunciation variant identifier. + */ + IMPORT_C virtual void DeleteL( TSIPronunciationID aPronunciationID ); + + /** + * Use to find a pronunciation based on pronunciation Id. + * @since 2.8 + * @param aPronunciationID: pronunciation identifier. + * @return The index of the first matching pronunciation within the lexicon. + * KErrNotFound, if no matching pronunciation can be found. + */ + IMPORT_C virtual TInt Find( const TSIPronunciationID aPronunciationID ) const; + + /** + * Use to find a pronunciation based on phoneme sequence. + * @since 2.8 + * @param aPronunciation: phoneme sequence. + * @return The index of the first matching pronunciation within the lexicon. + * KErrNotFound, if no matching pronunciation can be found. + */ + IMPORT_C virtual TInt Find( const TDesC8& aPhonemeSequence ) const; + + /** + * Use to count the number of lexicon entries in the lexicon. + * @since 2.8 + * @return Number of pronunciations. + */ + IMPORT_C virtual TInt Count() const; + + /** + * Use to retrieve the model bank Id of the model bank. + * @since 2.8 + * @return Model bank identifier. + */ + IMPORT_C virtual TSILexiconID LexiconID() const; + + /** + * Internalize to a data stream + * @since 2.8 + * @param aStream Data stream + */ + IMPORT_C virtual void InternalizeL( RReadStream& aStream ); + + /** + * Externalize from a data stream + * @since 2.8 + * @param aStream Data stream + */ + IMPORT_C virtual void ExternalizeL( RWriteStream& aStream ) const; + + protected: + IMPORT_C void ConstructL(); + IMPORT_C CSILexicon( const TSILexiconID aLexiconID ); + + private: + + /** + * Utility function to add pronunciation to the end of ID-ordered array + * + * @param "CSIPronunciation* aPronunciation" Pronunciation which should be added. + */ + void AddPronunciationToEndL( CSIPronunciation* aPronunciation ); + + private: + // ID of the lexicon + TSILexiconID iLexiconID; + // Pronunciations in the order of IDs + RPointerArray iPronunciationArray; + // Pronunciations in the order of the phoneme sequence + RPointerArray iPronunOrder; + // For future extensions + TAny* iReserved; + }; + + +/** +* Class to encapsulate a Speaker Independent Model +* +* @lib nsssispeechrecognitiondata.lib +* @since 2.8 +*/ +class CSIModel : public CSIParameters + { + public:// Constructors and destructor + /** + * Destructor. + */ + IMPORT_C virtual ~CSIModel(); + + /** + * Two-phased constructors. + */ + //IMPORT_C static CSIModel* NewL(); + //IMPORT_C static CSIModel* NewLC(); + IMPORT_C static CSIModel* NewL( const TSIModelID aModelID ); + IMPORT_C static CSIModel* NewLC( const TSIModelID aModelID ); + + public: // New functions + /** + * Use to set the phoneme Id of this model. + * @since 2.8 + * @param aModelID: phoneme identifier. + * @return None. + */ + IMPORT_C virtual void SetModelID( const TSIModelID aModelID); + + /** + * Use to retreive the phoneme Id of this model. + * @since 2.8 + * @param None. + * @return Phoneme identifier. + */ + IMPORT_C virtual TSIModelID ModelID() const; + + /** + * Use to get a pointer to the acoustic model of this model. + * @since 2.8 + * @param None. + * @return A descriptor to the acoustic model data. + */ + IMPORT_C virtual TDesC8& AcousticModel() const; + + /** + * Use to set the acoustic model of the model. + * @since 2.8 + * @param aAcousticModel: pointer descriptor containing the acoustic model (binary). + * @return None. + */ + IMPORT_C virtual void SetAcousticModel( HBufC8* aAcousticModel ); + + + protected: + IMPORT_C virtual void ConstructL(); + IMPORT_C CSIModel( ); + IMPORT_C CSIModel( const TSIModelID aModelID ); + + private: + TSIModelID iModelID; + HBufC8* iAcousticModel; + TAny* iReserved; + }; + +/** +* Class to encapsulate a Speaker Independent Model Bank +* +* @lib nsssispeechrecognitiondata.lib +* @since 2.8 +*/ +class CSIModelBank : public CBase + { + public:// Constructors and destructor + /** + * Destructor. + */ + IMPORT_C virtual ~CSIModelBank(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CSIModelBank* NewL(const TSIModelBankID aModelBankID); + IMPORT_C static CSIModelBank* NewLC(const TSIModelBankID aModelBankID); + + public: // New functions + + + + /** + * Use to add a model to the model bank. + * @since 2.8 + * @param aModel: reference to CSIModel object. + * @return None + */ + IMPORT_C virtual void AddL(const CSIModel* aModel); + + /** + * Use to return a model at the given index. + * @since 2.8 + * @param Reference to CSIModel object. + * @return None + */ + IMPORT_C virtual CSIModel& AtL(TInt aIndex) const; + + /** + * Deletes a model from model bank. + * @since 2.8 + * @param ID of the model + * @return None + */ + IMPORT_C virtual void DeleteL(TSIModelID aModelID); + + /** + * Use to find a model based on phoneme Id. + * @since 2.8 + * @param None. + * @return Index of the first matching model within the model bank. KErrNotFound, if no matching model can be found.. + */ + IMPORT_C virtual TInt Find(TSIModelID aModelID) const; + + /** + * Use to retreive the number of models in the model bank. + * @since 2.8 + * @param None. + * @return Number of models in the model bank. + */ + IMPORT_C virtual TInt Count() const; + + /** + * Use to return the model bank Id of the model bank. + * @since 2.8 + * @param None. + * @return Model bank identifier. + */ + IMPORT_C virtual TSIModelBankID ModelBankID() const; + + protected: + IMPORT_C virtual void ConstructL(); + IMPORT_C CSIModelBank(const TSIModelBankID aModelBankID); + + private: + TSIModelBankID iModelBankID; + RPointerArray iModelArray; + TAny* iReserved; + }; + +/** +* Class to define pronunciation type. +* +* @lib nsssispeechrecognitiondata.lib +* @since 2.8 +*/ +class CSIPronunciationInfo : public CSIParameters + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CSIPronunciationInfo* NewL(RPointerArray aPronunciationArray, + TLanguage aLanguage ); + IMPORT_C static CSIPronunciationInfo* NewLC(RPointerArray aPronunciationArray, + TLanguage aLanguage ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CSIPronunciationInfo(); + + public: // New functions + + /** + * Use to get phoneme sequence data + * @since 2.8 + * @return Phoneme sequence + */ + IMPORT_C virtual TDesC8& PronunciationL(TInt aIndex) const; + + /** + * Use to set phoneme sequence data + * @since 2.8 + * @return Phoneme sequence + */ + + IMPORT_C virtual void SetPronunciationL( TInt aIndex, HBufC8* aPronunciation); + + IMPORT_C virtual TLanguage Language() const; + + IMPORT_C virtual TInt Count() const; + + + protected: + IMPORT_C virtual void ConstructL(); + IMPORT_C CSIPronunciationInfo( RPointerArray aPronunciationArray,TLanguage aLanguage); + + private: // Data + + // phoneme sequence + //HBufC8* iPronunciation; + RPointerArray iPronunciationArray; + + TLanguage iLanguage; + TAny* iReserved; + }; + +/** +* Class to define word list. The list is used as input parameter for TTP. +* +* @lib SiSpeechRecognitionData.lib +* @since 2.8 +*/ +class CSITtpWordList : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CSITtpWordList* NewL(); + IMPORT_C static CSITtpWordList* NewLC(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CSITtpWordList(); + + public: // New functions + + /** + * Use to add a new word + * @since 2.8 + * @param aWord Word to be added + */ + IMPORT_C virtual void AddL( MDesCArray* aWords ); + + /** + * Use to get number of words + * @since 2.8 + * @return number of words + */ + IMPORT_C virtual TInt Count() const; + + /** + * Use to return word at an index + * @since 2.8 + * @param aIndex Index of word + * @return reference to word sequence + */ + IMPORT_C virtual MDesCArray& AtL( const TInt aIndex ) const; + + + /** + * Use to delete word at an index + * @since 2.8 + * @param aIndex Index of word + * @return None + */ + IMPORT_C virtual void DeleteL(TInt aIndex); + + + + /** + * Use to set pronunciation for a word + * @since 2.8 + * @param aIndex Index of word seqence + * @param aPronunciation Pronunciation to be added + */ + IMPORT_C virtual void AppendPronunciationL(TInt aIndex, + CSIPronunciationInfo* aPronunciation); + + + /** + * Use to get pronunciations for a word + * @since 2.8 + * @param aIndex Index of word sequence + * @param aPronunciations Array where to put pronunciations + */ + IMPORT_C virtual void GetPronunciationsL( const TInt aIndex, + RPointerArray& aPronunciations ) const; + + protected: + + /** + * C++ default constructor. + */ + IMPORT_C CSITtpWordList(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + IMPORT_C void ConstructL(); + + private: // Data + + // word array + // RArray iWordArray; + RPointerArray iWordArray; + // index array for pronunciations + RArray iIndexArray; + // pronunciation array + RPointerArray iPronunciationArray; + + // Reserved pointer for future extension + TAny* iReserved; + }; + +/** +* Class to encapsulate a Recognition Result +* +* @lib nsssispeechrecognitiondata.lib +* @since 2.8 +*/ +class CSIResult : public CSIParameters + { + public:// Constructors and destructor + /** + * Destructor. + */ + IMPORT_C virtual ~CSIResult(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CSIResult* NewL(); + IMPORT_C static CSIResult* NewLC(); + + public: // New functions + /** + * Use to set the grammar Id on the result. + * @since 2.8 + * @param aGrammarID - grammar identifier. + * @return None. + */ + IMPORT_C virtual void SetGrammarID(const TSIGrammarID aGrammarID); + + /** + * Use to retrieve the grammar Id of the result. + * @since 2.8 + * @param None. + * @return Grammar identifier. + */ + IMPORT_C virtual TSIGrammarID GrammarID() const; + + /** + * Use to set the rule Id of the result. + * @since 2.8 + * @param aRuleID - rule identifier. + * @return None. + */ + IMPORT_C virtual void SetRuleID(const TSIRuleID aRuleID); + + /** + * Use to retrieve the rule Id of the result. + * @since 2.8 + * @param None. + * @return Rule identifier. + */ + IMPORT_C virtual TSIRuleID RuleID() const; + + /** + * Use to set the rule variant Id of the result. + * @since 2.8 + * @param aRuleID - rule variant identifier. + * @return None. + */ + IMPORT_C virtual void SetRuleVariantID(const TSIRuleVariantID aRuleVariantID); + + /** + * Use to retrieve the rule variant Id of the result. + * @since 2.8 + * @param None. + * @return Rule variant identifier. + */ + IMPORT_C virtual TSIRuleVariantID RuleVariantID() const; + + /** + * Use to set the score for this result. + * @since 2.8 + * @param aScore: score of this result. + * @return None. + */ + IMPORT_C virtual void SetScore(const TInt32 aScore); + + /** + * Use to retreive the score of this result. + * @since 2.8 + * @param None. + * @return Score of this result. + */ + IMPORT_C virtual TInt32 Score() const; + + /** + * Sets the pronunciation information needed for speaker adaptation and playback. + * @since 2.8 + * @param aSIPronunciationInfo Pronunciation information, needed for speaker adaptation and playback + * @return None. + */ + IMPORT_C virtual void SetPronunciation( CSIPronunciation* aSIPronunciation); + + /** + * Gets the pronunciation information needed for speaker adaptation and playback. + * @since 2.8 + * @param None + * @return aSIPronunciationInfo Pronunciation information, needed for speaker adaptation and playback + */ + IMPORT_C virtual CSIPronunciation& Pronunciation() const ; + protected: + IMPORT_C virtual void ConstructL(); + IMPORT_C CSIResult(); + + private: + TSIGrammarID iGrammarID; + TSIRuleID iRuleID; + TSIRuleVariantID iRuleVariantID; + TInt32 iScore; + CSIPronunciation* iSIPronunciation; + TAny* iReserved; + }; + + +/** +* Class to encapsulate a a set of Recognition Result +* +* @lib nsssispeechrecognitiondata.lib +* @since 2.8 +*/ +class CSIResultSet : public CBase + { + public:// Constructors and destructor + /** + * Destructor. + */ + IMPORT_C virtual ~CSIResultSet(); + /** + * Two-phased constructor. + */ + IMPORT_C static CSIResultSet* NewL(); + IMPORT_C static CSIResultSet* NewLC(); + + public: // New functions + /** + * Use to add a result to the rule set. + * @since 2.8 + * @param aResult - reference to the result object to be added. + * @return KErrNone, if the insertion is successful, otherwise one of the system wide error codes. + */ + IMPORT_C virtual void AddL( const CSIResult* aResult); + + /** + * Use to return a result at a given index within the result set. + * @since 2.8 + * @param aIndex - index in the result set. + * @return A reference to CSIResult object. + */ + IMPORT_C virtual CSIResult& AtL(const TInt aIndex); + + /** + * Use to return a result at a given index within the result set. + * @since 2.8 + * @param aIndex - index in the result set. + * @return A constant reference to CSIResult object. + */ + IMPORT_C virtual const CSIResult& AtL(const TInt aIndex) const; + + /** + * Use to retreive the number of result in the result set. + * @since 2.8 + * @param None. + * @return Number of results in the result set. + */ + IMPORT_C virtual TInt Count() const; + + + /** + * Delete a result in the result set. + * @since 2.8 + * @param index of a result + * @return None + */ + IMPORT_C virtual void DeleteL(TInt aIndex); + + /** + * Sets the data needed for speaker adaptation. CSIResultSet takes ownership of the data. + * @since 2.8 + * @param Adaptation data + * @return None + */ + IMPORT_C virtual void SetAdaptationData( HBufC8* aAdaptationData ); + + + /** + * Gets the data needed for speaker adaptation. CSIResultSet takes ownership of the data. + * @since 2.8 + * @param None + * @return Adaptation data + */ + IMPORT_C virtual TDesC8& AdaptationData(); + + /** + * Stores the object to the stream. + * @since 2.8 + * @param aWriteStream The stream to write to. + * @return None + */ + IMPORT_C virtual void ExternalizeL( RWriteStream& aWriteStream ) const; + + /** + * Resurrects an object from the stream. + * @since 2.8 + * @param aReadStream The stream to read from. + * @return None + */ + IMPORT_C virtual void InternalizeL( RReadStream& aReadStream ); + + private: + /** + * By default Symbian 2nd phase constructor is private. + */ + IMPORT_C virtual void ConstructL(); + + /** + * C++ constructor + */ + IMPORT_C CSIResultSet(); + + private: + // The results + RPointerArray iResultArray; + + // Speaker adaptation data + HBufC8* iAdaptationData; + + // Reserved for future extensions + TAny* iReserved; + }; + +#endif + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/common/inc/nssttscommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/common/inc/nssttscommon.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,437 @@ +/* +* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Data type defininitions for TTS +* %version: 13 % +* +* Copyright © 2004-2006 Nokia Corporation. +*/ + + + + + +#ifndef TTSCOMMON_H +#define TTSCOMMON_H + +// INCLUDES +#include +#include + +// CONSTANTS +// Undefined synthesizing language. The default language of TTS processor will be used. +const TLanguage KTtsUndefinedLanguage( ELangOther ); + +// Undefined duration of segment. The duration will be defined using other properties. +const TInt32 KTtsUndefinedDuration( -1 ); + +// Undefined rate +const TInt KTtsRateUndefined( -1 ); + +// Default volume, which is maximum volume (100%). +const TInt KTtsDefaultVolume( 100 ); + +// Max length of voice name +const TInt KVoiceNameMaxLength( 50 ); + +// Maximum speaking rate +const TInt KTtsMaxSpeakingRate( 100 ); + +// +_LIT( KDefaultVoiceNameMale, "DefaultMale" ); +_LIT( KDefaultVoiceNameFemale, "DefaultFemale" ); + +// DATA TYPES + +// Style identifier +typedef TUint32 TTtsStyleID; + +// Voice identifier +typedef TBuf TTtsVoice; + +// Preferred quality of TTS output +enum TTtsQuality + { + ETtsQualityLowOnly, // Low quality + ETtsQualityHighOnly, // High quality + ETtsQualityHighPreferred, // High quality preferred, low quality fall back can be used + ETtsQualityLowPreferred, // Low quality preferred + ETtsQualityUndefined // Default quality will be used + }; + +// Custom command ids for CTtsUtility::CustomCommand(As|S)ync() +enum TTtsCustomCommandId + { + ETtsCustomCommandSetAudioOutput = 0, // For setting audio output routing + ETtsCustomCommandSetPluginParameter = 1, // For setting plugin parameter + }; + +// FORWARD DECLARATIONS +class CTtsParsedTextBody; + +// CLASS DECLARATION + +/** +* Class to encapsulate speaking style +* +* @lib nssttscommon.lib +* @since 2.8 +*/ +class TTtsStyle + { + public: // Constructor and destructor + + /** + * C++ default constructor. + */ + IMPORT_C TTtsStyle(); + + public: // Data + + // Synthesizing language + TLanguage iLanguage; + + // Voice identifier + TTtsVoice iVoice; + + // Speaking rate in words-per-minute. See TTtsRate. + TInt iRate; + + // Volume scale in percentages. The range is 0..100. + // Zero means silent and 100 maximum volume. + TInt iVolume; + + // Sampling rate + TInt iSamplingRate; + + // TTS quality (preferred or exclusive) + TTtsQuality iQuality; + + // Desired time to take to read the segment in microseconds + TTimeIntervalMicroSeconds32 iDuration; + + // Natural languagege processing on/off + TBool iNlp; + + }; + +/** +* Class to store segment information +* +* @lib nssttscommon.lib +* @since 2.8 +*/ +class TTtsSegment + { + public: // Constructors and destructor + + /** + * C++ default constructor. + * @since 2.8 + * @param aStyleID Indentifier of style. + * @param aText Text for segment + * @param aPhonemeSequence Corresponding phoneme sequence for text + * @param aTrailingSilenceDuration The duration of trailing silence. + */ + IMPORT_C TTtsSegment( const TTtsStyleID aStyleID, + const TDesC& aText = KNullDesC, + const TDesC8& aPhonemeSequence = KNullDesC8, + const TTimeIntervalMicroSeconds32& aTrailingSilenceDuration = KTtsUndefinedDuration ); + + public: // New functions + + /** + * Sets duration of trailing silence. + * @since 2.8 + * @param aDuration Duration of silence. + * @return None + */ + IMPORT_C void SetTrailingSilenceL( const TTimeIntervalMicroSeconds32& aDuration ); + + /** + * Sets phoneme sequence pointer. The phoneme sequence cannot be deleted + * during the life time of this object. + * @since 2.8 + * @param aPhonemeSequence Phoneme sequence. + * @return None + */ + IMPORT_C void SetPhonemeSequencePtr( const TDesC8& aPhonemeSequence ); + + /** + * Returns phoneme sequence pointer of the segment. + * @since 2.8 + * @param None + * @return Pointer to phoneme sequence + */ + IMPORT_C const TDesC8& PhonemeSequencePtr() const; + + /** + * Sets text pointer. The text cannot be deleted + * during the life time of this object. + * @since 2.8 + * @param aText Text. + * @return None + */ + IMPORT_C void SetTextPtr( const TDesC& aText ); + + /** + * Returns text pointer of the segment. + * @since 2.8 + * @param None + * @return Pointer to text. + */ + IMPORT_C const TDesC& TextPtr() const; + + /** + * Gets duration of trailing silence. + * @since 2.8 + * @param None + * @return Duration of silence. + */ + IMPORT_C const TTimeIntervalMicroSeconds32& TrailingSilence() const; + + /** + * Sets style for segment. The style cannot be deleted + * during this object life time. + * @since 2.8 + * @param aStyleID The identifier of the style. + * @return None + */ + IMPORT_C void SetStyleID( TTtsStyleID aStyleID ); + + /** + * Returns identifier of used style. + * @since 2.8 + * @param None + * @return Identifier of style. + */ + IMPORT_C TTtsStyleID StyleID() const; + + /** + * Sets style object for segment. + * + * @since 3.1 + * @param aStyle Style reference. + */ + IMPORT_C void SetStyle( TTtsStyle& aStyle ); + + /** + * Returns style object. + * + * @since 3.1 + * @return Reference to style. + */ + IMPORT_C TTtsStyle& StyleL(); + + /** + * Resets previously set style and segment will use the style ID. + * + * @since 3.1 + */ + IMPORT_C void ResetStyle(); + + private: // Data + + // Style identifier for segment + TTtsStyleID iStyleID; + + // Pointer to text associated for segment + TPtrC iText; + + // Pointer to phoneme sequence associated for segment + TPtrC8 iPhonemeSequence; + + // Duration of trailing silence + TTimeIntervalMicroSeconds32 iTrailingSilenceDuration; + + // Style assigned directly to segment + TTtsStyle iStyle; + + // On if style is directly assigned to the segment + TBool iIncludesStyle; + }; + +/** +* Class to define functions for TTS segment stream. +* Using the class, a client can implement similar classes to CParsedText. +* +* @lib nssttscommon.lib +* @since 2.8 +*/ +class MTtsSegmentStream + { + public: // New functions + + /** + * Returns used phoneme notation of the stream. + * @since 2.8 + * @return Descriptor of used phoneme notation. + */ + virtual TDesC& MTtsPhonemeNotation() = 0; + + /** + * Returns the next segment in the stream. + * @since 2.8 + * @param aSegment The requested segment. + * @return System wide error code. KErrNone if success. + * KErrUnderflow if there is no available segment. + */ + virtual TInt MTtsReceiveSegment( TTtsSegment& aSegment ) = 0; + + /** + * Notifies that the segment has been processed and it can be released. + * @since 2.8 + * @param aSegment The processed segment. + */ + virtual void MTtsSegmentDone( TTtsSegment& aSegment ) = 0; + + }; + +/** +* Class to store parsed text for TTS. +* +* @lib nssttscommon.lib +* @since 2.8 +*/ +class CTtsParsedText : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @since 2.8 + * @param aText Text to be parsed. + * @param aPhonemeSequence Corresponding phoneme sequence. + * If the sequence is not given, it will be determined automatically. + * @param aPhonemeNotation Identifier of phoneme notation. + * If the descriptor is empty, the TTS engine will use default notation. + * @return Created instance of CTtsParsedText + */ + IMPORT_C static CTtsParsedText* NewL( const TDesC& aText = KNullDesC, + const TDesC8& aPhonemeSequence = KNullDesC8, + const TDesC& aPhonemeNotation = KNullDesC ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CTtsParsedText(); + + public: // New functions + + /** + * Adds new segment and takes its ownership. + * @since 2.8 + * @param aSegment A new segment. + * @param aIndex Index where to add segment. If index is equal or larger + * than NumberOfSegments(), the segment will be added into end. + */ + IMPORT_C void AddSegmentL( const TTtsSegment& aSegment, TInt aIndex = KMaxTInt ); + + /** + * Deletes a segment + * @since 2.8 + * @param aIndex The index of segment to be deleted. The index must be 0..NumberOfSegments()-1. + */ + IMPORT_C void DeleteSegmentL( TInt aIndex ); + + /** + * Checks that the internal structure is valid. + * @since 2.8 + * @return ETrue if valid and EFalse if invalid. + */ + IMPORT_C TBool IsValid() const; + + /** + * Returns the number of segments. + * @since 2.8 + * @return The number of segments + */ + IMPORT_C TInt NumberOfSegments() const; + + /** + * Returns phoneme notation definition. + * @since 2.8 + * @return Notation descriptor. KNullDesC8 if none. + */ + IMPORT_C const TDesC& PhonemeNotation() const; + + /** + * Returns phoneme sequence. + * @since 2.8 + * @return Phoneme sequence. KNullDesC8 if none. + */ + IMPORT_C const TDesC8& PhonemeSequence() const; + + /** + * Returns segment from given index + * @since 2.8 + * @param aIndex The index of segment to be returned. The index must be 0..NumberOfSegments()-1. + * @return Requested segment. + */ + IMPORT_C const TTtsSegment& SegmentL( TInt aIndex ) const; + + /** + * Sets a phoneme notation. The descriptor is copied and can be released after the function call. + * @since 2.8 + * @param aPhonemeNotation Phoneme notation. + */ + IMPORT_C void SetPhonemeNotationL( const TDesC& aPhonemeNotation ); + + /** + * Sets a phoneme sequence. The descriptor is copied and can be released after the function call. + * @since 2.8 + * @param aPhonemeSequence Phoneme sequence. + */ + IMPORT_C void SetPhonemeSequenceL( const TDesC8& aPhonemeSequence ); + + /** + * Sets a text. The descriptor is copied and can be released after the function call. + * @since 2.8 + * @param aText Text. + */ + IMPORT_C void SetTextL( const TDesC& aText ); + + /** + * Returns text. + * @since 2.8 + * @return Text. KNullDesC8 if none. + */ + IMPORT_C const TDesC& Text() const; + + private: + + /** + * C++ default constructor. + */ + CTtsParsedText(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( const TDesC& aText, + const TDesC8& aPhonemeSequence, + const TDesC& aPhonemeNotation ); + + + private: // Data + + // Implementation for the class + CTtsParsedTextBody* iBody; + + // Reserved pointer for future extension + TAny* iReserved; + + }; +#endif // TTSCOMMON_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/common/src/asrshwdevice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/common/src/asrshwdevice.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware device base class +* +*/ + + + + + + +// INCLUDE FILES +#include "asrshwdevice.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CASRSHwDevice::CASRSHwDevice +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CASRSHwDevice::CASRSHwDevice() + { + } + +// ----------------------------------------------------------------------------- +// CASRSHwDevice::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CASRSHwDevice::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CASRSHwDevice::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CASRSHwDevice* CASRSHwDevice::NewL() + { + CASRSHwDevice* self = new( ELeave ) CASRSHwDevice; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CASRSHwDevice::~CASRSHwDevice +// Destructor +// ----------------------------------------------------------------------------- +// +EXPORT_C CASRSHwDevice::~CASRSHwDevice() + { + + } + +// ----------------------------------------------------------------------------- +// CASRSHwDevice::InitializeL() +// do nothing +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSHwDevice::InitializeL() + { + // nothing + } + +// ----------------------------------------------------------------------------- +// CASRSHwDevice::Clear() +// do nothing +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSHwDevice::Clear() + { + // nothing + } + +// ----------------------------------------------------------------------------- +// CASRSHwDevice::CustomInterface() +// return empty interface +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TAny* CASRSHwDevice::CustomInterface( TUid /*aInterfaceId*/ ) + { + return NULL; + } + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/grcompilerhwdevice/bwins/asrsgrcompilerhwdeviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/grcompilerhwdevice/bwins/asrsgrcompilerhwdeviceu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,17 @@ +EXPORTS + ??1CASRSGrCompilerHwDevice@@UAE@XZ @ 1 NONAME ; public: virtual __thiscall CASRSGrCompilerHwDevice::~CASRSGrCompilerHwDevice(void) + ??1CASRSHwDevice@@UAE@XZ @ 2 NONAME ; public: virtual __thiscall CASRSHwDevice::~CASRSHwDevice(void) + ?CancelCombination@CASRSGrCompilerHwDevice@@QAEXXZ @ 3 NONAME ; public: void __thiscall CASRSGrCompilerHwDevice::CancelCombination(void) + ?CancelCompilation@CASRSGrCompilerHwDevice@@QAEXXZ @ 4 NONAME ; public: void __thiscall CASRSGrCompilerHwDevice::CancelCompilation(void) + ?Clear@CASRSHwDevice@@UAEXXZ @ 5 NONAME ; public: virtual void __thiscall CASRSHwDevice::Clear(void) + ?ClearL@CASRSGrCompilerHwDevice@@QAEXXZ @ 6 NONAME ; public: void __thiscall CASRSGrCompilerHwDevice::ClearL(void) + ?CombineGrammarL@CASRSGrCompilerHwDevice@@QAEXABV?$RPointerArray@VCSICompiledGrammar@@@@ABV?$RPointerArray@VTSIRuleVariantInfo@@@@@Z @ 7 NONAME ; public: void __thiscall CASRSGrCompilerHwDevice::CombineGrammarL(class RPointerArray const &,class RPointerArray const &) + ?CompileGrammarL@CASRSGrCompilerHwDevice@@QAEXAAVCSICompiledGrammar@@@Z @ 8 NONAME ; public: void __thiscall CASRSGrCompilerHwDevice::CompileGrammarL(class CSICompiledGrammar &) + ?CustomInterface@CASRSGrCompilerHwDevice@@UAEPAXVTUid@@@Z @ 9 NONAME ; public: virtual void * __thiscall CASRSGrCompilerHwDevice::CustomInterface(class TUid) + ?CustomInterface@CASRSHwDevice@@UAEPAXVTUid@@@Z @ 10 NONAME ; public: virtual void * __thiscall CASRSHwDevice::CustomInterface(class TUid) + ?InitializeL@CASRSGrCompilerHwDevice@@UAEXXZ @ 11 NONAME ; public: virtual void __thiscall CASRSGrCompilerHwDevice::InitializeL(void) + ?InitializeL@CASRSHwDevice@@UAEXXZ @ 12 NONAME ; public: virtual void __thiscall CASRSHwDevice::InitializeL(void) + ?NewL@CASRSGrCompilerHwDevice@@SAPAV1@AAVMASRSGrCompilerHwDeviceObserver@@@Z @ 13 NONAME ; public: static class CASRSGrCompilerHwDevice * __cdecl CASRSGrCompilerHwDevice::NewL(class MASRSGrCompilerHwDeviceObserver &) + ?NewL@CASRSHwDevice@@SAPAV1@XZ @ 14 NONAME ; public: static class CASRSHwDevice * __cdecl CASRSHwDevice::NewL(void) + ?ResolveResult@CASRSGrCompilerHwDevice@@QBEXABV?$RArray@I@@AAVCSIResultSet@@ABV?$RPointerArray@VCSICompiledGrammar@@@@ABVTDesC8@@@Z @ 15 NONAME ; public: void __thiscall CASRSGrCompilerHwDevice::ResolveResult(class RArray const &,class CSIResultSet &,class RPointerArray const &,class TDesC8 const &)const + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/grcompilerhwdevice/eabi/asrsgrcompilerhwdeviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/grcompilerhwdevice/eabi/asrsgrcompilerhwdeviceu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,24 @@ +EXPORTS + _ZN13CASRSHwDevice11InitializeLEv @ 1 NONAME + _ZN13CASRSHwDevice15CustomInterfaceE4TUid @ 2 NONAME + _ZN13CASRSHwDevice4NewLEv @ 3 NONAME + _ZN13CASRSHwDevice5ClearEv @ 4 NONAME + _ZN13CASRSHwDeviceD0Ev @ 5 NONAME + _ZN13CASRSHwDeviceD1Ev @ 6 NONAME + _ZN13CASRSHwDeviceD2Ev @ 7 NONAME + _ZN23CASRSGrCompilerHwDevice11InitializeLEv @ 8 NONAME + _ZN23CASRSGrCompilerHwDevice15CombineGrammarLERK13RPointerArrayI18CSICompiledGrammarERKS0_I18TSIRuleVariantInfoE @ 9 NONAME + _ZN23CASRSGrCompilerHwDevice15CompileGrammarLER18CSICompiledGrammar @ 10 NONAME + _ZN23CASRSGrCompilerHwDevice15CustomInterfaceE4TUid @ 11 NONAME + _ZN23CASRSGrCompilerHwDevice17CancelCombinationEv @ 12 NONAME + _ZN23CASRSGrCompilerHwDevice17CancelCompilationEv @ 13 NONAME + _ZN23CASRSGrCompilerHwDevice4NewLER31MASRSGrCompilerHwDeviceObserver @ 14 NONAME + _ZN23CASRSGrCompilerHwDevice6ClearLEv @ 15 NONAME + _ZN23CASRSGrCompilerHwDeviceD0Ev @ 16 NONAME + _ZN23CASRSGrCompilerHwDeviceD1Ev @ 17 NONAME + _ZN23CASRSGrCompilerHwDeviceD2Ev @ 18 NONAME + _ZNK23CASRSGrCompilerHwDevice13ResolveResultERK6RArrayIjER12CSIResultSetRK13RPointerArrayI18CSICompiledGrammarERK6TDesC8 @ 19 NONAME + _ZTI13CASRSHwDevice @ 20 NONAME ; ## + _ZTI23CASRSGrCompilerHwDevice @ 21 NONAME ; ## + _ZTV13CASRSHwDevice @ 22 NONAME ; ## + _ZTV23CASRSGrCompilerHwDevice @ 23 NONAME ; ## diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/grcompilerhwdevice/group/asrsgrcompilerhwdevicestub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/grcompilerhwdevice/group/asrsgrcompilerhwdevicestub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for AsrsGrCompilerHwDeviceStub +* +*/ + + + + +#include + +#if defined( WINS ) || defined( WINSCW ) +TARGET asrsgrcompilerhwdevice.dll +#else +TARGET asrsgrcompilerhwdevice_stub.dll +#endif + +TARGETTYPE DLL +UID 0x1000008D 0x101ff929 // UID: 270530857 + +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE asrsgrcompilerhwdevice.cpp + +SOURCEPATH ../../common/src +SOURCE asrshwdevice.cpp + +USERINCLUDE ../inc ../src +USERINCLUDE ../../common/src + +// This is a SYSTEMINCLUDE macro containing the middleware +// layer specific include directories +APP_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE ../../common/inc + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY asrsgrcompilerhwdevice.lib + +// On ROM dll name is without the _stub part so that it can easily be +// replaced with the real dll +LINKAS asrsgrcompilerhwdevice.dll + +CAPABILITY CAP_GENERAL_DLL + + + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/grcompilerhwdevice/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/grcompilerhwdevice/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for AsrsGrCompilerHwDeviceStub +* +*/ + + + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +asrsgrcompilerhwdevicestub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/grcompilerhwdevice/src/asrsgrcompilerhwdevice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/grcompilerhwdevice/src/asrsgrcompilerhwdevice.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,193 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ARM hardware device for grammar compiling +* +*/ + + + + + + +// INCLUDE FILES +#include "asrsgrcompilerhwdevice.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CASRSGrCompilerHwDevice::CASRSGrCompilerHwDevice +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CASRSGrCompilerHwDevice::CASRSGrCompilerHwDevice( + MASRSGrCompilerHwDeviceObserver& anObserver + ) +: iObserver( anObserver ), + iAlgorithm( NULL ), + iIsInitialised( EFalse ), + iReserved( 0 ) + { + // Nothing + } + +// ----------------------------------------------------------------------------- +// CASRSGrCompilerHwDevice::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CASRSGrCompilerHwDevice::ConstructL(void) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSGrCompilerHwDevice::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CASRSGrCompilerHwDevice* CASRSGrCompilerHwDevice::NewL( + MASRSGrCompilerHwDeviceObserver& anObserver ) // The observer + { + CASRSGrCompilerHwDevice* self = new( ELeave ) CASRSGrCompilerHwDevice( anObserver ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// ----------------------------------------------------------------------------- +// ~CASRSGrCompilerHwDevice +// Destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CASRSGrCompilerHwDevice::~CASRSGrCompilerHwDevice() + { + } + +// ----------------------------------------------------------------------------- +// CustomInterface +// Provides clients with an interface, given an UID. +// Returns: NULL - No custom interface with that UID +// ----------------------------------------------------------------------------- +// +EXPORT_C TAny* CASRSGrCompilerHwDevice::CustomInterface( + TUid /*aInterfaceId*/ ) // UID of the interface + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// InitializeL +// Initializes the device. Subsequent calls reset the device. +// Returns: none +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSGrCompilerHwDevice::InitializeL(void) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// ClearL +// Clears the device +// Returns: None +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSGrCompilerHwDevice::ClearL(void) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// Compiles a speaker independent grammar. +// Clears the device +// Returns: None +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSGrCompilerHwDevice::CompileGrammarL( + CSICompiledGrammar& /*aSICompiledGrammar*/ ) // The grammar + + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// Compiles a speaker independent grammar. +// Clears the device +// Returns: None +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSGrCompilerHwDevice::CombineGrammarL( + const RPointerArray& /*aCompiledGrammars*/, // The grammars + const RPointerArray& /*aExcludedRules*/) // Blacklisted variants + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CancelCompilation +// Cancels grammar compilation. No callback is sent to the client. +// Returns: None +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSGrCompilerHwDevice::CancelCompilation() + { + } + +// ----------------------------------------------------------------------------- +// CancelCombination +// Cancels grammar combination. No callback is sent to the client. +// Returns: None +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSGrCompilerHwDevice::CancelCombination() + { + } + +// ----------------------------------------------------------------------------- +// Resolves a recognition result +// Clears the device +// Returns: None +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSGrCompilerHwDevice::ResolveResult( + const RArray& /*aNBestIDs*/, + CSIResultSet& /*aSIResultSet*/, + const RPointerArray& /*aSICompiledGrammar*/, + const TDesC8& /*aCombinedData*/ + ) const + { + } + + +// ================================ OTHER EXPORTED FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// E32Dll +// DLL entry function +// ----------------------------------------------------------------------------- +// +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason /*aReason*/ ) + { + return KErrNone; + } +#endif + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/grcompilerhwdevice/src/asrsgrcompilerhwdevice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/grcompilerhwdevice/src/asrsgrcompilerhwdevice.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,233 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ARM hardware device for grammar compiling +* +*/ + + + + + + +#ifndef ASRSGRCOMPILERHWDEVICE_H +#define ASRSGRCOMPILERHWDEVICE_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CAsrsGrCompilerAlgorithm; +class CSDCompiledGrammar; // For future extensions; the class doesn't exist yet. +class CSDLexicon; +class CSDModelBank; +class CSDResultSet; + +// CLASS DECLARATION +/** +* Callback class for Grammar Compiler. +* +* @lib asrgrcompilerhwdevice.lib +* @since 2.8 +*/ +class MASRSGrCompilerHwDeviceObserver + { +public: // New functions + + /** + * Called after grammar compilation has finished or stopped. + * @since 2.8 + * @param aError KErrNone or a system-wide error code + * @return none + */ + virtual void MghdoGrammarCompilerComplete(TInt aError) = 0; + + /** + * Called after grammar combination has finished or stopped. + * @since 2.8 + * @param aResult The compiled grammar. Format dependes on the technology provider. + * @param aError KErrNone or a system-wide error code + * @return none + */ + virtual void MghdoGrammarCombinerComplete(HBufC8* aResult, TInt aError) = 0; + + /** + * Combination and compilation operations require lexicons. To provide those + * lexicons when needed, the client must implement these functions. + * CASRGrCompilerHwDevice takes ownership of the data. + * @since 2.8 + * @param aID The lexicon identifier + * @return The lexicon. CASRGrCompiler takes ownership. + */ + virtual CSILexicon* MghdoSILexiconL(TSILexiconID aID) = 0; + + /** + * Callback function to load configuration data. + * Client provides an implementation. + * + * @param aPackageType Type identifier. + * @param aPackageID Package identifier. + * @param aStartPosition First byte. + * @param aEndPosition Last byte. If greater than the size of + * the data, rest of the data is given. + * @return Pointer to the data buffer, HW Device takes ownership. + */ + virtual HBufC8* MghdoConfigurationData( TUint32 aPackageType, + TUint32 aPackageID, + TUint32 aStartPosition = 0, + TUint32 aEndPosition = KMaxTUint32 ) = 0; + + }; + +/** +* Grammar compilation algortithms +* +* @lib asrgrcompilerhwdevice.lib +* @since 2.8 +*/ +class CASRSGrCompilerHwDevice : public CASRSHwDevice + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CASRSGrCompilerHwDevice* NewL( + MASRSGrCompilerHwDeviceObserver& aObserver + ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CASRSGrCompilerHwDevice(); + + public: // New functions + + /** + * Compiles a speaker independent grammar. Asynchronous. + * Callback is MghdoGrammarCompilerComplete. + * @since 2.8 + * @param aSICompiledGrammar The grammar to be compiled. + * @return none + */ + IMPORT_C void CompileGrammarL( CSICompiledGrammar& aSICompiledGrammar ); + + /** + * Combines several speaker independent grammars. The result is a combined grammar + * in internal data format. + * If some rules are excluded (blacklisted), then they are absent from the combined + * grammar, but the compiled grammars are left untouched. + * @since 2.8 + * @param aCompiledGrammars Array of previously compiled grammar + * @param aExcludedRules Rules to be blacklisted. + * @return none + */ + IMPORT_C void CombineGrammarL(const RPointerArray& aCompiledGrammars, + const RPointerArray& aExcludedRules); + + /** + * Cancels grammar compilation. No callback is sent to the client. + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C void CancelCompilation(); + + /** + * Cancels grammar combination. No callback is sent to the client. + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C void CancelCombination(); + + /** + * Decodes an N-Best list from internal format into a recognition result. + * @since 2.8 + * @param aNBestIDs - N-Best result, as it came from the Recognition HW Device + * @param aSIResultSet - Empty recognition result to be populated. + * @param aSICompiledGrammar - The grammars, which were combined to get aCombinedGrammar + * @param aCombinedData - The combined grammar, which was used in recognition + * @return none + */ + IMPORT_C void ResolveResult(const RArray& aNBestIDs, + CSIResultSet& aSIResultSet, + const RPointerArray& aSICompiledGrammar, + const TDesC8& aCombinedData + ) const; + + public: // Functions from base classes + + /** + * From CASRSHwDevice + * Retrieve a custom interface + * @since 2.8 + * @param aInterfaceId - UID of the interface + * @return Pointer to a custom interface + */ + IMPORT_C TAny* CustomInterface(TUid aInterfaceId); + + /** + * From CASRSHwDevice + * Initializes the device. Subsequent calls reset the device. + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C void InitializeL(); + + /** + * From CASRSHwDevice + * Clears the device. + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C void ClearL(); + + private: + + /** + * C++ default constructor. + */ + CASRSGrCompilerHwDevice(MASRSGrCompilerHwDeviceObserver& aObserver); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + CASRSGrCompilerHwDevice( const CASRSGrCompilerHwDevice& ); + // Prohibit assigment operator if not deriving from CBase. + CASRSGrCompilerHwDevice& operator=( const CASRSGrCompilerHwDevice& ); + + private: // Data + + // The observer + MASRSGrCompilerHwDeviceObserver& iObserver; + + // Implementation-specific functions and data + CAsrsGrCompilerAlgorithm *iAlgorithm; + + // Has Initialize() been called + TBool iIsInitialised; + + // Reserved pointer for future extension. + TAny* iReserved; + }; + +#endif // ASRSGRCOMPILERHWDEVICE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for all SRSF hardware device stubs. +* +*/ + + + + + +#include +#include "srsfenginestubbldvariant.hrh" + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/srsfenginestub.iby CORE_IBY_EXPORT_PATH(stubs, srsfenginestub.iby) + +PRJ_MMPFILES +../grcompilerhwdevice/group/asrsgrcompilerhwdevicestub.mmp +../ttphwdevice/group/asrsttphwdevicestub.mmp +../recognitionhwdevice/group/asrsrecognitionhwdevicestub.mmp +../adaptationhwdevice/group/asradaptationhwdevicestub.mmp +../vocmanhwdevice/group/asrvocmanhwdevicestub.mmp +../ttshwdevice/group/ttshwdevicestub.mmp +../nlphwdevice/group/asrsnlphwdevicestub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/group/srsfenginestubbldvariant.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/group/srsfenginestubbldvariant.hrh Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Flags for SRSFEngineStub build +* +*/ + + + + + +#ifndef SRSFENGINESTUBBLDVARIANT_HRH +#define SRSFENGINESTUBBLDVARIANT_HRH + +// Define these flags in ProductVariant.hrh if non-default configuration is needed + +#endif // SRSFENGINESTUBBLDVARIANT + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/layers.sysdef.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,14 @@ + + +]> + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/nlphwdevice/bwins/asrsnlphwdeviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/nlphwdevice/bwins/asrsnlphwdeviceu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,14 @@ +EXPORTS + ??1CASRSHwDevice@@UAE@XZ @ 1 NONAME ; CASRSHwDevice::~CASRSHwDevice(void) + ??1CNlpHwDevice@@UAE@XZ @ 2 NONAME ; CNlpHwDevice::~CNlpHwDevice(void) + ?Clear@CASRSHwDevice@@UAEXXZ @ 3 NONAME ; void CASRSHwDevice::Clear(void) + ?CustomInterface@CASRSHwDevice@@UAEPAXVTUid@@@Z @ 4 NONAME ; void * CASRSHwDevice::CustomInterface(class TUid) + ?InitializeL@CASRSHwDevice@@UAEXXZ @ 5 NONAME ; void CASRSHwDevice::InitializeL(void) + ?IsLanguageSupported@CNlpHwDevice@@QAEHW4TLanguage@@@Z @ 6 NONAME ; int CNlpHwDevice::IsLanguageSupported(enum TLanguage) + ?NewL@CASRSHwDevice@@SAPAV1@XZ @ 7 NONAME ; class CASRSHwDevice * CASRSHwDevice::NewL(void) + ?NewL@CNlpHwDevice@@SAPAV1@AAVMNlpHwDeviceObserver@@@Z @ 8 NONAME ; class CNlpHwDevice * CNlpHwDevice::NewL(class MNlpHwDeviceObserver &) + ?NormalizeAndSegmentTextL@CNlpHwDevice@@QAEXAAVCTtsParsedText@@@Z @ 9 NONAME ; void CNlpHwDevice::NormalizeAndSegmentTextL(class CTtsParsedText &) + ?NormalizeTextL@CNlpHwDevice@@QAEXAAVCTtsParsedText@@@Z @ 10 NONAME ; void CNlpHwDevice::NormalizeTextL(class CTtsParsedText &) + ?NormalizeAndSegmentTextAsyncL@CNlpHwDevice@@QAEXAAVCTtsParsedText@@@Z @ 11 NONAME ; void CNlpHwDevice::NormalizeAndSegmentTextAsyncL(class CTtsParsedText &) + ?NormalizeTextAsyncL@CNlpHwDevice@@QAEXAAVCTtsParsedText@@@Z @ 12 NONAME ; void CNlpHwDevice::NormalizeTextAsyncL(class CTtsParsedText &) + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/nlphwdevice/eabi/asrsnlphwdeviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/nlphwdevice/eabi/asrsnlphwdeviceu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,22 @@ +EXPORTS + _ZN12CNlpHwDevice14NormalizeTextLER14CTtsParsedText @ 1 NONAME + _ZN12CNlpHwDevice19IsLanguageSupportedE9TLanguage @ 2 NONAME + _ZN12CNlpHwDevice24NormalizeAndSegmentTextLER14CTtsParsedText @ 3 NONAME + _ZN12CNlpHwDevice4NewLER20MNlpHwDeviceObserver @ 4 NONAME + _ZN12CNlpHwDeviceD0Ev @ 5 NONAME + _ZN12CNlpHwDeviceD1Ev @ 6 NONAME + _ZN12CNlpHwDeviceD2Ev @ 7 NONAME + _ZN13CASRSHwDevice11InitializeLEv @ 8 NONAME + _ZN13CASRSHwDevice15CustomInterfaceE4TUid @ 9 NONAME + _ZN13CASRSHwDevice4NewLEv @ 10 NONAME + _ZN13CASRSHwDevice5ClearEv @ 11 NONAME + _ZN13CASRSHwDeviceD0Ev @ 12 NONAME + _ZN13CASRSHwDeviceD1Ev @ 13 NONAME + _ZN13CASRSHwDeviceD2Ev @ 14 NONAME + _ZTI12CNlpHwDevice @ 15 NONAME ; ## + _ZTI13CASRSHwDevice @ 16 NONAME ; ## + _ZTV12CNlpHwDevice @ 17 NONAME ; ## + _ZTV13CASRSHwDevice @ 18 NONAME ; ## + _ZN12CNlpHwDevice19NormalizeTextAsyncLER14CTtsParsedText @ 19 NONAME + _ZN12CNlpHwDevice29NormalizeAndSegmentTextAsyncLER14CTtsParsedText @ 20 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/nlphwdevice/group/asrsnlphwdevicestub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/nlphwdevice/group/asrsnlphwdevicestub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for AsrsNlpHwDeviceStub +* +*/ + + + + +#include + +#if defined( WINS ) || defined( WINSCW ) +TARGET asrsnlphwdevice.dll +#else +TARGET asrsnlphwdevice_stub.dll +#endif + +TARGETTYPE DLL +UID 0x1000008D 0x10201AF3 // UID: 270539507 + +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE asrsnlphwdevice.cpp + +SOURCEPATH ../../common/src +SOURCE asrshwdevice.cpp + +USERINCLUDE ../inc ../src +USERINCLUDE ../../common/src + +// This is a SYSTEMINCLUDE macro containing the middleware +// layer specific include directories +APP_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE ../../common/inc + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY asrsnlphwdevice.lib + +// On ROM dll name is without the _stub part so that it can easily be +// replaced with the real dll +LINKAS asrsnlphwdevice.dll + +CAPABILITY CAP_GENERAL_DLL + + + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/nlphwdevice/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/nlphwdevice/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for AsrsNlpHwDeviceStub +* +*/ + + + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +asrsnlphwdevicestub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/nlphwdevice/src/asrsnlphwdevice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/nlphwdevice/src/asrsnlphwdevice.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: HW device stub of NLP +* +*/ + + + + + +// INCLUDE FILES +#include "asrsnlphwdevice.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CNlpHwDevice::CNlpHwDevice +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CNlpHwDevice::CNlpHwDevice(): + iAlgorithm( NULL ), + iReserved( NULL ) + { + // nothing + } + +// ----------------------------------------------------------------------------- +// CNlpHwDevice::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CNlpHwDevice::ConstructL( MNlpHwDeviceObserver& /*aObserver*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CNlpHwDevice::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CNlpHwDevice* CNlpHwDevice::NewL( MNlpHwDeviceObserver& aObserver ) + { + CNlpHwDevice* self = new( ELeave ) CNlpHwDevice; + + CleanupStack::PushL( self ); + self->ConstructL( aObserver); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CNlpHwDevice::~CNlpHwDevice +// Destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CNlpHwDevice::~CNlpHwDevice() + { + } + +// ----------------------------------------------------------------------------- +// CNlpHwDevice::IsLanguageSupported +// Tells if given language is supported by NLP module or not. +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CNlpHwDevice::IsLanguageSupported( TLanguage /*aLanguage*/ ) + { + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CNlpHwDevice::NormalizeTextL +// Processes text. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CNlpHwDevice::NormalizeTextL( CTtsParsedText& /*aText*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CNlpHwDevice::NormalizeAndSegmentTextL +// Processes text and divides it to segments. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CNlpHwDevice::NormalizeAndSegmentTextL( CTtsParsedText& /*aText*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CNlpHwDevice::NormalizeTextL +// Processes text. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CNlpHwDevice::NormalizeTextAsyncL( CTtsParsedText& /*aText*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CNlpHwDevice::NormalizeAndSegmentTextL +// Processes text and divides it to segments. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CNlpHwDevice::NormalizeAndSegmentTextAsyncL( CTtsParsedText& /*aText*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// for DLL goodness +// ----------------------------------------------------------------------------- +// + +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason ) +{ + return KErrNone; +} +#endif + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/nlphwdevice/src/asrsnlphwdevice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/nlphwdevice/src/asrsnlphwdevice.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,171 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Algorithms for text normalization +* +*/ + + + + + +#ifndef NLPHWDEVICE_H +#define NLPHWDEVICE_H + +// INCLUDES +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CNlpAlgorithm; + +// CLASS DECLARATION +/** +* Class to define callback functions +* +* @lib asrsttshwdevice.lib +* @since 3.0 +*/ +class MNlpHwDeviceObserver + { + public: // New functions + + /** + * Called by the HW device when the asynchronous text processing + * has been completed. + * @since 3.0 + * @param aStatus Error code, KErrNone if success + * @return none + */ + virtual void MnhdoNlpCompleted( TInt aStatus ) = 0; + + + /** + * Invoked by Nlp Hw Device when it needs a configuration data package. + * @since 3.0 + * @param aPackageType Type identifier. + * @param aPackageID Identifier of package + * @param aStartPosition Start index in bytes + * @param aEndPosition End index in bytes. If the position is bigger + * than the size of data package, the end part will be returned. + * @return Data package in a buffer + */ + virtual HBufC8* MnhdoConfigurationData( TUint32 aPackageType, + TUint32 aPackageID, + TUint32 aStartPosition = 0, + TUint32 aEndPosition = KMaxTUint32 + ) = 0; + + + /** + * Returns style given the style id. + * @since 3.0 + * @param aStyleID The style id. + * @return A reference to TTtsStyle. + */ + virtual const TTtsStyle& MnhdoStyleL( TTtsStyleID aStyleID ) = 0; + + }; + + +/** +* Class to provide text normalization +* +* @lib asrsnlphwdevice.lib +* @since 3.0 +*/ +class CNlpHwDevice : public CASRSHwDevice + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aObserver Observer which implements callback functions. + * @param aSamplingRate Sampling rate for output audio + * @param aBufferSize Buffer size for output audio + */ + IMPORT_C static CNlpHwDevice* NewL( MNlpHwDeviceObserver& aObserver ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CNlpHwDevice(); + + public: // New functions + + /** + * Ask if a language is supported or not. + * @since 3.0 + * @param aLanguage Synthesizing language. + * @return ETrue language is supported otherwise EFalse + */ + IMPORT_C TBool IsLanguageSupported( TLanguage aLanguage ); + + + /** + * Normalize given text, text is not splits into segments. + * @since 3.0 + * @param aText + */ + IMPORT_C void NormalizeTextL( CTtsParsedText& aText ); + + + /** + * Normalize given text asynchronously, text is not splits into segments. + * @since 3.0 + * @param aText + */ + IMPORT_C void NormalizeTextAsyncL( CTtsParsedText& aText ); + + + /** + * Normalize given text, text is split into segments + * @since 3.0 + * @param aText + */ + IMPORT_C void NormalizeAndSegmentTextL( CTtsParsedText& aText ); + + /** + * Normalize given text asynchronously, text is split into segments + * @since 3.0 + * @param aText + */ + IMPORT_C void NormalizeAndSegmentTextAsyncL( CTtsParsedText& aText ); + + private: + + /** + * C++ default constructor. + */ + CNlpHwDevice(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( MNlpHwDeviceObserver& aObserver ); + + private: // Data + + // Actual algorithm where all processing happens + CNlpAlgorithm* iAlgorithm; + + // Reserved pointer for future extension + TAny* iReserved; + + }; + +#endif // NLPHWDEVICE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/recognitionhwdevice/bwins/asrsrecognitionhwdeviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/recognitionhwdevice/bwins/asrsrecognitionhwdeviceu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,20 @@ +EXPORTS + ??1CASRSHwDevice@@UAE@XZ @ 1 NONAME ; CASRSHwDevice::~CASRSHwDevice(void) + ??1CASRSRecognitionHwDevice@@UAE@XZ @ 2 NONAME ; CASRSRecognitionHwDevice::~CASRSRecognitionHwDevice(void) + ?Clear@CASRSHwDevice@@UAEXXZ @ 3 NONAME ; void CASRSHwDevice::Clear(void) + ?Clear@CASRSRecognitionHwDevice@@UAEXXZ @ 4 NONAME ; void CASRSRecognitionHwDevice::Clear(void) + ?CustomInterface@CASRSHwDevice@@UAEPAXVTUid@@@Z @ 5 NONAME ; void * CASRSHwDevice::CustomInterface(class TUid) + ?CustomInterface@CASRSRecognitionHwDevice@@UAEPAXVTUid@@@Z @ 6 NONAME ; void * CASRSRecognitionHwDevice::CustomInterface(class TUid) + ?GetRejection@CASRSRecognitionHwDevice@@QAEKXZ @ 7 NONAME ; unsigned long CASRSRecognitionHwDevice::GetRejection(void) + ?InitRecognizerBEL@CASRSRecognitionHwDevice@@QAEXABVTDesC8@@ABVCSIModelBank@@@Z @ 8 NONAME ; void CASRSRecognitionHwDevice::InitRecognizerBEL(class TDesC8 const &, class CSIModelBank const &) + ?InitRecognizerFEL@CASRSRecognitionHwDevice@@QAEXH@Z @ 9 NONAME ; void CASRSRecognitionHwDevice::InitRecognizerFEL(int) + ?InitializeL@CASRSHwDevice@@UAEXXZ @ 10 NONAME ; void CASRSHwDevice::InitializeL(void) + ?InitializeL@CASRSRecognitionHwDevice@@UAEXXZ @ 11 NONAME ; void CASRSRecognitionHwDevice::InitializeL(void) + ?NewL@CASRSHwDevice@@SAPAV1@XZ @ 12 NONAME ; class CASRSHwDevice * CASRSHwDevice::NewL(void) + ?NewL@CASRSRecognitionHwDevice@@SAPAV1@AAVMASRSRecognitionHwDeviceObserver@@@Z @ 13 NONAME ; class CASRSRecognitionHwDevice * CASRSRecognitionHwDevice::NewL(class MASRSRecognitionHwDeviceObserver &) + ?SendSpeechData@CASRSRecognitionHwDevice@@QAEXAAVTPtrC8@@H@Z @ 14 NONAME ; void CASRSRecognitionHwDevice::SendSpeechData(class TPtrC8 &, int) + ?SetNBest@CASRSRecognitionHwDevice@@QAEXK@Z @ 15 NONAME ; void CASRSRecognitionHwDevice::SetNBest(unsigned long) + ?SetRejection@CASRSRecognitionHwDevice@@QAEXK@Z @ 16 NONAME ; void CASRSRecognitionHwDevice::SetRejection(unsigned long) + ?StartRecognitionL@CASRSRecognitionHwDevice@@QAEXAAV?$RArray@I@@AAV?$RArray@H@@@Z @ 17 NONAME ; void CASRSRecognitionHwDevice::StartRecognitionL(class RArray &, class RArray &) + ?StopRecognition@CASRSRecognitionHwDevice@@QAEXXZ @ 18 NONAME ; void CASRSRecognitionHwDevice::StopRecognition(void) + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/recognitionhwdevice/eabi/asrsrecognitionhwdeviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/recognitionhwdevice/eabi/asrsrecognitionhwdeviceu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +EXPORTS + _ZN13CASRSHwDevice11InitializeLEv @ 1 NONAME + _ZN13CASRSHwDevice15CustomInterfaceE4TUid @ 2 NONAME + _ZN13CASRSHwDevice4NewLEv @ 3 NONAME + _ZN13CASRSHwDevice5ClearEv @ 4 NONAME + _ZN13CASRSHwDeviceD0Ev @ 5 NONAME + _ZN13CASRSHwDeviceD1Ev @ 6 NONAME + _ZN13CASRSHwDeviceD2Ev @ 7 NONAME + _ZN24CASRSRecognitionHwDevice11InitializeLEv @ 8 NONAME + _ZN24CASRSRecognitionHwDevice12GetRejectionEv @ 9 NONAME + _ZN24CASRSRecognitionHwDevice12SetRejectionEm @ 10 NONAME + _ZN24CASRSRecognitionHwDevice14SendSpeechDataER6TPtrC8i @ 11 NONAME + _ZN24CASRSRecognitionHwDevice15CustomInterfaceE4TUid @ 12 NONAME + _ZN24CASRSRecognitionHwDevice15StopRecognitionEv @ 13 NONAME + _ZN24CASRSRecognitionHwDevice17InitRecognizerBELERK6TDesC8RK12CSIModelBank @ 14 NONAME + _ZN24CASRSRecognitionHwDevice17InitRecognizerFELEi @ 15 NONAME + _ZN24CASRSRecognitionHwDevice17StartRecognitionLER6RArrayIjERS0_IiE @ 16 NONAME + _ZN24CASRSRecognitionHwDevice4NewLER32MASRSRecognitionHwDeviceObserver @ 17 NONAME + _ZN24CASRSRecognitionHwDevice5ClearEv @ 18 NONAME + _ZN24CASRSRecognitionHwDevice8SetNBestEm @ 19 NONAME + _ZN24CASRSRecognitionHwDeviceD0Ev @ 20 NONAME + _ZN24CASRSRecognitionHwDeviceD1Ev @ 21 NONAME + _ZN24CASRSRecognitionHwDeviceD2Ev @ 22 NONAME + _ZTI13CASRSHwDevice @ 23 NONAME ; ## + _ZTI24CASRSRecognitionHwDevice @ 24 NONAME ; ## + _ZTV13CASRSHwDevice @ 25 NONAME ; ## + _ZTV24CASRSRecognitionHwDevice @ 26 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/recognitionhwdevice/group/asrsrecognitionhwdevicestub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/recognitionhwdevice/group/asrsrecognitionhwdevicestub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for recognition algorithm stub. +* +*/ + + + + +#include + +#if defined( WINS ) || defined( WINSCW ) +TARGET asrsrecognitionhwdevice.dll +#else +TARGET asrsrecognitionhwdevice_stub.dll +#endif + +TARGETTYPE DLL +UID 0x1000008D 0x101FF92F // 270530863 + +VENDORID VID_DEFAULT + +SOURCEPATH ../src + +SOURCE asrsrecognitionhwdevice.cpp + +SOURCEPATH ../../common/src +SOURCE asrshwdevice.cpp + +USERINCLUDE ../inc ../src + +// This is a SYSTEMINCLUDE macro containing the middleware +// layer specific include directories +APP_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE ../../common/inc + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY asrsrecognitionhwdevice.lib + +// On ROM dll name is without the _stub part so that it can easily be +// replaced with the real dll +LINKAS asrsrecognitionhwdevice.dll + +CAPABILITY CAP_GENERAL_DLL diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/recognitionhwdevice/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/recognitionhwdevice/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information for recognition algorithm stub. +* +*/ + + + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +asrsrecognitionhwdevicestub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/recognitionhwdevice/src/asrsrecognitionhwdevice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/recognitionhwdevice/src/asrsrecognitionhwdevice.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,204 @@ +/* +* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Recognition HW device +* +*/ + + + + + +// INCLUDE FILES +#include "asrsrecognitionhwdevice.h" +#include + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::CASRSRecognitionHwDevice +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CASRSRecognitionHwDevice::CASRSRecognitionHwDevice() + : iRecAlgorithm( NULL ), + iReserved( NULL ) + { + } + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CASRSRecognitionHwDevice::ConstructL( + MASRSRecognitionHwDeviceObserver& /*aObserver*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CASRSRecognitionHwDevice* CASRSRecognitionHwDevice::NewL( + MASRSRecognitionHwDeviceObserver& aObserver ) + { + CASRSRecognitionHwDevice* self = new( ELeave ) CASRSRecognitionHwDevice; + + CleanupStack::PushL( self ); + self->ConstructL( aObserver ); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::~CASRSRecognitionHwDevice +// Destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CASRSRecognitionHwDevice::~CASRSRecognitionHwDevice() + { + } + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::InitRecognizerBEL +// Calls equivalent function of CRecognitionAlgorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSRecognitionHwDevice::InitRecognizerBEL( + const TDesC8& /*aRecognitionData*/, + const CSIModelBank& /*aModels*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::InitRecognizerFEL +// Calls equivalent function of CRecognitionAlgorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSRecognitionHwDevice::InitRecognizerFEL( + TBool /*aSendFeatureVectors*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::SetNBest +// Calls equivalent function of CRecognitionAlgorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSRecognitionHwDevice::SetNBest( + TUint32 /*aNBest*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::StartRecognitionL +// Calls equivalent function of CRecognitionAlgorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSRecognitionHwDevice::StartRecognitionL( + RArray& /*aNBestList*/, + RArray& /*aScore*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::StopRecognition +// Calls equivalent function of CRecognitionAlgorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSRecognitionHwDevice::StopRecognition() + { + } + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::SendSpeechData +// Calls equivalent function of CRecognitionAlgorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSRecognitionHwDevice::SendSpeechData( + TPtrC8& /*aBuffer*/, + TBool /*aEnd*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::InitializeL +// Calls equivalent function of CRecognitionAlgorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSRecognitionHwDevice::InitializeL() + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::Clear +// Calls equivalent function of CRecognitionAlgorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSRecognitionHwDevice::Clear() + { + } + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::CustomInterface +// Calls equivalent function of CRecognitionAlgorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TAny* CASRSRecognitionHwDevice::CustomInterface( + TUid /*aInterfaceId*/ ) + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::SetRejection +// Calls equivalent function of CRecognitionAlgorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSRecognitionHwDevice::SetRejection( TUint32 /*aRejection*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CASRSRecognitionHwDevice::GetRejection +// Calls equivalent function of CRecognitionAlgorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CASRSRecognitionHwDevice::GetRejection() + { + return 0; + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/recognitionhwdevice/src/asrsrecognitionhwdevice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/recognitionhwdevice/src/asrsrecognitionhwdevice.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,254 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: HW Device for speech recognition +* +*/ + + + + + + +#ifndef ASRSRECOGNITIONHWDEVICE_H +#define ASRSRECOGNITIONHWDEVICE_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CSDModelBank; +class CSIModelBank; +class CRecognitionAlgorithm; + +// CLASS DECLARATION +/** +* Observer for recognition HW device +* +* @lib asrsrecognitionhwdevice.lib +* @since 2.8 +*/ +class MASRSRecognitionHwDeviceObserver + { + + public: // New functions + + /** + * Called by the hardware device when the InitializeL() method has completed. + * @since 2.8 + * @param aError Initialization result code. + * KErrNone if successful otherwise a system-wide error code. + * @return none + */ + virtual void MarhdoInitializationComplete( TInt aError ) = 0; + + /** + * Called by the hardware device when the InitializeL() method has completed. + * @since 2.8 + * @param aError Initialization result code. + * KErrNone if successful otherwise a system-wide error code. + * @return none + */ + virtual void MarhdoInitRecognizerFEComplete( TInt aError ) = 0; + + /** + * Called by the hardware device when backend initialization is completed. + * @since 2.8 + * @param aError Initialization result code. + * KErrNone if successful otherwise a system-wide error code. + * @return none + */ + virtual void MarhdoInitRecognizerBEComplete( TInt aError ) = 0; + + /** + * Called by the hardware device when recognition result is available. + * @since 2.8 + * @param aError Recognition result code. KErrNone if successful. + * KErrRejected if the recognition result is rejected, + * otherwise a system-wide error code + * @return none + */ + virtual void MarhdoRecognitionComplete( TInt aError ) = 0; + + /** + * Called by the hardware device when end-of-utterance is detected by the + * acoustic frontend. This method must be called before MarhdoRecognitionComplete(). + * @since 2.8 + * @param aError Recognition result code. KErrNone if successful, otherwise KErrTooLong, + * KErrTooShort, KErrAsrSpeechTooEarly, KErrNoSpeech + * @return none + */ + virtual void MarhdoEouDetected( TInt aError ) = 0; + + /** + * Called by the hardware device when a feature vector is extracted by acoustic frontend. + * @since 2.8 + * @param aFV A buffer containing a feature vector. + * @param aSNR Signal-to-noise ratio. + * @param aPosition Indicates whether this is the first, subsequent or last feature vector in a series. + * @return none + */ + virtual void MarhdoFeatureVector( const TDesC8& aFV, TInt32 aSNR, TInt32 aPosition ) = 0; + + /** + * Called by the hardware device to request for utterance data. + * The response to the request is sent in SendSpeechData(). + * @since 2.8 + * @param none + * @return none + */ + virtual void MarhdoRequestSpeechData () = 0; + }; + +/** +* Recognition HW Device +* +* @lib asrsrecognitionhwdevice.lib +* @since 2.8 +*/ +class CASRSRecognitionHwDevice : public CASRSHwDevice + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CASRSRecognitionHwDevice* NewL( MASRSRecognitionHwDeviceObserver& aObserver ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CASRSRecognitionHwDevice(); + + public: // New functions + + /** + * This method initializes the backend of the recognition Hw device. + * @since 2.8 + * @param aRecognitionData A recognition data generated by grammar compilation. + * @param aModels A model bank containing acoustic models + * @return none + */ + IMPORT_C void InitRecognizerBEL( const TDesC8& aRecognitionData, + const CSIModelBank& aModels ); + + /** + * This method initialize the frontend of the recognition Hwdevice + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C void InitRecognizerFEL( TBool aSendFeatureVectors = EFalse ); + + /** + * Sets the maximum number of entries wanted in the ranked list of recognition results. + * @since 2.8 + * @param aNBest The n-best number. + * @return none + */ + IMPORT_C void SetNBest( TUint32 aNBest ); + + /** + * Sets the rejection threshold. + * @since 3.2 + * @param aRejection Rejection threshold value. + * @return none + */ + IMPORT_C void SetRejection( TUint32 aRejection ); + + /** + * Gets the rejection threshold. + * @since 2.8 + * @param none + * @return Rejection threshold value. + */ + IMPORT_C TUint32 GetRejection(); + + /** + * Start recognition + * @since 2.8 + * @param aNBestList At the end of recognition, this object will contain Nbest list IDs. + * @param aScore At the end of recognition, this object will contain scores for Nbest list. + * @param aSendFeatureVectors ETrue send feature vector to client, EFalse do not send feature vector to client. + * @return none + */ + IMPORT_C void StartRecognitionL( RArray& aNBestList, RArray& aScore ); + + /** + * Stop a started recognition process. + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C void StopRecognition(); + + /** + * Use to send utterance data + * @since 2.8 + * @param aBuffer Buffer containing utterance data. + * @param aEnd End of utterance data indicator. ETrue indicates end of data or no data. + * @return none + */ + IMPORT_C void SendSpeechData( TPtrC8& aBuffer, TBool aEnd ); + + public: // Functions from base classes + + /** + * From CASRSHwDevice Use to initilize HW device + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C virtual void InitializeL(); + + /** + * From CASRSHwDevice Use to clear HW device + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C virtual void Clear(); + + /** + * From CASRSHwDevice Use to get custom interface + * @since 2.8 + * @param aInterfaceId Identifier of the intercace implementation + * @return Pointer to the interface implementation or NULL. + */ + IMPORT_C virtual TAny* CustomInterface( TUid aInterfaceId ); + + private: + + /** + * C++ default constructor. + */ + CASRSRecognitionHwDevice(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( MASRSRecognitionHwDeviceObserver& aObserver ); + + private: // Data + + // Actual implementation of recognition + CRecognitionAlgorithm* iRecAlgorithm; + + // Reserved pointer for future extension + TAny* iReserved; + + }; + +#endif // ASRSRECOGNITIONHWDEVICE + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/rom/srsfenginestub.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/rom/srsfenginestub.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef __SRSFENGINESTUB_IBY__ +#define __SRSFENGINESTUB_IBY__ + +#ifdef __SIND + +file=ABI_DIR\BUILD_DIR\asrsadaptationhwdevice_stub.dll SHARED_LIB_DIR\asrsadaptationhwdevice.dll +file=ABI_DIR\BUILD_DIR\asrsgrcompilerhwdevice_stub.dll SHARED_LIB_DIR\asrsgrcompilerhwdevice.dll +file=ABI_DIR\BUILD_DIR\asrsrecognitionhwdevice_stub.dll SHARED_LIB_DIR\asrsrecognitionhwdevice.dll +file=ABI_DIR\BUILD_DIR\asrsttphwdevice_stub.dll SHARED_LIB_DIR\asrsttphwdevice.dll +file=ABI_DIR\BUILD_DIR\asrsttshwdevice_stub.dll SHARED_LIB_DIR\asrsttshwdevice.dll +file=ABI_DIR\BUILD_DIR\asrsvocmanhwdevice_stub.dll SHARED_LIB_DIR\asrsvocmanhwdevice.dll +// New addition starting from 3.1 +file=ABI_DIR\BUILD_DIR\asrsnlphwdevice_stub.dll SHARED_LIB_DIR\asrsnlphwdevice.dll + +#endif // __SIND + +#endif // __SRSFENGINESTUB_IBY__ diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/sysdef_1_4_0.dtd Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/ttphwdevice/bwins/asrsttphwdeviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/ttphwdevice/bwins/asrsttphwdeviceu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,18 @@ +EXPORTS + ??1CASRSHwDevice@@UAE@XZ @ 1 NONAME ; CASRSHwDevice::~CASRSHwDevice(void) + ??1CASRSTtpHwDevice@@UAE@XZ @ 2 NONAME ; CASRSTtpHwDevice::~CASRSTtpHwDevice(void) + ?CancelWordListConversion@CASRSTtpHwDevice@@QAEXXZ @ 3 NONAME ; void CASRSTtpHwDevice::CancelWordListConversion(void) + ?Clear@CASRSHwDevice@@UAEXXZ @ 4 NONAME ; void CASRSHwDevice::Clear(void) + ?Clear@CASRSTtpHwDevice@@UAEXXZ @ 5 NONAME ; void CASRSTtpHwDevice::Clear(void) + ?ConvertTextL@CASRSTtpHwDevice@@QAEPAVHBufC8@@ABVTDesC16@@AAW4TLanguage@@@Z @ 6 NONAME ; class HBufC8 * CASRSTtpHwDevice::ConvertTextL(class TDesC16 const &, enum TLanguage &) + ?ConvertWordListL@CASRSTtpHwDevice@@QAEXAAVCSITtpWordList@@V?$RArray@W4TLanguage@@@@V?$RArray@K@@@Z @ 7 NONAME ; void CASRSTtpHwDevice::ConvertWordListL(class CSITtpWordList &, class RArray, class RArray) + ?CustomInterface@CASRSHwDevice@@UAEPAXVTUid@@@Z @ 8 NONAME ; void * CASRSHwDevice::CustomInterface(class TUid) + ?CustomInterface@CASRSTtpHwDevice@@UAEPAXVTUid@@@Z @ 9 NONAME ; void * CASRSTtpHwDevice::CustomInterface(class TUid) + ?InitializeL@CASRSHwDevice@@UAEXXZ @ 10 NONAME ; void CASRSHwDevice::InitializeL(void) + ?InitializeL@CASRSTtpHwDevice@@UAEXXZ @ 11 NONAME ; void CASRSTtpHwDevice::InitializeL(void) + ?NewL@CASRSHwDevice@@SAPAV1@XZ @ 12 NONAME ; class CASRSHwDevice * CASRSHwDevice::NewL(void) + ?NewL@CASRSTtpHwDevice@@SAPAV1@AAVMASRSTtpHwDeviceObserver@@@Z @ 13 NONAME ; class CASRSTtpHwDevice * CASRSTtpHwDevice::NewL(class MASRSTtpHwDeviceObserver &) + ?PhonemeNotation@CASRSTtpHwDevice@@QAEABVTDesC16@@XZ @ 14 NONAME ; class TDesC16 const & CASRSTtpHwDevice::PhonemeNotation(void) + ?SetPhonemeNotationL@CASRSTtpHwDevice@@QAEXABVTDesC16@@@Z @ 15 NONAME ; void CASRSTtpHwDevice::SetPhonemeNotationL(class TDesC16 const &) + ?LanguageIdentificationL@CASRSTtpHwDevice@@QAEXABVTDesC16@@HAAV?$RArray@W4TLanguage@@@@AAV?$RArray@H@@@Z @ 16 NONAME ; public: void __thiscall CASRSTtpHwDevice::LanguageIdentificationL(class TDesC16 const &,int,class RArray &,class RArray &) + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/ttphwdevice/eabi/asrsttphwdeviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/ttphwdevice/eabi/asrsttphwdeviceu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,26 @@ +EXPORTS + _ZN13CASRSHwDevice11InitializeLEv @ 1 NONAME + _ZN13CASRSHwDevice15CustomInterfaceE4TUid @ 2 NONAME + _ZN13CASRSHwDevice4NewLEv @ 3 NONAME + _ZN13CASRSHwDevice5ClearEv @ 4 NONAME + _ZN13CASRSHwDeviceD0Ev @ 5 NONAME + _ZN13CASRSHwDeviceD1Ev @ 6 NONAME + _ZN13CASRSHwDeviceD2Ev @ 7 NONAME + _ZN16CASRSTtpHwDevice11InitializeLEv @ 8 NONAME + _ZN16CASRSTtpHwDevice12ConvertTextLERK7TDesC16R9TLanguage @ 9 NONAME + _ZN16CASRSTtpHwDevice15CustomInterfaceE4TUid @ 10 NONAME + _ZN16CASRSTtpHwDevice15PhonemeNotationEv @ 11 NONAME + _ZN16CASRSTtpHwDevice16ConvertWordListLER14CSITtpWordList6RArrayI9TLanguageES2_ImE @ 12 NONAME + _ZN16CASRSTtpHwDevice19SetPhonemeNotationLERK7TDesC16 @ 13 NONAME + _ZN16CASRSTtpHwDevice24CancelWordListConversionEv @ 14 NONAME + _ZN16CASRSTtpHwDevice4NewLER24MASRSTtpHwDeviceObserver @ 15 NONAME + _ZN16CASRSTtpHwDevice5ClearEv @ 16 NONAME + _ZN16CASRSTtpHwDeviceD0Ev @ 17 NONAME + _ZN16CASRSTtpHwDeviceD1Ev @ 18 NONAME + _ZN16CASRSTtpHwDeviceD2Ev @ 19 NONAME + _ZTI13CASRSHwDevice @ 20 NONAME ; ## + _ZTI16CASRSTtpHwDevice @ 21 NONAME ; ## + _ZTV13CASRSHwDevice @ 22 NONAME ; ## + _ZTV16CASRSTtpHwDevice @ 23 NONAME ; ## + _ZN16CASRSTtpHwDevice23LanguageIdentificationLERK7TDesC16iR6RArrayI9TLanguageERS3_IiE @ 24 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/ttphwdevice/group/asrsttphwdevicestub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/ttphwdevice/group/asrsttphwdevicestub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for AsrTtpHwDeviceStub. +* +*/ + + + + +#include +#include "../../group/srsfenginestubbldvariant.hrh" + +#if defined( WINS ) || defined( WINSCW ) +TARGET asrsttphwdevice.dll +#else +TARGET asrsttphwdevice_stub.dll +#endif + +TARGETTYPE DLL +UID 0x1000008D 0x101F8CA9 // UID: 270503081 + +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE asrsttphwdevice.cpp + +SOURCEPATH ../../common/src +SOURCE asrshwdevice.cpp + +USERINCLUDE ../inc ../src ../../group + +// This is a SYSTEMINCLUDE macro containing the middleware +// layer specific include directories +APP_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE ../../common/inc + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY asrsttphwdevice.lib + +// On ROM dll name is without the _stub part so that it can easily be +// replaced with the real dll +LINKAS asrsttphwdevice.dll + +CAPABILITY CAP_GENERAL_DLL diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/ttphwdevice/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/ttphwdevice/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for AsrsTtpHwDeviceStub +* +*/ + + + + + +#include "../../Group/SRSFEngineStubBldVariant.hrh" + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +asrsttphwdevicestub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/ttphwdevice/src/asrsttphwdevice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/ttphwdevice/src/asrsttphwdevice.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,219 @@ +/* +* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: TTP hardware device stub. +* +*/ + + + + + +// INCLUDE FILES +#include "srsfenginestubbldvariant.hrh" +#include "asrsttphwdevice.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::CASRSTtpHwDevice +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CASRSTtpHwDevice::CASRSTtpHwDevice( MASRSTtpHwDeviceObserver& aObserver ) : + iObserver( aObserver ), + iTTPAlgorithm( NULL ), + iTTPAlgObserver( NULL ) + { + } + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CASRSTtpHwDevice::ConstructL() + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CASRSTtpHwDevice* CASRSTtpHwDevice::NewL( MASRSTtpHwDeviceObserver& aObserver ) + { + CASRSTtpHwDevice* self = new( ELeave ) CASRSTtpHwDevice( aObserver ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::~CASRSTtpHwDevice +// Destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CASRSTtpHwDevice::~CASRSTtpHwDevice() + { + } + + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::InitializeL +// Initialize TTP module +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSTtpHwDevice::InitializeL() + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::ConvertTextL +// Perform TTP for text. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* CASRSTtpHwDevice::ConvertTextL( const TDesC& /*aText*/, + TLanguage& /*aLanguage*/ ) + { + User::Leave( KErrNotSupported ); + return NULL; + } + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::ConvertWordListL +// Perform TTP for word list. Asynchronous. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSTtpHwDevice::ConvertWordListL( CSITtpWordList& /*aWordList*/, + const RArray /*aDefaultLanguage*/, + const RArray /*aMaxNPronunsForWord*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::CancelWordListConversion +// Cancel TTP for word list. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSTtpHwDevice::CancelWordListConversion() + { + } + + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::SetPhonemeNotationL +// Sets the output phoneme notation. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSTtpHwDevice::SetPhonemeNotationL( const TDesC& /*aNotation*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::PhonemeNotation +// Returns the phoneme notation in use. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CASRSTtpHwDevice::PhonemeNotation() + { + _LIT( KError, "Error" ); + return KError; + } + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::Clear +// Clears HW Device. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSTtpHwDevice::Clear() + { + } + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::CustomInterface +// Returns pointer to wanted custom interface. Returns NULL pointer if not found. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TAny* CASRSTtpHwDevice::CustomInterface( TUid /*aInterfaceId*/ ) + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::WordListReady +// Notify that word list is ready +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CASRSTtpHwDevice::WordListReady( const TInt /*aError*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::ConfigurationData +// Notify that configuration data is needed. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +HBufC8* CASRSTtpHwDevice::ConfigurationData( TUint32 /*aPackageType*/, + TUint32 /*aPackageID*/, + TUint32 /*aStartPosition*/, + TUint32 /*aEndPosition*/ ) + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// CASRSTtpHwDevice::LanguageIdentificationL +// Tries to guess the language of given text. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSTtpHwDevice::LanguageIdentificationL( const TDesC& /*aText*/, + TInt /*aNumberOfGuesses*/, + RArray& /*aLanguages*/, + RArray& /*aScores*/ ) + { + User::Leave( KErrNotSupported ); + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// For DLL goodness +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason /*aReason*/ ) + { + return KErrNone; + } +#endif + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/ttphwdevice/src/asrsttphwdevice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/ttphwdevice/src/asrsttphwdevice.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,237 @@ +/* +* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Exported interface towards TTP HW Device. +* +*/ + + + + + +#ifndef ASRSTTPHWDEVICE_H +#define ASRSTTPHWDEVICE_H + +// INCLUDES +// Base class for all HW Devices +#include +// SI Data +#include + +// FORWARD DECLARATIONS +class CTTPAlgorithm; +class CTtpCallback; + + +// CLASS DECLARATION + +/** +* Class which defines callback functions. Client must implement this in order +* to receive callbacks. +* +* @lib asrsttphwdevice.lib +*/ +class MASRSTtpHwDeviceObserver + { + public: // New functions + + /** + * Callback function to load configuration data. + * Client provides an implementation. + * + * @param aPackageType Type identifier. + * @param aPackageID Package identifier. + * @param aStartPosition First byte. + * @param aEndPosition Last byte. If greater than the size of + * the data, rest of the data is given. + * @return Pointer to the data buffer, TTP HW Device takes ownership. + */ + virtual HBufC8* MathdoConfigurationData( TUint32 aPackageType, TUint32 aPackageID, + TUint32 aStartPosition = 0, + TUint32 aEndPosition = KMaxTUint32 ) = 0; + + /** + * Callback function to notify that word list is converted. + * Client provides an implementation. + * + * @param aError Error code, KErrNone if successful. + */ + virtual void MathdoWordListReady( const TInt aError ) = 0; + }; + +/** +* TTP HW Device interface. +* +* @lib asrsttphwdevice.lib +*/ +class CASRSTtpHwDevice : public CASRSHwDevice + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * + * @param aObserver Reference to callback observer. + */ + IMPORT_C static CASRSTtpHwDevice* NewL( MASRSTtpHwDeviceObserver& aObserver ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CASRSTtpHwDevice(); + + public: // New functions + + /** + * Use to convert text to phonemes. + * + * @param aText Text to be converted + * @param aLanguage Used language + * @return Phoneme sequence, client gains ownership + */ + IMPORT_C HBufC8* ConvertTextL( const TDesC& aText, + TLanguage& aLanguage ); + + /** + * Use to convert list of words to pronunciation sequences. + * + * @param aWordList Initialized word list to where + * pronunciations will be added. Client will keep the ownership + * of CSITtpWordList also after this call. + * @param aDefaultLanguage Language which overrides the first identified language. + * Iflanguage is ELangOther, language identification will be used. + * @param aMaxNPronunsForWord Maximum number of pronunciations (languages) for each word. + */ + IMPORT_C void ConvertWordListL( CSITtpWordList& aWordList, + const RArray aDefaultLanguage, + const RArray aMaxNPronunsForWord ); + + /** + * Use to cancel running word list conversion. + */ + IMPORT_C void CancelWordListConversion(); + + /** + * Sets the phoneme notation used in output. + * + * @param aNotation Phoneme notation identifier. + */ + IMPORT_C void SetPhonemeNotationL( const TDesC& aNotation ); + + /** + * Gets the current phoneme notation indentifier. + * + * @return Phoneme notation identifier. + */ + IMPORT_C const TDesC& PhonemeNotation(); + + public: // From CASRSHwDevice + + /** + * From CASRSHwDevice + * Custom interface + * + * @param aInterfaceId ID of wanted custom interface + * @return A pointer to the interface implementation, NULL if not found. + */ + IMPORT_C TAny* CustomInterface( TUid aInterfaceId ); + + /** + * From CASRSHwDevice + * Initializes Hw Device. + */ + IMPORT_C void InitializeL(); + + /** + * From CASRSHwDevice + * Clears Hw Device, counter part for InitializeL() + */ + IMPORT_C void Clear(); + + public: // New methods for SIND increment 3 + + /** + * Tries to identify the language of given text + * + * @param "const TDesC& aText" Text + * @param "TInt aNumberOfGuesses" Maximum number of guesses that will be provided + * @param "RArray& aLanguages" Output parameter, will contain list of guessed languages + * @param "RArray& aScores" Output parameter, scores + */ + IMPORT_C void LanguageIdentificationL( const TDesC& aText, + TInt aNumberOfGuesses, + RArray& aLanguages, + RArray& aScores ); + + private: + + /** + * C++ default constructor. + * @param aObserver Reference to observer. + */ + CASRSTtpHwDevice( MASRSTtpHwDeviceObserver& aObserver ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + CASRSTtpHwDevice( const CASRSTtpHwDevice& ); + // Prohibit assigment operator if not deriving from CBase. + CASRSTtpHwDevice& operator=( const CASRSTtpHwDevice& ); + + /** + * Function to notify that word list is converted + * Called by CTtpCallback. + * + * @param aError Error code + */ + void WordListReady( const TInt aError ); + + /** + * Function to notify that configuration data is needed. + * Called by CTtpCallback. + * + * @param aPackageType Type identifier. + * @param aPackageID Package identifier. + * @param aStartPosition First byte. + * @param aEndPosition Last byte. If greater than the size of + * the data, rest of the data is given. + * @return Pointer to the data buffer. + */ + virtual HBufC8* ConfigurationData( TUint32 aPackageType, TUint32 aPackageID, + TUint32 aStartPosition = 0, + TUint32 aEndPosition = KMaxTUint32 ); + + private: // Data + // Observer + MASRSTtpHwDeviceObserver& iObserver; + + // algorithm implementation + CTTPAlgorithm* iTTPAlgorithm; + + // Implements call backs from CTTPAlgorithm + CTtpCallback* iTTPAlgObserver; + + // Reserved pointer for future extension + TAny* iReserved; + + private: // Friend classes + friend class CTtpCallback; + + }; + +#endif // ASRSTTPHWDEVICE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/ttshwdevice/bwins/asrsttshwdeviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/ttshwdevice/bwins/asrsttshwdeviceu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +EXPORTS + ??1CASRSHwDevice@@UAE@XZ @ 1 NONAME ; CASRSHwDevice::~CASRSHwDevice(void) + ??1CTtsHwDevice@@UAE@XZ @ 2 NONAME ; CTtsHwDevice::~CTtsHwDevice(void) + ?AddStyleL@CTtsHwDevice@@QAEKABVTTtsStyle@@@Z @ 3 NONAME ; unsigned long CTtsHwDevice::AddStyleL(class TTtsStyle const &) + ?AnalyzeProsodyL@CTtsHwDevice@@QAEXAAVCTtsParsedText@@@Z @ 4 NONAME ; void CTtsHwDevice::AnalyzeProsodyL(class CTtsParsedText &) + ?AnalyzeStructureL@CTtsHwDevice@@QAEXAAVCTtsParsedText@@@Z @ 5 NONAME ; void CTtsHwDevice::AnalyzeStructureL(class CTtsParsedText &) + ?BufferProcessed@CTtsHwDevice@@QAEXABVTDesC8@@@Z @ 6 NONAME ; void CTtsHwDevice::BufferProcessed(class TDesC8 const &) + ?Clear@CASRSHwDevice@@UAEXXZ @ 7 NONAME ; void CASRSHwDevice::Clear(void) + ?CustomInterface@CASRSHwDevice@@UAEPAXVTUid@@@Z @ 8 NONAME ; void * CASRSHwDevice::CustomInterface(class TUid) + ?DeleteStyleL@CTtsHwDevice@@QAEXK@Z @ 9 NONAME ; void CTtsHwDevice::DeleteStyleL(unsigned long) + ?GetPositionL@CTtsHwDevice@@QAEXAAVTTimeIntervalMicroSeconds@@@Z @ 10 NONAME ; void CTtsHwDevice::GetPositionL(class TTimeIntervalMicroSeconds &) + ?GetPositionL@CTtsHwDevice@@QAEXAAVTTtsSegment@@AAH@Z @ 11 NONAME ; void CTtsHwDevice::GetPositionL(class TTtsSegment &, int &) + ?InitializeL@CASRSHwDevice@@UAEXXZ @ 12 NONAME ; void CASRSHwDevice::InitializeL(void) + ?IsLanguageSupported@CTtsHwDevice@@QAEHW4TLanguage@@@Z @ 13 NONAME ; int CTtsHwDevice::IsLanguageSupported(enum TLanguage) + ?NewL@CASRSHwDevice@@SAPAV1@XZ @ 14 NONAME ; class CASRSHwDevice * CASRSHwDevice::NewL(void) + ?NewL@CTtsHwDevice@@SAPAV1@AAVMTtsHwDeviceObserver@@II@Z @ 15 NONAME ; class CTtsHwDevice * CTtsHwDevice::NewL(class MTtsHwDeviceObserver &, unsigned int, unsigned int) + ?NumberOfStyles@CTtsHwDevice@@QBEGXZ @ 16 NONAME ; unsigned short CTtsHwDevice::NumberOfStyles(void) const + ?Pause@CTtsHwDevice@@QAEXXZ @ 17 NONAME ; void CTtsHwDevice::Pause(void) + ?PrimeSynthesisL@CTtsHwDevice@@QAEXAAVCTtsParsedText@@@Z @ 18 NONAME ; void CTtsHwDevice::PrimeSynthesisL(class CTtsParsedText &) + ?PrimeSynthesisL@CTtsHwDevice@@QAEXAAVMTtsSegmentStream@@@Z @ 19 NONAME ; void CTtsHwDevice::PrimeSynthesisL(class MTtsSegmentStream &) + ?SetPositionL@CTtsHwDevice@@QAEXABVTTimeIntervalMicroSeconds@@@Z @ 20 NONAME ; void CTtsHwDevice::SetPositionL(class TTimeIntervalMicroSeconds const &) + ?SetPositionL@CTtsHwDevice@@QAEXABVTTtsSegment@@H@Z @ 21 NONAME ; void CTtsHwDevice::SetPositionL(class TTtsSegment const &, int) + ?Stop@CTtsHwDevice@@QAEXXZ @ 22 NONAME ; void CTtsHwDevice::Stop(void) + ?StyleL@CTtsHwDevice@@QAEAAVTTtsStyle@@G@Z @ 23 NONAME ; class TTtsStyle & CTtsHwDevice::StyleL(unsigned short) + ?StyleL@CTtsHwDevice@@QAEAAVTTtsStyle@@K@Z @ 24 NONAME ; class TTtsStyle & CTtsHwDevice::StyleL(unsigned long) + ?SynthesizeL@CTtsHwDevice@@QAEXXZ @ 25 NONAME ; void CTtsHwDevice::SynthesizeL(void) + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/ttshwdevice/eabi/asrsttshwdeviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/ttshwdevice/eabi/asrsttshwdeviceu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,35 @@ +EXPORTS + _ZN12CTtsHwDevice11SynthesizeLEv @ 1 NONAME + _ZN12CTtsHwDevice12DeleteStyleLEm @ 2 NONAME + _ZN12CTtsHwDevice12GetPositionLER11TTtsSegmentRi @ 3 NONAME + _ZN12CTtsHwDevice12GetPositionLER25TTimeIntervalMicroSeconds @ 4 NONAME + _ZN12CTtsHwDevice12SetPositionLERK11TTtsSegmenti @ 5 NONAME + _ZN12CTtsHwDevice12SetPositionLERK25TTimeIntervalMicroSeconds @ 6 NONAME + _ZN12CTtsHwDevice15AnalyzeProsodyLER14CTtsParsedText @ 7 NONAME + _ZN12CTtsHwDevice15BufferProcessedERK6TDesC8 @ 8 NONAME + _ZN12CTtsHwDevice15PrimeSynthesisLER14CTtsParsedText @ 9 NONAME + _ZN12CTtsHwDevice15PrimeSynthesisLER17MTtsSegmentStream @ 10 NONAME + _ZN12CTtsHwDevice17AnalyzeStructureLER14CTtsParsedText @ 11 NONAME + _ZN12CTtsHwDevice19IsLanguageSupportedE9TLanguage @ 12 NONAME + _ZN12CTtsHwDevice4NewLER20MTtsHwDeviceObserverjj @ 13 NONAME + _ZN12CTtsHwDevice4StopEv @ 14 NONAME + _ZN12CTtsHwDevice5PauseEv @ 15 NONAME + _ZN12CTtsHwDevice6StyleLEm @ 16 NONAME + _ZN12CTtsHwDevice6StyleLEt @ 17 NONAME + _ZN12CTtsHwDevice9AddStyleLERK9TTtsStyle @ 18 NONAME + _ZN12CTtsHwDeviceD0Ev @ 19 NONAME + _ZN12CTtsHwDeviceD1Ev @ 20 NONAME + _ZN12CTtsHwDeviceD2Ev @ 21 NONAME + _ZN13CASRSHwDevice11InitializeLEv @ 22 NONAME + _ZN13CASRSHwDevice15CustomInterfaceE4TUid @ 23 NONAME + _ZN13CASRSHwDevice4NewLEv @ 24 NONAME + _ZN13CASRSHwDevice5ClearEv @ 25 NONAME + _ZN13CASRSHwDeviceD0Ev @ 26 NONAME + _ZN13CASRSHwDeviceD1Ev @ 27 NONAME + _ZN13CASRSHwDeviceD2Ev @ 28 NONAME + _ZNK12CTtsHwDevice14NumberOfStylesEv @ 29 NONAME + _ZTI12CTtsHwDevice @ 30 NONAME ; ## + _ZTI13CASRSHwDevice @ 31 NONAME ; ## + _ZTV12CTtsHwDevice @ 32 NONAME ; ## + _ZTV13CASRSHwDevice @ 33 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/ttshwdevice/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/ttshwdevice/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information for TTS HWDevice Stub. +* +*/ + + + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +TTSHwDeviceStub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/ttshwdevice/group/ttshwdevicestub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/ttshwdevice/group/ttshwdevicestub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for TtsHwDeviceStub. +* +*/ + + + + +#include + +#if defined( WINS ) || defined( WINSCW ) +TARGET asrsttshwdevice.dll +#else +TARGET asrsttshwdevice_stub.dll +#endif + +TARGETTYPE DLL +UID 0x1000008D 0x101F8CA5 + +VENDORID VID_DEFAULT + +USERINCLUDE . ../inc +// This is a SYSTEMINCLUDE macro containing the middleware +// layer specific include directories +APP_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE ../../common/inc +SYSTEMINCLUDE ../../common/src + +SOURCEPATH ../src +SOURCE asrsttshwdevice.cpp + +SOURCEPATH ../../common/src +SOURCE asrshwdevice.cpp + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY asrsttshwdevice.lib + +// On ROM dll name is without the _stub part so that it can easily be +// replaced with the real dll +LINKAS asrsttshwdevice.dll + +CAPABILITY CAP_GENERAL_DLL diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/ttshwdevice/src/asrsttshwdevice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/ttshwdevice/src/asrsttshwdevice.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,300 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Stub algorithms for Speech Synthesis +* +*/ + + + + + +// INCLUDE FILES +#include "asrsttshwdevice.h" +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::CTtsHwDevice +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CTtsHwDevice::CTtsHwDevice(): iAlgorithm( NULL ), iReserved( NULL ) + { + // nothing + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CTtsHwDevice::ConstructL( MTtsHwDeviceObserver& /*aObserver*/, + TUint /*aSamplingRate*/, + TUint /*aBufferSize*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CTtsHwDevice* CTtsHwDevice::NewL( MTtsHwDeviceObserver& aObserver, + TUint aSamplingRate, + TUint aBufferSize ) + { + CTtsHwDevice* self = new ( ELeave ) CTtsHwDevice; + + CleanupStack::PushL( self ); + self->ConstructL( aObserver, aSamplingRate, aBufferSize ); + CleanupStack::Pop(); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::~CTtsHwDevice +// Destructor; +// ----------------------------------------------------------------------------- +// +EXPORT_C CTtsHwDevice::~CTtsHwDevice() + { + } + + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::AddStyleL +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TTtsStyleID CTtsHwDevice::AddStyleL( const TTtsStyle& /*aStyle*/ ) + { + User::Leave( KErrNotSupported ); + return 0; + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::AnalyzeProsodyL +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTtsHwDevice::AnalyzeProsodyL( CTtsParsedText& /*aText*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::AnalyzeStructureL +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTtsHwDevice::AnalyzeStructureL( CTtsParsedText& /*aText*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::BufferProcessed +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTtsHwDevice::BufferProcessed( const TDesC8& /*aBuffer*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::DeleteStyleL +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTtsHwDevice::DeleteStyleL( TTtsStyleID /*aStyleID*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::GetPositionL +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTtsHwDevice::GetPositionL( TTimeIntervalMicroSeconds& /*aTime*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::GetPositionL +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTtsHwDevice::GetPositionL( TTtsSegment& /*aSegment*/, + TInt& /*aWordIndex*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::IsLanguageSupported +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CTtsHwDevice::IsLanguageSupported( TLanguage /*aLanguage*/ ) + { + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::NumberOfStyles +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint16 CTtsHwDevice::NumberOfStyles() const + { + return 0; + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::Pause +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTtsHwDevice::Pause() + { + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::PrimeSynthesisL +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTtsHwDevice::PrimeSynthesisL( MTtsSegmentStream& /*aStream*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::PrimeSynthesisL +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTtsHwDevice::PrimeSynthesisL( CTtsParsedText& /*aText*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::SetPositionL +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTtsHwDevice::SetPositionL( const TTimeIntervalMicroSeconds& /*aTime*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::SetPositionL +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTtsHwDevice::SetPositionL( const TTtsSegment& /*aSegment*/, + TInt /*aWordIndex*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::Stop +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTtsHwDevice::Stop() + { + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::StyleL +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TTtsStyle& CTtsHwDevice::StyleL( TTtsStyleID /*aStyleID*/ ) + { + User::Leave( KErrNotSupported ); + // Just for removing errors & warning, we never get here + TInt* dummy = new ( ELeave ) TInt; + TTtsStyle* style = (TTtsStyle*) dummy; + return *style; + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::StyleL +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TTtsStyle& CTtsHwDevice::StyleL( TUint16 /*aIndex*/ ) + { + User::Leave( KErrNotSupported ); + // Just for removing errors & warning, we never get here + TInt* dummy = new ( ELeave ) TInt; + TTtsStyle* style = (TTtsStyle*) dummy; + return *style; + } + +// ----------------------------------------------------------------------------- +// CTtsHwDevice::SynthesizeL +// Calls responding function of TTS algorithm +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTtsHwDevice::SynthesizeL() + { + User::Leave( KErrNotSupported ); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// for DLL goodness +// ----------------------------------------------------------------------------- +// +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason /*aReason*/ ) + { + return KErrNone; + } +#endif + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/ttshwdevice/src/asrsttshwdevice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/ttshwdevice/src/asrsttshwdevice.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,293 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Algorithms for Speech Synthesis +* +*/ + + + + + +#ifndef TTSHWDEVICE_H +#define TTSHWDEVICE_H + +// INCLUDES +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CTtsAlgorithm; + +// CLASS DECLARATION +/** +* Class to define callback functions +* +* @lib asrsttshwdevice.lib +* @since 2.8 +*/ +class MTtsHwDeviceObserver + { + public: // New functions + + /** + * Called by the HW device when the synthesis has been completed. + * @since 2.8 + * @param aStatus Error code, KErrNone if success + * @return none + */ + virtual void MthdTtsCompleted( TInt aStatus ) = 0; + + /** + * Invoked by TTS HW Device when it needs a configuration data package. + * @since 2.8 + * @param aPackageType Type identifier. + * @param aPackageID Identifier of package + * @param aStartPosition Start index in bytes + * @param aEndPosition End index in bytes. If the position is bigger + * than the size of data package, the end part will be returned. + * @return Data package in a buffer + */ + virtual HBufC8* MthdoConfigurationData( TUint32 aPackageType, + TUint32 aPackageID, + TUint32 aStartPosition, + TUint32 aEndPosition) = 0; + /** + * Called by the HW device when custom command implementation wants to notify a client. + * @since 2.8 + * @param aEvent Event code aStatus Error code, KErrNone if success. + * @param aParameter Optional parameter + * @return none + */ + virtual void MthdCustomEvent( TInt aEvent, + TInt aStatus, + const TDesC8& aParameter = KNullDesC8 ) = 0; + + /** + * Called by the HW device when the HW device has synthesized a new audio buffer. + * @since 2.8 + * @param aBuffer Synthesized audio buffer. + * @return none + */ + virtual void MthdProcessBuffer( const TDesC8& aBuffer ) = 0; + + }; + + + +/** +* Class to provide speech synthesis +* +* @lib asrsttshwdevice.lib +* @since 2.8 +*/ +class CTtsHwDevice : public CASRSHwDevice + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aObserver Observer which implements callback functions. + * @param aSamplingRate Sampling rate for output audio + * @param aBufferSize Buffer size for output audio + */ + IMPORT_C static CTtsHwDevice* NewL( MTtsHwDeviceObserver& aObserver, + TUint aSamplingRate, + TUint aBufferSize ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CTtsHwDevice(); + + public: // New functions + + /** + * Adds new style to the collection. If equal style exists already, new style is not added. + * @since 2.8 + * @param aStyle Style to be added. + * @return Identifier of added style. If equal style exists already, identifier to the old style will be returned. + */ + IMPORT_C TTtsStyleID AddStyleL( const TTtsStyle& aStyle ); + + /** + * Analyses stucture of text and adds style information. + * @since 2.8 + * @param aText Updates text object by dividing it into segments with new styles. + * @return none + */ + IMPORT_C void AnalyzeProsodyL( CTtsParsedText& aText ); + + /** + * Analyses stucture of text by finding paragraphs and sentences. + * @since 2.8 + * @param aText Updates text object by segmenting it into paragraphs and sentences. + * @return none + */ + IMPORT_C void AnalyzeStructureL( CTtsParsedText& aText ); + + /** + * Notifies that the buffer has been processed + * @since 2.8 + * @param aBuffer The buffer which has been processed + * @return none + */ + IMPORT_C void BufferProcessed( const TDesC8& aBuffer ); + + /** + * Deletes style. + * @since 2.8 + * @param aStyleID Identifier of style to be deleted. + * @return none + */ + IMPORT_C void DeleteStyleL( TTtsStyleID aStyleID ); + + /** + * Gives current position of synthesizing. + * @since 2.8 + * @param aTime Time of the synthesizing position. + * @return none + */ + IMPORT_C void GetPositionL( TTimeIntervalMicroSeconds& aTime ); + + /** + * Gives current position of synthesizing. + * @since 2.8 + * @param aSegment The segment being synthesizing + * @param aWordIndex The index of word being synthesizing + * @return none + */ + IMPORT_C void GetPositionL( TTtsSegment& aSegment, + TInt& aWordIndex ); + + /** + * Ask if a language is supported or not. + * @since 2.8 + * @param aLanguage Synthesizing language. + * @return ETrue language is supported otherwise EFalse + */ + IMPORT_C TBool IsLanguageSupported( TLanguage aLanguage ); + + /** + * Gives number of styles. + * @since 2.8 + * @param none + * @return Number of styles. + */ + IMPORT_C TUint16 NumberOfStyles() const; + + /** + * Pauses synthesizing. + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C void Pause(); + + /** + * Prepares for synthesizing. + * @since 2.8 + * @param aStream Stream to be synthesized. + * @return none + */ + IMPORT_C void PrimeSynthesisL( MTtsSegmentStream& aStream ); + + /** + * Prepares for synthesizing. + * @since 2.8 + * @param aText Text containing segments to be synthesized. + * @return none + */ + IMPORT_C void PrimeSynthesisL( CTtsParsedText& aText ); + + /** + * Sets new position for synthesizing. + * @since 2.8 + * @param aTime Time of the synthesizing postion. + * @return none + */ + IMPORT_C void SetPositionL( const TTimeIntervalMicroSeconds& aTime ); + + /** + * Sets new position for synthesizing. + * @since 2.8 + * @param aSegment The segment being synthesizing + * @param aWordIndex The index of word being synthesizing + * @return none + */ + IMPORT_C void SetPositionL( const TTtsSegment& aSegment, + TInt aWordIndex ); + + /** + * Stops synthesizing and releases resources of synthesizing. + * The method does nothing if already stopped. + * @since 2.8 + * @param + * @return none + */ + IMPORT_C void Stop(); + + /** + * Receives style information + * @since 2.8 + * @param aStyleID Style identifier + * @return Style + */ + IMPORT_C TTtsStyle& StyleL( TTtsStyleID aStyleID ); + + /** + * Receives style information + * @since 2.8 + * @param aIndex Index to style: 0..NumberOfStyles() + * @return Style + */ + IMPORT_C TTtsStyle& StyleL( TUint16 aIndex ); + + /** + * Starts waveform production. The synthesized audio buffers are send back + * to client using MthdProcessBuffer(). + * @since 2.8 + * @param none + * @return none + */ + IMPORT_C void SynthesizeL(); + + private: + + /** + * C++ default constructor. + */ + CTtsHwDevice(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( MTtsHwDeviceObserver& aObserver, + TUint aSamplingRate, + TUint aBufferSize ); + + private: // Data + + // Actual algorithm where all processing happens + CTtsAlgorithm* iAlgorithm; + + // Reserved pointer for future extension + TAny* iReserved; + + }; + +#endif // TTSHWDEVICE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/vocmanhwdevice/bwins/asrsvocmanhwdeviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/vocmanhwdevice/bwins/asrsvocmanhwdeviceu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,12 @@ +EXPORTS + ??1CASRSHwDevice@@UAE@XZ @ 1 NONAME ; CASRSHwDevice::~CASRSHwDevice(void) + ??1CASRSVocManHwDevice@@UAE@XZ @ 2 NONAME ; CASRSVocManHwDevice::~CASRSVocManHwDevice(void) + ?AdaptL@CASRSVocManHwDevice@@QAEXEAAVCSIRule@@@Z @ 3 NONAME ; void CASRSVocManHwDevice::AdaptL(unsigned char, class CSIRule &) + ?Clear@CASRSHwDevice@@UAEXXZ @ 4 NONAME ; void CASRSHwDevice::Clear(void) + ?ComputeNRuleVariantsL@CASRSVocManHwDevice@@QAEXABVCSIGrammar@@KKABV?$RArray@I@@AAV3@AAK@Z @ 5 NONAME ; void CASRSVocManHwDevice::ComputeNRuleVariantsL(class CSIGrammar const &, unsigned long, unsigned long, class RArray const &, class RArray &, unsigned long &) + ?CustomInterface@CASRSHwDevice@@UAEPAXVTUid@@@Z @ 6 NONAME ; void * CASRSHwDevice::CustomInterface(class TUid) + ?InitializeL@CASRSHwDevice@@UAEXXZ @ 7 NONAME ; void CASRSHwDevice::InitializeL(void) + ?NewL@CASRSHwDevice@@SAPAV1@XZ @ 8 NONAME ; class CASRSHwDevice * CASRSHwDevice::NewL(void) + ?NewL@CASRSVocManHwDevice@@SAPAV1@XZ @ 9 NONAME ; class CASRSVocManHwDevice * CASRSVocManHwDevice::NewL(void) + ?Prune@CASRSVocManHwDevice@@QAEHABVCSIGrammar@@KAAV?$RArray@VTSIRuleVariantInfo@@@@@Z @ 10 NONAME ; int CASRSVocManHwDevice::Prune(class CSIGrammar const &, unsigned long, class RArray &) + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/vocmanhwdevice/eabi/asrsvocmanhwdeviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/vocmanhwdevice/eabi/asrsvocmanhwdeviceu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,20 @@ +EXPORTS + _ZN13CASRSHwDevice11InitializeLEv @ 1 NONAME + _ZN13CASRSHwDevice15CustomInterfaceE4TUid @ 2 NONAME + _ZN13CASRSHwDevice4NewLEv @ 3 NONAME + _ZN13CASRSHwDevice5ClearEv @ 4 NONAME + _ZN13CASRSHwDeviceD0Ev @ 5 NONAME + _ZN13CASRSHwDeviceD1Ev @ 6 NONAME + _ZN13CASRSHwDeviceD2Ev @ 7 NONAME + _ZN19CASRSVocManHwDevice21ComputeNRuleVariantsLERK10CSIGrammarmmRK6RArrayIjERS4_Rm @ 8 NONAME + _ZN19CASRSVocManHwDevice4NewLEv @ 9 NONAME + _ZN19CASRSVocManHwDevice5PruneERK10CSIGrammarmR6RArrayI18TSIRuleVariantInfoE @ 10 NONAME + _ZN19CASRSVocManHwDevice6AdaptLEhR7CSIRule @ 11 NONAME + _ZN19CASRSVocManHwDeviceD0Ev @ 12 NONAME + _ZN19CASRSVocManHwDeviceD1Ev @ 13 NONAME + _ZN19CASRSVocManHwDeviceD2Ev @ 14 NONAME + _ZTI13CASRSHwDevice @ 15 NONAME ; ## + _ZTI19CASRSVocManHwDevice @ 16 NONAME ; ## + _ZTV13CASRSHwDevice @ 17 NONAME ; ## + _ZTV19CASRSVocManHwDevice @ 18 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/vocmanhwdevice/group/asrvocmanhwdevicestub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/vocmanhwdevice/group/asrvocmanhwdevicestub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for AsrsVocManHwDeviceStub +* +*/ + + + + +#include + +#if defined( WINS ) || defined( WINSCW ) +TARGET asrsvocmanhwdevice.dll +#else +TARGET asrsvocmanhwdevice_stub.dll +#endif + +TARGETTYPE DLL +UID 0x1000008D 0x101FF92E // UID: 270530862 + +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE asrsvocmanhwdevice.cpp + +SOURCEPATH ../../common/src +SOURCE asrshwdevice.cpp + +USERINCLUDE ../inc ../src + +// This is a SYSTEMINCLUDE macro containing the middleware +// layer specific include directories +APP_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE ../../common/inc + +LIBRARY euser.lib + +// Users link against the non-stub name, so that rebuild is not necessary +EXPORTLIBRARY asrsvocmanhwdevice.lib + +// On ROM dll name is without the _stub part so that it can easily be +// replaced with the real dll +LINKAS asrsvocmanhwdevice.dll + +CAPABILITY CAP_GENERAL_DLL diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/vocmanhwdevice/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/vocmanhwdevice/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for AsrVocManHwDeviceStub. +* +*/ + + + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +asrvocmanhwdevicestub.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/vocmanhwdevice/src/asrsvocmanhwdevice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/vocmanhwdevice/src/asrsvocmanhwdevice.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Vocabulary handling stub functions. +* +*/ + + + + + + +// INCLUDE FILES +#include "asrsvocmanhwdevice.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CASRSVocManHwDevice::CASRSVocManHwDevice +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CASRSVocManHwDevice::CASRSVocManHwDevice() +: iVMAlgorithm( NULL ) + { + } + +// ----------------------------------------------------------------------------- +// CASRSVocManHwDevice::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CASRSVocManHwDevice::ConstructL() + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSVocManHwDevice::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CASRSVocManHwDevice* CASRSVocManHwDevice::NewL() + { + CASRSVocManHwDevice* self = new ( ELeave ) CASRSVocManHwDevice; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CASRSVocManHwDevice::~CASRSVocManHwDevice +// Destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CASRSVocManHwDevice::~CASRSVocManHwDevice() + { + } + + +// ----------------------------------------------------------------------------- +// CASRSVocManHwDevice::AdaptL +// Updates given scores +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSVocManHwDevice::AdaptL( + const TSIRuleVariantID /*aCorrectRuleVariantID*/, + CSIRule& /*aRule*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSVocManHwDevice::Prune +// Give information which items can be pruned +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CASRSVocManHwDevice::Prune( + const CSIGrammar& /*aGrammar*/, + const TUint32 /*aMinNumber*/, + RArray& /*aPrunedItems*/ ) + { + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CASRSVocManHwDevice::ComputeNRuleVariantsL +// Determine how many rule variants can be added to grammar +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CASRSVocManHwDevice::ComputeNRuleVariantsL( + const CSIGrammar& /*aGrammar*/, + const TUint32 /*aTargetNRuleVariants*/, + const TUint32 /*aMaxNRuleVariants*/, + const RArray& /*aNewRuleScores*/, + RArray& /*aNNewRuleVariants*/, + TUint32& /*aNPrune*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSVocManHwDevice::InitializeL +// Initializes the HW device. +// You only need this function, if you have called ClearL(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CASRSVocManHwDevice::InitializeL() + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CASRSVocManHwDevice::Clear +// Clears the HW device. +// You don't need this function, destructor does the same better +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CASRSVocManHwDevice::Clear() + { + } + +// ----------------------------------------------------------------------------- +// CASRSVocManHwDevice::CustomInterface +// Returns a custom interface. None implemented yet. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TAny* CASRSVocManHwDevice::CustomInterface(TUid /*aInterfaceUid*/) + { + return( NULL ); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// for DLL goodness +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason /*aReason*/ ) + { + return KErrNone; + } +#endif + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 srsfenginestub/vocmanhwdevice/src/asrsvocmanhwdevice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsfenginestub/vocmanhwdevice/src/asrsvocmanhwdevice.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,187 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Vocabulary pruning functions for speech recognition +* +*/ + + + + + + +#ifndef ASRSVOCMANHWDEVICE_H +#define ASRSVOCMANHWDEVICE_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CVocManAlgorithm; + +// CLASS DECLARATION + +/** +* Class for pruning +* When the grammar starts to get big, this class can prune +* least used rule variants away before adding new rules. +* +* @lib AsrsVocmanHwDevice.dll +* @since ?Series60_version +*/ +class CASRSVocManHwDevice : public CASRSHwDevice + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CASRSVocManHwDevice* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CASRSVocManHwDevice(); + + public: // Functions from base classes + + /** + * From CASRHwDevice + * Gets a custom interface + * @since 2.8 + * @param aInterfaceUid Uid of the interface. + * @return Pointer to the interface. Ownership depends on UID. + */ + TAny* CustomInterface(TUid aInterfaceUid); + + /** + * From CASRHwDevice + * Initializes the HW Device + * @since 2.8 + * @return None + */ + void InitializeL(); + + /** + * From CASRHwDevice + * Clear HW Device's allocated memory + * @since 2.8 + * @return None + */ + void Clear(); + + public: // New functions + + /** + * Use to adapt rule after recognition + * @since 2.6 + * @param aCorrectRuleVariantID Correctly recognized rule variant + * @param aRule Rule including correct variant + */ + IMPORT_C void AdaptL( const TSIRuleVariantID aCorrectRuleVariantID, + CSIRule& aRule ); + + /** + * Use to prune grammar. + * @since 2.6 + * @param aGrammar Grammar to be pruned + * @param aMinNumber Minimum number of items to be pruned + * @param aPrunedItems Information which items can be removed + * @return ETrue pruning successful, EFalse cannot be pruned + */ + IMPORT_C TBool Prune( const CSIGrammar& aGrammar, + TUint32 aMinNumber, + RArray& aPrunedItems); + + /** + * Use to determine number of new rule variants + * @since 2.6 + * @param aGrammar Grammar where new variants should be added to + * @param aTargetNRuleVariants Target number of rule variants in the grammar + * @param aMaxNRuleVariants Maximum number of rule variants in the grammar + * @param aNewRuleScores Score for each new rule + * @param aNNRuleVariants Number of rule variants for each rule. + * Array must be initialized as maximum number of rule variants per a rule. + * @return None + */ + IMPORT_C void ComputeNRuleVariantsL( const CSIGrammar& aGrammar, + const TUint32 aTargetNRuleVariants, + const TUint32 aMaxNRuleVariants, + const RArray& aNewRuleScores, + RArray& aNNewRuleVariants, + TUint32& aNPrune ); + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CASRSVocManHwDevice(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // CASRVocManHwDevice( const CASRVocManHwDevice& ); + // Prohibit assigment operator if not deriving from CBase. + // CASRVocManHwDevice& operator=( const CASRVocManHwDevice& ); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // ?one_line_short_description_of_data + CVocManAlgorithm* iVMAlgorithm; + + // Reserved pointer for future extension + TAny* iReserved; + + }; + +#endif // ASRSVOCMANHWDEVICE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/TVOutConfig/BWINS/TvOutConfigU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/TVOutConfig/BWINS/TvOutConfigU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?NewL@CTvOutConfig@@SAPAV1@XZ @ 1 NONAME ; class CTvOutConfig * CTvOutConfig::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/TVOutConfig/EABI/TvOutConfigU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/TVOutConfig/EABI/TvOutConfigU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,3 @@ +EXPORTS + _ZN12CTvOutConfig4NewLEv @ 1 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/TVOutConfig/Inc/tvoutconfigimp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/TVOutConfig/Inc/tvoutconfigimp.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the headers used in +* TVOutConfig Dummy Implementation. +* +*/ + + +#ifndef __TVOUTCONFIGIMP_H__ +#define __TVOUTCONFIGIMP_H__ + +//- Include Files ---------------------------------------------------------- + +#include +#include "tvoutconfig.h" + +//- Class Definitions ------------------------------------------------------- + +/** +Inherited implementation of CTvOutConfig +*/ +NONSHARABLE_CLASS(CTvOutConfigImp) : public CTvOutConfig + { + public: + CTvOutConfigImp(); + virtual ~CTvOutConfigImp(); + virtual TInt GetNumberOfHdmiModes(TUint& aNumberOfModes); + virtual TInt GetSupportedHdmiMode(TUint aModeNumber, TSupportedHdmiDviMode& aReadMode); + virtual TInt GetTvHwCapabilities(TTvSettings::TOutput aConnector, THwCapabilities& aReadCapabilities); + virtual TInt SetConfig(const TTvSettings& aTvSettings); + virtual TInt SetConfig(const THdmiDviTimings& aTvSettings); + virtual TInt GetConfig(TTvSettings& aTvSettings); + virtual TInt GetConfig(THdmiDviTimings& aTvSettings); + virtual TInt SettingsChangedListener(TRequestStatus& aListenerRequest); + virtual TInt SettingsChangedListenerCancel(); + virtual TInt StandByFigureMaxSizeInBytes(TUint& aMaxFigureSize); + virtual TInt StandByFigure(const TStandByFigure& aStandByFigure); + virtual TInt GetStandByFigure(TStandByFigure& aStandByFigure); + virtual TInt Enable(); + virtual TInt Disable(); + virtual TInt OnOffListener(TRequestStatus& aListenerRequest); + virtual TInt OnOffListenerCancel(); + virtual TBool Enabled(); + virtual TInt HdmiCableListener(TRequestStatus& aListenerRequest); + virtual TInt HdmiCableListenerCancel(); + virtual TBool HdmiCableConnected(); + virtual TInt SetAvailableTvConfigList(const RArray& aAnalogConfigs, const RArray& aHdmiConfigs); + virtual TInt GetAvailableTvConfigList(RArray& aAnalogConfigs, RArray& aHdmiConfigs); + virtual TInt AvailableTvConfigListListener(TRequestStatus& aListenerRequest); + virtual TInt AvailableTvConfigListListenerCancel(); + virtual TInt CopyProtectionStatusListener(TRequestStatus& aListenerRequest); + virtual TInt CopyProtectionStatusCancel(); + virtual TBool CopyProtectionStatus(); + virtual TInt CopyProtection(TBool aCopyProtectEnabled); + virtual void ConstructL(); + }; + +#endif //__TVOUTCONFIGIMP_H__ + +// End of File + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/TVOutConfig/Src/tvoutconfig.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/TVOutConfig/Src/tvoutconfig.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file implements the needed functions defined in + tvoutconfig.h part of TVOutConfig Dummy Implementation. +* +*/ + + +//- Include Files ---------------------------------------------------------- + +#include "tvoutconfig.h" +#include "tvoutconfigimp.h" + +//- External Data ----------------------------------------------------------- + +//- External Function Prototypes -------------------------------------------- + +//- Constants --------------------------------------------------------------- + +//- Macros ------------------------------------------------------------------ + +//- Global and Local Variables ---------------------------------------------- + +//- Local Function Prototypes ----------------------------------------------- + +//- Local Functions --------------------------------------------------------- + +//- Member Functions -------------------------------------------------------- + +//============================================================================= + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +EXPORT_C CTvOutConfig* CTvOutConfig::NewL() + { + + CTvOutConfigImp* result = new ( ELeave ) CTvOutConfigImp; + + CleanupStack::PushL( result ); + result->ConstructL(); + CleanupStack::Pop(); + + return result; + + } + +// End of File + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/TVOutConfig/Src/tvoutconfigimp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/TVOutConfig/Src/tvoutconfigimp.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,321 @@ +/* +* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implements the all the virtual functions derived from + CTvOutConfig TVOutConfig Dummy Implementation. +* +*/ + + +//- Include Files ---------------------------------------------------------- + +#include "tvoutconfigimp.h" + +//- External Data ----------------------------------------------------------- + +//- External Function Prototypes -------------------------------------------- + +//- Constants --------------------------------------------------------------- + +//- Macros ------------------------------------------------------------------ + +//- Global and Local Variables ---------------------------------------------- + +//- Local Function Prototypes ----------------------------------------------- + +//- Local Functions --------------------------------------------------------- + +//- Member Functions -------------------------------------------------------- + +//============================================================================= + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +CTvOutConfigImp::CTvOutConfigImp(): + CTvOutConfig() + { + + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +CTvOutConfigImp::~CTvOutConfigImp() + { + } + +//--------------------------------------------------------------------------- +/** + Dummy implementation. +*/ +void CTvOutConfigImp::ConstructL() + { + //This is dummy implementation. does nothing + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::SetConfig( const TTvSettings& /*aTvSettings*/ ) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::StandByFigureMaxSizeInBytes( TUint& /*aMaxFigureSize*/ ) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::StandByFigure( const TStandByFigure& /*aStandByFigure*/ ) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::Enable() + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::Disable() + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TBool CTvOutConfigImp::Enabled() + { + return EFalse; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::OnOffListener( TRequestStatus& /*aListenerRequest*/ ) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::OnOffListenerCancel() + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::HdmiCableListener(TRequestStatus& /*aListenerRequest*/ ) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::HdmiCableListenerCancel() + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::SetConfig( const THdmiDviTimings& /*aTvSettings*/ ) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TBool CTvOutConfigImp::HdmiCableConnected() + { + return EFalse; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::GetNumberOfHdmiModes(TUint& /*aNumberOfModes*/ ) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::GetSupportedHdmiMode(TUint /*aModeNumber*/, TSupportedHdmiDviMode& /*aReadMode*/ ) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::GetTvHwCapabilities(TTvSettings::TOutput /*aConnector*/, THwCapabilities& /*aReadCapabilities*/ ) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::GetConfig(TTvSettings& /*aTvSettings*/ ) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::GetConfig(THdmiDviTimings& /*aTvSettings*/ ) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::GetStandByFigure(TStandByFigure& /*aStandByFigure*/ ) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::SetAvailableTvConfigList(const RArray& /*aAnalogConfigs*/, const RArray& /*aHdmiConfigs*/) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h + */ +TInt CTvOutConfigImp::GetAvailableTvConfigList( RArray& /*aAnalogConfigs*/, RArray& /*aHdmiConfigs*/ ) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::AvailableTvConfigListListener(TRequestStatus& /*aListenerRequest*/) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::AvailableTvConfigListListenerCancel() + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::SettingsChangedListener(TRequestStatus& /*aListenerRequest*/) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::SettingsChangedListenerCancel() + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::CopyProtection( TBool /*aCopyProtectEnabled*/ ) + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TBool CTvOutConfigImp::CopyProtectionStatus() + { + return EFalse; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::CopyProtectionStatusCancel() + { + return KErrNotReady; + } + +//--------------------------------------------------------------------------- +/** + @see TvOutConfig.h +*/ +TInt CTvOutConfigImp::CopyProtectionStatusListener( TRequestStatus& /*aListenerRequest*/ ) + { + return KErrNotReady; + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/TVOutConfig/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/TVOutConfig/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* TVOutConfig Dummy Implementation. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +tvoutconfig + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/TVOutConfig/group/tvoutconfig.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/TVOutConfig/group/tvoutconfig.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2003-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* TVOutConfig Dummy Implementation. +* +*/ + + +#include + +target TvOutConfig.dll +targettype dll +uid 0x1000008D 0x101f6e00 + +vendorid VID_DEFAULT + +capability all -tcb + +//----------------------------- +// include paths -> +//----------------------------- + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../Inc + +//----------------------------- +// sources -> +//----------------------------- +sourcepath ../Src +source tvoutconfig.cpp +source tvoutconfigimp.cpp + +//----------------------------- +// needed libraries -> +//----------------------------- +library euser.lib + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/TVOutConfig/rom/TvOutConfig.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/TVOutConfig/rom/TvOutConfig.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: TvOutConfig ROM files. +* +*/ + +#ifndef TVOUTCONFIG_IBY +#define TVOUTCONFIG_IBY + + // GS TvOutConfig library: + file=ABI_DIR\BUILD_DIR\TvOutConfig.dll sys\bin\TvOutConfig.dll + +#endif // TVOUTCONFIG_IBY +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/AccPolCapRules.ini diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/AccPolGIDInt.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/AccPolGIDInt.dat Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1 @@ +HEADSET 999999 1 1 0 1 2440 0 0 0,0 0 0 0 0 0 0 0 0 2 0 2 diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/DBS_10205030_accpolicydb.db Binary file systemswstubs/accessorypolicyreference/data/DBS_10205030_accpolicydb.db has changed diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/ApplicationProtocol.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/ApplicationProtocol.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,142 @@ + + + +12 + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa33.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa33.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa34.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa34.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa35.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa35.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa36.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa36.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa37.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa37.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa38.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa38.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa39.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa39.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa40.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa40.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa41.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa41.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa42.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa42.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa43.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa43.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa44.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa44.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa45.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa45.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa46.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa46.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa47.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa47.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa48.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa48.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa49.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa49.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa50.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa50.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa51.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa51.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa52.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa52.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa53.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa53.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa54.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa54.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa55.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa55.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa56.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa56.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa57.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa57.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa58.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa58.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa59.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa59.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa60.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa60.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa61.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa61.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa62.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa62.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa63.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa63.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/Capa64.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/Capa64.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1078 @@ + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + +1 + + + + 1 + + + + 2 + + + + 4 + + + + 8 + + + + 16 + + + + 32 + + + + 64 + + + + 128 + + + + 256 + + + + 512 + + + + + 1024 + + + + 2048 + + + + 4096 + + + + 8192 + + + + 16384 + + + + 32768 + + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/CapaInfo.dta diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/CapabilityGroups.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/CapabilityGroups.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,271 @@ + + + + 13 + + + 4294967296 + + + + 8589934592 + + + + 17179869184 + + + + 34359738368 + + + + 68719476736 + + + + 137438953472 + + + + 274877906944 + + + + 549755813888 + + + + 1099511627776 + + + + + 2199023255552 + + + + 4398046511104 + + + + 8796093022208 + + + + 17592186044416 + + + + 35184372088832 + + + + 70368744177664 + + + + 140737488355328 + + + + 281474976710656 + + + + 562949953421312 + + + + 1125899906842624 + + + + 2251799813685248 + + + + 4503599627370496 + + + + 9007199254740992 + + + + 18014398509481984 + + + + 36028797018963968 + + + + 72057594037927936 + + + + 144115188075855872 + + + + 288230376151711744 + + + + 576460752303423488 + + + + 1152921504606846976 + + + + 2305843009213693952 + + + + 4611686018427387904 + + + + 9223372036854775808 + + + + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/DeviceType.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/DeviceType.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,145 @@ + + + + + + 10 + + + 65536 + + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/PhysicalConnection.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/XML/PhysicalConnection.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,141 @@ + + + +11 + + + 65536 + + + + 131072 + + + + 262144 + + + + 524288 + + + + 1048576 + + + + 2097152 + + + + 4194304 + + + + 8388608 + + + + 16777216 + + + + 33554432 + + + + 67108864 + + + + 134217728 + + + + 268435456 + + + + 536870912 + + + + 1073741824 + + + + 2147483648 + + + + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/XML/additional.dta diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/data/rules.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/data/rules.dat Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,7 @@ +SELECTION 1 TTY 010001 1 1 0 1 2444 0 0 0,0 0 0 0 0 0 0 0 0 0 0 0 2 0 2 +SELECTION 2 Loopset 010201 32 1 0 1 2320 0 0 0,1 -19 1 0 0 0 2 1 2 +SELECTION 4 Headset 010001 1 1 0 1 2444 0 0 0,0 0 0 0 0 0 0 0 0 0 0 0 2 0 2 +SELECTION 8 Headphones 010001 1 1 0 1 2188 0 0 0,0 0 0 0 0 0 0 0 0 2 0 2 +SELECTION 16 LineOut 010001 1 1 0 1 2188 0 0 0,0 0 0 0 0 0 0 0 0 2 1 2 +SELECTION 32 TVOut 000004 512 1 0 17 2188 0 0 0 1 0 0 0,0 0 0 0 0 0 0 0 0 2 1 2 0 0 0 +SELECTION 64 MusicStand 00000 4 1 0 1 2188 0 0 0,0 0 0 0 0 0 0 0 0 2 1 2 diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +#include + +PRJ_EXPORTS +#ifdef __ACCESSORY_FW + +../rom/AccRefPolicy.iby CORE_OS_LAYER_IBY_EXPORT_PATH(AccRefPolicy.iby) +../inc/AccPolProprietaryNameValuePairs.h OS_LAYER_PLATFORM_EXPORT_PATH( AccPolProprietaryNameValuePairs.h ) +../inc/AccPolPropGenericID.h OS_LAYER_PLATFORM_EXPORT_PATH( AccPolPropGenericID.h ) +../data/AccPolGIDInt.dat /epoc32/winscw/c/private/1020504A/AccPolGIDInt.dat +../data/AccPolCapRules.ini /epoc32/winscw/c/private/1020504A/AccPolCapRules.ini +../data/rules.dat /epoc32/winscw/c/private/1020504A/rules.dat + +../data/DBS_10205030_accpolicydb.db /epoc32/RELEASE/winscw/UDEB/Z/private/100012a5/DBS_10205030_accpolicydb.db +../data/DBS_10205030_accpolicydb.db /epoc32/RELEASE/winscw/UREL/Z/private/100012a5/DBS_10205030_accpolicydb.db +../data/DBS_10205030_accpolicydb.db /epoc32/data/z/private/100012a5/DBS_10205030_accpolicydb.db + +#endif // __ACCESSORY_FW + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/inc/AccPolPropGenericID.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/inc/AccPolPropGenericID.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: These definitions define the proprietary Generic ID features. +* +*/ + + +#ifndef ACCPOLPROPGENERICID_H +#define ACCPOLPROPGENERICID_H + +#include + +/** +* Proprietary Generic ID bit mask definitions. +* These definitions define the proprietary Generic ID features, e.g. +* -Device type bit mask definitions +* -Physical connection bit mask definitions +* -Application protocol bit mask definitions +* -Subblock definitions +* +* Proprietary NAME-VALUE PAIRS are defined in +* AccPolProprietaryNameValuePairs.h-file. +*/ + +// Device type bit mask definitions + +// Physical connection bit mask definitions + +// Application protocol bit mask definitions + +// Proprietary subblock +// const TUint64 KSBProprietaryCapabilityGroup = 0x100000000; // 00000 00100 00000 00000 00000 00000 00000 00000 + +#endif // ACCPOLPROPGENERICID + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/inc/AccPolProprietaryNameValuePairs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/inc/AccPolProprietaryNameValuePairs.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This header provides the proprietary Name/Value defintions of Name/Value pairs. +* +*/ + + +#ifndef ACCPOLPROPRIETARYNAMEVALUEPAIRS_H +#define ACCPOLPROPRIETARYNAMEVALUEPAIRS_H + +// INCLUDES +#include + +// CONSTANTS + +// Accessory capabilities can be described as name/value pairs. To use accessorys +// capabilities from generic identification, the user needs constants. These +// constants are referenced with name/value pairs. +// Name constants are defined to a certain numerical space. +// In this numerical space each of these constats is presented with a term called +// "name const literal". E.g. For name KAccAcousticEchoControl name const literal is +// "1#1#1". +// Accessory capabilities can be described the following values: name, value type, +// dynamic type, I/O type, description and bitmask. +// Name: Acoustic Echo Control +// --------------> Name of the capability +// Value Type: TBool +// --------------> Type of the value +// Dynamic Type: Dynamic/Static +// --------------> Indicates if value can change while accessory is connected. +// If value is dynamic type the client should registrate for +// listening indications for value changes. +// I/O Type: From accessory to terminal, input. +// --------------> I/O type indicates the direction how the state update is done. +// E.g.output indicated that user can use setValueL method. If +// accessory updates the value I/O type is input and if it done +// by the terminal I/O type is output. +// Description: Accessory supports acoustic echo control. If value is true terminal +// must disable its own echo control. To indicate if accessory has +// internal acoustic echo control. +// --------------> Description of the capability. + +// Format of capability: +// ===================== +// +// 0b 000001 00000 00010 +// ------ ----- ----- +// | | | +// | | |_5 bits for capability. Tells which bit is one (*). +// | |_5 bits for namespace, +// |_6 bits for capability group. Tells which bit is one (*). +// +// (*): +// 0b00 -> bit number 1 is one -> value is 0b0001=1 +// 0b01 -> bit number 2 is one -> value is 0b0010=2 +// 0b10 -> bit number 3 is one -> value is 0b0100=4 +// 0b11 -> bit number 4 is one -> value is 0b1000=8 +// + +// Proprietary NAME-VALUE PAIRS: + +// Name: Proprietary capability. +// Value: N/A +// Dynamic Type: N/A +// I/O Type: N/A +// Description: N/A +//const TUint32 KAccProprietaryCapability = 0x8000; + +#endif // ACCPOLPROPRIETARYNAMEVALUEPAIRS_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/accessorypolicyreference/rom/AccRefPolicy.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/accessorypolicyreference/rom/AccRefPolicy.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef ACCREFPOLICY_IBY +#define ACCREFPOLICY_IBY + +#ifdef __ACCESSORY_FW + +data=ZPRIVATE\100012a5\DBS_10205030_accpolicydb.db \Private\100012a5\DBS_10205030_accpolicydb.db + +#endif // __ACCESSORY_FW + +#endif // ACCREFPOLICY_IBY + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/asyreference/data/101F5500.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/asyreference/data/101F5500.rss Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation +* Declaration of ASYReferencePlugin ECom resource +* +*/ + + +// RESOURCE IDENTIFIER + +// INCLUDES +#include "ecom/registryinfov2.rh" +#include "AsyServiceUids.h" + +// CONSTANTS + +// MACROS + +// RESOURCE DEFINITIONS +// ----------------------------------------------------------------------------- +// +// 101F5500.rss +// Declares info for ASYReference implementations +// +// ----------------------------------------------------------------------------- +// + +RESOURCE REGISTRY_INFO ASYReferencePlugin + { + // UID for the DLL. See ASYReferencePlugin.mmp + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x101F5500; + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = KACCESSORYPLUGINAPIUID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x1000B000; + version_no = 1; + display_name = "0x101F5500"; + default_data = KACCESSORYPLUGINAPIMAINSERVICE; + opaque_data = "Heap=0x2BCD|Stack=0x1F00"; + rom_only = 1; + }, + IMPLEMENTATION_INFO + { + implementation_uid = 0x1000B001; + version_no = 1; + display_name = "0x101F5500"; + default_data = KACCESSORYPLUGINAPIHANDLER; + opaque_data = ""; + rom_only = 1; + } + }; + } + }; + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/asyreference/group/ASYReferencePlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/asyreference/group/ASYReferencePlugin.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for ASYReferencePlugin.dll +* +*/ + + +#include + +TARGET ASYReferencePlugin.dll +TARGETTYPE PLUGIN +VENDORID VID_DEFAULT + +// ECom Dll recognition UID followed by the unique UID for this dll +UID 0x10009D8D 0x101F5500 + +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../src + +SOURCE ASYReferencePluginProxy.cpp +SOURCE ASYReferenceCmdHandlerBase.cpp +SOURCE ASYReferenceMainServiceBase.cpp +SOURCE ASYmessage.cpp + +USERINCLUDE ../inc + +OS_LAYER_SYSTEMINCLUDE + +// The resource name should have to be same as the third UID above + +START RESOURCE ../data/101F5500.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET ASYReferencePlugin.rsc +#endif // SYMBIAN_SECURE_ECOM +END + +LIBRARY euser.lib +LIBRARY ASYProxy.lib +LIBRARY AccPolicy.lib +LIBRARY accclient.lib +LIBRARY acccontrol.lib +LIBRARY accpolicy.lib +LIBRARY accsrvutil.lib +LIBRARY asyproxy.lib + +MACRO API_TRACE_FLAG +MACRO COMPONENT_TRACE_FLAG diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/asyreference/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/asyreference/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../rom/ASYReference.iby CORE_OS_LAYER_IBY_EXPORT_PATH(ASYReference.iby) + +PRJ_MMPFILES +#ifdef __ACCESSORY_FW +ASYReferencePlugin.mmp +#endif // __ACCESSORY_FW + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/asyreference/inc/ASYAdaptation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/asyreference/inc/ASYAdaptation.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of MASYAdaptation class. MASYAdaptation class +* defines an example interface to receive events from lower layer and also command sending. +* +*/ + + + +#ifndef MASYADAPTATION_H +#define MASYADAPTATION_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class TASYMessage; + +// CLASS DECLARATION + +/** +* MASYAdaptation +*/ +class MASYAdaptation + { + + public: // New functions + + /** + * Indicates ASY about received response message + * @return none + */ + virtual void ProcessResponseL( TASYMessage& aMessage ) = 0; + + /** + * Indicates ASY about received error response message + * @return none + */ + virtual void ProcessErrorResponseL( TInt aErrorCode, TASYMessage& aMessage ) = 0; + + /** + * Indicates ASY about received event message + * @return none + */ + virtual void RaiseEventL( TASYMessage& aMessage ) = 0; + }; + +#endif // MASYADAPTATION_H + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/asyreference/inc/ASYReferenceCmdHandlerBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/asyreference/inc/ASYReferenceCmdHandlerBase.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation. +* +*/ + + +#ifndef CASYREFERENCECMDHANDLERBASE_H +#define CASYREFERENCECMDHANDLERBASE_H + +// INCLUDES +#include +#include "ASYAdaptation.h" +#include "ASYmessage.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +//class CSACSession; +class CASYReferenceMainServiceBase; + +// CLASS DECLARATION + +/** +* CSACAccessoryCommandHandler +* This class declarates the CSACAccessoryCommandHandler +*/ + +class CASYReferenceCmdHandlerBase : public CASYCommandHandlerBase, public MASYAdaptation + { + public: // constructor and destructor + + /** + * Constructor + */ + static CASYReferenceCmdHandlerBase* NewL(); + + /** + * Destructor. + */ + virtual ~CASYReferenceCmdHandlerBase(); + + private: // constuctors + + /** + * C++ constructor. + */ + CASYReferenceCmdHandlerBase(); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * Maps ASY command parameter to internal accessory feature + * @param aCommandParamRecord Accessory Server parameter + * @param aAccessoryFeature Internal accessory feature + */ + void MapCommandToAccessoryFeatureL( const TASYCommandParamRecord& aCommandParamRecord, + AccessoryFeature::TAccessoryFeature& aAccessoryFeature ); + + private: // functions from base classes + + /** + * From CASYCommandHandlerBase + * Processes command from Accessory FW + * @param aCommand Command + * @param aCmdParams Parameters + * @return none + */ + void ProcessCommandL( const TProcessCmdId aCommand, const TASYCmdParams& aCmdParams ); + + private: // functions from base classes + + /** + * From MASYAdaptation + * Indicates ASY about received response message + * @param aMessage Reference to a received message + * @return none + */ + void ProcessResponseL( TASYMessage& aMessage ); + + /** + * From MASYAdaptation + * Indicates ASY about received error response message + * @param aErrorCode Error code for current message + * @param aMessage Reference to a received message + * @return none + */ + void ProcessErrorResponseL( TInt aErrorCode, TASYMessage& aMessage ); + + /** + * From MASYAdaptation + * Indicates ASY about received accessory event message + * @param aMessage Reference to a received message + * @return none + */ + void RaiseEventL( TASYMessage& aMessage ); + + private: // data + + }; + +#endif //CASYREFERENCECMDHANDLERBASE_H + +// End of File + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/asyreference/inc/ASYReferenceMainServiceBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/asyreference/inc/ASYReferenceMainServiceBase.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation +* +*/ + + +#ifndef CASYREFERENCEMAINSERVICEBASE_H +#define CASYREFERENCEMAINSERVICEBASE_H + +// INCLUDES +#include +#include "ASYAdaptation.h" +#include "ASYmessage.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CAccConfigFileParser; +class RAccessoryControl; +class CAccConGenericID; + +// CLASS DECLARATION + +/** +* Declaration of CSACAccessoryConnectionHandler class. +*/ + +class CASYReferenceMainServiceBase : public CASYMainServiceBase, public MASYAdaptation + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CASYReferenceMainServiceBase* NewL(); + + /** + * Destructor. + */ + virtual ~CASYReferenceMainServiceBase(); + + private: // Constructors + + /** + * C++ constructor. + */ + CASYReferenceMainServiceBase(); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + + private: // Functions from base classes + + /** + * From CASYMainServiceBase + * @return Error code. + */ + TInt StartL(); + + private: // Functions from base classes + + /** + * From MASYAdaptation + * Indicates ASY about received response message + * @param aMessage Reference to a received message + * @return none + */ + void ProcessResponseL( TASYMessage& aMessage ); + + /** + * From MASYAdaptation + * Indicates ASY about received error response message + * @param aErrorCode Error code for current message + * @param aMessage Reference to a received message + * @return none + */ + void ProcessErrorResponseL( TInt aErrorCode, TASYMessage& aMessage ); + + /** + * From MASYAdaptation + * Indicates ASY about received event message + * @param aMessage Reference to a received message + * @return none + */ + void RaiseEventL( TASYMessage& aMessage ); + + public: // Enumerations + + // internal states + enum TState + { + EStateUnknown = 1, + EStateInitWait, + EStateInitOngoing, + EStateInitOk, + }; + + public: // New functions + + /** + * Signals that an accessory connection state has changed. + * @param aState Accessory Connection state + * @return void + */ + void ConnectionStateChangedL( AccessoryConnection::TConnectionStateInfoStruct& aState ); + + /** + * Changes internal state. + * @param aState Internal state + */ + void StateChangeL( TState aState ); + + /** + * Maps internal accessory feature to ASY command parameter + * @param aAccessoryFeature Internal accessory feature + * @param aCommandParamRecord Accessory Server parameter + */ + void MapAccessoryFeatureL( AccessoryFeature::TAccessoryFeature& aAccessoryFeature, + TASYCommandParamRecord& aCommandParamRecord ); + + + + private: // New functions + + /** + * Signals that an accessory feature state has changed. + * @param aState Feature State + * @return void + */ + void AccessoryFeatureStateBooleanChangedL( AccessoryFeature::TFeatureStateBooleanStruct& aState ); + + private: // Data + + // handle to accessory server subsession + RAccessoryControl* iAccessoryControl; + + // accessory configuration file parser + CAccConfigFileParser* iAccConfigFileParser; + + // internal state + TState iState; + + // Generic ID + CAccConGenericID* iConnectedAccessory; + }; + +#endif // CASYREFERENCEMAINSERVICEBASE_H + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/asyreference/inc/ASYmessage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/asyreference/inc/ASYmessage.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation +* +*/ + + + +#ifndef ASYMESSAGE_H +#define ASYMESSAGE_H + +// INCLUDES +#include +#include "ASYmessagedefinitions.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION +NONSHARABLE_CLASS( TASYMessage ); + +/** +* TASYMessage +* This class declarates the TASYMessage, which is a generic message class example. +* message class. +* +*/ +class TASYMessage + { + public: // Constructors and destructor + + /** + * Constructor. + * @param aGroup Message group. + * @param aID Message ID. + * @param aData Pointer to data. + */ + TASYMessage( const TUint32 aGroupId, const TUint32 aMessageId, + TDesC8& aData ); + + public: // New functions + + /** + * Returns message group + * @return Message group + */ + TUint32 GroupId(); + + /** + * Returns message id + * @return Message id + */ + TUint32 MessageId(); + + /** + * Returns message data + * @return Message data + */ + TDesC8& Data(); + + + private: // Data + // Group id + TUint32 iGroupId; + + // Message id + TUint32 iMessageId; + + // Message data + TDesC8& iData; + + }; + +#endif // ASYMESSAGE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/asyreference/inc/ASYmessagedefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/asyreference/inc/ASYmessagedefinitions.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation +* +*/ + + +#ifndef ASYMESSAGEDEFINITIONS_H +#define ASYMESSAGEDEFINITIONS_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +const TUint32 KASYMessageGroupAccessoryMessage = 0x00010001; /* Message group for Accessory messages */ +const TUint32 KASYMessageGroupAccessoryEvent = 0x00010002; /* Message group for Accessory events */ + + +typedef TBuf8< 15 > TASYAccessoryFeatureData; // Data + +namespace AccessoryConnection + { + enum TConnectionState + { + EStateNotConnected = 1, + EStateConnected + }; + + NONSHARABLE_STRUCT( TConnectionStateInfoStruct ) + { + TInt32 iAccessoryId; // specific accessory ID + TConnectionState iState; // Accessory connection state + }; + + NONSHARABLE_STRUCT( TConnectionStateInfoRetStruct ) + { + TConnectionStateInfoStruct iStateInfo; + TInt iErrorCode; + }; + } + +namespace AccessoryFeature + { + enum TAccessoryFeatureType + { + ETypeNotSupported = 0, + ETypeBoolean, + ETypeData + }; + + enum TAccessoryFeature + { + ENotSupported = 0, + EHeadphonesConnected, + EExternalPowerSourceConnected, + }; + + // Data type for getter (boolean and data) + NONSHARABLE_STRUCT( TFeatureStateGetStruct ) + { + TInt32 iAccessoryId; // specific accessory ID + TAccessoryFeature iFeature; // Feature + }; + + // Data type for boolean feature + NONSHARABLE_STRUCT( TFeatureStateBooleanStruct ) + { + TInt32 iAccessoryId; // specific accessory ID + TAccessoryFeature iFeature; // Feature + TBool iState; // Feature state (boolean) + }; + + NONSHARABLE_STRUCT( TFeatureStateBooleanRetStruct ) + { + TFeatureStateBooleanStruct iFeatureState; + TInt iErrorCode; + }; + + } + +// Example messages +// ----------------------------------------------------------------------------- + const TUint32 KASYMsgAccessoryConnectionHandlerInitCmd = 0x00000001; + +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- + const TUint32 KASYMsgAccessoryConnectionHandlerInitRet = 0x00000002; + typedef TPckgBuf< AccessoryConnection::TConnectionStateInfoRetStruct > TASYMsgAccessoryConnectionHandlerInitRetBuf; +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- + const TUint32 KASYMsgAccessoryGetValueBooleanCmd = 0x00000003; + + typedef TPckgBuf< AccessoryFeature::TFeatureStateGetStruct > TASYMsgAccessoryGetValueBooleanCmdBuf; +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- + const TUint32 KASYMsgAccessoryGetValueBooleanRet = 0x00000004; + + typedef TPckgBuf< AccessoryFeature::TFeatureStateBooleanRetStruct > TASYMsgAccessoryGetValueBooleanRetBuf; +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- + const TUint32 KASYMsgAccessorySetValueBooleanCmd = 0x00000005; + + typedef TPckgBuf< AccessoryFeature::TFeatureStateBooleanStruct > TASYMsgAccessorySetValueBooleanCmdBuf; +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- + const TUint32 KASYMsgAccessorySetValueBooleanRet = 0x00000006; + + typedef TPckgBuf< AccessoryFeature::TFeatureStateBooleanRetStruct > TASYMsgAccessorySetValueBooleanRetBuf; +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- + const TUint32 KASYMsgAccessoryConnectionStateChangedEvent = 0x00000007; + + typedef TPckgBuf< AccessoryConnection::TConnectionStateInfoStruct > TASYMsgAccessoryConnectionStateChangedEventBuf; +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- + const TUint32 KASYMsgAccessoryFeatureStateChangedEvent = 0x00000008; + + typedef TPckgBuf< AccessoryFeature::TFeatureStateBooleanStruct > TASYMsgAccessoryFeatureStateChangedEventBuf; +// ----------------------------------------------------------------------------- + +#endif // ASYMESSAGEDEFINITIONS_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/asyreference/inc/acc_debug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/asyreference/inc/acc_debug.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,234 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Macro definitions for tracing and debugging purposes. +* +*/ + + +#ifndef ACC_DEBUG_H +#define ACC_DEBUG_H + +#ifdef _DEBUG + +// INCLUDES +#include + +// CONSTANTS +_LIT( KComponent, "[AccFW:Component]" ); +_LIT( KThisFile, "[AccFW:Component] - Trace this file: %s, line: %d, compiled: %s %s" ); +_LIT( KAssertion, "[AccFW:Component] - Assertion failed: File: %s, line: %d, compiled: %s %s" ); +_LIT( KPanic, "[AccFW:Component] - Panic occurred: File: %s, line: %d, compiled: %s %s" ); +_LIT8( KDATE, __DATE__ ); +_LIT8( KTIME, __TIME__ ); + +// DATA TYPES +enum TTraceType + { + ETraceInit, + ETraceAssert, + ETracePanic + }; + +// INLINE FUNCTIONS + + // ----------------------------------------------------------------------------- + // ThisFileFunc + // ----------------------------------------------------------------------------- + inline void ThisFileFunc( const TDesC8& aFile, + TInt aLine, + TTraceType aType = ETraceInit ) + { + HBufC* fileBuf = HBufC::New( aFile.Length() + 1 ); + HBufC* dateBuf = HBufC::New( 32 ); + HBufC* timeBuf = HBufC::New( 32 ); + + if ( fileBuf != NULL && dateBuf != NULL && timeBuf != NULL ) + { + fileBuf->Des().Copy( aFile ); + timeBuf->Des().Copy( KTIME ); + dateBuf->Des().Copy( KDATE ); + + if ( aType == ETraceInit ) + { + RDebug::Print( KThisFile, + fileBuf->Des().PtrZ(), + aLine, + dateBuf->Des().PtrZ(), + timeBuf->Des().PtrZ() ); + } + + else if ( aType == ETraceAssert ) + { + RDebug::Print( KAssertion, + fileBuf->Des().PtrZ(), + aLine, + dateBuf->Des().PtrZ(), + timeBuf->Des().PtrZ() ); + } + + else if ( aType == ETracePanic ) + { + RDebug::Print( KPanic, + fileBuf->Des().PtrZ(), + aLine, + dateBuf->Des().PtrZ(), + timeBuf->Des().PtrZ() ); + } + + else + { + + } + } + + else + { + RDebug::Print( _L( "Assertion and memory allocation failed!" ) ); + } + + delete fileBuf; + delete dateBuf; + delete timeBuf; + } + + // ----------------------------------------------------------------------------- + // TraceAssertFunc + // ----------------------------------------------------------------------------- + inline void TraceAssertFunc( const TDesC8& aFile, TInt aLine ) + { + ThisFileFunc( aFile, aLine, ETraceAssert ); + } + + // ----------------------------------------------------------------------------- + // TracePanicFunc + // ----------------------------------------------------------------------------- + inline void TracePanicFunc( const TDesC8& aFile, TInt aLine ) + { + ThisFileFunc( aFile, aLine, ETracePanic ); + User::Panic( KComponent, KErrGeneral ); + } + +// MACROS + #define PANIC_IF_FALSE( a ) if ( !( a ) )\ + TracePanicFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ ) + + #define PANIC_IF_TRUE( a ) if ( ( a ) )\ + TracePanicFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ ) + + #define PANIC_ALWAYS\ + TracePanicFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ ) + + // ----------------------------------------------------------------------------- + // COMPONENT_TRACE_FLAG + // ----------------------------------------------------------------------------- + #ifdef COMPONENT_TRACE_FLAG + + #define COMPONENT_TRACE_THIS_FILE\ + ThisFileFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ ) + + #define COM_TRACE_( AAA ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr ); } while ( 0 ) + + #define COM_TRACE_1( AAA, BBB ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB ); } while ( 0 ) + + #define COM_TRACE_2( AAA, BBB, CCC ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC ); } while ( 0 ) + + #define COM_TRACE_3( AAA, BBB, CCC, DDD ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD ); } while ( 0 ) + + #define COM_TRACE_4( AAA, BBB, CCC, DDD, EEE ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD, EEE ); } while ( 0 ) + + #else + + #define COMPONENT_TRACE_THIS_FILE + + #define COM_TRACE_( AAA ) + #define COM_TRACE_1( AAA, BBB ) + #define COM_TRACE_2( AAA, BBB, CCC ) + #define COM_TRACE_3( AAA, BBB, CCC, DDD ) + #define COM_TRACE_4( AAA, BBB, CCC, DDD, EEE ) + + #endif // COMPONENT_TRACE_FLAG + + #define TRACE_ASSERT( a ) if ( !( a ) )\ + TraceAssertFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ ) + + #define TRACE_ASSERT_RETURN( a ) if ( !( ( a ) == KErrNone ) )\ + TraceAssertFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ ) + + #define TRACE_ASSERT_ALWAYS\ + TraceAssertFunc( TPtrC8( ( TText8* ) __FILE__ ), __LINE__ ) + + // ----------------------------------------------------------------------------- + // API_TRACE_FLAG + // ----------------------------------------------------------------------------- + #ifdef API_TRACE_FLAG + + #define API_TRACE_( AAA ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr ); } while ( 0 ) + + #define API_TRACE_1( AAA, BBB ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB ); } while ( 0 ) + + #define API_TRACE_2( AAA, BBB, CCC ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC ); } while ( 0 ) + + #define API_TRACE_3( AAA, BBB, CCC, DDD ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD ); } while ( 0 ) + + #define API_TRACE_4( AAA, BBB, CCC, DDD, EEE ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD, EEE ); } while ( 0 ) + + #else + + #define API_TRACE_( AAA ) + #define API_TRACE_1( AAA, BBB ) + #define API_TRACE_2( AAA, BBB, CCC ) + #define API_TRACE_3( AAA, BBB, CCC, DDD ) + #define API_TRACE_4( AAA, BBB, CCC, DDD, EEE ) + + #endif // API_TRACE_FLAG + +#else // _DEBUG + + #define TRACE_ASSERT( a ) + #define TRACE_ASSERT_RETURN( a ) a + #define TRACE_ASSERT_ALWAYS + + #define COM_TRACE_( AAA ) + #define COM_TRACE_1( AAA, BBB ) + #define COM_TRACE_2( AAA, BBB, CCC ) + #define COM_TRACE_3( AAA, BBB, CCC, DDD ) + #define COM_TRACE_4( AAA, BBB, CCC, DDD, EEE ) + + #define API_TRACE_( AAA ) + #define API_TRACE_1( AAA, BBB ) + #define API_TRACE_2( AAA, BBB, CCC ) + #define API_TRACE_3( AAA, BBB, CCC, DDD ) + #define API_TRACE_4( AAA, BBB, CCC, DDD, EEE ) + + #define COMPONENT_TRACE_THIS_FILE + + #define PANIC_IF_FALSE( a ) + #define PANIC_IF_TRUE( a ) + #define PANIC_ALWAYS + +#endif // _DEBUG + +#endif // ACC_DEBUG_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/asyreference/rom/ASYReference.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/asyreference/rom/ASYReference.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef ASYREFERENCE_IBY +#define ASYREFERENCE_IBY + +#ifdef __ACCESSORY_FW + +ECOM_PLUGIN(ASYReferencePlugin.dll, ASYReferencePlugin.rsc) + +#endif // __ACCESSORY_FW +#endif // ASYREFERENCE_IBY + +// End of File + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/asyreference/src/ASYReferenceCmdHandlerBase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/asyreference/src/ASYReferenceCmdHandlerBase.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,355 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation +* +*/ + + +// INCLUDE FILES + +#include "ASYReferenceCmdHandlerBase.h" +#include "ASYReferenceMainServiceBase.h" +#include "acc_debug.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CASYReferenceCmdHandlerBase* CASYReferenceCmdHandlerBase::NewL() + { + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceCmdHandlerBase::NewL() - Enter" ); + + CASYReferenceCmdHandlerBase * self = new(ELeave) CASYReferenceCmdHandlerBase( ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceCmdHandlerBase::NewL() - Return" ); + + return self; + } + +// ----------------------------------------------------------------------------- +// destructor. +// ----------------------------------------------------------------------------- +// +CASYReferenceCmdHandlerBase::~CASYReferenceCmdHandlerBase() + { + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceCmdHandlerBase::~CASYReferenceCmdHandlerBase() - Enter" ); + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceCmdHandlerBase::~CASYReferenceCmdHandlerBase() - Return" ); + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CASYReferenceCmdHandlerBase::CASYReferenceCmdHandlerBase() + { + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceCmdHandlerBase::CASYReferenceCmdHandlerBase() - Enter" ); + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceCmdHandlerBase::CASYReferenceCmdHandlerBase() - Return" ); + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +void CASYReferenceCmdHandlerBase::ConstructL() + { + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceCmdHandlerBase::CASYReferenceCmdHandlerBase() - Enter" ); + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceCmdHandlerBase::CASYReferenceCmdHandlerBase() - Return" ); + } + +// ----------------------------------------------------------------------------- +// CASYReferenceCmdHandlerBase::ProcessCommandL +// ----------------------------------------------------------------------------- +// +void CASYReferenceCmdHandlerBase::ProcessCommandL( + const TProcessCmdId aCommand, + const TASYCmdParams& aCmdParams ) + { + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceCmdHandlerBase::ProcessCommandL() - Enter" ); + + CASYReferenceMainServiceBase* connectionHandler = (CASYReferenceMainServiceBase *) ASYMainServiceBase(); + + if( !connectionHandler ) + { + User::Leave( KErrGeneral ); + } + + switch( aCommand ) + { + case ECmdProcessCommandInit: + { + + // Command received from Accessory Server. + + // Connection handler state is set ongoing. + connectionHandler->StateChangeL( CASYReferenceMainServiceBase::EStateInitOngoing ); + + // [A.2] Process command init is received from Accessory Server + // At this point it is possible to request from an Accessory Driver/Domestic OS if the accessory connection exists. + // In this example the Process response is send immediately to Accessory Server. + TASYMsgAccessoryConnectionHandlerInitRetBuf package; + + // Accessory is not connected to terminal. + package().iStateInfo.iState = AccessoryConnection::EStateNotConnected; + package().iStateInfo.iAccessoryId = 0xffffff; + TASYMessage message( KASYMessageGroupAccessoryMessage, KASYMsgAccessoryConnectionHandlerInitRet, package ); + + // Call straight ProcessResponse. + ProcessResponseL( message ); + + } + break; + + case ECmdGetValueBool: + { + + // [E.1] Command received from Accessory Server + + TASYMsgAccessoryGetValueBooleanCmdBuf cmdPackage; + + // Map and set feature + MapCommandToAccessoryFeatureL( aCmdParams(), cmdPackage().iFeature ); + + // Set Device ID + TInt32 deviceId = ( TInt32 ) aCmdParams().iGenericID.HWDeviceID(); + cmdPackage().iAccessoryId = deviceId; + + // + // [E.2] Send request to an Accessory Driver/Domestic OS. + // + + } + break; + + + case ECmdSetValueBool: + { + + // [E.1] Command received from Accessory Server + + TASYMsgAccessorySetValueBooleanCmdBuf cmdPackage; + + // Map and set feature + MapCommandToAccessoryFeatureL( aCmdParams(), cmdPackage().iFeature ); + + // Set Device ID + TInt32 deviceId = ( TInt32 ) aCmdParams().iGenericID.HWDeviceID(); + cmdPackage().iAccessoryId = deviceId; + + if( aCmdParams().iCmdValue ) + { + cmdPackage().iState = ETrue; + } + else + { + cmdPackage().iState = EFalse; + } + + // + // [E.2] Send request to an Accessory Driver/Domestic OS + // + + } + break; + + default: + + User::Leave( KErrNotSupported ); + break; + } + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceCmdHandlerBase::ProcessCommandL() - Enter" ); + } + +// ----------------------------------------------------------------------------- +// CASYReferenceCmdHandlerBase::ProcessResponseL +// ----------------------------------------------------------------------------- +// +void CASYReferenceCmdHandlerBase::ProcessResponseL( TASYMessage& aMessage ) + { + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceCmdHandlerBase::ProcessResponseL() - Enter" ); + // Response for previous made process command, received from an Accessory Driver/Domestic OS. + + CASYReferenceMainServiceBase* connectionHandler = (CASYReferenceMainServiceBase *) ASYMainServiceBase(); + + if( !connectionHandler ) + { + User::Leave( KErrGeneral ); + } + + switch ( aMessage.GroupId() ) + { + case KASYMessageGroupAccessoryMessage: + + switch ( aMessage.MessageId() ) + { + + case KASYMsgAccessoryConnectionHandlerInitRet: + { + + connectionHandler->StateChangeL( CASYReferenceMainServiceBase::EStateInitOk ); + + TASYMsgAccessoryConnectionHandlerInitRetBuf package; + package.Copy( aMessage.Data() ); + + if( package().iStateInfo.iState == AccessoryConnection::EStateConnected ) + { + // + // Accessory connection exists in Accessory Driver/Domestic OS, inform accessory connection handler. + // + connectionHandler->ConnectionStateChangedL( package().iStateInfo ); + } + + TAccValueTypeTBool state; + state.iValue = ETrue; + + // [A.3] After process responce for the previous made process command with init parameter + // Server is aware wheather accessory was connected or not ( to Accessory Server ). + + CASYCommandHandlerBase::ProcessResponseL( state, KErrNone ); + + } + break; + case KASYMsgAccessoryGetValueBooleanRet: + { + + // + // [E.3] Send response previous made process command ( to Accessory Server ). + // + TASYMsgAccessoryGetValueBooleanRetBuf response; + response.Copy( aMessage.Data() ); + + TAccValueTypeTBool state; + state.iValue = response().iFeatureState.iState; + CASYCommandHandlerBase::ProcessResponseL( state, KErrNone ); + + } + break; + + case KASYMsgAccessorySetValueBooleanRet: + { + + // + // [E.3] Send response previous made process command ( to Accessory Server ). + // + + TASYMsgAccessorySetValueBooleanRetBuf response; + response.Copy( aMessage.Data() ); + + TAccValueTypeTBool state; + TInt errorCode = response().iErrorCode; + state.iValue = response().iFeatureState.iState; + CASYCommandHandlerBase::ProcessResponseL( state, errorCode ); + + } + break; + + default: + { + + User::Leave( KErrGeneral ); + } + break; + } + + break; + + default: + { + + User::Leave( KErrGeneral ); + } + break; + } + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceCmdHandlerBase::ProcessResponseL() - Return" ); + } + +// ----------------------------------------------------------------------------- +// CSACAccessoryCommandHandler::ProcessErrorResponseL +// ----------------------------------------------------------------------------- +// +void CASYReferenceCmdHandlerBase::ProcessErrorResponseL( TInt /*aErrorCode*/, + TASYMessage& /*aMessage*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CASYReferenceCmdHandlerBase::MapCommandToAccessoryFeatureL( const TASYCommandParamRecord& aCommandParamRecord, + AccessoryFeature::TAccessoryFeature& aAccessoryFeature ) + { + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceCmdHandlerBase::MapCommandToAccessoryFeatureL() - Enter" ); + TUint32 param; + + //Couple of accessory feature examples which can be requested from an Accessory Driver/Domestic OS. + aCommandParamRecord.iNameRecord.GetName( param ); + + if( param == KAccAudioOutConnector ) + { + aAccessoryFeature = AccessoryFeature::EHeadphonesConnected; + } + else if( param == KAccExtPowerSupply ) + { + + aAccessoryFeature = AccessoryFeature::EExternalPowerSourceConnected; + } + else + { + + User::Leave( KErrArgument ); + } + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceCmdHandlerBase::MapCommandToAccessoryFeatureL() - Return" ); + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CASYReferenceCmdHandlerBase::RaiseEventL( TASYMessage& aMessage ) + { + + (void) aMessage; + } + +// End of file + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/asyreference/src/ASYReferenceMainServiceBase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/asyreference/src/ASYReferenceMainServiceBase.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,497 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation +* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include "ASYReferenceMainServiceBase.h" +#include "acc_debug.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CASYReferenceMainServiceBase::CASYReferenceMainServiceBase() + : iAccessoryControl() + , iAccConfigFileParser( NULL ) + , iState( EStateUnknown ) + , iConnectedAccessory( NULL ) + { + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::CASYReferenceMainServiceBase() - Enter" ); + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::CASYReferenceMainServiceBase() - Return" ); + } + +// ----------------------------------------------------------------------------- +// +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +void CASYReferenceMainServiceBase::ConstructL() + { + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::ConstructL() - Enter" ); + + // ConfigFileParser instance is created for GID parsing. + iAccConfigFileParser = CAccConfigFileParser::NewL( KNullDesC ); + + // AccessoryControl instance is created for Accessory Connection / Disconnection handling. + iAccessoryControl = new ( ELeave ) RAccessoryControl(); + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::ConstructL() - Return" ); + } + +// ----------------------------------------------------------------------------- +// +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CASYReferenceMainServiceBase* CASYReferenceMainServiceBase::NewL() + { + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::NewL() - Enter" ); + + CASYReferenceMainServiceBase * self = new ( ELeave ) CASYReferenceMainServiceBase(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::NewL() - Return" ); + + return self; + } + +// ----------------------------------------------------------------------------- +// +// destructor. +// ----------------------------------------------------------------------------- +// +CASYReferenceMainServiceBase::~CASYReferenceMainServiceBase() + { + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::~CASYReferenceMainServiceBase() - Enter" ); + + if( iAccessoryControl ) + { + iAccessoryControl->CloseSubSession(); + } + + delete iConnectedAccessory; + iConnectedAccessory = NULL; + + delete iAccessoryControl; + iAccessoryControl = NULL; + + delete iAccConfigFileParser; + iAccConfigFileParser = NULL; + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::~CASYReferenceMainServiceBase() - Return" ); + + } + +// ---------------------------------------------------------------------------------- +// CASYReferenceMainServiceBase::StartL +// ---------------------------------------------------------------------------------- +// +TInt CASYReferenceMainServiceBase::StartL() + { + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::StartL() - Enter" ); + + // + //CASYReferenceMainServiceBase internal state is change to InitWait + // + StateChangeL( EStateInitWait ); + + TInt err ( KErrNone ); + + + // + // Following syntax is used from now on to illustrate ASY sequences. + // + + // + // Comments of initialization sequence during terminal boot are marked as [A.n]. + // + + // + // Comments of accessory connection sequence are marked as [B.n] + // + + // + // Comments of accessory disconnection sequence are marked as [C.n] + // + + // + // Comments of internal state change of accessory feature are marked as [D.n] + // Example external headphones are connected to headset control unit. + + // + // Comments of getting/setting accessory internal state are marked as [E.n] + // + + // [A.1] Signals Accessory Server that ASY implementation is ready to receive commands. + // Process command by init parameter is received after signal method call + // (Receiver in this example is CASYReferenceCmdHandlerBase class). + Signal(); + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::StartL() - Return" ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CASYReferenceMainServiceBase::ProcessResponseL +// ----------------------------------------------------------------------------- +// +void CASYReferenceMainServiceBase::ProcessResponseL( TASYMessage& /*aMessage*/ ) + { + + } + +// ----------------------------------------------------------------------------- +// CASYReferenceMainServiceBase::ProcessErrorResponseL +// ----------------------------------------------------------------------------- +// +void CASYReferenceMainServiceBase::ProcessErrorResponseL( + TInt aErrorCode, + TASYMessage& aMessage ) + { + + (void) aMessage; + (void) aErrorCode; + + } + +// ----------------------------------------------------------------------------- +// CASYReferenceMainServiceBase::RaiseEventL +// ----------------------------------------------------------------------------- +// +void CASYReferenceMainServiceBase::RaiseEventL( TASYMessage& aMessage ) + { + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::RaiseEventL() - Enter" ); + + // + // [B.1], [C.1], [D.1] Accessory events are received from Accessory Driver/Domestic OS. + // + if( aMessage.GroupId() == KASYMessageGroupAccessoryEvent ) + { + // Event processing according the accessory event. + switch( aMessage.MessageId() ) + { + case KASYMsgAccessoryConnectionStateChangedEvent: + { + + // Accessory connection state is changed. + TASYMsgAccessoryConnectionStateChangedEventBuf package; + package.Copy( aMessage.Data() ); + + ConnectionStateChangedL( package() ); + } + break; + case KASYMsgAccessoryFeatureStateChangedEvent: + { + + // State of accessory feature is changed. + TASYMsgAccessoryFeatureStateChangedEventBuf package; + package.Copy( aMessage.Data() ); + + AccessoryFeatureStateBooleanChangedL( package() ); + } + break; + default: + User::Leave( KErrGeneral ); + break; + }; + } + else + { + User::Leave( KErrGeneral ); + } + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::RaiseEventL() - Return" ); + } + + +// ----------------------------------------------------------------------------- +// CASYReferenceMainServiceBase::StateChangeL +// ----------------------------------------------------------------------------- +// +void CASYReferenceMainServiceBase::StateChangeL( TState aState ) + { + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::StateChangeL() - Enter" ); + + TInt err ( KErrGeneral ); + + switch ( aState ) + { + case EStateInitWait: + { + + if ( iState != EStateUnknown ) + { + User::Leave( KErrGeneral ); + } + else + { + // + // initialization of event subscribe(s) can be done here. + // + } + } + break; + case EStateInitOngoing: + { + + if ( iState != EStateInitWait ) + { + User::Leave( KErrGeneral ); + } + // + // Current state extra handling can be added here, if needed. + // + } + break; + case EStateInitOk: + { + if ( iState != EStateInitOngoing ) + { + User::Leave( KErrGeneral ); + } + else + { + // + // Initialized sequence is ready, and session can be created to accessory control. + // + err = iAccessoryControl->CreateSubSession( CASYMainServiceBase::Session() ); + + if ( err != KErrNone ) + { + User::Leave( err ); + } + } + } + break; + + default: + { + User::Leave( KErrGeneral ); + } + break; + } + + // + // Example class state change. + // + iState = aState; + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::StateChangeL() - Return" ); + + } + + +// ----------------------------------------------------------------------------- +// CASYReferenceMainServiceBase::ConnectionStateChangedL +// ----------------------------------------------------------------------------- +// +void CASYReferenceMainServiceBase::ConnectionStateChangedL( AccessoryConnection::TConnectionStateInfoStruct& aState ) + { + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::ConnectionStateChangedL() - Enter" ); + // + // Accessory Connection handling example. + // + TRequestStatus status; + + switch( aState.iState ) + { + case AccessoryConnection::EStateConnected: + { + + // + // [B.2] Event of an accessory connection is raised to ASY from a Accessory Driver/Domestic OS. + // + + // Delete old Generic ID + if( iConnectedAccessory ) + { + + delete iConnectedAccessory; + iConnectedAccessory = NULL; + } + + TUint64 accessoryId( aState.iAccessoryId ); + + + iConnectedAccessory = CAccConGenericID::NewL(); + + // [B.3] Parse a new Generic ID according to the accessory spesific ID. + iAccConfigFileParser->FindL( iConnectedAccessory, accessoryId, KNullDesC ); + + // Check if accessory is not supported + if( ( iConnectedAccessory->GenericID().UniqueID() ) < 0 ) + { + // Accessory is not supported. Debug purpose. + } + else + { + // Accessory is supported. Debug purpose. + } + + // [B.4] Send connect accessory request to Accessory Server + iAccessoryControl->ConnectAccessory( status, iConnectedAccessory, EFalse ); + + // the WaitForRequest method can be used because ConnectAccessory is immediately complete by + // Accessory Server. + User::WaitForRequest( status ); + + } + break; + case AccessoryConnection::EStateNotConnected: + { + + // + // [C.2] Event of an accessory disconnection is raised to ASY from a Accessory Driver/Domestic OS. + // + + // [C.3] Get current Generic ID. + TAccPolGenericID genericId = iConnectedAccessory->GenericID(); + + // [C.4] Send disconnect request to Accessory Server. + iAccessoryControl->DisconnectAccessory( status, genericId ); + + // the WaitForRequest can be used because DisconnectAccessory is immediately complete by + // Accessory Server. + User::WaitForRequest( status ); + + delete iConnectedAccessory; + iConnectedAccessory = NULL; + } + break; + default: + { + User::Leave( KErrGeneral ); + } + break; + } + + if ( status.Int() != KErrNone ) + { + + } + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::ConnectionStateChangedL() - Return" ); + } + + +// ----------------------------------------------------------------------------- +// CASYReferenceMainServiceBase::AccessoryFeatureStateBooleanChangedL +// ----------------------------------------------------------------------------- +void CASYReferenceMainServiceBase::AccessoryFeatureStateBooleanChangedL( AccessoryFeature::TFeatureStateBooleanStruct& aState ) + { + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::AccessoryFeatureStateBooleanChangedL() - Enter" ); + + // [D.2] the accessory internal state is change. + + TASYCommandParamRecord record; + + // See accessory feature example --> MapAccessoryFeatureL method. + MapAccessoryFeatureL( aState.iFeature, record ); + + TAccValueTypeTBool state; + state.iValue = aState.iState; + + //Current Generic ID + TAccPolGenericID genericId = iConnectedAccessory->GenericID(); + + // [D.4] Accessory internal state change is indicated to Accessory Server. + iAccessoryControl->AccessoryValueChangedNotifyL( genericId, record.iNameRecord, state ); + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::AccessoryFeatureStateBooleanChangedL() - Return" ); + + } + +// ----------------------------------------------------------------------------- +// CASYReferenceMainServiceBase::MapAccessoryFeatureL +// ----------------------------------------------------------------------------- +void CASYReferenceMainServiceBase::MapAccessoryFeatureL( AccessoryFeature::TAccessoryFeature& aAccessoryFeature, + TASYCommandParamRecord& aCommandParamRecord ) + { + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::AccessoryFeatureStateBooleanChangedL() - Enter" ); + + // Couple feature examples + switch( aAccessoryFeature ) + { + + // [D.3] + //A headphone is not connected to the sound adapter which means that the accessory is not detected as a control connection (the headset icon is not shown on the phone display). + //Audio Out Connector capability value is updated by ASY when the headphone is connected to the sound adapter, which means that the accessory connection is updated as a control connection. + + case AccessoryFeature::EHeadphonesConnected: + { + aCommandParamRecord.iNameRecord.SetNameL( KAccAudioOutConnector ); + } + break; + case AccessoryFeature::EExternalPowerSourceConnected: + { + aCommandParamRecord.iNameRecord.SetNameL( KAccExtPowerSupply ); + } + break; + + default: + { + User::Leave( KErrGeneral ); + } + break; + } + + COM_TRACE_( "[AccFW:AsyReference] CASYReferenceMainServiceBase::AccessoryFeatureStateBooleanChangedL() - Return" ); + + } + +// End of file + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/asyreference/src/ASYReferencePluginProxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/asyreference/src/ASYReferencePluginProxy.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation +* +*/ + + +// INCLUDE FILES +#include "ASYReferenceMainServiceBase.h" +#include "ASYReferenceCmdHandlerBase.h" + +#include +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// Map the interface implementation UIDs to implementation factory functions +const TImplementationProxy ImplementationTable[] = + { + { { 0x1000B000 }, ( TProxyNewLPtr ) CASYReferenceMainServiceBase::NewL }, + { { 0x1000B001 }, ( TProxyNewLPtr ) CASYReferenceCmdHandlerBase::NewL } + }; + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// Exported proxy for instantiation method resolution. +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + return ImplementationTable; + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/asyreference/src/ASYmessage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/asyreference/src/ASYmessage.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The implementation of TASYMessage example class +* +*/ + + + +// INCLUDE FILES +#include "ASYmessage.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// TSASMessage::TSASMessage +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +TASYMessage::TASYMessage( const TUint32 aGroupId, const TUint32 aMessageId, TDesC8& aData ) + : iGroupId( aGroupId ), + iMessageId( aMessageId ), + iData( aData ) + { + } + +// ----------------------------------------------------------------------------- +// TSASMessage::GroupId() +// This function returns the group id of the SAS message +// ----------------------------------------------------------------------------- +// +TUint32 TASYMessage::GroupId() + { + + return iGroupId; + + } + +// ----------------------------------------------------------------------------- +// TSASMessage::MessageId() +// This function returns the message id of the SAS message +// ----------------------------------------------------------------------------- +// +TUint32 TASYMessage::MessageId() + { + + return iMessageId; + + } + +// ----------------------------------------------------------------------------- +// TSASMessage::Data() +// This function returns the transaction id of the SAS message +// ----------------------------------------------------------------------------- +// +TDesC8& TASYMessage::Data() + { + + return iData; + + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/ddcaccessstub/bwins/ddc_accessu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/ddcaccessstub/bwins/ddc_accessu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?ApiVersion@CDdcPortAccess@@SAIXZ @ 1 NONAME ; unsigned int CDdcPortAccess::ApiVersion(void) + ?NewL@CDdcPortAccess@@SAPAV1@XZ @ 2 NONAME ; class CDdcPortAccess * CDdcPortAccess::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/ddcaccessstub/eabi/ddc_accessu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/ddcaccessstub/eabi/ddc_accessu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + _ZN14CDdcPortAccess10ApiVersionEv @ 1 NONAME + _ZN14CDdcPortAccess4NewLEv @ 2 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/ddcaccessstub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/ddcaccessstub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Build information file for DDC Access Stub. +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +ddc_access.mmp diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/ddcaccessstub/group/ddc_access.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/ddcaccessstub/group/ddc_access.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Project definition file for DDC Access Stub. +* +*/ + +#include +#include + +TARGET ddc_access.dll +TARGETTYPE dll + +UID 0x1000008D 0x101f6e00 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE ddc_access.cpp +SOURCE ddc_accessimpl.cpp + +USERINCLUDE ../inc + +OS_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/ddcaccessstub/inc/ddc_accessimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/ddcaccessstub/inc/ddc_accessimpl.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * CDdcPortAccessImpl class declaration. + * + */ + +#ifndef DDCACCESSIMPL_H +#define DDCACCESSIMPL_H + +// SYSTEM INCLUDE FILES +#include +#include + +// USER INCLUDE FILES + +// FORWARD DECLARATIONS + +// DATA TYPES + +// CLASS DECLARATION + +/** + * DDC Access Stub implementation. + * + * @lib ddc_access.lib + * @since S60 TB9.2 + */ +NONSHARABLE_CLASS( CDdcPortAccessImpl ): public CDdcPortAccess + { +public: + + /** + * Symbian two phased constructors. + * + * @since S60 TB9.2 + * @param None. + * @return CDDCAccessImpl + */ + static CDdcPortAccessImpl* NewL(); + static CDdcPortAccessImpl* NewLC(); + + /** + * C++ destructor. + */ + virtual ~CDdcPortAccessImpl(); + +protected: // From base classes + + // @see CDdcPortAccess + virtual TInt Read( TDdcPort aDdcPort, + TUint aBlockNumber, + TDataBlock& aDataBlock, + TRequestStatus& aCompletedWhenRead ); + + // @see CDdcPortAccess + virtual void CancelAll(); + + // @see CDdcPortAccess + virtual void ConstructL(); + +private: + + CDdcPortAccessImpl(); + }; + +#endif // DDCACCESSIMPL_H diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/ddcaccessstub/rom/ddcaccessstub.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/ddcaccessstub/rom/ddcaccessstub.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: DDC Access Stub ROM files. +* +*/ + +#ifndef DDCACCESSSTUB_IBY +#define TVOUTCONFIG_IBY + +// GS TvOutConfig library: +file=ABI_DIR\BUILD_DIR\ddc_access.dll sys\bin\ddc_access.dll + +#endif // DDCACCESSSTUB_IBY +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/ddcaccessstub/src/ddc_access.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/ddcaccessstub/src/ddc_access.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * CDdcPortAccess class implementation. + * + */ + +// SYSTEM INCLUDES + +// USER INCLUDES +#include "ddc_access.h" +#include "ddc_accessimpl.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Symbian two phased constructor. +// --------------------------------------------------------------------------- +// +EXPORT_C CDdcPortAccess* CDdcPortAccess::NewL() + { + return CDdcPortAccessImpl::NewL(); + } + +//------------------------------------------------------------------------------ +// CDdcPortAccess::ApiVersion +//------------------------------------------------------------------------------ +// +EXPORT_C TUint CDdcPortAccess::ApiVersion() + { + return KDdcAccessVersion; + } + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/ddcaccessstub/src/ddc_accessimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/ddcaccessstub/src/ddc_accessimpl.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * CDdcPortAccessImpl class implementation. + * + */ + +// USER INCLUDES +#include "ddc_accessimpl.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// C++ constructor. +// --------------------------------------------------------------------------- +// +CDdcPortAccessImpl::CDdcPortAccessImpl() + { + + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor. +// --------------------------------------------------------------------------- +// +void CDdcPortAccessImpl::ConstructL() + { + + } + +// --------------------------------------------------------------------------- +// Symbian two phased constructor. +// --------------------------------------------------------------------------- +// +CDdcPortAccessImpl* CDdcPortAccessImpl::NewL() + { + CDdcPortAccessImpl* self = CDdcPortAccessImpl::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Symbian two phased constructor. +// Leaves pointer in the cleanup stack. +// --------------------------------------------------------------------------- +// +CDdcPortAccessImpl* CDdcPortAccessImpl::NewLC() + { + CDdcPortAccessImpl* self = new ( ELeave ) CDdcPortAccessImpl; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// C++ destructor. +// --------------------------------------------------------------------------- +// +CDdcPortAccessImpl::~CDdcPortAccessImpl() + { + + } + +//------------------------------------------------------------------------------ +// CDdcPortAccessImpl::Read +//------------------------------------------------------------------------------ +// +TInt CDdcPortAccessImpl::Read( TDdcPort /*aDdcPort*/, + TUint /*aBlockNumber*/, + TDataBlock& /*aDataBlock*/, + TRequestStatus& aCompletedWhenRead ) + { + TRequestStatus* status = &aCompletedWhenRead; + User::RequestComplete( status, KErrNotSupported ); + return KErrNotSupported; + } + +//------------------------------------------------------------------------------ +// CDdcPortAccessImpl::CancelAll +//------------------------------------------------------------------------------ +// +void CDdcPortAccessImpl::CancelAll() + { + // Nothing to do here. + } + +// End of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/BWINS/ISCDRIVEREXTENSIONU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/BWINS/ISCDRIVEREXTENSIONU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateLogicalDevice@@YAPAVDLogicalDevice@@XZ @ 1 NONAME ; class DLogicalDevice * __cdecl CreateLogicalDevice(void) + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/BWINS/ISCDRIVERU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/BWINS/ISCDRIVERU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,33 @@ +EXPORTS + ?CreateLogicalDevice@@YAPAVDLogicalDevice@@XZ @ 1 NONAME ; class DLogicalDevice * CreateLogicalDevice(void) + ??0DIscChannel@@QAE@PAVDLogicalDevice@@@Z @ 2 NONAME ; DIscChannel::DIscChannel(class DLogicalDevice *) + ??0DIscDevice@@QAE@XZ @ 3 NONAME ; DIscDevice::DIscDevice(void) + ??0DIscQueue@@QAE@PAPAKG@Z @ 4 NONAME ; DIscQueue::DIscQueue(unsigned long * *, unsigned short) + ??0DIscSendQueue@@QAE@PAPAKPAPAVTIscSendFrameInfo@@G@Z @ 5 NONAME ; DIscSendQueue::DIscSendQueue(unsigned long * *, class TIscSendFrameInfo * *, unsigned short) + ??1DIscDevice@@UAE@XZ @ 6 NONAME ; DIscDevice::~DIscDevice(void) + ??1DIscQueue@@UAE@XZ @ 7 NONAME ; DIscQueue::~DIscQueue(void) + ??1DIscSendQueue@@UAE@XZ @ 8 NONAME ; DIscSendQueue::~DIscSendQueue(void) + ?Add@DIscQueue@@QAEHPAX@Z @ 9 NONAME ; int DIscQueue::Add(void *) + ?Add@DIscSendQueue@@QAEHPAXGPAVDIscChannel@@0@Z @ 10 NONAME ; int DIscSendQueue::Add(void *, unsigned short, class DIscChannel *, void *) + ?CancelSending@DIscDevice@@QAEHGPBX@Z @ 11 NONAME ; int DIscDevice::CancelSending(unsigned short, void const *) + ?CompleteRequest@DIscDevice@@QAEXGHPBX@Z @ 12 NONAME ; void DIscDevice::CompleteRequest(unsigned short, int, void const *) + ?CopyFromUserBuffer@DIscDevice@@QAEHABVTDesC8@@AAVTDes8@@PBXH@Z @ 13 NONAME ; int DIscDevice::CopyFromUserBuffer(class TDesC8 const &, class TDes8 &, void const *, int) + ?CopyToUserBuffer@DIscDevice@@QAEHPAXABVTDesC8@@PBXH@Z @ 14 NONAME ; int DIscDevice::CopyToUserBuffer(void *, class TDesC8 const &, void const *, int) + ?DeleteFirst@DIscQueue@@QAEXXZ @ 15 NONAME ; void DIscQueue::DeleteFirst(void) + ?Empty@DIscQueue@@QAEHXZ @ 16 NONAME ; int DIscQueue::Empty(void) + ?FlushQueues@DIscDevice@@QAEXXZ @ 17 NONAME ; void DIscDevice::FlushQueues(void) + ?GetCaps@DIscDevice@@UBEXAAVTDes8@@@Z @ 18 NONAME ; void DIscDevice::GetCaps(class TDes8 &) const + ?GetFirst@DIscQueue@@QAEPAXXZ @ 19 NONAME ; void * DIscQueue::GetFirst(void) + ?GetFirstFrameInfo@DIscSendQueue@@QAEPAVTIscSendFrameInfo@@XZ @ 20 NONAME ; class TIscSendFrameInfo * DIscSendQueue::GetFirstFrameInfo(void) + ?GetThreadPtr@DIscDevice@@QAEPAVDThread@@PBX@Z @ 21 NONAME ; class DThread * DIscDevice::GetThreadPtr(void const *) + ?IsPending@DIscDevice@@QAEHGPBX@Z @ 22 NONAME ; int DIscDevice::IsPending(unsigned short, void const *) + ?NextBufferLength@DIscQueue@@QAEGXZ @ 23 NONAME ; unsigned short DIscQueue::NextBufferLength(void) + ?NotifyConnectionStatus@DIscDevice@@QAEXH@Z @ 24 NONAME ; void DIscDevice::NotifyConnectionStatus(int) + ?QueueFrame@DIscDevice@@QAEHGPBVTDesC8@@PBXPAX@Z @ 25 NONAME ; int DIscDevice::QueueFrame(unsigned short, class TDesC8 const *, void const *, void *) + ?Receive@DIscDevice@@QBEXPAVTDesC8@@@Z @ 26 NONAME ; void DIscDevice::Receive(class TDesC8 *) const + ?ReleaseMemoryBlock@DIscDevice@@QAEXPAVTDes8@@@Z @ 27 NONAME ; void DIscDevice::ReleaseMemoryBlock(class TDes8 *) + ?RemoveFirst@DIscQueue@@QAEPAXXZ @ 28 NONAME ; void * DIscQueue::RemoveFirst(void) + ?ReserveMemoryBlock@DIscDevice@@QAEXAAPAVTDes8@@G@Z @ 29 NONAME ; void DIscDevice::ReserveMemoryBlock(class TDes8 * &, unsigned short) + ?SetChannel@IscChannelContainer@@SAHPAVDIscChannel@@G@Z @ 30 NONAME ; int IscChannelContainer::SetChannel(class DIscChannel *, unsigned short) + ?ULFlowControl@DIscDevice@@QAEXHGPBX@Z @ 31 NONAME ; void DIscDevice::ULFlowControl(int, unsigned short, void const *) + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/BWINS/IscDataTransmissionBaseCWU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/BWINS/IscDataTransmissionBaseCWU.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,15 @@ +EXPORTS + ?CreateLogicalDevice@@YAPAVDLogicalDevice@@XZ @ 1 NONAME ; class DLogicalDevice * CreateLogicalDevice(void) + ??0DIscDataTransmissionBase@@QAE@XZ @ 2 NONAME ; DIscDataTransmissionBase::DIscDataTransmissionBase(void) + ??1DIscDataTransmissionBase@@UAE@XZ @ 3 NONAME ; DIscDataTransmissionBase::~DIscDataTransmissionBase(void) + ?AllocBuffers@DIscBufferAllocator@@QAEHXZ @ 4 NONAME ; int DIscBufferAllocator::AllocBuffers(void) + ?AllocBuffers@DIscDataTransmissionBase@@UAEXPAUTIscBufferEntry@@@Z @ 5 NONAME ; void DIscDataTransmissionBase::AllocBuffers(struct TIscBufferEntry *) + ?Connect@DIscDataTransmissionBase@@UAEXPAVDIscDevice@@@Z @ 6 NONAME ; void DIscDataTransmissionBase::Connect(class DIscDevice *) + ?Install@DIscDataTransmissionBase@@UAEHXZ @ 7 NONAME ; int DIscDataTransmissionBase::Install(void) + ?NotifyConnectionStatus@DIscDataTransmissionBase@@IAEXH@Z @ 8 NONAME ; void DIscDataTransmissionBase::NotifyConnectionStatus(int) + ?ReceiveFrame@DIscDataTransmissionBase@@IAEXAAVTDesC8@@@Z @ 9 NONAME ; void DIscDataTransmissionBase::ReceiveFrame(class TDesC8 &) + ?ReleaseMemoryBlock@DIscBufferAllocator@@QAEXPAVTDes8@@@Z @ 10 NONAME ; void DIscBufferAllocator::ReleaseMemoryBlock(class TDes8 *) + ?ReleaseMemoryBlock@DIscDataTransmissionBase@@UAEXPAVTDes8@@@Z @ 11 NONAME ; void DIscDataTransmissionBase::ReleaseMemoryBlock(class TDes8 *) + ?ReserveMemoryBlock@DIscBufferAllocator@@QAEXAAPAVTDes8@@G@Z @ 12 NONAME ; void DIscBufferAllocator::ReserveMemoryBlock(class TDes8 * &, unsigned short) + ?ReserveMemoryBlock@DIscDataTransmissionBase@@UAEXAAPAVTDes8@@G@Z @ 13 NONAME ; void DIscDataTransmissionBase::ReserveMemoryBlock(class TDes8 * &, unsigned short) + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/BWINS/IscMultiplexerBaseCWU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/BWINS/IscMultiplexerBaseCWU.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,21 @@ +EXPORTS + ?CreateLogicalDevice@@YAPAVDLogicalDevice@@XZ @ 1 NONAME ; class DLogicalDevice * CreateLogicalDevice(void) + ??0DIscMultiplexerBase@@QAE@XZ @ 2 NONAME ; DIscMultiplexerBase::DIscMultiplexerBase(void) + ??1DIscMultiplexerBase@@UAE@XZ @ 3 NONAME ; DIscMultiplexerBase::~DIscMultiplexerBase(void) + ?CancelSending@DIscMultiplexerBase@@IAEHGPBX@Z @ 4 NONAME ; int DIscMultiplexerBase::CancelSending(unsigned short, void const *) + ?CompleteRequest@DIscMultiplexerBase@@IAEXGHPBX@Z @ 5 NONAME ; void DIscMultiplexerBase::CompleteRequest(unsigned short, int, void const *) + ?Connect@DIscMultiplexerBase@@UAEXPAVDIscDevice@@@Z @ 6 NONAME ; void DIscMultiplexerBase::Connect(class DIscDevice *) + ?CopyFromUserBuffer@DIscMultiplexerBase@@IAEHABVTDesC8@@AAVTDes8@@PBXH@Z @ 7 NONAME ; int DIscMultiplexerBase::CopyFromUserBuffer(class TDesC8 const &, class TDes8 &, void const *, int) + ?CopyToUserBuffer@DIscMultiplexerBase@@IAEHPAXABVTDesC8@@PBXH@Z @ 8 NONAME ; int DIscMultiplexerBase::CopyToUserBuffer(void *, class TDesC8 const &, void const *, int) + ?CustomFunction@DIscMultiplexerBase@@UAEHGGPAXPBX@Z @ 9 NONAME ; int DIscMultiplexerBase::CustomFunction(unsigned short, unsigned short, void *, void const *) + ?FlushQueues@DIscMultiplexerBase@@IAEXXZ @ 10 NONAME ; void DIscMultiplexerBase::FlushQueues(void) + ?GetChannelInfo@DIscMultiplexerBase@@UAEHGAAVTDes8@@@Z @ 11 NONAME ; int DIscMultiplexerBase::GetChannelInfo(unsigned short, class TDes8 &) + ?Install@DIscMultiplexerBase@@UAEHXZ @ 12 NONAME ; int DIscMultiplexerBase::Install(void) + ?IsPending@DIscMultiplexerBase@@IAEHGPBX@Z @ 13 NONAME ; int DIscMultiplexerBase::IsPending(unsigned short, void const *) + ?QueueFrame@DIscMultiplexerBase@@IAEHGPBVTDesC8@@PBXPAX@Z @ 14 NONAME ; int DIscMultiplexerBase::QueueFrame(unsigned short, class TDesC8 const *, void const *, void *) + ?ReleaseMemoryBlock@DIscMultiplexerBase@@IAEXPAVTDes8@@@Z @ 15 NONAME ; void DIscMultiplexerBase::ReleaseMemoryBlock(class TDes8 *) + ?ReserveMemoryBlock@DIscMultiplexerBase@@IAEXAAPAVTDes8@@G@Z @ 16 NONAME ; void DIscMultiplexerBase::ReserveMemoryBlock(class TDes8 * &, unsigned short) + ?SetInitializationParameters@DIscMultiplexerBase@@UAEXABVTDesC8@@@Z @ 17 NONAME ; void DIscMultiplexerBase::SetInitializationParameters(class TDesC8 const &) + ?ULFlowControl@DIscMultiplexerBase@@IAEXHGPAX@Z @ 18 NONAME ; void DIscMultiplexerBase::ULFlowControl(int, unsigned short, void *) + ?GetThreadPtr@DIscMultiplexerBase@@IAEPAVDThread@@PBX@Z @ 19 NONAME ; class DThread * DIscMultiplexerBase::GetThreadPtr(void const *) + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/EABI/IscDataTransmissionBaseU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/EABI/IscDataTransmissionBaseU.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,17 @@ +EXPORTS + _ZN24DIscDataTransmissionBase12AllocBuffersEP15TIscBufferEntry @ 1 NONAME + _ZN24DIscDataTransmissionBase12ReceiveFrameER6TDesC8 @ 2 NONAME + _ZN24DIscDataTransmissionBase18ReleaseMemoryBlockEP5TDes8 @ 3 NONAME + _ZN24DIscDataTransmissionBase18ReserveMemoryBlockERP5TDes8t @ 4 NONAME + _ZN24DIscDataTransmissionBase22NotifyConnectionStatusEi @ 5 NONAME + _ZN24DIscDataTransmissionBase7ConnectEP10DIscDevice @ 6 NONAME + _ZN24DIscDataTransmissionBase7InstallEv @ 7 NONAME + _ZN24DIscDataTransmissionBaseC2Ev @ 8 NONAME + _ZN24DIscDataTransmissionBaseD0Ev @ 9 NONAME + _ZN24DIscDataTransmissionBaseD1Ev @ 10 NONAME + _ZN24DIscDataTransmissionBaseD2Ev @ 11 NONAME + _ZTI19DIscBufferAllocator @ 12 NONAME ; ## + _ZTI24DIscDataTransmissionBase @ 13 NONAME ; ## + _ZTV19DIscBufferAllocator @ 14 NONAME ; ## + _ZTV24DIscDataTransmissionBase @ 15 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/EABI/IscDriverExtensionU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/EABI/IscDriverExtensionU.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,5 @@ +EXPORTS + _Z19CreateLogicalDevicev @ 1 NONAME + _ZTI25DIscDriverExtensionDevice @ 2 NONAME ; ## + _ZTV25DIscDriverExtensionDevice @ 3 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/EABI/IscDriverU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/EABI/IscDriverU.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,53 @@ +EXPORTS + _Z19CreateLogicalDevicev @ 1 NONAME + _ZN10DIscDevice10QueueFrameEtPK6TDesC8PKvPv @ 2 NONAME + _ZN10DIscDevice11FlushQueuesEv @ 3 NONAME + _ZN10DIscDevice13CancelSendingEtPKv @ 4 NONAME + _ZN10DIscDevice13ULFlowControlEitPKv @ 5 NONAME + _ZN10DIscDevice15CompleteRequestEtiPKv @ 6 NONAME + _ZN10DIscDevice16CopyToUserBufferEPvRK6TDesC8PKvi @ 7 NONAME + _ZN10DIscDevice18CopyFromUserBufferERK6TDesC8R5TDes8PKvi @ 8 NONAME + _ZN10DIscDevice18ReleaseMemoryBlockEP5TDes8 @ 9 NONAME + _ZN10DIscDevice18ReserveMemoryBlockERP5TDes8t @ 10 NONAME + _ZN10DIscDevice22NotifyConnectionStatusEi @ 11 NONAME + _ZN10DIscDevice9IsPendingEtPKv @ 12 NONAME + _ZN10DIscDeviceC1Ev @ 13 NONAME + _ZN10DIscDeviceC2Ev @ 14 NONAME + _ZN10DIscDeviceD0Ev @ 15 NONAME + _ZN10DIscDeviceD1Ev @ 16 NONAME + _ZN10DIscDeviceD2Ev @ 17 NONAME + _ZN11DIscChannelC1EP14DLogicalDevice @ 18 NONAME + _ZN11DIscChannelC2EP14DLogicalDevice @ 19 NONAME + _ZN13DIscSendQueue17GetFirstFrameInfoEv @ 20 NONAME + _ZN13DIscSendQueue3AddEPvtP11DIscChannelS0_ @ 21 NONAME + _ZN13DIscSendQueueC1EPPmPP17TIscSendFrameInfot @ 22 NONAME + _ZN13DIscSendQueueC2EPPmPP17TIscSendFrameInfot @ 23 NONAME + _ZN13DIscSendQueueD0Ev @ 24 NONAME + _ZN13DIscSendQueueD1Ev @ 25 NONAME + _ZN13DIscSendQueueD2Ev @ 26 NONAME + _ZN19IscChannelContainer10SetChannelEP11DIscChannelt @ 27 NONAME + _ZN9DIscQueue11DeleteFirstEv @ 28 NONAME + _ZN9DIscQueue11RemoveFirstEv @ 29 NONAME + _ZN9DIscQueue16NextBufferLengthEv @ 30 NONAME + _ZN9DIscQueue3AddEPv @ 31 NONAME + _ZN9DIscQueue5EmptyEv @ 32 NONAME + _ZN9DIscQueue8GetFirstEv @ 33 NONAME + _ZN9DIscQueueC1EPPmt @ 34 NONAME + _ZN9DIscQueueC2EPPmt @ 35 NONAME + _ZN9DIscQueueD0Ev @ 36 NONAME + _ZN9DIscQueueD1Ev @ 37 NONAME + _ZN9DIscQueueD2Ev @ 38 NONAME + _ZNK10DIscDevice7GetCapsER5TDes8 @ 39 NONAME + _ZNK10DIscDevice7ReceiveEP6TDesC8 @ 40 NONAME + _ZTI10DIscDevice @ 41 NONAME ; ## + _ZTI11DIscChannel @ 42 NONAME ; ## + _ZTI13DIscSendQueue @ 43 NONAME ; ## + _ZTI17DIscMainRcvBuffer @ 44 NONAME ; ## + _ZTI9DIscQueue @ 45 NONAME ; ## + _ZTV10DIscDevice @ 46 NONAME ; ## + _ZTV11DIscChannel @ 47 NONAME ; ## + _ZTV13DIscSendQueue @ 48 NONAME ; ## + _ZTV17DIscMainRcvBuffer @ 49 NONAME ; ## + _ZTV9DIscQueue @ 50 NONAME ; ## + _ZN10DIscDevice12GetThreadPtrEPKv @ 51 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/EABI/IscMultiplexerBaseU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/EABI/IscMultiplexerBaseU.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,24 @@ +EXPORTS + _ZN19DIscMultiplexerBase10QueueFrameEtPK6TDesC8PKvPv @ 1 NONAME + _ZN19DIscMultiplexerBase11FlushQueuesEv @ 2 NONAME + _ZN19DIscMultiplexerBase13CancelSendingEtPKv @ 3 NONAME + _ZN19DIscMultiplexerBase13ULFlowControlEitPv @ 4 NONAME + _ZN19DIscMultiplexerBase14CustomFunctionEttPvPKv @ 5 NONAME + _ZN19DIscMultiplexerBase14GetChannelInfoEtR5TDes8 @ 6 NONAME + _ZN19DIscMultiplexerBase15CompleteRequestEtiPKv @ 7 NONAME + _ZN19DIscMultiplexerBase16CopyToUserBufferEPvRK6TDesC8PKvi @ 8 NONAME + _ZN19DIscMultiplexerBase18CopyFromUserBufferERK6TDesC8R5TDes8PKvi @ 9 NONAME + _ZN19DIscMultiplexerBase18ReleaseMemoryBlockEP5TDes8 @ 10 NONAME + _ZN19DIscMultiplexerBase18ReserveMemoryBlockERP5TDes8t @ 11 NONAME + _ZN19DIscMultiplexerBase27SetInitializationParametersERK6TDesC8 @ 12 NONAME + _ZN19DIscMultiplexerBase7ConnectEP10DIscDevice @ 13 NONAME + _ZN19DIscMultiplexerBase7InstallEv @ 14 NONAME + _ZN19DIscMultiplexerBase9IsPendingEtPKv @ 15 NONAME + _ZN19DIscMultiplexerBaseC2Ev @ 16 NONAME + _ZN19DIscMultiplexerBaseD0Ev @ 17 NONAME + _ZN19DIscMultiplexerBaseD1Ev @ 18 NONAME + _ZN19DIscMultiplexerBaseD2Ev @ 19 NONAME + _ZTI19DIscMultiplexerBase @ 20 NONAME ; ## + _ZTV19DIscMultiplexerBase @ 21 NONAME ; ## + _ZN19DIscMultiplexerBase12GetThreadPtrEPKv @ 22 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscApi/inc/IscDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscApi/inc/IscDefinitions.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,210 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + + +#ifndef ISCDEFINITIONS_H +#define ISCDEFINITIONS_H + +// INCLUDES +#ifndef __KERNEL_MODE__ +#include +#else +#include +#endif // __KERNEL_MODE__ + +// CONSTANTS +const TInt KIscNumberOfUnits = 64; + +// uncomment definition to support channel sharing +//#define ISC_CHANNEL_SHARING_IN_USE + +#ifdef ISC_CHANNEL_SHARING_IN_USE +// amount of how many users one channel can have +const TInt KIscMaxNumberOfChannelSharers = 3; +#else +const TInt KIscMaxNumberOfChannelSharers = 1; +#endif // ISC_CHANNEL_SHARING_IN_USE + +const TInt KIscIniLineLength = 256; + +// constant used by DIscMultiplexerBase::GetFrameInfo, +// TIscFrameInfo.DataMode +enum TIscFrameType + { + EIscNonDataFrame, + EIscDataFrame + }; + +// frame concatenation enumeration +enum TIscFrameConcatenation + { + EIscNoConcatenation, + EIscConcatenationDataStart, + EIscConcatenationData, + EIscConcatenationDataEnd + }; + +/** Connection status enumeration. +@see RIscApi::NotifyConnectionStatus +@see RIscApi::ConnectionStatus +@publishedPartner +@released +*/ +enum TIscConnectionStatus + { + /** + The connection is functional. + */ + EIscConnectionOk=0, + /** + The connection to baseband modem is not functional. + */ + EIscConnectionNotOk + }; + +/** Flow control status enumeration. +@see RIscApi::FlowControlStatus +@see RIscApi::NotifyFlowControl +@publishedPartner +@released +*/ +enum TIscFlowControlStatus + { + /** + Flow control is not active; i.e. the client can operate normally. + */ + EIscFlowControlOff=0, + /** + Flow control is invoked, meaning that the user may no longer send data until the status is back to EIscFlowControlOff. + */ + EIscFlowControlOn, + /** + Indicates that other end has finished sending data or the data connection has been removed. + */ + EIscTransmissionEnd + }; + +const TUint16 KIscControlChannel = 0x00; +const TUint16 KIscFirstChannel = 0x01; +const TUint16 KIscLastChannel = KIscNumberOfUnits-1; // Maximun number of channels in ISC driver framework + +const TUint16 KIscMaxChannelsInLdd = 0x20; // 32 + +const TUint16 KIscFrameReceiverNotFound = 0x500; + +const TUint16 KIscAllChannels = 0x100; + + +// MACROS + +// DATA TYPES + +// enumerations for asynchronous requests in ISC +enum TIscAsyncRequest + { + EIscAsyncInitializeModemInterface, + EIscAsyncOpen, + EIscAsyncLastKernelServerContext, // last kernel server context call + EIscAsyncSend, + EIscAsyncReceive, + EIscAsyncDataSend, + EIscAsyncDataReceive, + EIscAsyncNotifyConnectionStatus, + EIscAsyncNotifyFlowControlStatus, + EIscAsyncCustomOperation1, + EIscAsyncCustomOperation2, + EIscAsyncCustomOperation3, + EIscAsyncCustomOperation4, + EIscAsyncCustomOperation5, + EIscAsyncClose, + EIscAsyncLast + }; + +// enumerations for synchronous requests in ISC +enum TIscSyncRequest + { + EIscSyncClose = EIscAsyncLast, // 15 + EIscSyncLastKernelServerContext,// last kernel server context call + EIscSyncSend, + EIscSyncDataSend, + EIscSyncGetConnectionStatus, + EIscSyncGetFlowControlStatus, + EIscSyncGetChannelInfo, + EIscSyncGetMaximunDataSize, + EIscSyncCustomOperation1, + EIscSyncCustomOperation2, + EIscSyncCustomOperation3, + EIscSyncCustomOperation4, + EIscSyncCustomOperation5, + EIscSyncResetBuffers, + EIscSyncLast + }; + +// enumerations for canceling asynchronous requests in ISC +enum TIscCancelRequest + { + EIscCancelAsyncInitialize = EIscSyncLast, + EIscCancelAsyncOpen, + EIscCancelAsyncSend, + EIscCancelAsyncDataSend, + EIscCancelAsyncReceive, + EIscCancelAsyncDataReceive, + EIscCancelAsyncNotifyConnection, + EIscCancelAsyncNotifyFlowControl, + EIscCancelAsyncCustomOperation1, + EIscCancelAsyncCustomOperation2, + EIscCancelAsyncCustomOperation3, + EIscCancelAsyncCustomOperation4, + EIscCancelAsyncCustomOperation5, + EIscCancelAsyncClose, + EIscCancelLast + }; + +// Panic values used in ASSERT_RESET macro +// Can be seen as "FAULT [component] [TIscIfFault]" in trace or crash debugger +// e.g "FAULT IscDriver: 0x1" +enum TIscIfFault + { + EIscPanicSetChannel=1, // 1 + EIscPanicCreateLogicalDevice, // 2 + EIscMainRcvBufferOverflow, // 3 + EIscNotAllowedCallToDoRequest, // 4 + EIscNotAllowedCallToDoCancel, // 5 + EIscUnknownCommand, // 6 + EIscNullIscDriverPointer, // 7 + EIscMemoryAllocationFailure, // 8 + EIscRequestAlreadyActive, // 9 + EIscDriverNotFound, // 10 + EIscLogicalDevicesNotFound, // 11 + EIscMultiplexerNotFound, // 12 + EIscDataTransmissionDriverNotFound, // 13 + EIscMainRcvBufferInitialize, // 14 + EIscBufferAllocationFailure, // 15 + EIscControlBufferOverflow, // 16 + EIscInvalidChannelPtr // 17 only in debug mode + }; + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +#endif // ISCDEFINITIONS_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscApi/inc/IscTrace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscApi/inc/IscTrace.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef ISCTRACE_H +#define ISCTRACE_H + +// INCLUDES +// CONSTANTS + +// MACROS + +#ifdef TRACE_MODE_KERNEL + + // INCLUDES + #include + + #define _T(a) a +#else + + // INCLUDES + #include // RDebug + #include + + #define _T(a) _L(a) + +#endif // TRACE_MODE_KERNEL + +#ifdef _DEBUG + + #ifdef TRACE_MODE_KERNEL + #define __TRACE_PRINTF(a) Kern::Printf a + #else + #define __TRACE_PRINTF(a) RDebug::Print a + #endif + +#else + #define __TRACE_PRINTF(a) +#endif // _DEBUG + + +#ifdef _DEBUG + + void BuildTraceFunc( const TDesC& aPrefix ); + void DataDumpTraceFunc( const TDesC& aPrefix, const TDesC8& aData ); + + #define BUILD_TRACE( a ) BuildTraceFunc( a ) + #define DATA_DUMP_TRACE( a, b ) DataDumpTraceFunc( a, b ) + + #ifdef TRACE_MODE_KERNEL + + // define assertions + #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled=" __DATE__" "__TIME__, __LINE__ )) + + #else + + // define assertions + #ifdef __WINS__ + #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF((_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__)) + #else + #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF((_L("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__ __TIME__""),__LINE__ )) + #endif //__WINS__ + + #endif // TRACE_MODE_KERNEL + + + #if defined COMPONENT_TRACE_FLAG + #define C_TRACE(a) __TRACE_PRINTF(a) + #else + #define C_TRACE(a) + #endif // COMPONENT_TRACE_FLAG + + #if defined API_TRACE_FLAG + #define A_TRACE(a) __TRACE_PRINTF(a) + #else + #define A_TRACE(a) + #endif // API_TRACE_FLAG + + #if defined EXTENDED_TRACE_FLAG + #define E_TRACE(a) __TRACE_PRINTF(a) + #else + #define E_TRACE(a) + #endif // EXTENDED_TRACE_FLAG + +#else + #define TRACE_ASSERT(a) + #define C_TRACE(a) + #define A_TRACE(a) + #define E_TRACE(a) + #define BUILD_TRACE(a) + #define DATA_DUMP_TRACE(a, b) +#endif // _DEBUG + + +// Resets are made both in UDEB and UREL (traces only in udeb) +#ifdef TRACE_MODE_KERNEL + #define ASSERT_RESET_ALWAYS(a,b,c) if(!(a)) { __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__)); Kern::Fault(b,c); } + #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( ("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__) ) +#else + #ifdef __WINS__ + #define ASSERT_RESET_ALWAYS(a,b,c) error + #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__) ) + #else + #define ASSERT_RESET_ALWAYS(a,b,c) error + #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file=%s, line=%d, compiled=%s %s "),__FILE__, __LINE__, __DATE__, __TIME__) ) + #endif +#endif // kernel + + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +#endif // ISCTRACE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscApi/src/IscApi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscApi/src/IscApi.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1230 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of RIscApi class +* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include "IscTrace.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS +_LIT( KIscApiPanic,"IscApi Panic" ); +_LIT( KIscDriverName,"IscDriver" ); +_LIT( KIscDriverExtensionName,"IscDriverExtension" ); + +// MACROS + +// LOCAL CONSTANTS AND MACROS +_LIT( KIniFile,"Z:\\resource\\ISC\\isc_config.ini" ); +_LIT( KMultiplexerLdd,"MultiplexerLdd" ); +_LIT( KDataTransmissionLdd,"DataTransmissionLdd" ); +_LIT( KDataTransmissionPdd,"DataTransmissionPdd" ); +_LIT( KPdd,"PDD" ); +_LIT( KLdd,"LDD" ); +_LIT( KHashSign,"#" ); +_LIT( KSemiColon,";" ); +_LIT( KEqualSign,"=" ); + +_LIT( KIscDriverLdd, "iscdriver.ldd" ); +_LIT( KIscDriverExtensionLdd, "iscdriverextension.ldd" ); + +const TInt KZeroLength( KErrNone ); +const TInt KStartPosition( KErrNone ); +const TInt KOneParam( 1 ); +const TInt KTwoParams( 2 ); +const TInt KThreeParams( 3 ); +const TInt KFirstParam( 0 ); +const TInt KSecondParam( 1 ); +const TInt KThirdParam( 2 ); +const TInt KMajor( KErrNone ); +const TInt KMinor( KErrNone ); +const TInt KBuild( KErrNone ); +const TInt KAddPosition( 1 ); +const TInt KInfoLength( 1 ); + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// RIscApi::RIscApi +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C RIscApi::RIscApi() + :iNeededLen( NULL, KZeroLength ), + iNeededDataLen( NULL, KZeroLength ), + iConnectionStatus( NULL, KZeroLength ), + iFlowControlStatus( NULL, KZeroLength ), + iOpen( EFalse ), + iChannelNumber( KIscFrameReceiverNotFound ) +#ifdef __WINS__ + ,iInitializing( EFalse ) +#endif + { + } + + +EXPORT_C RIscApi::~RIscApi() + { + + if( iOpen || iChannelNumber != KIscFrameReceiverNotFound ) + { + Close(); + } + else + { + // Do nothing. + } + + } + + +// ----------------------------------------------------------------------------- +// RIscApi::Initialize +// Initialize the ISC Interface +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::InitializeModemInterface + ( + TRequestStatus& aStatus + ) + { + A_TRACE( ( _T( "RIscApi::InitializeModemInterface(0x%x)" ), &aStatus ) ); + +#ifdef __WINS__ + iInitializing = ETrue; +#endif + + CTrapCleanup* cleanup = CTrapCleanup::New(); + TInt r( KErrNone ); + TInt r2( KErrNone ); + HBufC8* multiplexerInit = NULL; + TRAP( r, ( multiplexerInit = HBufC8::NewL( KIscIniLineLength ) ) ); + // buffer to hold the init-string for second-level driver + HBufC8* dataTransmissionInit = NULL; + TRAP( r2, ( dataTransmissionInit = HBufC8::NewL( KIscIniLineLength ) ) ); + __ASSERT_ALWAYS( ( KErrNone == r && KErrNone == r2 ), + User::Panic( KIscApiPanic, EIscApiMemoryAllocationFailure ) ); + // Read ini-file and load needed drivers. + TRAP( r, LoadL( *multiplexerInit, *dataTransmissionInit ) ); + if( KErrAlreadyExists == r ) + { + TRACE_ASSERT_ALWAYS; + C_TRACE( ( _T( "RIscApi::InitializeModemInterface DRIVERS ERROR" ) ) ); + delete multiplexerInit; + multiplexerInit = NULL; + delete dataTransmissionInit; + dataTransmissionInit = NULL; + delete cleanup; + cleanup = NULL; + TRequestStatus* ptrStatus = &aStatus; + User::RequestComplete( ptrStatus, r ); + return; + } + else + { + __ASSERT_ALWAYS( ( KErrNone == r ), + User::Panic( KIscApiPanic,EIscApiDriverLoadFail ) ); + } + + // Open control channel + TInt channel( KIscControlChannel ); + TInt err = DoCreate( KIscDriverName, + TVersion( KMajor, KMinor, KBuild ), + channel, + NULL, + NULL, + EOwnerThread ); + __ASSERT_ALWAYS( KErrNone == err, + User::Panic( KIscApiPanic, EIscApiChannelCreateFail ) ); + iChannelNumber = static_cast( channel ); + iOpen = ETrue; + + TPtrC8 multiplexerInitString( multiplexerInit->Des() ); + TPtrC8 dataTransmissionInitString( dataTransmissionInit->Des() ); + TAny* params[ KThreeParams ]; + params[ KFirstParam ] = (TAny*)&aStatus; + params[ KSecondParam ] = static_cast( &multiplexerInitString ); + params[ KThirdParam ] = static_cast( &dataTransmissionInitString ); + + aStatus = KRequestPending; + //Initialize Data transmission + DoSvControl( EIscAsyncInitializeModemInterface, params ); + + delete multiplexerInit; + multiplexerInit = NULL; + delete dataTransmissionInit; + dataTransmissionInit = NULL; + delete cleanup; + cleanup = NULL; + +#ifdef __WINS__ + iInitializing = EFalse; +#endif + A_TRACE( ( _T( "RIscApi::InitializeModemInterfaceL - return void" ) ) ); + + } + +// ----------------------------------------------------------------------------- +// RIscApi::InitializeCancel +// Cancel ISC Initialization sequence +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::InitializeCancel() + { + A_TRACE( ( _T( "RIscApi::InitializeCancel()" ) ) ); + + if( iOpen && iChannelNumber == KIscControlChannel ) + { + DoControl( EIscCancelAsyncInitialize ); + } + else + { + // Do nothing if not controlchannel who is handling the initialization. + } + + A_TRACE( ( _T( "RIscApi::InitializeCancel - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::LoadL +// Load required drivers using Isc_config.ini file +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void RIscApi::LoadL + ( + const TDesC8& aMultiplexerInit, // Multiplexer init. + const TDesC8& aDataTransmissionInit // Datatransmission init. + ) const + { + C_TRACE( ( _T( "RIscApi::LoadL(0x%x, 0x%x)" ), &aMultiplexerInit, + &aDataTransmissionInit ) ); + + TInt err( KErrNone ); + TInt loadStatus( KErrNone ); + TInt pos( KErrNone ); + + // Temporary buffers. + HBufC* driverNameBuf = HBufC::NewLC( KIscIniLineLength ); + HBufC* iniFileLineBuf = HBufC::NewLC( KIscIniLineLength ); + HBufC* initStringBuf = HBufC::NewLC( KIscIniLineLength ); + // Temporary pointers. + TPtr driverName( driverNameBuf->Des() ); + TPtr initString( initStringBuf->Des() ); + TPtr iniFileLine( iniFileLineBuf->Des() ); + + RFs fsSession; + CleanupClosePushL( fsSession ); + RFile file; + CleanupClosePushL( file ); + TFileText fileText; + User::LeaveIfError( fsSession.Connect() ); + User::LeaveIfError( file.Open( fsSession, KIniFile, + EFileStreamText | EFileRead ) ); + fileText.Set( file ); + + while( KErrNone == fileText.Read( iniFileLine ) ) + { + if( KErrNone < iniFileLine.Length() ) + { + C_TRACE( ( iniFileLine ) ); + pos = KErrNotFound; + loadStatus = KErrNotFound; + if ( iniFileLine.Find( KHashSign ) != KErrNotFound ) + { + pos = KErrNone; + loadStatus = KErrNone; + } + else if ( iniFileLine.Find( KDataTransmissionPdd ) != KErrNotFound ) + { + C_TRACE( ( _T( "RIscApi::LoadL - datatransmissionpdd" ) ) ); + iniFileLine.Trim(); + pos = InifileLineParser( iniFileLine, driverName ); + if( KErrNotFound != pos ) + { + loadStatus = User::LoadPhysicalDevice( driverName ); + } + else + { + // Do nothing. + } + } + else if ( iniFileLine.Find( KDataTransmissionLdd ) != KErrNotFound ) + { + C_TRACE( ( iniFileLine ) ); + pos = InifileLineParser( iniFileLine, driverName ); + if( KErrNotFound != pos ) + { + DriverNameParser( initString, driverName, + *&aDataTransmissionInit ); + loadStatus = User::LoadLogicalDevice( driverName ); + } + else + { + // Do nothing. + } + } + else if ( iniFileLine.Find( KMultiplexerLdd ) != KErrNotFound ) + { + C_TRACE( ( iniFileLine ) ); + pos = InifileLineParser( iniFileLine, driverName ); + if( KErrNotFound != pos ) + { + DriverNameParser( initString, driverName, + *&aMultiplexerInit ); + loadStatus = User::LoadLogicalDevice( driverName ); + } + else + { + // Do nothing. + } + } + else if ( iniFileLine.Find( KPdd ) != KErrNotFound ) + { + C_TRACE( ( _T( "RIscApi::LoadL - pdd" ) ) ); + iniFileLine.Trim(); + pos = InifileLineParser( iniFileLine, driverName ); + if( KErrNotFound != pos ) + { + loadStatus = User::LoadPhysicalDevice( driverName ); + } + else + { + // Do nothing. + } + } + else if ( iniFileLine.Find( KLdd ) != KErrNotFound ) + { + RDebug::Print( _L( "RIscApi::LoadL ldd" ) ); + iniFileLine.Trim(); + pos = InifileLineParser( iniFileLine, driverName ); + if( KErrNotFound != pos ) + { + loadStatus = User::LoadLogicalDevice( driverName ); + } + else + { + // Do nothing. + } + } + __ASSERT_ALWAYS( pos != KErrNotFound, + User::Panic( KIscApiPanic, EIscApiFalseIniFile ) ); + __ASSERT_ALWAYS( KErrAlreadyExists != loadStatus, + User::Leave( loadStatus ) ); + __ASSERT_ALWAYS( KErrNone == loadStatus, + User::Panic( KIscApiPanic, EIscApiDriverLoadFail ) ); + } + else + { + C_TRACE( ( _T( "RIscApi::LoadL IniFileLength = KErrNone" ) ) ); + } + } + loadStatus = User::LoadLogicalDevice( KIscDriverLdd ); + err = User::LoadLogicalDevice( KIscDriverExtensionLdd ); + C_TRACE( ( _T( "RIscApi::LoadL drivers iscdriver %d, iscdriverext %d" ), + loadStatus, err ) ); + __ASSERT_ALWAYS( ( KErrNone == loadStatus|| KErrNone == err ), + User::Panic( KIscApiPanic, EIscApiDriverLoadFail ) ); + // R-Classes fsSession and file Close-method is called when deleted + // from CleanupStack. + CleanupStack::PopAndDestroy( KTwoParams ); + CleanupStack::PopAndDestroy( initStringBuf ); + CleanupStack::PopAndDestroy( iniFileLineBuf ); + CleanupStack::PopAndDestroy( driverNameBuf ); + C_TRACE( ( _T( "RIscApi::LoadL - return void" ) ) ); + + } + +// ----------------------------------------------------------------------------- +// IscApi::LoadLHelper +// Helps parsing the .ini file. +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt RIscApi::InifileLineParser + ( + TDes& aInifileLine, + TDes& aDriverName + ) const + { + C_TRACE( ( _T( "RIscApi::InifileLineParser" ) ) ); + + TInt position( KErrNotFound ); + position = aInifileLine.Find( KEqualSign ); + if( KErrNotFound != position ) + { + // Split the string. + C_TRACE( ( aInifileLine ) ); + aDriverName.Zero(); + aDriverName.Append( aInifileLine.Mid( position + KAddPosition ) ); + aInifileLine.Delete( KStartPosition, KIscIniLineLength ); + C_TRACE( ( aDriverName ) ); + } + else + { + // Do nothing. + } + C_TRACE( ( _T( "RIscApi::InifileLineParser return %d" ), position ) ); + return position; + + } + +// ----------------------------------------------------------------------------- +// IscApi::LoadLSecondHelper +// Helps parsing the .ini file. +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void RIscApi::DriverNameParser + ( + TDes& aInitString, + TDes& aDriverName, + const TDesC8& aString + )const + { + C_TRACE( ( _T( "RIscApi::DriverNameParser" ) ) ); + + TInt position = aDriverName.Find( KSemiColon ); + if( KErrNotFound != position ) + { + C_TRACE( ( aInitString ) ); + // Split the string. + aInitString.Zero(); + aInitString.Append( aDriverName.Mid( position + KAddPosition ) ); + aDriverName.Delete( position, KIscIniLineLength ); + C_TRACE( ( aDriverName ) ); + TPtr8 tmpPtr( ( static_cast( &const_cast( aString ) ) )->Des() ); + tmpPtr.Append( aInitString ); + C_TRACE( ( aInitString ) ); + } + else + { + // Do nothing. + } + C_TRACE( ( _T( "RIscApi::DriverNameParser return " ) ) ); + + } + +// ----------------------------------------------------------------------------- +// RIscApi::Open +// Open ISC channel asyncronously +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::Open( + const TUint16 aChannelNumber, + TRequestStatus& aStatus, + TOwnerType aType, + const TDesC8* aOpenParams ) + { + A_TRACE( ( _T( "RIscApi::Open(0x%x, 0x%x, 0x%x, 0x%x) this %x" ), + aChannelNumber, &aStatus, aType, aOpenParams, this ) ); + + // In case if async Close() is called but channel is not destructed, + // release kernel side memory allocations before actual channel opening. + if( iChannelNumber != KIscFrameReceiverNotFound && iOpen == EFalse ) + { + Close(); + } + else + { + // Do nothing. + } + +#ifdef __WINS__ + // InitializeModemInterface() must be called to load correct drivers. + // In HW this is done e.g. from EStart + + RMutex iscapiMutex; + if ( !iInitializing ) + { + C_TRACE( ( _T( "RIscApi::Open mutex creation" ) ) ); + TInt createErr( iscapiMutex.CreateGlobal( _L( "ISCAPICONNECT" ) ) ); + if ( createErr == KErrNoMemory ) + { + C_TRACE( ( _T( "RIscApi::Open mutex creation FAILED" ) ) ); + TRequestStatus* ptrStatus = &aStatus; + User::RequestComplete( ptrStatus, KErrNoMemory ); + return; + } + else if ( createErr ) + { + TInt openErr( iscapiMutex.OpenGlobal( _L( "ISCAPICONNECT" ) ) ); + if ( openErr ) + { + C_TRACE( ( _T( "RIscApi::Open mutex open FAILED" ) ) ); + TRequestStatus* ptrStatus = &aStatus; + User::RequestComplete( ptrStatus, KErrNoMemory ); + return; + } + else + { + // Do nothing. + } + } + else + { + // Do nothing. + } + iscapiMutex.Wait(); + } + + RDevice handle; + // If already openend, initialization not needed + TInt r = handle.Open( KIscDriverName ); + if( r == KErrNotFound && !iInitializing ) + { + RIscApi temp; + TRequestStatus status; + temp.InitializeModemInterface( status ); + iInitializing = EFalse; + + User::WaitForRequest( status ); + r = status.Int(); + + temp.Close(); + } + else + { + // Do nothing. + } + + if( !iInitializing ) + { + iscapiMutex.Signal(); + } + else + { + // Do nothing. + } + + if( r != KErrNone ) + { + C_TRACE( ( _T( "RIscApi::Open Initialization FAILED" ) ) ); + TRequestStatus* ptrStatus = &aStatus; + User::RequestComplete( ptrStatus, r ); + return; + } + else + { + // Do nothing. + } +#endif + + TBuf8 info; + TInt error( KErrInUse ); + if( !iOpen ) + { + // handle channels 1 .. 31, open channel to IscDriver + if ( aChannelNumber >= KIscFirstChannel + && aChannelNumber < KIscMaxChannelsInLdd ) + { + C_TRACE( ( _T( "RIscApi::Open 1st ldd" ) ) ); + info.Append( ( TUint8 )aChannelNumber ); + error = DoCreate( KIscDriverName, + TVersion( KMajor, KMinor, KBuild ), + ( TInt )aChannelNumber, + NULL, + &info, + aType ); + + } + // handle channels 32 .. 63, open channel to IscDriverExtension + else if ( aChannelNumber >= KIscMaxChannelsInLdd + && aChannelNumber < KIscNumberOfUnits ) + { + C_TRACE( ( _T( "RIscApi::Open 2nd ldd" ) ) ); + info.Append( ( TUint8 )aChannelNumber ); + TInt channelCount( aChannelNumber - KIscMaxChannelsInLdd ); + error = DoCreate( KIscDriverExtensionName, + TVersion( KMajor, KMinor, KBuild ), + channelCount, + NULL, + &info, + aType ); + } + // channel number out of range + else // illegal channel number + { + User::Panic( KIscApiPanic,EIscApiChannelNumberOutOfRange ); + } + } + + if ( error != KErrNone ) + { + C_TRACE( ( _T( "RIscApi::Open - Channel open Failed,\ + channel 0x%x error %d" ), aChannelNumber, error ) ); + TRequestStatus* ptrStatus = &aStatus; + User::RequestComplete( ptrStatus, error ); + } + else + { + iChannelNumber = aChannelNumber; + C_TRACE( ( _T( "RIscApi::Open iChannelNumber %d " ), iChannelNumber ) ); + iOpen = ETrue; + TAny* params[ KThreeParams ]; + params[ KFirstParam ] = (TAny*)&aStatus; + params[ KSecondParam ] = (TAny*)aChannelNumber; + params[ KThirdParam ] = (TAny*)aOpenParams; + + aStatus = KRequestPending; + error = DoSvControl( EIscAsyncOpen, params ); + } + + A_TRACE( ( _T( "RIscApi::Open - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::OpenCancel +// Cancel asynchronous channel opening +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::OpenCancel() + { + A_TRACE( ( _T( "RIscApi::OpenCancel() channel 0x%x" ), iChannelNumber ) ); + + PanicIfNotOpen(); + + DoSvControl( EIscCancelAsyncOpen ); + Close(); + + A_TRACE( ( _T( "RIscApi::OpenCancel - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::Close +// Close ISC Channel +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::Close() + { + A_TRACE( ( _T( "RIscApi::Close channel 0x%x" ), iChannelNumber ) ); + + if( iChannelNumber <= KIscLastChannel && iOpen ) + { + DoSvControl( EIscSyncClose ); + } + else + { + // Do nothing. + } + + iChannelNumber = KIscFrameReceiverNotFound; + iOpen = EFalse; + RHandleBase::Close(); + + A_TRACE( ( _T( "RIscApi::Close - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::Close +// Close ISC Channel +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::Close( TRequestStatus& aStatus ) + { + A_TRACE( ( _T( "RIscApi::Close(0x%x) channel (0x%x)" ), &aStatus, + iChannelNumber ) ); + + TAny* params[ KOneParam ]; + + params[ KFirstParam ] = (TAny*)&aStatus; + aStatus = KRequestPending; + if ( iChannelNumber <= KIscLastChannel && + iOpen ) + { + DoSvControl( EIscAsyncClose, params ); + } + else + { + C_TRACE((_T("RIscApi::Close FAILED"))); + TRequestStatus* ptrStatus = &aStatus; + User::RequestComplete( ptrStatus, KErrNotReady ); + } + + iOpen = EFalse; + + A_TRACE( ( _T( "RIscApi::Close - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIsaApi::ResetBuffers +// Resets buffers. +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::ResetBuffers() + { + A_TRACE( ( _T( "RIscApi::ResetBuffers() 0x%x" ), iChannelNumber ) ); + + PanicIfNotOpen(); + + DoSvControl( EIscSyncResetBuffers ); + + A_TRACE( ( _T( "RIscApi::ResetBuffers - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::Send +// Send data to Domestic OS ( asynchronous ) +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::Send( + TRequestStatus& aStatus, + const TDesC8& aData ) + { + A_TRACE( ( _T( "RIscApi::Send(0x%x, 0x%x) iChannelNumber (0x%x) this %x" ), + &aStatus, &aData, iChannelNumber, this ) ); + + PanicIfNotOpen(); + + TAny* params[ KTwoParams ]; + + params[ KFirstParam ] = (TAny*)&aStatus; + params[ KSecondParam ] = (TAny*)&aData; + + aStatus = KRequestPending; + DoControl( EIscAsyncSend, params ); + + A_TRACE( ( _T( "RIscApi::Send - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::Send +// Send data to Domestic OS ( synchronous ) +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RIscApi::Send( + const TDesC8& aData ) + { + A_TRACE( ( _T( "RIscApi::Send(0x%x) iChannelNumber (0x%x) this %x" ), + &aData, iChannelNumber, this ) ); + + + PanicIfNotOpen(); + + TInt error( KErrNone ); + + TAny* params[ KOneParam ]; + params[ KFirstParam ] = (TAny*)&aData; + + error = DoControl( EIscSyncSend, params ); + + A_TRACE( ( _T( "RIscApi::Send - return %d" ), error ) ); + return error; + } + +// ----------------------------------------------------------------------------- +// RIscApi::SendCancel +// Cancel asynchronous Send request +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::SendCancel() + { + A_TRACE( ( _T( "RIscApi::SendCancel(), channel 0x%x" ), iChannelNumber ) ); + + PanicIfNotOpen(); + + DoSvControl( EIscCancelAsyncSend ); + + A_TRACE( ( _T( "RIscApi::SendCancel - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::Receive +// Receive data from Domestic OS +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::Receive( + TRequestStatus& aStatus, + TDes8& aData, + TUint16& aNeededBufLen ) + { + A_TRACE( ( _T( "RIscApi::Receive 0x%x, 0x%x, 0x%x iChannelNumber 0x%x this\ + 0x%x" ), &aStatus, &aData, aNeededBufLen, iChannelNumber, this ) ); + + PanicIfNotOpen(); + + TAny* params[ KThreeParams ]; + + iNeededLen.Set( ( TUint8* )&aNeededBufLen, sizeof ( TUint16 ), sizeof ( TUint16 ) ); + + params[ KFirstParam ] = (TAny*)&aStatus; + params[ KSecondParam ] = (TAny*)&aData; + params[ KThirdParam ] = (TAny*)&iNeededLen; + + aStatus = KRequestPending; + DoControl( EIscAsyncReceive, params ); + + A_TRACE( ( _T( "RIscApi::Receive - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::ReceiveCancel +// Cancel data receiving from Domestic OS +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::ReceiveCancel() + { + A_TRACE( ( _T( "RIscApi::ReceiveCancel() iChannelNumber (0x%x)" ), + iChannelNumber ) ); + + PanicIfNotOpen(); + + DoControl( EIscCancelAsyncReceive ); + + A_TRACE( ( _T( "RIscApi::ReceiveCancel - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::DataReceiveCancel +// Cancel data receiving from Domestic OS +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::DataReceiveCancel() + { + A_TRACE( ( _T( "RIscApi::DataReceiveCancel() channel 0x%x" ), + iChannelNumber ) ); + + PanicIfNotOpen(); + + DoControl( EIscCancelAsyncDataReceive ); + + A_TRACE( ( _T( "RIscApi::DataReceiveCancel - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::ConnectionStatus +// Get the current connection status +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RIscApi::ConnectionStatus() + { + A_TRACE( ( _T( "RIscApi::ConnectionStatus() channel 0x%x" ), + iChannelNumber ) ); + + PanicIfNotOpen(); + + TInt state( EIscConnectionOk ); + + state = DoControl( EIscSyncGetConnectionStatus ); + + A_TRACE( ( _T( "RIscApi::ConnectionStatus - return 0x%x" ), state ) ); + + return state; + } + +// ----------------------------------------------------------------------------- +// RIscApi::NotifyConnectionStatus +// Listen for connection status changes +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::NotifyConnectionStatus( + TRequestStatus& aStatus, + TInt& aConnectionStatus ) + { + A_TRACE( ( _T( "RIscApi::NotifyConnectionStatus(0x%x, 0x%x)\ + iChannelNumber (0x%x)" ), &aStatus, aConnectionStatus, iChannelNumber ) ); + + PanicIfNotOpen(); + + TAny* params[ KTwoParams ]; + + iConnectionStatus.Set( ( TUint8* )&aConnectionStatus, + sizeof ( TInt ), sizeof ( TInt ) ); + + params[ KFirstParam ] = (TAny*)&aStatus; + params[ KSecondParam ] = (TAny*)&iConnectionStatus; + + aStatus = KRequestPending; + DoControl( EIscAsyncNotifyConnectionStatus, params ); + + A_TRACE( ( _T( "RIscApi::NotifyConnectionStatus - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::NotifyConnectionStatusCancel +// Stop listening for connection status changes +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::NotifyConnectionStatusCancel() + { + A_TRACE( ( _T( "RIscApi::NotifyConnectionStatusCancel() channel 0x%x" ), + iChannelNumber ) ); + + PanicIfNotOpen(); + + DoControl( EIscCancelAsyncNotifyConnection ); + + A_TRACE( ( _T( "RIscApi::NotifyConnectionStatusCancel - return void" ) ) ); + } + + +// ----------------------------------------------------------------------------- +// RIscApi::CustomFunction +// Asynchronous API extension function +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::CustomFunction( + TRequestStatus& aStatus, + const TUint16 aOperation, + TAny* aParameters ) + { + A_TRACE( ( _T( "RIscApi::CustomFunction(0x%x, 0x%x, 0x%x) iChannelNumber\ + 0x%x" ), &aStatus, aOperation, aParameters, iChannelNumber ) ); + + PanicIfNotOpen(); + + // Check if custom operation is out of range. + if ( aOperation < EIscAsyncCustomOperation1 + || aOperation > EIscAsyncCustomOperation5 ) + { + User::Panic( KIscApiPanic, EIscApiCustomFunctionUndefined ); + } + TAny* params[ KTwoParams ]; + + params[ KFirstParam ] = (TAny*)&aStatus; + params[ KSecondParam ] = aParameters; + + aStatus = KRequestPending; + DoSvControl( aOperation, params ); + + A_TRACE( ( _T( "RIscApi::CustomFunction - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::CustomFunction +// Synchronous API extension function +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RIscApi::CustomFunction( + const TUint16 aOperation, + TAny* aParameters ) + { + A_TRACE( ( _T( "RIscApi::CustomFunction(0x%x, 0x%x) iChannelNumber\ + (0x%x) this %x" ), aOperation, aParameters, iChannelNumber, this ) ); + + PanicIfNotOpen(); + + // Check if custom operation is out of range. + if ( aOperation < EIscSyncCustomOperation1 + || aOperation > EIscSyncCustomOperation5 ) + { + User::Panic( KIscApiPanic, EIscApiCustomFunctionUndefined ); + } + + TInt error( KErrNone ); + TAny* params[ KOneParam ]; + params[ KFirstParam ] = aParameters; + + error = DoSvControl( aOperation, params ); + + A_TRACE( ( _T( "RIscApi::CustomFunction - return %d" ), error ) ); + return error; + } + +// ----------------------------------------------------------------------------- +// RIscApi::CustomFunctionCancel +// Cancel the execution of the asynchronous API extension function +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::CustomFunctionCancel( + const TUint16 aOperation ) + { + A_TRACE( ( _T( "RIscApi::CustomFunctionCancel(0x%x) iChannelNumber (0x%x)" ) + , aOperation, iChannelNumber ) ); + + PanicIfNotOpen(); + + // Check if custom operation is out of range + if ( aOperation < EIscCancelAsyncCustomOperation1 + || aOperation > EIscCancelAsyncCustomOperation5 ) + { + User::Panic( KIscApiPanic, EIscApiCustomFunctionUndefined ); + } + + DoSvControl( aOperation ); + + A_TRACE( ( _T( "RIscApi::CustomFunctionCancel - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::DataSend +// Send data to Domestic OS ( asynchronous ) +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::DataSend( + TRequestStatus& aStatus, + const TDesC8& aData ) + { + A_TRACE( ( _T( "RIscApi::DataSend(0x%x, 0x%x) iChannelNumber 0x%x" ), + &aStatus, &aData, iChannelNumber ) ); + + PanicIfNotOpen(); + + TAny* params[ KTwoParams ]; + + params[ KFirstParam ] = (TAny*)&aStatus; + params[ KSecondParam ] = (TAny*)&aData; + + aStatus = KRequestPending; + DoControl( EIscAsyncDataSend, params ); + + A_TRACE( ( _T( "RIscApi::DataSend - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::DataSend +// Send data to Domestic OS ( synchronous ) +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RIscApi::DataSend( + const TDesC8& aData ) + { + A_TRACE( ( _T( "RIscApi::DataSend(0x%x) iChannelNumber 0x%x" ), + &aData, iChannelNumber ) ); + + PanicIfNotOpen(); + + TInt error( KErrNone ); + TAny* params[ KOneParam ]; + + params[ KFirstParam ] = (TAny*)&aData; + + error = DoControl( EIscSyncDataSend, params ); + + A_TRACE( ( _T( "RIscApi::DataSend - return %d" ), error ) ); + return error; + } + +// ----------------------------------------------------------------------------- +// RIscApi::DataSendCancel +// Cancel asynchronous DataSend request +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::DataSendCancel() + { + A_TRACE( ( _T( "RIscApi::DataSendCancel() iChannelNumber 0x%x" ), + iChannelNumber ) ); + + PanicIfNotOpen(); + + DoSvControl( EIscCancelAsyncDataSend ); + + A_TRACE( ( _T( "RIscApi::DataSendCancel - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::DataReceive +// Receive data from Domestic OS +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::DataReceive( + TRequestStatus& aStatus, + TDes8& aData, + TUint16& aNeededBufLen ) + { + A_TRACE( ( _T( "RIscApi::DataReceive(0x%x, 0x%x, 0x%x) iChannelNumber 0x%x" ), + &aStatus, &aData, aNeededBufLen, iChannelNumber ) ); + + PanicIfNotOpen(); + + TAny* params[ KThreeParams ]; + + iNeededDataLen.Set( ( TUint8* )&aNeededBufLen, sizeof ( TUint16 ),sizeof ( TUint16 ) ); + + params[ KFirstParam ] = (TAny*)&aStatus; + params[ KSecondParam ] = (TAny*)&aData; + params[ KThirdParam ] = (TAny*)&iNeededDataLen; + + aStatus = KRequestPending; + DoControl( EIscAsyncDataReceive, params ); + + A_TRACE( ( _T( "RIscApi::DataReceive - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::FlowControlStatus +// Get the current flow control status ( in uplink-direction ) +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RIscApi::FlowControlStatus() + { + A_TRACE( ( _T( "RIscApi::FlowControlStatus() channel 0x%x" ), + iChannelNumber ) ); + + PanicIfNotOpen(); + + TInt state( EIscFlowControlOff ); + + state = DoControl( EIscSyncGetFlowControlStatus ); + + A_TRACE( ( _T( "RIscApi::FlowControlStatus - return %d" ), state ) ); + + return state; + } + + +// ----------------------------------------------------------------------------- +// RIscApi::NotifyFlowControl +// Listen for flow control status changes +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::NotifyFlowControl( + TRequestStatus& aStatus, + TInt& aFlowControlStatus ) + { + A_TRACE( ( _T( "RIscApi::NotifyFlowControl(0x%x, 0x%x) channel 0x%x" ), + &aStatus, aFlowControlStatus, iChannelNumber ) ); + + PanicIfNotOpen(); + + TAny* params[ KTwoParams ]; + + iFlowControlStatus.Set( ( TUint8* )&aFlowControlStatus,sizeof ( TInt ),sizeof ( TInt ) ); + + params[ KFirstParam ] = (TAny*)&aStatus; + params[ KSecondParam ] = (TAny*)&iFlowControlStatus; + + aStatus = KRequestPending; + DoControl( EIscAsyncNotifyFlowControlStatus, params ); + + A_TRACE( ( _T( "RIscApi::NotifyFlowControl - return void" ) ) ); + } + + +// ----------------------------------------------------------------------------- +// RIscApi::NotifyFlowControlCancel +// Stop listening for flow control status changes +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RIscApi::NotifyFlowControlCancel() + { + A_TRACE( ( _T( "RIscApi::NotifyFlowControlCancel()" ) ) ); + + PanicIfNotOpen(); + + DoControl( EIscCancelAsyncNotifyFlowControl ); + + A_TRACE( ( _T( "RIscApi::NotifyFlowControlCancel - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// RIscApi::MaximumDataSize +// Get maximun data size ( for sending and receiving ) +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RIscApi::MaximumDataSize() + { + A_TRACE( ( _T( "RIscApi::MaximumDataSize() channel 0x%x" ), + iChannelNumber ) ); + + PanicIfNotOpen(); + + TInt r = DoControl( EIscSyncGetMaximunDataSize ); + A_TRACE( ( _T( "RIscApi::MaximumDataSize - return 0x%x" ), r ) ); + return r; + + } + +// ----------------------------------------------------------------------------- +// RIscApi::GetChannelInfo +// Get channel info from multiplexer +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RIscApi::GetChannelInfo( + const TUint16 aChannel, + TDes8& aInfo ) + { + A_TRACE( ( _T( "RIscApi::GetChannelInfo(0x%x, 0x%x)" ), + aChannel, &aInfo ) ); + + PanicIfNotOpen(); + + TAny* params[ KTwoParams ]; + params[ KFirstParam ] = (TAny*)aChannel; + params[ KSecondParam ] = (TAny*)&aInfo; + + TInt error = DoControl( EIscSyncGetChannelInfo, params ); + + A_TRACE( ( _T( "RIscApi::GetChannelInfo - return %d" ), error ) ); + return error; + } + +// ----------------------------------------------------------------------------- +// IscApi::PanicIfNotOpen +// Panic if channel is not opened yet +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void RIscApi::PanicIfNotOpen() const + { + + if( !iOpen ) + { + C_TRACE( ( _T( "IscApi::PanicIfNotOpen() channel 0x%x" ), + iChannelNumber ) ); + User::Panic( KIscApiPanic, EIscApiChannelNotOpen ); + } + else + { + // Do nothing. + } + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDataTransmissionBase/inc/IscBufferAllocator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDataTransmissionBase/inc/IscBufferAllocator.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Reference implementation for ISC buffer allocator. +* +*/ + + + + +#ifndef ISCBUFFERALLOCATOR_H +#define ISCBUFFERALLOCATOR_H + +// INCLUDES +#include + +#include "IscDataTransmissionBase.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class DIscDevice; +class IscBufferQueue; +class DPlatChunkHw; +class DIscBufferQueue; + +// CLASS DECLARATION + + +/** +* Manages pre-allocated memory blocks +* +* @lib IscDataTransmissionBase.LIB +* @since 2.8 +*/ +class DIscBufferAllocator //: public DLogicalDevice + { + public: // Constructors and destructor + + DIscBufferAllocator( TIscBufferEntry* aBufferConfig ); + virtual ~DIscBufferAllocator(); + + public: // New functions + + /** + * This method reserves pre-allocated memory block for sending/receiving frames + * @since 2.8 + * @param TDes8*& aPtr a reference to pointer of descriptor + * @param TUint16 aSize The minimum size of needed memory block + * @return void + */ + IMPORT_C void ReserveMemoryBlock( TDes8*& aPtr, TUint16 aSize ); + + /** + * This method releases memory block allocated with ReserveMemoryBlock + * @since 2.8 + * @param TDes8* aPtr a pointer to descriptor that is to be released + * @return void + */ + IMPORT_C void ReleaseMemoryBlock( TDes8* aPtr ); + + /** + * This method makes the buffer allocations according to the + * configuration specified by the ISC Multiplexer + * @since 2.8 + * @return TInt KErrNone if succesful + */ + IMPORT_C TInt AllocBuffers(); + + + private: + + /** + * This method makes the physical buffer allocations + * @since 2.8 + * @param TInt aPages amount of needed pages to allocate + * @return void + */ + void AllocPhMemory( TInt aPages ); + + private: // Data + + TIscBufferEntry iBufferConfig[KIscBufferAmount]; + DIscBufferQueue** iBuffers; + +#ifndef __WINS__ + DPlatChunkHw* iBufferChunk; + TLinAddr iCurrentAddress; +#endif + + }; + +#endif // ISCBUFFERALLOCATOR + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDataTransmissionBase/inc/IscBufferQueue.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDataTransmissionBase/inc/IscBufferQueue.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of DIscBufferQueue class +* +*/ + + + +#ifndef ISCBUFFERQUEUE_H +#define ISCBUFFERQUEUE_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class DIscQueue; + +// CLASS DECLARATION + +/** +* Queue class for buffer allocation and management +* +* @lib IscDataTransmissionBase.LIB +* @since 2.8 +*/ +class DIscBufferQueue + { + public: // Constructors and destructor + + /** + * C++ default constructor. + */ + DIscBufferQueue(); + + /** + * Construct a new queue + * @since 2.8 + * @param TUint16 aSize size of element in queue + * @param TUint16 aCount amount of elements in queue + * @param TUint8* &aCurrentAddress start address of queue + * @return DIscBufferQueue* pointer to queue + */ + static DIscBufferQueue* New( TUint16 aSize, TUint16 aCount, TUint8* &aCurrentAddress ); + + /** + * Destructor. + */ + ~DIscBufferQueue(); + + public: // New functions + + /** + * Checks if queue is empty + * @since 2.8 + * @return TBool ETrue if empty, otherwise EFalse + */ + inline TBool Empty(){return iCount ? EFalse : ETrue;}; + + /** + * Reserves first element from the queue + * @since 2.8 + * @return TDes8* pointer to element if succesful, otherwise NULL + */ + TDes8* Reserve(); + + /** + * Releases element from the queue + * @since 2.8 + * @param TDes8* aPtr pointer to element + * @return void + */ + void Release( TDes8* aPtr ); + + protected: // New functions + + /** + * Function to disable interrupts + * @since 2.8 + * @return TInt KErrNone if succesful + */ + TInt DisableIrqs(); + + /** + * Function to restore interrupts + * @since 2.8 + * @param TInt aLevel level where interrupts should be restored + * @return void + */ + void RestoreIrqs( TInt aLevel ); + + + protected: // Functions from base classes + + private: + + /** + * 2nd phase constructor + * @since 2.8 + * @param TUint16 aSize size of element in queue + * @param TUint16 aCount amount of elements in queue + * @param TUint8* &aCurrentAddress start address of queue + * @return TInt + */ + TInt Construct( TUint16 aSize, TUint16 aCount, TUint8* &aCurrentAddress ); + + public: // Data + + protected: // Data + + private: // Data + + volatile TUint32 iCount; + TUint32** iBuffers; + DIscQueue* iBuffersQueue; + + }; + +#endif // ISCBUFFERQUEUE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDataTransmissionBase/inc/IscDataTransmissionBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDataTransmissionBase/inc/IscDataTransmissionBase.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,188 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A reference implementation for ISC data transmission base. +* +*/ + + + +#ifndef ISCDATATRANSMISSIONBASE_H +#define ISCDATATRANSMISSIONBASE_H + +// INCLUDES +#include +#include + +// CONSTANTS +_LIT(KIscDataTransmissionDriverName,"IscDataTransmissionDriver"); + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class DIscDevice; +class DIscBufferAllocator; + +// CLASS DECLARATION + +/** +* DIscDataTransmissionBase defines the ISC Data Transmission Plug-In API +* +* @lib IscDataTransmissionBase.LIB +* @since 2.8 +*/ +class DIscDataTransmissionBase : public DLogicalDevice + { + + public: + /** + * C++ default constructor. + */ + IMPORT_C DIscDataTransmissionBase(); + + /** + * Destructor. + */ + IMPORT_C virtual ~DIscDataTransmissionBase(); + + public: // Functions from base class + + /** + * Implementation of pure-virtual Install from DLogicalDevice. This + * function calls Install2ndPhase. + * @since 2.8 + * @return TInt KErrNone + */ + IMPORT_C TInt Install(); + + /** + * This method makes the buffer allocations according to the + * configuration specified by the ISC Multiplexer + * @since 2.8 + * @param TIscBufferEntry* aBufferConfig pointer to buffer configuration table + * @return void + */ + IMPORT_C virtual void AllocBuffers( TIscBufferEntry* aBufferConfig ); + + public: // New functions + + /** + * Second phase initialization, called during ISC Multiplexer loading. + * ISC Data Transmission Driver must do all initialization here that + * are normally done in Install() + * @since ?Series60_version + * @return TInt KErrNone if successful + */ + virtual TInt Install2ndPhase() = 0; + + /** + * ISC Data Transmission driver initialization + * @since 2.8 + * @param aParameters Initialization parameters passed from + * ISC initialization file + * @param aDfc Dfc that must be runned after the initialization + * has been done + * @return void + */ + virtual void InitializeDataTransmission( TDesC8& aParameters, + TDfc* aDfc, + TInt& aErrorCode /* KErrNone */) = 0; + + /** + * In asynchronous data transmission checkin if transmission is not yet finished + * Access to this method is necessary since transmission can be asynchronous. + * @since 2.8 + * @return TBool EFalse / ETrue + */ + virtual TBool IsWritePending() { return EFalse; }; + + /** + * Send frame to Domestic OS + * @since 2.8 + * @param aFrame Frame to be sent + * @param aDfc Dfc function that must be runned after the frame is sent. + * Or the dfc can be runned immediately if the driver internally buffers + * the outgoing frames + * @param aMultiplexerDfc Dfc function in multiplexer to handle send complition + * @param aMultiplexerErrorCode error code for frame sending to modem + * @return void + */ + virtual void SendFrame( TDes8& aFrame, TDfc* aDfc, TAny* aFrameInfo ) = 0; + + /** + * Get the connection status + * @since 2.8 + * @return TInt EIscConnectionOk / EIscConnectionNotOk + */ + virtual TInt ConnectionStatus() = 0; + + /** + * Connects ISC Driver to ISC Data Transmission Driver + * @since 2.8 + * @param aDevice Pointer to DIscDevice class in ISC Driver + * @return void + */ + IMPORT_C virtual void Connect(DIscDevice* aDevice); + + /** + * Reserve memory block + * @since 2.8 + * @param aPtr Pointer to reserved memory block, NULL if not successful + * @param aSize Required minimun size of the block + * @return void + */ + IMPORT_C virtual void ReserveMemoryBlock( TDes8*& aPtr, TUint16 aSize); + + /** + * Release the reserved memory block + * @since 2.8 + * @param aPtr Pointer to memory block to be released + * @return void + */ + IMPORT_C virtual void ReleaseMemoryBlock( TDes8* aPtr ); + + protected: // New functions + + /** + * Transfer incoming frame to ISC Driver + * @since 2.8 + * @param aFrame Frame that was received + * @return void + */ + IMPORT_C void ReceiveFrame(TDesC8& aFrame); + + /** + * Notifies any connection status changes to ISC Driver + * @since 2.8 + * @param aStatus EIscConnectionOk / EIscConnectionNotOk + * @return void + */ + IMPORT_C void NotifyConnectionStatus( TInt aStatus ); + + private: // Data + + // pointer to DIscDevice class from ISC Driver + DIscDevice* iDevice; // No ownership + + // pointer to pre-allocated buffers + DIscBufferAllocator* iIscBufferAllocator; // Ownership + + }; + +#endif // ISCDATATRANSMISSIONBASE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDataTransmissionBase/inc/IscTrace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDataTransmissionBase/inc/IscTrace.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef ISCTRACE_H +#define ISCTRACE_H + +// INCLUDES +// CONSTANTS + +// MACROS + +#ifdef TRACE_MODE_KERNEL + + // INCLUDES + #include + + #define _T(a) a +#else + + // INCLUDES + #include // RDebug + #include + + #define _T(a) _L(a) + +#endif // TRACE_MODE_KERNEL + +#ifdef _DEBUG + + #ifdef TRACE_MODE_KERNEL + #define __TRACE_PRINTF(a) Kern::Printf a + #else + #define __TRACE_PRINTF(a) RDebug::Print a + #endif + +#else + #define __TRACE_PRINTF(a) +#endif // _DEBUG + + +#ifdef _DEBUG + + void BuildTraceFunc( const TDesC& aPrefix ); + void DataDumpTraceFunc( const TDesC& aPrefix, const TDesC8& aData ); + + #define BUILD_TRACE( a ) BuildTraceFunc( a ) + #define DATA_DUMP_TRACE( a, b ) DataDumpTraceFunc( a, b ) + + #ifdef TRACE_MODE_KERNEL + + // define assertions + #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled=" __DATE__" "__TIME__, __LINE__ )) + + #else + + // define assertions + #ifdef __WINS__ + #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF((_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__)) + #else + #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF((_L("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__ __TIME__""),__LINE__ )) + #endif //__WINS__ + + #endif // TRACE_MODE_KERNEL + + + #if defined COMPONENT_TRACE_FLAG + #define C_TRACE(a) __TRACE_PRINTF(a) + #else + #define C_TRACE(a) + #endif // COMPONENT_TRACE_FLAG + + #if defined API_TRACE_FLAG + #define A_TRACE(a) __TRACE_PRINTF(a) + #else + #define A_TRACE(a) + #endif // API_TRACE_FLAG + + #if defined EXTENDED_TRACE_FLAG + #define E_TRACE(a) __TRACE_PRINTF(a) + #else + #define E_TRACE(a) + #endif // EXTENDED_TRACE_FLAG + +#else + #define TRACE_ASSERT(a) + #define C_TRACE(a) + #define A_TRACE(a) + #define E_TRACE(a) + #define BUILD_TRACE(a) + #define DATA_DUMP_TRACE(a, b) +#endif // _DEBUG + + +// Resets are made both in UDEB and UREL (traces only in udeb) +#ifdef TRACE_MODE_KERNEL + #define ASSERT_RESET_ALWAYS(a,b,c) if(!(a)) { __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__)); Kern::Fault(b,c); } + #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( ("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__) ) +#else + #ifdef __WINS__ + #define ASSERT_RESET_ALWAYS(a,b,c) error + #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__) ) + #else + #define ASSERT_RESET_ALWAYS(a,b,c) error + #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file=%s, line=%d, compiled=%s %s "),__FILE__, __LINE__, __DATE__, __TIME__) ) + #endif +#endif // kernel + + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +#endif // ISCTRACE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDataTransmissionBase/src/IscBufferAllocator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDataTransmissionBase/src/IscBufferAllocator.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,229 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of DIscBufferAllocator class +* +*/ + + + +// INCLUDE FILES +#include +#include +#include + +#include "IscBufferAllocator.h" +#include "IscBufferQueue.h" +#include "IscTrace.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// DIscBufferAllocator::DIscBufferAllocator +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +DIscBufferAllocator::DIscBufferAllocator( TIscBufferEntry* aBufferConfig ) + : iBuffers( NULL ) +#ifndef __WINS__ + , iBufferChunk( NULL ) + , iCurrentAddress( NULL ) +#endif + { + for ( TUint16 i = 0; i < KIscBufferAmount; i++ ) + { + iBufferConfig[i].size = aBufferConfig[i].size; + iBufferConfig[i].count = aBufferConfig[i].count; + } + + C_TRACE( ( _T( "DIscBufferAllocator::DIscBufferAllocator" ) ) ); + } + +// Destructor +DIscBufferAllocator::~DIscBufferAllocator() + { + // delete iBuffers & chunk + for ( TUint8 i = 0; i < KIscBufferAmount; i++ ) + { + delete iBuffers[i]; + iBuffers[i] = NULL; + } + delete [] iBuffers; + iBuffers=NULL; + +#ifndef __WINS__ + delete iBufferChunk; + iBufferChunk = NULL; + // free ram pages.. +#endif + } + +// ----------------------------------------------------------------------------- +// DIscBufferAllocator::AllocBuffers +// Allocate buffers according the multiplexer +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscBufferAllocator::AllocBuffers() + { + C_TRACE( ( _T( "DIscBufferAllocator::AllocBuffers()" ) ) ); + TUint8 i = 0; +#ifndef __WINS__ + TInt memoryNeeded = 0; + for ( i = 0; i < KIscBufferAmount; i++ ) + { + if ( iBufferConfig[i].size > 0 && iBufferConfig[i].count> 0 ) + { + memoryNeeded += ( iBufferConfig[i].size * iBufferConfig[i].count ); + } + } + C_TRACE( ( _T( "DIscBufferAllocator::AllocBuffers memory needed %d" ), memoryNeeded ) ); + + // Check if buffers are allocated from ISC + if ( memoryNeeded > 0 ) + { + AllocPhMemory( memoryNeeded ); + } + else + { + return KErrNone; + } + + TUint8* address = ( TUint8* )iCurrentAddress; +#else + TUint8* address = NULL; +#endif //WINS + + + + iBuffers = new DIscBufferQueue*[ KIscBufferAmount ]; + ASSERT_RESET_ALWAYS( iBuffers, "ISCDataTransmissionBase",EIscMemoryAllocationFailure ); + + for ( i = 0; i < KIscBufferAmount; i++ ) + { + if ( iBufferConfig[i].size > 0 && iBufferConfig[i].count > 0 ) + { + iBuffers[i] = DIscBufferQueue::New( iBufferConfig[i].size, iBufferConfig[i].count, address ); + } + } + + return KErrNone; + + } + +#ifndef __WINS__ +// ----------------------------------------------------------------------------- +// DIscBufferAllocator::AllocPhMemory +// Physical buffer allocations +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscBufferAllocator::AllocPhMemory( TInt aMemoryNeeded ) + { + C_TRACE( ( _T( "DIscBufferAllocator::AllocPhMemory(0x%x)" ), aMemoryNeeded ) ); + + TPhysAddr physAddr = 0; + NKern::ThreadEnterCS(); + TInt r = Epoc::AllocPhysicalRam( aMemoryNeeded, physAddr ); + ASSERT_RESET_ALWAYS( r == KErrNone, "IscDataTransmissionBase",EIscMemoryAllocationFailure ); + r = DPlatChunkHw::New( iBufferChunk, physAddr, aMemoryNeeded, EMapAttrSupRw ); + NKern::ThreadLeaveCS(); + ASSERT_RESET_ALWAYS( r == KErrNone, "IscDataTransmissionBase",EIscMemoryAllocationFailure ); + iCurrentAddress = iBufferChunk->LinearAddress(); + + } +#endif //WINS + +// ----------------------------------------------------------------------------- +// DIscBufferAllocator::ReserveMemoryBlock +// Reserves pre-allocated memory block +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscBufferAllocator::ReserveMemoryBlock( + TDes8*& aPtr, + TUint16 aSize ) + { + E_TRACE( ( _T( "IBA:Res (0x%x)" ), aSize ) ); + + if ( iBuffers ) + { + for ( TUint8 i = 0; i < KIscBufferAmount;i++ ) + { + if ( aSize <= iBufferConfig[i].size && iBufferConfig[i].count > 0 ) + { + if ( iBuffers[i] ) + { + if ( !iBuffers[i]->Empty() ) + { + aPtr = ( TPtr8* )iBuffers[i]->Reserve(); + if ( aPtr ) + { + aPtr->SetLength( 0 ); + E_TRACE( ( _T( "IBA:Res 0x%x %d" ), aPtr, i ) ); + return; + } + } + } + } + } + } + // If Memory block is not reserved, set NULL to aPtr + aPtr = NULL; + return; + } + +// ----------------------------------------------------------------------------- +// DIscBufferAllocator::ReleaseMemoryBlock +// Releases memory block allocated with ReserveMemoryBlock +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscBufferAllocator::ReleaseMemoryBlock( + TDes8* aPtr ) + { + E_TRACE( ( _T( "IBA:Rel 0x%x" ), aPtr ) ); + if ( !aPtr ) + { + TRACE_ASSERT_ALWAYS; + } + else if ( KIscBufferAmount != 0 && iBuffers ) + { + for ( TUint8 i = 0; i < KIscBufferAmount; i++ ) + { + if ( iBufferConfig[i].size == ( ( TDes8* )aPtr )->MaxLength() ) + { + iBuffers[i]->Release( aPtr ); + } + } + } + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDataTransmissionBase/src/IscBufferQueue.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDataTransmissionBase/src/IscBufferQueue.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,263 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of DIscBufferQueue class +* +*/ + + + +// INCLUDE FILES + +#include +#include "IscBufferQueue.h" +#include "IscQueue.h" +#include "IscTrace.h" + +#ifdef __WINS__ +#include +#endif + +// EXTERNAL DATA STRUCTURES +#ifdef __WINS__ +extern CRITICAL_SECTION g_IscDTBCriticalSection; +#endif + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS +const TInt KIscInterruptLevelTwo( 2 ); + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// DIscBufferQueue::DIscBufferQueue +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +DIscBufferQueue::DIscBufferQueue() + : iCount( NULL ), + iBuffers( NULL ), + iBuffersQueue( NULL ) + { + } + + +// ----------------------------------------------------------------------------- +// DIscBufferQueue::Construct +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +TInt DIscBufferQueue::Construct( + TUint16 aSize, + TUint16 aCount, + TUint8* &aCurrentAddress ) + { + C_TRACE( ( _T( "DIscBufferQueue::Construct(0x%x, 0x%x, 0x%x) 0x%x, 0x%x" ), aSize, aCount, &aCurrentAddress, iBuffers, iBuffersQueue ) ); + + TInt r = KErrNone; + if ( aSize == 0 || aCount == 0 ) + return KErrArgument; + + iCount = aCount; + iBuffers = new TUint32*[aCount]; + ASSERT_RESET_ALWAYS( iBuffers, "ISCDataTransmissionBase",EIscMemoryAllocationFailure ); + iBuffersQueue = new DIscQueue( iBuffers, aCount ); + ASSERT_RESET_ALWAYS( iBuffersQueue, "ISCDataTransmissionBase",EIscMemoryAllocationFailure ); + + for ( TInt i = 0; i < aCount; i++ ) + { + TPtr8* pTmp; +#ifndef __WINS__ + pTmp = new TPtr8 ( ( TUint8* )aCurrentAddress, aSize ); + ASSERT_RESET_ALWAYS( pTmp, "ISCDataTransmissionBase",EIscMemoryAllocationFailure ); +#else + TAny* ptr = Kern::Alloc( aSize ); + ASSERT_RESET_ALWAYS( ptr, "ISCDataTransmissionBase",EIscMemoryAllocationFailure ); + pTmp = new TPtr8( ( TUint8* )ptr, 0, aSize ); + ASSERT_RESET_ALWAYS( pTmp, "ISCDataTransmissionBase",EIscMemoryAllocationFailure ); +#endif // __WINS__ + + // Put the buffer into RX resource queue. + r = iBuffersQueue->Add( pTmp ); + + aCurrentAddress += aSize; + } + + C_TRACE( ( _T( "DIscBufferQueue::Construct - return 0x%x" ),r ) ); + + return r; + } + + +// ----------------------------------------------------------------------------- +// DIscBufferQueue::New +// Construct a new queue +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +DIscBufferQueue* DIscBufferQueue::New( + TUint16 aSize, + TUint16 aCount, + TUint8*& aCurrentAddress ) + { + C_TRACE( ( _T( "DIscBufferQueue::New(0x%x, 0x%x, 0x%x)" ), aSize, aCount, aCurrentAddress) ); + + DIscBufferQueue* self = new DIscBufferQueue(); + ASSERT_RESET_ALWAYS( self, "ISCDataTransmissionBase",EIscMemoryAllocationFailure ); + if ( self->Construct( aSize, aCount, aCurrentAddress ) != KErrNone ) + { + delete self; + self = NULL; + } + else + { + } + + C_TRACE( ( _T( "DIscBufferQueue::New - return 0x%x" ),self ) ); + return self; + } + + +// ----------------------------------------------------------------------------- +// DIscBufferQueue::~DIscBufferQueue +// Destructor +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +DIscBufferQueue::~DIscBufferQueue() + { + C_TRACE( ( _T( "DIscBufferQueue::~DIscBufferQueue()" ) ) ); + if ( iBuffersQueue ) + { + /* release all buffers */ + for ( TInt i = 0; i < iBuffersQueue->Count(); i++ ) + { + // destroy allocated buffer + TPtr8* delBuf = ( TPtr8* )iBuffersQueue->RemoveFirst(); + + if ( delBuf ) + { +#ifdef __WINS__ + Kern::Free( ( TAny* )delBuf->Ptr() ); + delete delBuf; +#else + delete delBuf; +#endif + } + else + { + } + } + delete iBuffersQueue; + delete []iBuffers; + } + C_TRACE( ( _T( "DIscBufferQueue::~DIscBufferQueue - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// DIscBufferQueue::Reserve +// Reserves first element from the queue +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TDes8* DIscBufferQueue::Reserve() + { + + if ( iBuffersQueue ) + { + TDes8* temp = ( TDes8* )iBuffersQueue->RemoveFirst(); + if ( temp ) + { + TInt irqLevel = DisableIrqs(); + iCount--; + RestoreIrqs( irqLevel ); + } + return temp; + } + else + { + return NULL; + } + + } + +// ----------------------------------------------------------------------------- +// DIscBufferQueue::Release +// Releases element from the queue +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscBufferQueue::Release( + TDes8* aPtr ) + { + + if ( iBuffersQueue ) + { + aPtr->Zero(); + TInt err = iBuffersQueue->Add( aPtr ); + ASSERT_RESET_ALWAYS( err == KErrNone, "ISCDataTransmissionBase",EIscBufferAllocationFailure ); + TInt irqLevel = DisableIrqs(); + iCount++; + RestoreIrqs( irqLevel ); + } + + } + +// ----------------------------------------------------------------------------- +// DIscBufferQueue::DisableIrqs +// Function to disable interrupts +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscBufferQueue::DisableIrqs() + { +#ifndef __WINS__ + return NKern::DisableInterrupts( KIscInterruptLevelTwo ); +#else //__WINS__ + EnterCriticalSection( &g_IscDTBCriticalSection ); + return KErrNone; +#endif//__WINS__ + } + +// ----------------------------------------------------------------------------- +// DIscBufferQueue::RestoreIrqs +// Function to restore interrupts +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// + +#ifndef __WINS__ +void DIscBufferQueue::RestoreIrqs( + TInt aLevel ) + { + NKern::RestoreInterrupts( aLevel ); +#else //__WINS__ +void DIscBufferQueue::RestoreIrqs( + TInt ) + { + LeaveCriticalSection( &g_IscDTBCriticalSection ); +#endif//__WINS__ + } +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDataTransmissionBase/src/IscDataTransmissionBase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDataTransmissionBase/src/IscDataTransmissionBase.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,216 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of DIscDataTransmissionBase class +* +*/ + + + +// INCLUDE FILES +#include +#include "IscTrace.h" +#include "IscDataTransmissionBase.h" +#include "IscBufferAllocator.h" + +#ifdef __WINS__ +#include +#endif + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +#ifdef __WINS__ +CRITICAL_SECTION g_IscDTBCriticalSection; +#endif + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// DIscDataTransmissionBase::DIscDataTransmissionBase +// C++ default constructor +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C DIscDataTransmissionBase::DIscDataTransmissionBase() + :iDevice( NULL ), + iIscBufferAllocator( NULL ) + { + A_TRACE( ( _T( "DIscDataTransmissionBase::DIscDataTransmissionBase()" ) ) ); +#ifdef __WINS__ + InitializeCriticalSection( &g_IscDTBCriticalSection ); +#endif + } + + +// Destructor +EXPORT_C DIscDataTransmissionBase::~DIscDataTransmissionBase() + { + A_TRACE( ( _T( "DIscDataTransmissionBase::~DIscDataTransmissionBase()" ) ) ); + if ( iIscBufferAllocator ) + { + delete iIscBufferAllocator; + iIscBufferAllocator=NULL; + } +#ifdef __WINS__ + DeleteCriticalSection( &g_IscDTBCriticalSection ); +#endif + A_TRACE( ( _T( "DIscDataTransmissionBase::~DIscDataTransmissionBase - return void" ) ) ); + } + + +// ----------------------------------------------------------------------------- +// DIscDataTransmissionBase::AllocBuffers +// buffer allocations according to the ISC Multiplexer +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscDataTransmissionBase::AllocBuffers( TIscBufferEntry* aBufferConfig ) + { + A_TRACE( ( _T( "DIscDataTransmissionBase::AllocBuffers(0x%x)" ), aBufferConfig ) ); + // Allocate buffers + if ( !iIscBufferAllocator ) + { + iIscBufferAllocator = new DIscBufferAllocator( aBufferConfig ); + ASSERT_RESET_ALWAYS( iIscBufferAllocator, "ISCDataTransmissionBase",EIscMemoryAllocationFailure ); + iIscBufferAllocator->AllocBuffers(); + } + A_TRACE( ( _T( "DIscDataTransmissionBase::AllocBuffers - return void" ) ) ); + } +// ----------------------------------------------------------------------------- +// DIscDataTransmissionBase::ReceiveFrame +// Transfer incoming frame to ISC Driver +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscDataTransmissionBase::ReceiveFrame( + TDesC8& aFrame ) + { + + if ( iDevice ) + { + iDevice->Receive( &aFrame ); + } + else + { + TRACE_ASSERT_ALWAYS; + } + + } + +// ----------------------------------------------------------------------------- +// DIscDataTransmissionBase::NotifyConnectionStatus +// Notifies any connection status changes to ISC Driver +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscDataTransmissionBase::NotifyConnectionStatus( + TInt aStatus ) + { + A_TRACE( ( _T( "DIscDataTransmissionBase::NotifyConnectionStatus(0x%x)" ), aStatus ) ); + + if ( iDevice ) + { + iDevice->NotifyConnectionStatus( aStatus ); + } + + A_TRACE( ( _T( "DIscDataTransmissionBase::NotifyConnectionStatus - return void" ) ) ); + } + + +// ----------------------------------------------------------------------------- +// DIscDataTransmissionBase::ReserveMemoryBlock +// Reserve memory block +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscDataTransmissionBase::ReserveMemoryBlock( + TDes8*& aPtr, + TUint16 aSize ) + { + E_TRACE( ( _T( "IDTB:Res(0x%x)" ), aSize ) ); + + iIscBufferAllocator->ReserveMemoryBlock( aPtr, aSize ); + } + + +// ----------------------------------------------------------------------------- +// DIscDataTransmissionBase::ReleaseMemoryBlock +// Release the reserved memory block +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscDataTransmissionBase::ReleaseMemoryBlock( + TDes8* aPtr ) + { + + E_TRACE( ( _T( "IDTB:Rel (0x%x)" ), aPtr ) ); + iIscBufferAllocator->ReleaseMemoryBlock( aPtr ); + + } + + +// ----------------------------------------------------------------------------- +// DIscDataTransmissionBase::Connect +// Connects ISC Driver to ISC Data Transmission Driver +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscDataTransmissionBase::Connect( + DIscDevice* aDevice ) + { + A_TRACE( ( _T( "DIscDataTransmissionBase::Connect(0x%x)" ), aDevice ) ); + ASSERT_RESET_ALWAYS( aDevice, "ISCDataTransmissionBase", EIscNullIscDriverPointer ); + iDevice = aDevice; + A_TRACE( ( _T( "DIscDataTransmissionBase::Connect - return void" ) ) ); + } + + +// ----------------------------------------------------------------------------- +// DIscDataTransmissionBase::Install +// Implementation of pure-virtual Install from DLogicalDevice +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DIscDataTransmissionBase::Install() + { + A_TRACE( ( _T( "DIscDataTransmissionBase::Install()" ) ) ); + SetName( &KIscDataTransmissionDriverName ); + + // call second phase install ( located in the driver realizing this API ) + TInt r = Install2ndPhase(); + + A_TRACE( ( _T( "DIscDataTransmissionBase::Install - return 0x%x" ), r ) ); + return r; + } + +#if defined( __WINSCW__ ) +DECLARE_STANDARD_LDD() + { + return NULL; + } +#endif + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/inc/IscChannel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/inc/IscChannel.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,325 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef DISCCHANNEL_H +#define DISCCHANNEL_H + +// INCLUDES +#include +#include // TIscFrameInfo + +// CONSTANTS +const TInt KMajorVersionNumber = 1; +const TInt KMinorVersionNumber = 0; +const TInt KBuildVersionNumber = 1; + +const TUint8 KBehaviormask = 15; //bits 00001111 + +// MACROS + +const TInt KIscEmptyMyBuffersDfcPriority( 4 ); +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION +class DIscDevice; +class DIscQueue; +class IscChannelContainer; + +/** +* Handles all interraction with the user-side +* +* @lib IscDriver.LIB +* @since 2.8 +*/ +class DIscChannel : public DLogicalChannel + { + + public: // Constructors and destructor + + /** + * C++ default constructor. + * @param pointer to owner device + */ + IMPORT_C DIscChannel( DLogicalDevice* aDevice ); + + /** + * Destructor. + */ + ~DIscChannel(); + + public: // Functions from base classes + + /** + * Secondary initialization of channel. + * @since 2.8 + * @param TInt aUnit Channel number + * @param const TDesC8* anInfo pointer to a descriptor containing extra + * information for the device. + * @param const TVersion& aVer reference containing the version being + * requested by the thread which is opening this channel + * @return virtual TInt KErrNone if succesful. KErrAlreadyExist if channel already open + */ + virtual TInt DoCreate( TInt aUnit, const TDesC8* anInfo, const TVersion& aVer ); + + /** + * Message handling ( kernel server context ). + * @since 2.8 + * @param aMsg Thread message to get parameters from user side + * @return void + */ + virtual void HandleMsg( TMessageBase* aMsg ); + + /** + * Message handling ( user thread context ). + * @since 2.8 + * @param aReqNo request number called from IscApi + * @param a1 pointer array to get parameters from user side + * @param a2 not used in ISC + * @return TInt KErrNone if succesful + */ + TInt Request( TInt aReqNo, TAny* a1, TAny* a2 ); + + public: // New functions + /** + * Function to complete clients pending asynchronous request + * @since 2.8 + * @param TInt aOperation asynchronous operation to complete + * @param TInt aCompleteStatus status of request to be completed + * @return void + */ + void CompleteRequest( TInt aOperation, TInt aCompleteStatus ); + + /** + * Stores the incoming frame to channels receive queue + * @since 2.8 + * @param TDesC8* aData pointer to storable frame + * @return void + */ + void StoreFrame( TDesC8* aData ); + + /** + * Goes through channel's queue and delivers possible frame to client + * @since 2.8 + * @return void + */ + void EmptyBuffers(); + + /** + * Notify user side client that uplink flow control is on/off + * @since 2.8 + * @param const TInt aFlowControlStatus EIscFlowControlOn / EIscFlowControlOff + * @return void + */ + void NotifyFlowControl( const TInt aFlowControlStatus ); + + /** + * Notify user side client that status of connection between Symbian side and the Domestic OS has changed + * @since 2.8 + * @param const TInt aConnectionStatus EIscConnectionOk / EIscConnectionNotOk + * @return void + */ + void NotifyConnectionStatus( const TInt aConnectionStatus ); + + /** + * Check if asynchronous request is active + * @since 2.8 + * @param const TUint16 aReqNumber Number of request + * @return TInt KRequestPending if request active. Otherwise KErrNone + */ + TInt IsPending( const TUint16 aReqNumber ); + + /** + * Copy data from user buffer to kernel side buffer by multiplexer + * @since 2.8 + * @param aUserBuffer pointer to source descriptor + * @param aKernelBuffer pointer to destination descriptor + * @param aOffset Offset of the source buffer + * @return KErrNone if successful + */ + TInt CopyFromUserBuffer( const TDesC8& aUserBuffer, + TDes8& aKernelBuffer, + TInt aOffset ); + + /** + * Writes data/frames to clients buffer + * @since 2.8 + * @param aDest pointer to destination descriptor + * @param aSrc pointer to source descriptor + * @param aOffset Offset on where to start writing to target descriptor + * @return TInt + */ + TInt ThreadWrite( TAny* aDest, const TDesC8* aSrc, TInt aOffset ); + + /** + * Delete send frames / receive queue for channel in question + * @since 2.8 + * @return void + */ + void ResetBuffers(); + + /** + * Returns the channel number. + * @since 3.0 + * @return TUint16, the number of the channel. + */ + inline TUint16 GetChannelNumber(){return iChannelNumber;}; + + /** + * Returns a reference to user side thread of this channel. + * @since 3.0 + * @param None + * @return DThread*, user side thread ownership is not given. + */ + inline DThread* GetDThread() + { + return iThread; + }; + + protected: + + // None + + private: + + /** + * Call from user side comes to this function + * @since 2.8 + * @param TInt aFunction request number + * @param TAny* a1 pointer to array including info about request + * @param TAny* a2 not used + * @return TInt KErrNone if succesful + */ + TInt HandleRequest( TInt aFunction, TAny* a1, TAny* a2 ); + + /** + * Handles channel destruction. + * @since 2.8 + * @param void + * @return void + */ + void ChannelDestruction(); + + /** + * Handles asynchronous client requests + * @since 2.8 + * @param TInt aFunction request number + * @param TAny* a1 pointer to array including info about request + * @return void + */ + void HandleAsyncRequest( TInt aFunction, TAny* a1 ); + + /** + * Handles synchronous client requests + * @since 2.8 + * @param TInt aFunction + * @param TAny* a1 pointer to array including info about request + * @return TInt + */ + TInt HandleSyncRequest( TInt aFunction, TAny* a1 ); + + /** + * Cancels active request + * @since 2.8 + * @param TInt aFunction request number + * @param TAny* a1 not used + * @return TInt + */ + TInt HandleCancelRequest( TInt aFunction, TAny* a1 ); + + /** + * Copies several data frames to clients buffer if needed before compliting receive request + * @since 2.8 + * @param TDes8* aPtr pointer to frame + * @param TIscFrameInfo& aInfo info needed in frame combining + * @return void + */ + void HandleConcatenatedDataFrame( TDes8* aPtr, TIscFrameInfo& aInfo ); + + /** + * Copies several frames to clients buffer if needed before compliting receive request + * @since 2.8 + * @param TDes8* aPtr pointer to frame + * @param TIscFrameInfo& aInfo info needed in frame combining + * @return void + */ + void HandleConcatenatedFrame( TDes8* aPtr, TIscFrameInfo& aInfo ); + + /** + * Initialization complete dfc + * @since 2.8 + * @param TAny* aPtr pointer to channel + * @return static void. + */ + static void InitializeComplete( TAny* aPtr ); + + /** + * Completes the multiplexer initialization + * @since 2.8 + * @return void + */ + void DoMultiplexerInitialize(); + + private: // Data + + TDfc* iInitializeDfc; + TPtr8* iDataTransmissionIniData; + TPtr8* iMultiplexerIniData; + TUint8* iMultiplexerBuffer; + TUint8* iDataTransmissionBuffer; + DIscDevice* iIscDevice; + TPtr8* iIscConnectionStatusPtr; + TPtr8* iIscFlowControlStatusPtr; + //Store of Isc requests + TRequestStatus* iIscRequests[ EIscAsyncLast ]; + // Pointers to client message buffers + TPtr8* iReceiveBufPtr; + TPtr8* iDataReceiveBufPtr; + TPtr8* iNeededBufLen; + TPtr8* iNeededDataBufLen; + TUint16 iChannelNumber; + TBool iChannelOpen; + // Queue for incoming frames + TUint32** iFrameRx; + DIscQueue* iFrameRxQueue; + + // Queue for incoming data frames + TUint32** iDataFrameRx; + DIscQueue* iDataFrameRxQueue; + + TInt iULFlowControlStatus; + TInt iDLFlowControlStatus; + // Stores the last notified uplink flowcontrol status. + TInt iLastNotifiedULFlowstatus; + + TUint16 iIscChannelHighWaterMark; + TUint16 iIscChannelLowWaterMark; + TBool iOverFlow; + TBool iClientPanic; + TInt iDataTransmissionErrorCode; + + DThread* iThread; + + }; + +#endif // DISCCHANNEL_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/inc/IscChannelContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/inc/IscChannelContainer.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + + +#ifndef ISCCHANNELCONTAINER_H +#define ISCCHANNELCONTAINER_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class DIscChannel; + +// CLASS DECLARATION + +/** +* Static class to hold channel objects +* +* @lib IscDriver.LIB +* @since 2.8 +*/ +class IscChannelContainer + { + public: // Constructors and destructor + + + public: // New functions + + /** + * Set pointer to channel + * @since 2.8 + * @param IscChannel* aChannel pointer to channel + * @param const TUint16 aUnit channelnumber + * @return void + */ + IMPORT_C static TInt SetChannel( DIscChannel* aChannel, + const TUint16 aUnit ); + + /** + * Return pointer to channel. TUint16 aChannelSharingIndex is needed + * for channel sharing + * @since 2.8 + * @param const TUint16 aChannel channel number + * @param const TUint16 aChannelSharingIndex, index in channel table. + * @return static DIscChannel* pointer to channel instance + */ + static DIscChannel* Channel( const TUint16 aChannel, + const TUint16 aChannelSharingIndex ); + + /** + * Remove channel pointer from channel table + * @since 2.8 + * @param DIscChannel* aChannel pointer to DIscChannel + * @return static TInt + */ + static TInt RemoveChannel( DIscChannel* aChannel ); + + /** + * Goes through channels and open ones are emptied + * @since 2.8 + * @param TAny* not used + * @return static void + */ + static void ChannelComplition( TAny* /*a*/ ); + + /** + * Allocates Dfc function dynamically and formats data tables. + * @since 2.8 + * @return static void + */ + static void Initialize(); + + + /** + * Deallocates Dfc function + * @since 2.8 + * @return static void + */ + static void DeActivate(); + + /** + * Adds ChannelComplition Dfc. + * Can be called from any context. + * @since 2.8 + * @return static void + */ + static void AddDfc(); + + /** + * Make sure that pointer is valid DIscChannel pointer + * @since 2.8 + * @param aChannelPtr DIscChannel pointer + * @return void + */ + static TInt ValidateChannel( DIscChannel* aChannelPtr ); + + private: // Data + + static DIscChannel* iIscChannels[KIscNumberOfUnits][KIscMaxNumberOfChannelSharers]; + + static TDfc* iDfc; + + }; + +#endif // ISCCHANNELCONTAINER_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/inc/IscDevice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/inc/IscDevice.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,333 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef ISCDEVICE_H +#define ISCDEVICE_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class DIscDataTransmissionBase; +class DIscMultiplexerBase; +class DIscChannel; +class DIscMainRcvBuffer; +class DIscQueue; +class DIscSendQueue; +class TIscSendFrameInfo; + +// CLASS DECLARATION + +/** +* Isc driver ldd factory object +* +* @lib IscDriver.LIB +* @since 2.8 +*/ +class DIscDevice : public DLogicalDevice + { + public: // Constructors and destructor + /** + * C++ default constructor. + */ + IMPORT_C DIscDevice(); + + /** + * Destructor. + */ + IMPORT_C virtual ~DIscDevice(); + + + public: // Functions from base classes + + /** + * From DLogicalDevice. + * Create a logical channel + * @since 2.8 + * @param DLogicalChannelBase*& aChannel logical channel to be set + * @return TInt KErrNone if succesful, otherwise KErrNoMemory + */ + virtual TInt Create( DLogicalChannelBase*& aChannel ); + + /** + * Complete the installation of driver + * @since 2.8 + * @return TInt KErrNone if successful + */ + virtual TInt Install(); + + /** + * From DLogicalDevice. + * Get capabilities of this logical device + * @since 2.8 + * @param TDes8& aDes a reference which contains return + * information describing the capabilities of this device. + * @return void + */ + IMPORT_C virtual void GetCaps( TDes8& aDes ) const; + + public: // New functions + + /** + * Complete the initialization of driver + * @since 2.8 + * @return void + */ + void Initialize(); + + /** + * Get message block from buffers allocated in IscDataTransmissionBase.dll + * @since 2.8 + * @param TDes8*& aPtr pointer where message block is set + * @param TUint16 aSize size of needed memory block + * @return void + */ + IMPORT_C void ReserveMemoryBlock( TDes8*& aPtr, TUint16 aSize ); + + /** + * Release memory block allocated with ReserveMemoryBlock + * @since 2.8 + * @param TDes8* aData + * @return void + */ + IMPORT_C void ReleaseMemoryBlock( TDes8* aData ); + + /** + * Connection status change function. Can be called from any context. + * @since 2.8 + * @param const TInt aStatus status of driver + * @return void + */ + EXPORT_C void NotifyConnectionStatus( const TInt aStatus ); + + /** + * Frames coming from Domestic OS + * @since 2.8 + * @param TDesC8* aData pointer to data + * @return void + */ + IMPORT_C void Receive( TDesC8* aData ) const; + + /** + * Queue frames that will be sent to Domestic OS + * @since 2.8 + * @param aChannelId number of sender channel + * @param const TDesC8* aFrame pointer to send frame + * @param aChannelPtr DIscChannel pointer + * @param aMultiplexerDfc dfc to run by data transmission driver after frame has delivered + * @param aMultiplexerErrorCode status how frame transmission succeeded + * @return TInt KErrNone if frame added to send queue succesfully + */ + IMPORT_C TInt QueueFrame( const TUint16 aChannelId, + const TDesC8* aFrame, + const TAny* aChannelPtr, + TAny* aFrameInfo ); + + /** + * Cancels sending of frames to Domestic OS of certain channel and deletes queued frames + * @since 2.8 + * @param aChannelId channel number to which canceling is done + * @param aChannelPtr DIscChannel pointer + * @return TInt KErrNone when canceling is done + */ + IMPORT_C TInt CancelSending( const TUint16 aChannelId, + const TAny* aChannelPtr ); + + /** + * Adds Dfc to empty queues. Can be called from any context. + * @since 2.8 + * @return void + */ + IMPORT_C void FlushQueues(); + + /** + * Function to complete user side asynchronous request. Uses DIscChannel pointer + * @since 2.8 + * @param aOperation operation to complete + * @param aCompleteStatus status of operation + * @param aChannelPtr pointer to a DIscChannel + * @return void + */ + IMPORT_C void CompleteRequest( TUint16 aOperation, + TInt aCompleteStatus, + const TAny* aChannelPtr ); + + /** + * Function to notify client about uplink flow control status + * @since 2.8 + * @param aULFlowStatus EIscFlowControlOn / EIscFlowControlOff + * @param aChannelId Channel to be affected by the flow control + * @param aChannelPtr pointer to DIscChannel + * @return void + */ + IMPORT_C void ULFlowControl( const TInt aULFlowStatus, + const TUint16 aChannelId, + const TAny* aChannelPtr ); + + /** + * Function to check if asycnhronous request is active + * @since 2.8 + * @param const TUint16 aReqNumber request number + * @param const TUint16 aChannelId channel number + * @return TInt KRequestPending if request active, otherwise KErrNone + */ + IMPORT_C TInt IsPending( const TUint16 aReqNumber, + const TAny* aChannelPtr ); + + /** + * Copy data from user buffer to kernel side buffer by multiplexer. + * This method will be deprecated in the future. + * It is preffered to use GetThreadPtr instead. + * @since 2.8 + * @param aUserBuffer pointer to source descriptor + * @param aKernelBuffer pointer to destination descriptor + * @param aChannelPtr DIscChannel pointer + * @param aOffset Offset of the source buffer + * @return KErrNone if successful + */ + IMPORT_C TInt CopyFromUserBuffer( const TDesC8& aUserBuffer, + TDes8& aKernelBuffer, + const TAny* aChannelPtr, + const TInt aOffset ); + + /** + * Copy data to user side buffer from kernel side by multiplexer. + * This method will be deprecated in the future. + * It is preffered to use GetThreadPtr instead. + * @since 2.8 + * @param aUserBuffer pointer to destination descriptor + * @param aKernelBuffer pointer to source descriptor + * @param aChannelPtr DIscChannel pointer + * @param aOffset Offset of the destination buffer + * @return KErrNone if succesful + */ + IMPORT_C TInt CopyToUserBuffer( TAny* aUserBuffer, + const TDesC8& aKernelBuffer, + const TAny* aChannelPtr, + const TInt aOffset ); + + /** + * Returns a user side thread of a given channel. + * @since 3.0 + * @param const TAny* aChannelPtr, channel pointer (DIscChannel). + * @return DThread*, user side clients thread. Ownership is not given. + */ + IMPORT_C DThread* GetThreadPtr( const TAny* aChannelPtr ); + + /** + * Notify multiplexer about down link flow control + * @since 2.8 + * @param const TInt aDLFlowStatus EIscFlowControlOn / EIscFlowControlOff + * @param const TUint16 aChannel channel number + * @return void + */ + void DLFlowControlNotify( const TInt aDLFlowStatus, + const TUint16 aChannel, + const TAny* aChannelPtr ); + + /** + * Function to tell current status of connection to Domestic OS + * @since 2.8 + * @return TInt EIscConnectionOk / EIscConnectionNotOk + */ + TInt ConnectionStatus(); + + protected: + + /** + * Function to disable interrupts + * @since 2.8 + * @return TInt KErrNone if succesful + */ + static TInt DisableIrqs(); + + /** + * Function to restore interrupts + * @since 2.8 + * @param TInt aLevel level where interrupts should be restored + * @return void + */ + static void RestoreIrqs( TInt aLevel ); + + + private: + + /** + * Function to connect to DataTransmission and Multiplexer ldds + * @since 2.8 + * @return TInt KErrNone if succesful + */ + TInt InitializeLdd2LddInterface(); + + /** + * Dfc to empty control channel and other send queues + * @since 2.8 + * @param TAny* aPtr pointer to DIscDevice + * @return static void + */ + static void Flush( TAny* aPtr ); + + /** + * Notifies connection changes. + * @since 2.8 + * @param TAny* aPtr + * @return static void + */ + static void NotifyConnection( TAny* aPtr ); + + + public: // Data + + static DIscMultiplexerBase* iIscMultiplexerInterface; + static DIscDataTransmissionBase* iIscDataTransmissionInterface; + + + private: // Data + + TUint32** iSend; + TUint32** iTempSend; + TUint32** iControlSend; + + TIscSendFrameInfo** iSendFrameParameters; + TIscSendFrameInfo** iTempFrameParameters; + TIscSendFrameInfo** iControlFrameParameters; + + static DIscSendQueue* iSendQueue; + static DIscSendQueue* iTempQueue; + static DIscSendQueue* iControlSendQueue; + + static TDfc* iSendDfc; + static TDfc* iNotifyDfc; + + DIscMainRcvBuffer* iIscMainRcvBuffer; + + static TInt iConnectionStatus; + + }; + +#endif // ISCDEVICE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/inc/IscDriverExtensionDevice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/inc/IscDriverExtensionDevice.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Reference implementation for ISC Driver extension +* +*/ + + + + +#ifndef ISCDRIVER_EXTENSION_DEVICE_H +#define ISCDRIVER_EXTENSION_DEVICE_H + +// INCLUDES +#include +#include // Base class + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Isc driver extension ldd factory object +* +* @lib IscDriver.LIB +* @since 2.8 +*/ +class DIscDriverExtensionDevice : public DIscDevice + { + public: // Constructors and destructor + + /** + * C++ default constructor. + */ + DIscDriverExtensionDevice(); + + /** + * Destructor. + */ + virtual ~DIscDriverExtensionDevice(); + + public: // Functions from base classes + + /** + * Create a logical channel + * @since 2.8 + * @param DLogicalChannelBase*& aChannel logical channel to be set + * @return virtual TInt KErrNone if succesful, otherwise KErrNoMemory + */ + virtual TInt Create( DLogicalChannelBase*& aChannel ); + + /** + * Complete the installation of driver + * @since 2.8 + * @return TInt KErrNone if successful + */ + TInt Install(); + + + private: + + DIscDevice* iIscDriverDevice; + }; + +#endif // ISCDRIVER_EXTENSION_DEVICE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/inc/IscMainRcvBuffer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/inc/IscMainRcvBuffer.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of DIscMainRcvBuffer class +* +*/ + + + + +#ifndef DISCMAINRCVBUFFER_H +#define DISCMAINRCVBUFFER_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION +class DIscDevice; +class DIscQueue; + +/** +* First place to store incoming messages from Domestic OS +* +* @lib IscDriver.LIB +* @since 2.8 +*/ +class DIscMainRcvBuffer//: public CBase + { + public: // Constructors and destructor + + /** + * C++ default constructor. + */ + DIscMainRcvBuffer( DIscDevice* aDevice, TUint16 aIscMainRcvBufferQueueSize ); + + /** + * Destructor. + */ + virtual ~DIscMainRcvBuffer(); + + public: // New functions + + /** + * Second-phase constructor. Should be called to complete construction. + * @since 2.8 + * @return void + */ + void DoCreate(); + + /** + * Function that should be called to store incoming frame + * @since 2.8 + * @param TDesC8* aData pointer to frame + * @return void + */ + static void MsgReceive( TDesC8* aData ); + + /** + * Function for adding Dfc. Can be called from any context. + * @since 2.8 + * @return void + */ + void AddDfc(); + + private: + + /** + * Function that goes through messages in main buffer + * and empties those to correct channel buffers + * @since 2.8 + * @param TAny* aPtr pointer to DIscMainRcvBuffer + * @return static void + */ + static void BufferCleanUp( TAny* aPtr ); + + private: // Data + + DIscDevice* iDevice; + TDfc* iDfc; + static DIscMainRcvBuffer* iThisPointer; + TUint16 iIscMainRcvBufferQueueSize; + TUint32** iMainRcvBuffer; + DIscQueue* iMainRcvBufferQueue; + + }; + +#endif // DISCMAINRCVBUFFER_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/inc/IscQueue.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/inc/IscQueue.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,144 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for Iscqueue +* +*/ + + + +#ifndef DISCQUEUE_H +#define DISCQUEUE_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Generic FIFO-type class +* +* @lib IscDriver.LIB +* @since 2.8 +*/ +class DIscQueue + { + public: // Constructors and destructor + + DIscQueue(); + + /** + * C++ default constructor. + */ + IMPORT_C DIscQueue( TUint32** aQueue, TUint16 Size ); + + /** + * Destructor. + */ + IMPORT_C virtual ~DIscQueue(); + + /** + * Function to add element to queue + * @since 2.8 + * @param TAny* pointer to frame + * @return TInt KErrNone / KErrNoMemory + */ + IMPORT_C TInt Add( TAny* ); + + /** + * Removes first element from the queue + * @since 2.8 + * @return TAny* pointer to frame + */ + IMPORT_C TAny* RemoveFirst(); + + /** + * Fetches first element from the queue + * @since 2.8 + * @return TAny* pointer to frame + */ + IMPORT_C TAny* GetFirst(); + + /** + * Deletes first element from the queue + * @since 2.8 + * @return void + */ + IMPORT_C void DeleteFirst(); + + /** + * Checks if queue is empty + * @since 2.8 + * @return TBool ETrue if empty, otherwise EFalse + */ + IMPORT_C TBool Empty(); + + /** + * Gets length of next frame in queue + * @since 2.8 + * @return TUint16 + */ + IMPORT_C TUint16 NextBufferLength(); + + /** + * Inline function to tell the amount of elements in queue + * @since 2.8 + * @return TUint16 amount of elements in queue + */ + inline TUint16 Count() const { return iCount; }; + + /** + * Inline function to tell the size of queue + * @since 2.8 + * @return TUint16 size of queue + */ + inline TUint16 SizeOf() const { return iSize; }; + + protected: + + /** + * Function to disable interrupts + * @since 2.8 + * @return TInt KErrNone if succesful + */ + TInt DisableIrqs(); + + /** + * Function to restore interrupts + * @since 2.8 + * @param TInt aLevel level where interrupts should be restored + * @return void + */ + void RestoreIrqs( TInt aLevel ); + + volatile TUint16 iHead; + volatile TUint16 iTail; + volatile TUint16 iCount; + TUint16 iSize; + TUint32** iQueue; + + }; + +#endif // DISCQUEUE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/inc/IscSendQueue.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/inc/IscSendQueue.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: An example implementation for ISC Driver Reference +* +*/ + + + +#ifndef DISCSENDQUEUE_H +#define DISCSENDQUEUE_H + +// INCLUDES +#include +#include "IscQueue.h" // Base class + +// CONSTANTS + +// MACROS + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION +class DIscChannel; +class TIscSendFrameInfo; + +// DATA TYPES + +/** +* Generic FIFO-type class for send messages +* +* @lib IscDriver.LIB +* @since 2.8 +*/ +class DIscSendQueue : public DIscQueue + { + public: // Constructors and destructor + + /** + * C++ default constructor. + */ + IMPORT_C DIscSendQueue( TUint32** aQueue, + TIscSendFrameInfo** aParameterQueue, + TUint16 aSize ); + + /** + * Destructor. + */ + IMPORT_C ~DIscSendQueue(); + + /** + * Function to add element to queue + * @since 2.8 + * @param anEntry pointer to frame + * @param aId channel number + * @param aChannelPtr DIscChannel pointer + * @param aFrameInfo Additional information to pass information to data transmission driver + * @return TInt KErrNone / KErrNoMemory + */ + IMPORT_C TInt Add( TAny* anEntry, TUint16 aId, DIscChannel* aChannelPtr, TAny* aFrameInfo ); + + /** + * Function to get information about first frame in queue + * @since 2.8 + * @return TIscSendFrameInfo* (channel id, channel pointer and frameinfo) + */ + IMPORT_C TIscSendFrameInfo* GetFirstFrameInfo(); + + + private: + + TIscSendFrameInfo** iParameterQueue; + + }; + +class TIscSendFrameInfo + { + public: + DIscChannel* iChannelPtr; + TAny* iFrameInfo; + TUint16 iChannelId; + }; + +#endif // DISCSENDQUEUE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/inc/IscTrace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/inc/IscTrace.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Trace macros for example common isc. +* +*/ + + +#ifndef ISCTRACE_H +#define ISCTRACE_H + +// INCLUDES +// CONSTANTS + +// MACROS + +#ifdef TRACE_MODE_KERNEL + + // INCLUDES + #include + + #define _T(a) a +#else + + // INCLUDES + #include // RDebug + #include + + #define _T(a) _L(a) + +#endif // TRACE_MODE_KERNEL + +#ifdef _DEBUG + + #ifdef TRACE_MODE_KERNEL + #define __TRACE_PRINTF(a) Kern::Printf a + #else + #define __TRACE_PRINTF(a) RDebug::Print a + #endif + +#else + #define __TRACE_PRINTF(a) +#endif // _DEBUG + + +#ifdef _DEBUG + + void BuildTraceFunc( const TDesC& aPrefix ); + void DataDumpTraceFunc( const TDesC& aPrefix, const TDesC8& aData ); + + #define BUILD_TRACE( a ) BuildTraceFunc( a ) + #define DATA_DUMP_TRACE( a, b ) DataDumpTraceFunc( a, b ) + + #ifdef TRACE_MODE_KERNEL + + // define assertions + #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled=" __DATE__" "__TIME__, __LINE__ )) + + #else + + // define assertions + #ifdef __WINS__ + #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF((_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__)) + #else + #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF((_L("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__ __TIME__""),__LINE__ )) + #endif //__WINS__ + + #endif // TRACE_MODE_KERNEL + + + #if defined COMPONENT_TRACE_FLAG + #define C_TRACE(a) __TRACE_PRINTF(a) + #else + #define C_TRACE(a) + #endif // COMPONENT_TRACE_FLAG + + #if defined API_TRACE_FLAG + #define A_TRACE(a) __TRACE_PRINTF(a) + #else + #define A_TRACE(a) + #endif // API_TRACE_FLAG + + #if defined EXTENDED_TRACE_FLAG + #define E_TRACE(a) __TRACE_PRINTF(a) + #else + #define E_TRACE(a) + #endif // EXTENDED_TRACE_FLAG + +#else + #define TRACE_ASSERT(a) + #define C_TRACE(a) + #define A_TRACE(a) + #define E_TRACE(a) + #define BUILD_TRACE(a) + #define DATA_DUMP_TRACE(a, b) +#endif // _DEBUG + + +// Resets are made both in UDEB and UREL (traces only in udeb) +#ifdef TRACE_MODE_KERNEL + #define ASSERT_RESET_ALWAYS(a,b,c) if(!(a)) { __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__)); Kern::Fault(b,c); } + #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( ("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__) ) +#else + #ifdef __WINS__ + #define ASSERT_RESET_ALWAYS(a,b,c) error + #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__) ) + #else + #define ASSERT_RESET_ALWAYS(a,b,c) error + #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file=%s, line=%d, compiled=%s %s "),__FILE__, __LINE__, __DATE__, __TIME__) ) + #endif +#endif // kernel + + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +#endif // ISCTRACE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/src/IscChannel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/src/IscChannel.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1800 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: An example implementation for ISC Driver Reference +* +*/ + + + +// INCLUDE FILES +#include +#include +#include "IscChannel.h" +#include "IscDevice.h" +#include "IscChannelContainer.h" +#include "IscQueue.h" +#include "IscTrace.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS +_LIT( KIscDriver, "IscDriver" ); + +// MACROS + +// LOCAL CONSTANTS AND MACROS +const TInt KIscInitializeDfcPriority( 1 ); +const TInt KOneParam( 1 ); +const TInt KTwoParams( 2 ); +const TInt KThreeParams( 3 ); +const TInt KFirstParam( 0 ); +const TInt KSecondParam( 1 ); +const TInt KThirdParam( 2 ); +const TInt KMultiplyByOne( KSecondParam ); +const TInt KMultiplyByThree( KThreeParams ); +const TInt KDivideByFour( 4 ); + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// DIscChannel::DIscChannel +// C++ default constructor. +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C DIscChannel::DIscChannel( DLogicalDevice* aDevice ) + : iInitializeDfc( NULL ), + iDataTransmissionIniData( NULL ), + iMultiplexerIniData( NULL ), + iMultiplexerBuffer( NULL ), + iDataTransmissionBuffer( NULL ), + iIscDevice( NULL ), + iIscConnectionStatusPtr( NULL ), + iIscFlowControlStatusPtr( NULL ), + iReceiveBufPtr( NULL ), + iDataReceiveBufPtr( NULL ), + iNeededBufLen( NULL ), + iNeededDataBufLen( NULL ), + iChannelNumber( 0 ), + iChannelOpen( EFalse ), + iFrameRx( NULL ), + iFrameRxQueue( NULL ), + iDataFrameRx( NULL ), + iDataFrameRxQueue( NULL ), + iULFlowControlStatus( EIscFlowControlOff ), + iDLFlowControlStatus( EIscFlowControlOff ), + iLastNotifiedULFlowstatus( EIscFlowControlOff ), + iIscChannelHighWaterMark( 0 ), + iIscChannelLowWaterMark( 0 ), + iOverFlow( EFalse ), + iClientPanic( EFalse ), + iDataTransmissionErrorCode( KErrNone ) + { + + iIscDevice = ( DIscDevice * )aDevice; + for ( TInt i( KErrNone ); i < EIscAsyncLast; i++ ) + { + iIscRequests[i] = NULL; + } + iThread = &Kern::CurrentThread(); + TInt r = iThread->Open(); + TRACE_ASSERT( r == KErrNone ); + + } + + +// ----------------------------------------------------------------------------- +// DIscChannel::~DIscChannel +// Destructor +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +DIscChannel::~DIscChannel() + { + C_TRACE( ( _T( "DIscChannel::~DIscChannel()" ) ) ); + + if ( iChannelNumber < KIscNumberOfUnits ) + { + IscChannelContainer::RemoveChannel( this ); + } + else + { + C_TRACE( ( _T( "DIscChannel::~DIscChannel() re-open" ) ) ); + } + + ChannelDestruction(); + Kern::SafeClose( ( DObject*& )iThread, NULL ); + C_TRACE( ( _T( "DIscChannel::~DIscChannel() SafeClose called" ) ) ); + + } + +// ----------------------------------------------------------------------------- +// DIscChannel::ChannelDestruction +// Destructor +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscChannel::ChannelDestruction() + { + C_TRACE( ( _T( "DIscChannel::ChannelDestruction() iChannelNumber (0x%x)" ),iChannelNumber ) ); + + // call DIscMultiplexerBase::CloseDLC and DLFlowControlNotify in case the channel has not been + // properly closed ( e.g. client thread panic etc. ) + if ( iChannelOpen ) + { + iIscDevice->CancelSending( iChannelNumber, this );// Delete pending send frames + iIscDevice->iIscMultiplexerInterface->CloseDLC( iChannelNumber, this ); + iIscDevice->DLFlowControlNotify( EIscFlowControlOff, iChannelNumber, this ); + } + + if ( iFrameRxQueue ) + { + while ( !iFrameRxQueue->Empty() ) + { + TDes8* tempPtr = ( TDes8* ) iFrameRxQueue->GetFirst(); + iFrameRxQueue->DeleteFirst(); + iIscDevice->ReleaseMemoryBlock( tempPtr ); + } + delete iFrameRxQueue; + iFrameRxQueue = NULL; + } + + if ( iFrameRx ) + { + delete [] iFrameRx; + iFrameRx = NULL; + } + + if ( iDataFrameRxQueue ) + { + while ( !iDataFrameRxQueue->Empty() ) + { + TDes8* tempPtr = ( TDes8* ) iDataFrameRxQueue->GetFirst(); + iDataFrameRxQueue->DeleteFirst(); + iIscDevice->ReleaseMemoryBlock( tempPtr ); + } + delete iDataFrameRxQueue; + iDataFrameRxQueue = NULL; + } + + if ( iDataFrameRx ) + { + delete [] iDataFrameRx; + iDataFrameRx = NULL; + } + + if ( iInitializeDfc ) + { + delete iInitializeDfc; + iInitializeDfc = NULL; + } + + if ( iDataTransmissionIniData ) + { + Kern::Free( iDataTransmissionBuffer ); + delete iDataTransmissionIniData; + iDataTransmissionIniData = NULL; + } + + if ( iMultiplexerIniData ) + { + Kern::Free( iMultiplexerBuffer ); + delete iMultiplexerIniData; + iMultiplexerIniData = NULL; + } + + C_TRACE( ( _T( "DIscChannel::ChannelDestruction - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// DIscChannel::HandleMsg +// Message handling ( kernel server context ). +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscChannel::HandleMsg( + TMessageBase* aMsg ) + { + C_TRACE( ( _T( "DIscChannel::HandleMsg(0x%x)" ), aMsg ) ); + TThreadMessage& m=*( TThreadMessage* )aMsg; + TInt id( m.iValue ); + + if ( id==( TInt )ECloseMsg ) + { + C_TRACE( ( _T( "DIscChannel::HandleMsg ECloseMsg" ) ) ); + m.Complete( KErrNone,EFalse ); + return; + } + + else if ( id==KMaxTInt ) + { + // DoCancel + // Should not come here ever + ASSERT_RESET_ALWAYS( 0,"IscDriver",EIscNotAllowedCallToDoCancel ); + } + + else if ( id<0 ) + { + // DoRequest + // should not come here ever + ASSERT_RESET_ALWAYS( 0,"IscDriver",EIscNotAllowedCallToDoRequest ); + } + + else + { + // DoControl + TUint32 a1[ KThreeParams ]; + TInt r( KErrNone ); + if ( id != EIscSyncClose ) + { + TInt amountOfParams( KErrNone ); + switch( id ) + { + case EIscAsyncInitializeModemInterface: + case EIscAsyncOpen: + amountOfParams = KThreeParams; + break; + default: + ASSERT_RESET_ALWAYS( 0, "NokiaISCDriver", EIscUnknownCommand ); + break; + } + r = Kern::ThreadRawRead( iThread, ( TAny* )m.Ptr0(), a1, + amountOfParams * sizeof( TAny* ) ); + TRACE_ASSERT( r == KErrNone ); + } + if( r == KErrNone ) + { + r=HandleRequest( id,a1,m.Ptr1() ); + } + + m.Complete( r,ETrue ); + } + } + +// ----------------------------------------------------------------------------- +// DIscChannel::Request +// Message handling ( user thread context ). +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +#ifndef COMPONENT_TRACE_FLAG +TInt DIscChannel::Request( TInt aReqNo, TAny* a1, TAny* ) +#else +TInt DIscChannel::Request( TInt aReqNo, TAny* a1, TAny* a2) +#endif + { + C_TRACE( ( _T( "DIscChannel::Request(0x%x, 0x%x, 0x%x)" ), aReqNo, a1, a2 ) ); + + TInt r( KErrNotFound ); + + if ( aReqNo<( TInt )EMinRequestId ) + C_TRACE( ( _T( "DIscChannel::Request ERROR: False aReqNo %d" ), aReqNo ) ); + + if ( aReqNo >= 0 && aReqNo < EIscAsyncLastKernelServerContext || + aReqNo >= EIscAsyncLast && aReqNo < EIscSyncLastKernelServerContext ) + { + TThreadMessage& m=Kern::Message(); + m.iValue=aReqNo; + m.iArg[ KFirstParam ]=a1; + m.iArg[ KSecondParam ]=NULL; + r = m.SendReceive( &iMsgQ ); + } + else + { + TInt ulen( KErrNotFound ); + switch ( aReqNo ) + { + case EIscCancelAsyncInitialize: + case EIscCancelAsyncReceive: + case EIscCancelAsyncDataReceive: + case EIscSyncGetConnectionStatus: + case EIscCancelAsyncNotifyConnection: + case EIscSyncGetFlowControlStatus: + case EIscCancelAsyncNotifyFlowControl: + case EIscSyncGetMaximunDataSize: + case EIscCancelAsyncCustomOperation1: + case EIscCancelAsyncCustomOperation2: + case EIscCancelAsyncCustomOperation3: + case EIscCancelAsyncCustomOperation4: + case EIscCancelAsyncCustomOperation5: + case EIscCancelAsyncOpen: + case EIscSyncResetBuffers: + case EIscCancelAsyncSend: + case EIscCancelAsyncDataSend: + { + ulen = KErrNone; + break; + } + case EIscSyncSend: + case EIscSyncDataSend: + case EIscSyncCustomOperation1: + case EIscSyncCustomOperation2: + case EIscSyncCustomOperation3: + case EIscSyncCustomOperation4: + case EIscSyncCustomOperation5: + case EIscAsyncClose: + { + ulen = KOneParam; + break; + } + case EIscAsyncSend: + case EIscAsyncDataSend: + case EIscSyncGetChannelInfo: + case EIscAsyncNotifyConnectionStatus: + case EIscAsyncNotifyFlowControlStatus: + case EIscAsyncCustomOperation1: + case EIscAsyncCustomOperation2: + case EIscAsyncCustomOperation3: + case EIscAsyncCustomOperation4: + case EIscAsyncCustomOperation5: + { + ulen = KTwoParams; + break; + } + case EIscAsyncReceive: + case EIscAsyncDataReceive: + { + ulen = KThreeParams; + break; + } + default: + { + TRACE_ASSERT_ALWAYS; + } + } + ASSERT_RESET_ALWAYS( KErrNotFound != ulen, "ISCDriver", EIscUnknownCommand ); + // Maximum number of elements is three!!! + TAny* kptr[ KThreeParams ] = { KErrNone }; + if( ulen > KErrNone ) + { + C_TRACE( ( _T( "DIscChannel::Request ISC kumemget32" ) ) ); + kumemget32( kptr , a1, ( sizeof( TAny* ) ) * ulen ); + } + r = HandleRequest( aReqNo, kptr, NULL ); + } + C_TRACE( ( _T( "DIscChannel::Request ISC return %d CH 0x%x" ), r, iChannelNumber ) ); + return r; + + } + +// ----------------------------------------------------------------------------- +// DIscChannel::DoControl +// Handles requests. +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscChannel::HandleRequest( + TInt aFunction, + TAny* a1, + TAny* /*a2*/ ) + { + C_TRACE( ( _T( "DIscChannel::DoControl(0x%x, 0x%x) iChannelNumber 0x%x channelPtr 0x%x" ), aFunction, a1, iChannelNumber, this ) ); + + TInt error( KErrNone ); + +#ifdef _DEBUG + // Check if control frame buffer overflow -> panic + if ( iClientPanic ) + { + C_TRACE( ( _T( "DIscChannel::DoControl() BUFFER OVERFLOW: PANIC CLIENT 0x%x" ), iChannelNumber ) ); + TRACE_ASSERT_ALWAYS; + // This panic the user thread only. + Kern::ThreadKill( iThread, EExitPanic, EIscControlBufferOverflow, KIscDriver ); + } +#endif // _DEBUG + + // Handle asynchronous requests + if ( aFunction >= EIscAsyncInitializeModemInterface && + aFunction < EIscAsyncLast ) + { + // if request is already active + if ( iIscRequests[aFunction] ) + { + TUint32* tablePtr = ( TUint32* )a1; + TRequestStatus* requestStatus = ( TRequestStatus* )( tablePtr[ KFirstParam ] ); + Kern::RequestComplete( iThread, requestStatus, KErrAlreadyExists ); + } + else + { + HandleAsyncRequest( aFunction, a1 ); + } + } + // Handle synchronous requests. + else if ( aFunction >= EIscAsyncLast && + aFunction < EIscSyncLast ) + { + error = HandleSyncRequest( aFunction, a1 ); + } + // Handle cancellation requests. + else if ( aFunction >= EIscSyncLast && + aFunction < EIscCancelLast ) + { + error = HandleCancelRequest( aFunction, a1 ); + } + // Undefined request, panic current thread. + else + { + // This panic the user thread only. + Kern::ThreadKill( iThread, EExitPanic, EIscControlBufferOverflow, KIscDriver ); + } + + C_TRACE( ( _T( "DIscChannel::DoControl - return %d" ), error ) ); + + return error; + } + + +// ----------------------------------------------------------------------------- +// DIscChannel::HandleAsyncRequests +// Handles asynchronous client requests +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscChannel::HandleAsyncRequest( + TInt aFunction, + TAny* a1 ) + { + C_TRACE( ( _T( "DIscChannel::HandleAsyncRequest(0x%x, 0x%x) channelPtr 0x%x" ), aFunction, a1, this ) ); + + TUint32* tablePtr = ( TUint32* )a1; + + switch ( aFunction ) + { + case EIscAsyncInitializeModemInterface: + { + TInt r = KErrNotFound; + iIscRequests[EIscAsyncInitializeModemInterface] = ( TRequestStatus* )( tablePtr[ KFirstParam ] ); + + iInitializeDfc = new TDfc( InitializeComplete, this, Kern::DfcQue0(), KIscInitializeDfcPriority ); + ASSERT_RESET_ALWAYS( iInitializeDfc, "IscDriver",EIscMemoryAllocationFailure ); + + // Get Data Transmission Driver initialization string + TDesC8* tempPtr = ( TDesC8* )tablePtr[ KThirdParam ]; + iDataTransmissionBuffer = ( TUint8* )Kern::Alloc( KIscIniLineLength ); + ASSERT_RESET_ALWAYS( iDataTransmissionBuffer, "IscDriver",EIscMemoryAllocationFailure ); + + iDataTransmissionIniData = new ( TPtr8 )( iDataTransmissionBuffer, KIscIniLineLength ); + ASSERT_RESET_ALWAYS( iDataTransmissionIniData, "IscDriver",EIscMemoryAllocationFailure ); + + r = Kern::ThreadDesRead( iThread, tempPtr, *iDataTransmissionIniData, 0, KChunkShiftBy0 ); + ASSERT_RESET_ALWAYS( r == KErrNone, "IscDriver",EIscMemoryAllocationFailure ); + + // Get Multiplexer initialization string + tempPtr = ( TDesC8* )tablePtr[1]; + iMultiplexerBuffer = ( TUint8* )Kern::Alloc( KIscIniLineLength ); + ASSERT_RESET_ALWAYS( iMultiplexerBuffer, "IscDriver",EIscMemoryAllocationFailure ); + + iMultiplexerIniData = new ( TPtr8 )( iMultiplexerBuffer, KIscIniLineLength ); + ASSERT_RESET_ALWAYS( iDataTransmissionIniData, "IscDriver",EIscMemoryAllocationFailure ); + + r = Kern::ThreadDesRead( iThread, tempPtr, *iMultiplexerIniData, 0, KChunkShiftBy0 ); + ASSERT_RESET_ALWAYS( r == KErrNone, "IscDriver",EIscMemoryAllocationFailure ); + + // If buffer configuration is given from isc_config.ini as multiplexer configuration string, multiplexer + // needs configuration before datatransmissin driver is initialized + iIscDevice->iIscMultiplexerInterface->SetInitializationParameters( *iMultiplexerIniData ); + + // Allocate buffers and receive queues + iIscDevice->Initialize(); + + iIscDevice->iIscDataTransmissionInterface->InitializeDataTransmission( *iDataTransmissionIniData, + iInitializeDfc, + iDataTransmissionErrorCode ); + break; + } + + case EIscAsyncOpen: + { + iIscRequests[EIscAsyncOpen] = ( TRequestStatus* )( tablePtr[ KFirstParam ] ); + if ( iIscDevice->ConnectionStatus() == EIscConnectionOk ) + { + TDesC8* openInfo = ( TDesC8* )tablePtr[ KThirdParam ]; + // Channel info parameter has to be copied from user side in Epoc Kernel Architecture 2 + TInt length = Kern::ThreadGetDesLength( iThread, ( TDesC8* )tablePtr[ KThirdParam ] ); + TUint8* buffer = NULL; + TPtr8* bufferPtr = NULL; + if ( length > KErrNone ) + { + C_TRACE( ( _T( "DIscChannel::HandleAsyncRequest EIscAsyncOpen channel info got" ) ) ); + buffer = ( TUint8* )Kern::Alloc( length ); + bufferPtr = new ( TPtr8 )( buffer, length ); + TInt r = Kern::ThreadDesRead( iThread, openInfo, *bufferPtr, 0, KChunkShiftBy0 ); + ASSERT_RESET_ALWAYS( r == KErrNone, "IscDriver",EIscMemoryAllocationFailure ); + openInfo = ( TDesC8* )bufferPtr; + } + iIscDevice->iIscMultiplexerInterface->OpenDLC( ( TUint16 )tablePtr[ KSecondParam ], + openInfo, + this ); + + if ( buffer ) + Kern::Free( buffer ); + if ( bufferPtr ) + { + delete bufferPtr; + bufferPtr = NULL; + } + } + else + { + CompleteRequest( aFunction, KErrNotReady ); + } + break; + } + case EIscAsyncSend: + { + iIscRequests[EIscAsyncSend] = ( TRequestStatus* )( tablePtr[ KFirstParam ] ); + if ( iIscDevice->ConnectionStatus() == EIscConnectionOk + && iULFlowControlStatus == EIscFlowControlOff ) + { + TDesC8* ptr = ( TDesC8* ) tablePtr[ KSecondParam ]; + + // No return values check needed. Request completed with error value by multiplexer + iIscDevice->iIscMultiplexerInterface->Send( ( TUint16 )aFunction, + iChannelNumber, + *ptr, + this ); + } + else + { + if ( iULFlowControlStatus != EIscFlowControlOff ) + { + CompleteRequest( aFunction, KErrOverflow ); + } + else + { + CompleteRequest( aFunction, KErrNotReady ); + } + } + break; + } + case EIscAsyncReceive: + { + TRACE_ASSERT( tablePtr[ KFirstParam ] ); + TRACE_ASSERT( tablePtr[ KSecondParam ] ); + TRACE_ASSERT( tablePtr[ KThirdParam ] ); + + // check for descriptor validity + TRACE_ASSERT( Kern::ThreadGetDesMaxLength( iThread, (TPtr8* )tablePtr[KSecondParam] ) > 0 ); + + //Store needed length ptr + iNeededBufLen = ( TPtr8* )tablePtr[ KThirdParam ]; + + //Store msg data ptr + iReceiveBufPtr = ( TPtr8* )tablePtr[ KSecondParam ]; + + iIscRequests[EIscAsyncReceive] = ( TRequestStatus* )( tablePtr[ KFirstParam ] ); + + break; + } + case EIscAsyncDataSend: + { + iIscRequests[EIscAsyncDataSend] = ( TRequestStatus* )( tablePtr[ KFirstParam ] ); + + if ( iIscDevice->ConnectionStatus() == EIscConnectionOk + && iULFlowControlStatus == EIscFlowControlOff ) + { + TDesC8* ptr = ( TDesC8* )tablePtr[ KSecondParam ]; + iIscDevice->iIscMultiplexerInterface->DataSend( ( TUint16 )aFunction, + iChannelNumber, + *ptr, + this ); + } + else + { + if ( iULFlowControlStatus != EIscFlowControlOff ) + { + CompleteRequest( aFunction, KErrOverflow ); + } + else + { + CompleteRequest( aFunction, KErrNotReady ); + } + } + break; + } + case EIscAsyncDataReceive: + { + TRACE_ASSERT( tablePtr[ KFirstParam ] ); + TRACE_ASSERT( tablePtr[ KSecondParam ] ); + TRACE_ASSERT( tablePtr[ KThirdParam ] ); + + // check for descriptor validity + TRACE_ASSERT( Kern::ThreadGetDesMaxLength( iThread, (TPtr8* )tablePtr[KSecondParam] ) > 0 ); + + //Store needed length ptr + iNeededDataBufLen = ( TPtr8* )tablePtr[ KThirdParam ]; + + //Store msg data ptr + iDataReceiveBufPtr = ( TPtr8* )tablePtr[ KSecondParam ]; + + iIscRequests[EIscAsyncDataReceive] = ( TRequestStatus* )( tablePtr[ KFirstParam ] ); + + break; + } + case EIscAsyncNotifyConnectionStatus: + { + iIscConnectionStatusPtr = ( TPtr8* )tablePtr[ KSecondParam ]; + iIscRequests[EIscAsyncNotifyConnectionStatus] = ( TRequestStatus* )( tablePtr[ KFirstParam ] ); + break; + } + case EIscAsyncNotifyFlowControlStatus: + { + iIscFlowControlStatusPtr = reinterpret_cast( tablePtr[ KSecondParam ] ); + iIscRequests[ EIscAsyncNotifyFlowControlStatus ] = reinterpret_cast( tablePtr[ KFirstParam ] ); + C_TRACE( ( _T( "DIscChannel::NotifyFlowControl iLastNotifiedULFlowstatus = %d iULFlowControlStatus = %d" ), iLastNotifiedULFlowstatus, iULFlowControlStatus ) ); + + if( iULFlowControlStatus != iLastNotifiedULFlowstatus ) + { + // Complete immediately. + C_TRACE( ( _T( "DIscChannel::HandleAsyncRequest iULFlowControlStatus != iLastNotifiedULFlowstatus" ) ) ); + NotifyFlowControl( iULFlowControlStatus ); + } + else + { + // None + } + break; + } + case EIscAsyncCustomOperation1: + case EIscAsyncCustomOperation2: + case EIscAsyncCustomOperation3: + case EIscAsyncCustomOperation4: + case EIscAsyncCustomOperation5: + { + iIscRequests[aFunction] = ( TRequestStatus* )( tablePtr[ KFirstParam ] ); + TAny* tempPtr = ( TAny* )tablePtr[ KSecondParam ]; + iIscDevice->iIscMultiplexerInterface->CustomFunction( iChannelNumber, + ( TUint16 )aFunction, + tempPtr, + this ); + break; + } + case EIscAsyncClose: + { + iIscRequests[aFunction] = ( TRequestStatus* )( tablePtr[ KFirstParam ] ); + + ResetBuffers(); + + // Cancel all active requests except asynchronous close + for ( TInt i( KErrNone ); i < EIscAsyncLast; i++ ) + { + // if request is active complete it with KErrCancel + if ( iIscRequests[i] && i != EIscAsyncClose ) + { + iIscDevice->iIscMultiplexerInterface->CancelNotify( iChannelNumber, i, this ); + CompleteRequest( i, KErrCancel ); + } + } + + iChannelOpen = EFalse; + + iIscDevice->iIscMultiplexerInterface->CloseDLC( iChannelNumber, this ); + + break; + } + default: + { + ASSERT_RESET_ALWAYS( 0,"IscDriver",EIscUnknownCommand ); + break; + } + } + + IscChannelContainer::AddDfc(); + + } + + +// ----------------------------------------------------------------------------- +// DIscChannel::HandleSyncRequest +// Handles synchronous client requests +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscChannel::HandleSyncRequest( + TInt aFunction, + TAny* a1 ) + { + C_TRACE( ( _T( "DIscChannel::HandleSyncRequest(0x%x, 0x%x) channelPtr 0x%x" ), aFunction, a1, this ) ); + + TInt error( KErrNone ); + TUint32* tablePtr = ( TUint32* )a1; + + switch ( aFunction ) + { + case EIscSyncClose: + { + ResetBuffers(); + + iIscDevice->iIscMultiplexerInterface->CloseDLC( iChannelNumber, this ); + + // Cancel all active requests + for ( TInt i( KErrNone ); i < EIscAsyncLast; i++ ) + { + // if request is active complete it with KErrCancel + if ( iIscRequests[i] ) + { + iIscDevice->iIscMultiplexerInterface->CancelNotify( iChannelNumber, i, this ); + CompleteRequest( i, KErrCancel ); + } + } + + error = KErrNone; + iChannelOpen = EFalse; + break; + } + case EIscSyncSend: + { + if ( iIscDevice->ConnectionStatus() == EIscConnectionOk + && iULFlowControlStatus == EIscFlowControlOff ) + { + + TDesC8* ptr = ( TDesC8* ) tablePtr[ KFirstParam ]; + error = iIscDevice->iIscMultiplexerInterface->Send( ( TUint16 )aFunction, + iChannelNumber, + *ptr, + this ); + } + else + { + if ( iULFlowControlStatus != EIscFlowControlOff ) + { + error = KErrOverflow; + } + else + { + error = KErrNotReady; + } + } + break; + } + case EIscSyncDataSend: + { + if ( iIscDevice->ConnectionStatus() == EIscConnectionOk + && iULFlowControlStatus == EIscFlowControlOff ) + { + TDesC8* ptr = ( TDesC8* ) tablePtr[ KFirstParam ]; + error = iIscDevice->iIscMultiplexerInterface->DataSend( ( TUint16 )aFunction, + iChannelNumber, + *ptr, + this ); + } + else + { + if ( iULFlowControlStatus != EIscFlowControlOff ) + { + error = KErrOverflow; + } + else + { + error = KErrNotReady; + } + } + break; + } + case EIscSyncGetConnectionStatus: + { + error = iIscDevice->ConnectionStatus(); + break; + } + case EIscSyncGetFlowControlStatus: + { + error = iULFlowControlStatus; + break; + } + case EIscSyncGetChannelInfo: + { + TDes8* tempPtr = ( TDes8* ) tablePtr[1]; + error = iIscDevice->iIscMultiplexerInterface->GetChannelInfo( ( TUint16 )tablePtr[ KFirstParam ], + *tempPtr ); + break; + } + case EIscSyncGetMaximunDataSize: + { + error = iIscDevice->iIscMultiplexerInterface->MaximumDataSize( iChannelNumber ); + break; + } + case EIscSyncCustomOperation1: + case EIscSyncCustomOperation2: + case EIscSyncCustomOperation3: + case EIscSyncCustomOperation4: + case EIscSyncCustomOperation5: + { + TAny* tempPtr = ( TAny* )tablePtr[ KFirstParam ]; + error = iIscDevice->iIscMultiplexerInterface->CustomFunction( iChannelNumber, + ( TUint16 )aFunction, + tempPtr, + this ); + break; + } + case EIscSyncResetBuffers: + { + ResetBuffers(); + error = KErrNone; + break; + } + default: + { + ASSERT_RESET_ALWAYS( 0,"IscDriver",EIscUnknownCommand ); + break; + } + } + return error; + } + +// ----------------------------------------------------------------------------- +// DIscChannel::HandleCancelRequest +// Cancels active request +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscChannel::HandleCancelRequest( + TInt aFunction, + TAny* /*a1*/ ) + { + C_TRACE( ( _T( "DIscChannel::HandleCancelRequest(0x%x)" ), aFunction ) ); + + TUint16 operationToCancel( 0 ); + switch ( aFunction ) + { + + case EIscCancelAsyncInitialize: + { + if ( iDataTransmissionIniData ) + { + Kern::Free( iDataTransmissionBuffer ); + delete iDataTransmissionIniData; + iDataTransmissionIniData = NULL; + } + if ( iMultiplexerIniData ) + { + Kern::Free( iMultiplexerBuffer ); + delete iMultiplexerIniData; + iMultiplexerIniData = NULL; + } + + operationToCancel = EIscAsyncInitializeModemInterface; + break; + } + case EIscCancelAsyncOpen: + { + if ( KRequestPending == IsPending( EIscAsyncOpen ) ) + { + iChannelOpen = EFalse; + } + operationToCancel = EIscAsyncOpen; + break; + } + case EIscCancelAsyncSend: + { + operationToCancel = EIscAsyncSend; + // Cancel sending / empty send queues + iIscDevice->CancelSending( iChannelNumber, this ); + break; + } + case EIscCancelAsyncDataSend: + { + operationToCancel = EIscAsyncDataSend; + // Cancel sending / empty send queues + iIscDevice->CancelSending( iChannelNumber, this ); + break; + } + + case EIscCancelAsyncReceive: + { + iReceiveBufPtr = NULL; + iNeededBufLen = NULL; + operationToCancel = EIscAsyncReceive; + break; + } + + case EIscCancelAsyncDataReceive: + { + iDataReceiveBufPtr = NULL; + iNeededDataBufLen = NULL; + operationToCancel = EIscAsyncDataReceive; + break; + } + + case EIscCancelAsyncNotifyConnection: + { + iIscConnectionStatusPtr = NULL; + operationToCancel = EIscAsyncNotifyConnectionStatus; + break; + } + + case EIscCancelAsyncNotifyFlowControl: + { + iIscFlowControlStatusPtr = NULL; + operationToCancel = EIscAsyncNotifyFlowControlStatus; + break; + } + case EIscCancelAsyncCustomOperation1: + { + operationToCancel = EIscAsyncCustomOperation1; + break; + } + case EIscCancelAsyncCustomOperation2: + { + operationToCancel = EIscAsyncCustomOperation2; + break; + } + case EIscCancelAsyncCustomOperation3: + { + operationToCancel = EIscAsyncCustomOperation3; + break; + } + case EIscCancelAsyncCustomOperation4: + { + operationToCancel = EIscAsyncCustomOperation4; + break; + } + case EIscCancelAsyncCustomOperation5: + { + operationToCancel = EIscAsyncCustomOperation5; + break; + } + case EIscCancelAsyncClose: + { + TRACE_ASSERT_ALWAYS; + operationToCancel = EIscAsyncClose; + break; + } + default: + { + ASSERT_RESET_ALWAYS( 0,"IscDriver",EIscUnknownCommand ); + break; + } + } + + iIscDevice->iIscMultiplexerInterface->CancelNotify( iChannelNumber, ( TUint16 )operationToCancel, this ); + CompleteRequest( operationToCancel, KErrCancel ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// DIscChannel::DoCreate +// Secondary initialization of channel +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscChannel::DoCreate( + TInt aUnit, + const TDesC8* anInfo, + const TVersion& /*aVer*/ ) + { + C_TRACE( ( _T( "DIscChannel::DoCreate(0x%x, 0x%x, 0x%x)" ), aUnit, anInfo, this ) ); + if ( !Kern::CurrentThreadHasCapability( ECapabilityCommDD,__PLATSEC_DIAGNOSTIC_STRING + ( "Checked by ISCDRIVER.LDD ( Inter-System Communication Driver )" ) ) ) + { + return KErrPermissionDenied; + } + TUint16 channelNumber = ( TUint16 )aUnit; + if ( anInfo ) + { + // check for channel number inside anInfo + TUint8 channel = ( TUint8 )( *anInfo )[0]; + if ( channel >= KIscMaxChannelsInLdd ) + { + channelNumber += KIscMaxChannelsInLdd; + } + C_TRACE( ( _T( "DIscChannel::DoCreate channel=0x%x" ), channelNumber ) ); + } + + if ( channelNumber != KIscControlChannel ) + { + TIscConfiguration config; + iIscDevice->iIscMultiplexerInterface->GetConfiguration( config ); + TInt i( KErrNone ); + iFrameRx = new TUint32*[config.channelRcvQueueSize]; + ASSERT_RESET_ALWAYS( iFrameRx, "IscDriver",EIscMemoryAllocationFailure ); + for ( i = KErrNone; i < config.channelRcvQueueSize; i++ ) + { + iFrameRx[i] = 0; + } + + iDataFrameRx = new TUint32*[config.channelDataRcvQueueSize]; + ASSERT_RESET_ALWAYS( iDataFrameRx, "IscDriver",EIscMemoryAllocationFailure ); + for ( i = KErrNone; i < config.channelDataRcvQueueSize; i++ ) + { + iDataFrameRx[i] = 0; + } + + // creating frame queue for incoming frames + iFrameRxQueue = new DIscQueue( iFrameRx, config.channelRcvQueueSize ); + ASSERT_RESET_ALWAYS( iFrameRxQueue, "IscDriver",EIscMemoryAllocationFailure ); + + // creating frame queue for incoming data frames + iDataFrameRxQueue = new DIscQueue( iDataFrameRx, config.channelDataRcvQueueSize ); + ASSERT_RESET_ALWAYS( iDataFrameRxQueue, "IscDriver",EIscMemoryAllocationFailure ); + + // Flowcontrol marks for data frames + iIscChannelHighWaterMark = ( TUint16 )( ( ( ( TUint16 )config.channelDataRcvQueueSize ) * KMultiplyByThree ) / KDivideByFour );// 75% = multiply with 3, divide by 4 + iIscChannelLowWaterMark = ( TUint16 )( ( ( ( TUint16 )config.channelDataRcvQueueSize ) * KMultiplyByOne ) / KDivideByFour );// 25% = multiply with 1, divide by 4 + + TRACE_ASSERT( iIscChannelHighWaterMark != 0 ); + } + +#ifndef ISC_CHANNEL_SHARING_IN_USE + // Remove checking if channel already set to enable channel sharing + //Check if channel already set + if ( IscChannelContainer::Channel( channelNumber, 0 ) ) + { + C_TRACE( ( _T( "DIscChannel::DoCreate channel 0x%x already set!!!!" ), channelNumber ) ); + return KErrAlreadyExists; + } +#endif //ISC_CHANNEL_SHARING_IN_USE + + //Add itself to channel table. + TInt error = IscChannelContainer::SetChannel( ( DIscChannel* )this, channelNumber ); + if ( KErrNone != error ) + { + return error; + } + + iChannelOpen = ETrue; + + // Store channel number. + iChannelNumber = channelNumber; + SetDfcQ( Kern::DfcQue0() ); + iMsgQ.Receive(); + + return KErrNone; + + } + + +// ----------------------------------------------------------------------------- +// DIscChannel::NotifyFlowControl +// Notify user side client that uplink flow control is on/off +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscChannel::NotifyFlowControl + ( + const TInt aFlowControlStatus + ) + { + C_TRACE( ( _T( "DIscChannel::NotifyFlowControl(0x%x) iChannelNumber 0x%x channelPtr 0x%x" ), aFlowControlStatus, iChannelNumber, this ) ); + + iULFlowControlStatus = aFlowControlStatus; + if( iIscRequests[ EIscAsyncNotifyFlowControlStatus ] + && iIscFlowControlStatusPtr ) + { + TPtr8 tempDes( reinterpret_cast( &iULFlowControlStatus ), sizeof ( TInt ), sizeof ( TInt ) ); + iLastNotifiedULFlowstatus = aFlowControlStatus; + TInt r = ThreadWrite( static_cast( iIscFlowControlStatusPtr ), &tempDes, 0 ); + TRACE_ASSERT( r == KErrNone ); + CompleteRequest( EIscAsyncNotifyFlowControlStatus, r ); + } + else + { + C_TRACE( ( _T( "DIscChannel::NotifyFlowControl No request pending!" ) ) ); + } + } + +// ----------------------------------------------------------------------------- +// DIscChannel::NotifyConnectionStatus +// Notify user side client that connection status has changed +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscChannel::NotifyConnectionStatus( + const TInt aConnectionStatus ) + { + C_TRACE( ( _T( "DIscChannel::NotifyConnectionStatus(0x%x) channelPtr 0x%x" ), aConnectionStatus, this ) ); + + if ( iIscRequests[EIscAsyncNotifyConnectionStatus] + && iIscConnectionStatusPtr ) + { + TInt temp = aConnectionStatus; + TPtr8 tempDes( ( TUint8* )&temp,sizeof ( TInt ),sizeof ( TInt ) ); + TInt r = ThreadWrite( ( TAny* )iIscConnectionStatusPtr, &tempDes, 0 ); + TRACE_ASSERT( r == KErrNone ); + + CompleteRequest( EIscAsyncNotifyConnectionStatus, r ); + } + } + +// ----------------------------------------------------------------------------- +// DIscChannel::IsPending +// Check if asynchronous request is active +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscChannel::IsPending( + const TUint16 aReqNumber ) + { + TInt error( KErrNone ); + if ( iIscRequests[aReqNumber] ) + { + error = KRequestPending; + } + else + { + // error is KErrNone + } + return error; + } +// ----------------------------------------------------------------------------- +// DIscChannel::CompleteRequest +// Function to complete clients pending asynchronous request +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscChannel::CompleteRequest( + TInt aOperation, + TInt aCompleteStatus ) + { + C_TRACE( ( _T( "DIscChannel::CompleteRequest(0x%x, 0x%x) iChannelNumber 0x%x channelPtr 0x%x" ), aOperation, aCompleteStatus, iChannelNumber, this ) ); + + if ( aOperation < EIscAsyncLast ) + { + + TRequestStatus* requestStatus = iIscRequests[aOperation]; + if ( requestStatus ) + { + // In case of higher priority thread, set request to NULL from the request table before actual completing + iIscRequests[aOperation] = NULL; + Kern::RequestComplete( iThread, requestStatus, aCompleteStatus ); + } + } + else + { + // Do nothing + } + + C_TRACE( ( _T( "DIscChannel::CompleteRequest - return void" ) ) ); + + } + +// ----------------------------------------------------------------------------- +// DIscChannel::InitializeComplete +// Initialization complete dfc +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscChannel::InitializeComplete( + TAny* aPtr ) + { + C_TRACE( ( _T( "DIscChannel::InitializeComplete(0x%x)" ), aPtr ) ); + + DIscChannel* ThisPtr = ( DIscChannel* )aPtr; + if ( KErrNone == ThisPtr->iDataTransmissionErrorCode ) + { + ThisPtr->DoMultiplexerInitialize(); + } + else + { + ThisPtr->CompleteRequest( EIscAsyncInitializeModemInterface, ThisPtr->iDataTransmissionErrorCode ); + } + C_TRACE( ( _T( "DIscChannel::InitializeComplete - return 0x%x" ) ) ); + + } + +// ----------------------------------------------------------------------------- +// DIscChannel::DoMultiplexerInitialize +// Completes the multiplexer initialization +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscChannel::DoMultiplexerInitialize() + { + C_TRACE( ( _T( "DIscChannel::DoMultiplexerInitialize() channelPtr 0x%x" ), this ) ); + + if ( iIscRequests[EIscAsyncInitializeModemInterface] ) + { + + iIscDevice->iIscMultiplexerInterface->InitializeMultiplexer( + EIscAsyncInitializeModemInterface, + *iMultiplexerIniData, + this ); + } + + C_TRACE( ( _T( "DIscChannel::DoMultiplexerInitialize - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// DIscChannel::StoreFrame +// Stores the incoming frame to channels receive queue +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscChannel::StoreFrame( TDesC8* aData ) + { + C_TRACE( ( _T( "DIscChannel::StoreFrame(0x%x) channelId 0x%x channelPtr 0x%x" ), aData, iChannelNumber, this ) ); + + TInt error( KErrNone ); + + TIscFrameInfo frameInfo; + iIscDevice->iIscMultiplexerInterface->GetFrameInfo( *aData, frameInfo ); + + if ( frameInfo.frameType == EIscDataFrame ) + { + C_TRACE( ( _T( "DIscChannel::StoreFrame dataFrame" ) ) ); + error = iDataFrameRxQueue->Add( ( TAny* )aData ); + if ( error == KErrNone ) + { + if ( iDataFrameRxQueue->Count() >= iIscChannelHighWaterMark + && iDLFlowControlStatus == EIscFlowControlOff ) + { + iIscDevice->DLFlowControlNotify( EIscFlowControlOn, iChannelNumber, this ); + iDLFlowControlStatus = EIscFlowControlOn; + } + else if ( iDataFrameRxQueue->Count() <= iIscChannelLowWaterMark + && iDLFlowControlStatus != EIscFlowControlOff ) + { + iIscDevice->DLFlowControlNotify( EIscFlowControlOff, iChannelNumber, this ); + iDLFlowControlStatus = EIscFlowControlOff; + } + else + { + // Do nothing + } + } + else + { + // Set overflow flag on. Complete next DataReceive with KErrOverFlow + TRACE_ASSERT_ALWAYS; + iOverFlow = ETrue; + iIscDevice->ReleaseMemoryBlock( ( TDes8* )aData ); + } + } + + else + { + C_TRACE( ( _T( "DIscChannel::StoreFrame controlFrame" ) ) ); + error = iFrameRxQueue->Add( ( TAny* )aData ); + if ( error != KErrNone ) + { + C_TRACE( ( _T( "DIscChannel::StoreFrame() CONTROL FRAME OVERFLOW channel %d" ), iChannelNumber ) ); + TRACE_ASSERT_ALWAYS; + iClientPanic = ETrue; + iIscDevice->ReleaseMemoryBlock( ( TDes8* )aData ); + } + } + + C_TRACE( ( _T( "DIscChannel::StoreFrame - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// DIscChannel::EmptyBuffers +// Goes through channel's queue and delivers possible frame( s ) to client +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscChannel::EmptyBuffers() + { + C_TRACE( ( _T( "DIscChannel::EmptyBuffers() channelId 0x%x channelPtr 0x%x" ),iChannelNumber, this ) ); + + if ( iDataFrameRxQueue->NextBufferLength() > KErrNone ) + { + TDes8* tempPtr = ( TDes8* ) iDataFrameRxQueue->GetFirst(); + TIscFrameInfo frameInfo; + TInt desMaxLen( KErrNone ); + + iIscDevice->iIscMultiplexerInterface->GetFrameInfo( *tempPtr, frameInfo ); + + // frame incoming, and datareceive request active + if ( iIscRequests[EIscAsyncDataReceive] && frameInfo.frameType == EIscDataFrame ) + { + if ( frameInfo.concatenation == EIscNoConcatenation ) + { + desMaxLen = Kern::ThreadGetDesMaxLength( iThread, iDataReceiveBufPtr ); + + C_TRACE( ( _T( "DIscChannel::EmptyBuffers() data desMaxLen %d" ),desMaxLen ) ); + + TRACE_ASSERT( desMaxLen > KErrNone ); + + // check that client's memory block is big enough + if ( desMaxLen >= frameInfo.writeLength ) + { + // create a temporary descriptor for writing since we're + // necessary not writing the whole contents of the + // source descriptor, only the part that ISC Multiplexer + // wants + TPtr8 writePtr( ( TUint8* )( tempPtr->Ptr() + frameInfo.writeStartIndex ), + frameInfo.writeLength, + frameInfo.writeLength ); + + TInt r = ThreadWrite( iDataReceiveBufPtr, &writePtr, 0 ); + + TRACE_ASSERT( r == KErrNone ); + + // remove the pointer from queue and release the memory block + // but only if the ThreadWrite was successfull + if ( r == KErrNone ) + { + iDataFrameRxQueue->DeleteFirst(); + iIscDevice->ReleaseMemoryBlock( tempPtr ); + if ( iOverFlow ) + { + iOverFlow = EFalse; + CompleteRequest( EIscAsyncDataReceive, KErrOverflow ); + } + else + { + CompleteRequest( EIscAsyncDataReceive, KErrNone ); + } + } + else + { + C_TRACE( ( _T( "DIscChannel::EmptyBuffers() data ThreadWrite %d" ), r ) ); + CompleteRequest( EIscAsyncDataReceive, r ); + } + } + // client buffer too small + else + { + TUint16 tempLen( frameInfo.writeLength ); + TPtr8 tempLenDes( ( TUint8* )&tempLen, sizeof ( TUint16 ), sizeof ( TUint16 ) ); + + TInt r = ThreadWrite( ( TAny* )iNeededDataBufLen, &tempLenDes, 0 ); + TRACE_ASSERT( r == KErrNone ); + if ( r != KErrNone ) + { + C_TRACE( ( _T( "DIscChannel::EmptyBuffers() data ThreadWrite %d" ), r ) ); + } + + CompleteRequest( EIscAsyncDataReceive, KErrNoMemory ); + } + } + else + { + HandleConcatenatedDataFrame( tempPtr, frameInfo ); + } + } + } + // no frames in data queue + else + { + C_TRACE( ( _T( "DIscChannel::EmptyBuffers() channelId 0x%x channelPtr No frames in data queue" ), iChannelNumber, this ) ); + } + + // Check if there is frame in queue + if ( iFrameRxQueue->NextBufferLength() > KErrNone ) + { + TDes8* tempPtr = ( TDes8* ) iFrameRxQueue->GetFirst(); + TIscFrameInfo frameInfo; + TInt desMaxLen( KErrNone ); + + iIscDevice->iIscMultiplexerInterface->GetFrameInfo( *tempPtr, frameInfo ); + + // frame incoming and normal receive request active + if ( iIscRequests[EIscAsyncReceive] && frameInfo.frameType == EIscNonDataFrame ) + { + if ( frameInfo.concatenation == EIscNoConcatenation ) + { + desMaxLen = Kern::ThreadGetDesMaxLength( iThread, iReceiveBufPtr ); + + C_TRACE( ( _T( "DIscChannel::EmptyBuffers() desMaxLen %d" ),desMaxLen ) ); + + TRACE_ASSERT( desMaxLen > KErrNone ); + + // check that client's memory block is big enough + if ( desMaxLen >= frameInfo.writeLength ) + { + // create a temporary descriptor for writing since we're + // necessary not writing the whole contents of the + // source descriptor, only the part that ISC Multiplexer + // wants + TPtr8 writePtr( ( TUint8* )( tempPtr->Ptr() + frameInfo.writeStartIndex ), + frameInfo.writeLength, + frameInfo.writeLength ); + + TInt r = ThreadWrite( iReceiveBufPtr, &writePtr, 0 ); + + TRACE_ASSERT( r == KErrNone ); + + // remove the pointer from queue and release the memory block + // but only if the ThreadWrite was successfull + if ( r == KErrNone ) + { + iFrameRxQueue->DeleteFirst(); + iIscDevice->ReleaseMemoryBlock( tempPtr ); + if ( iClientPanic ) + { + iClientPanic = EFalse; + CompleteRequest( EIscAsyncReceive, KErrOverflow ); + } + else + { + CompleteRequest( EIscAsyncReceive, KErrNone ); + } + } + else + { + C_TRACE( ( _T( "DIscChannel::EmptyBuffers() ThreadWrite %d" ), r ) ); + CompleteRequest( EIscAsyncReceive, r ); + } + } + // client buffer too small + else + { + TUint16 tempLen = frameInfo.writeLength; + TPtr8 tempLenDes( ( TUint8* )&tempLen, sizeof ( TUint16 ), sizeof ( TUint16 ) ); + + TInt r = ThreadWrite ( ( TAny* )iNeededBufLen, &tempLenDes, 0 ); + TRACE_ASSERT( r == KErrNone ); + if ( r != KErrNone ) + { + C_TRACE( ( _T( "DIscChannel::EmptyBuffers() ThreadWrite %d" ), r ) ); + } + + CompleteRequest( EIscAsyncReceive, KErrNoMemory ); + } + } + else + { + HandleConcatenatedFrame( tempPtr, frameInfo ); + } + } + } + // no frames in queue + else + { + C_TRACE( ( _T( "DIscChannel::EmptyBuffers() channelId 0x%x channelPtr 0x%x No frames in queue" ), iChannelNumber, this ) ); + } + + // If possible, set flow control off from data frame receiving + if ( iDataFrameRxQueue->Count() <= iIscChannelLowWaterMark + && iDLFlowControlStatus != EIscFlowControlOff ) + { + iIscDevice->DLFlowControlNotify( EIscFlowControlOff, iChannelNumber, this ); + iDLFlowControlStatus = EIscFlowControlOff; + } + + + C_TRACE( ( _T( "DIscChannel::EmptyBuffers - return void" ) ) ); + + } + +// ----------------------------------------------------------------------------- +// DIscChannel::HandleConcatenatedDataFrame +// Copies several data frames to clients buffer if needed before compliting receive request +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscChannel::HandleConcatenatedDataFrame( TDes8* aPtr, TIscFrameInfo& aInfo ) + { + C_TRACE( ( _T( "DIscChannel::HandleConcatenatedDataFrame(0x%x, 0x%x) channelPtr 0x%x" ), aPtr, &aInfo, this ) ); + TInt desMaxLen( KErrNone ); + TInt desLen( KErrNone ); + TUint16 totalLength( 0 ); + + desMaxLen = Kern::ThreadGetDesMaxLength( iThread, iDataReceiveBufPtr ); + desLen = Kern::ThreadGetDesLength( iThread, iDataReceiveBufPtr ); + + if ( aInfo.totalLength > KErrNone ) + { + totalLength = aInfo.totalLength; + } + else + { + totalLength = desMaxLen; + } + switch ( aInfo.concatenation ) + { + // first frame of a larger data chunk + case EIscConcatenationDataStart: + { + // check whether the whole data amount will fit into the user buffer + if ( desMaxLen >= ( desLen + aInfo.writeLength ) && desMaxLen >= totalLength ) + { + // create a temporary descriptor for writing since we're + // necessary not writing the whole contents of the + // source descriptor, only the part that ISC Multiplexer + // wants + TPtr8 writePtr( ( TUint8* )( aPtr->Ptr() + aInfo.writeStartIndex ), + aInfo.writeLength, + aInfo.writeLength ); + + // start writing the data at offset 0 since this is the first frame + TInt r = ThreadWrite( iDataReceiveBufPtr, &writePtr, 0 ); + + // remove the pointer from queue and release the memory block + // but only if the ThreadWrite was successfull + // we do not complete the user request until EIscConcatenationDataEnd + if ( r == KErrNone ) + { + iDataFrameRxQueue->DeleteFirst(); + iIscDevice->ReleaseMemoryBlock( aPtr ); + } + else + { + C_TRACE( ( _T( "DIscChannel::HandleConcatenatedDataFrame() ThreadWrite %d" ), r ) ); + TRACE_ASSERT_ALWAYS; + CompleteRequest( EIscAsyncDataReceive, KErrWrite ); + } + } + else // buffer too small + { + TRACE_ASSERT( totalLength >= ( desLen + aInfo.writeLength ) ); + TPtr8 tempLenDes( ( TUint8* )&totalLength, sizeof ( TUint16 ), sizeof ( TUint16 ) ); + TInt r = ThreadWrite ( ( TAny* )iNeededDataBufLen, &tempLenDes, 0 ); + TRACE_ASSERT( r == KErrNone ); + if ( r != KErrNone ) + { + C_TRACE( ( _T( "DIscChannel::HandleConcatenatedDataFrame() data start KErrNoMemory ThreadWrite %d" ), r ) ); + } + + CompleteRequest( EIscAsyncDataReceive, KErrNoMemory ); + } + break; + } + case EIscConcatenationData: + case EIscConcatenationDataEnd: + { + // check whether the next frame fits to the remaining buffer + if ( ( desMaxLen - desLen ) >= aInfo.writeLength ) + { + // create a temporary descriptor for writing since we're + // necessary not writing the whole contents of the + // source descriptor, only the part that ISC Multiplexer + // wants + TPtr8 writePtr( ( TUint8* )( aPtr->Ptr() + aInfo.writeStartIndex ), + aInfo.writeLength, + aInfo.writeLength ); + + // start writing the data at offset desLen + TInt r = ThreadWrite( iDataReceiveBufPtr, &writePtr, desLen ); + TRACE_ASSERT( r == KErrNone ); + // remove the pointer from queue and release the memory block + // but only if the ThreadWrite was successfull + if ( r == KErrNone ) + { + iDataFrameRxQueue->DeleteFirst(); + iIscDevice->ReleaseMemoryBlock( aPtr ); + } + else + { + C_TRACE( ( _T( "DIscChannel::HandleConcatenatedDataFrame() data ThreadWrite %d" ), r ) ); + } + + // complete client request if the frame was the last one + if ( aInfo.concatenation == EIscConcatenationDataEnd ) + { + if ( r == KErrNone ) + { + CompleteRequest( EIscAsyncDataReceive, KErrNone ); + } + else + { + CompleteRequest( EIscAsyncDataReceive, KErrWrite ); + } + } + } + else + { + CompleteRequest( EIscAsyncDataReceive, KErrUnderflow ); + } + break; + } + default: + { + ASSERT_RESET_ALWAYS( 0,"IscDriver",EIscNotAllowedCallToDoCancel ); + break; + } + } + } + +// ----------------------------------------------------------------------------- +// DIscChannel::HandleConcatenatedFrame +// Copies several frames to clients buffer if needed before compliting receive request +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscChannel::HandleConcatenatedFrame( TDes8* aPtr, TIscFrameInfo& aInfo ) + { + C_TRACE( ( _T( "DIscChannel::HandleConcatenatedFrame(0x%x, 0x%x) channelPtr 0x%x" ), aPtr, &aInfo, this ) ); + TInt desMaxLen( 0 ); + TInt desLen( 0 ); + TUint16 totalLength( 0 ); + + desMaxLen = Kern::ThreadGetDesMaxLength( iThread, iReceiveBufPtr ); + desLen = Kern::ThreadGetDesLength( iThread, iReceiveBufPtr ); + + if ( aInfo.totalLength > 0 ) + { + totalLength = aInfo.totalLength; + } + else + { + totalLength = desMaxLen; + } + switch ( aInfo.concatenation ) + { + // first frame of a larger data chunk + case EIscConcatenationDataStart: + { + // check whether the whole data amount will fit into the user buffer + if ( desMaxLen >= ( desLen + aInfo.writeLength ) && desMaxLen >= totalLength ) + { + // create a temporary descriptor for writing since we're + // necessary not writing the whole contents of the + // source descriptor, only the part that ISC Multiplexer + // wants + TPtr8 writePtr( ( TUint8* )( aPtr->Ptr() + aInfo.writeStartIndex ), + aInfo.writeLength, + aInfo.writeLength ); + + // start writing the data at offset 0 since this is the first frame + TInt r = ThreadWrite( iReceiveBufPtr, &writePtr, 0 ); + TRACE_ASSERT( r == KErrNone ); + + // remove the pointer from queue and release the memory block + // but only if the ThreadWrite was successfull + // we do not complete the user request until EIscConcatenationDataEnd + if ( r == KErrNone ) + { + iFrameRxQueue->DeleteFirst(); + iIscDevice->ReleaseMemoryBlock( aPtr ); + } + else + { + C_TRACE( ( _T( "DIscChannel::HandleConcatenatedFrame() ThreadWrite %d" ), r ) ); + CompleteRequest( EIscAsyncReceive, KErrWrite ); + } + } + else // buffer too small + { + TRACE_ASSERT( totalLength >= ( desLen + aInfo.writeLength ) ); + TPtr8 tempLenDes( ( TUint8* )&totalLength, sizeof ( TUint16 ), sizeof ( TUint16 ) ); + TInt r = ThreadWrite ( ( TAny* )iNeededBufLen, &tempLenDes, 0 ); + TRACE_ASSERT( r == KErrNone ); + if ( r != KErrNone ) + { + C_TRACE( ( _T( "DIscChannel::HandleConcatenatedFrame() ThreadWrite %d" ), r ) ); + } + + CompleteRequest( EIscAsyncReceive, KErrNoMemory ); + } + break; + } + case EIscConcatenationData: + case EIscConcatenationDataEnd: + { + // check whether the next frame fits to the remaining buffer + if ( ( desMaxLen - desLen ) >= aInfo.writeLength ) + { + // create a temporary descriptor for writing since we're + // necessary not writing the whole contents of the + // source descriptor, only the part that ISC Multiplexer + // wants + TPtr8 writePtr( ( TUint8* )( aPtr->Ptr() + aInfo.writeStartIndex ), + aInfo.writeLength, + aInfo.writeLength ); + + // start writing the data at offset desLen + TInt r = ThreadWrite( iReceiveBufPtr, &writePtr, desLen ); + + if ( r != KErrNone ) + { + C_TRACE( ( _T( "DIscChannel::HandleConcatenatedFrame() ThreadWrite %d" ), r ) ); + } + // remove the pointer from queue and release the memory block + // but only if the ThreadWrite was successfull + if ( r == KErrNone ) + { + iFrameRxQueue->DeleteFirst(); + iIscDevice->ReleaseMemoryBlock( aPtr ); + } + + // complete client request if the frame was the last one + if ( aInfo.concatenation == EIscConcatenationDataEnd ) + { + if ( r == KErrNone ) + { + CompleteRequest( EIscAsyncReceive, KErrNone ); + } + else + { + CompleteRequest( EIscAsyncReceive, KErrWrite ); + } + } + } + else + { + CompleteRequest( EIscAsyncDataReceive, KErrUnderflow ); + } + break; + } + default: + { + ASSERT_RESET_ALWAYS( 0,"IscDriver",EIscUnknownCommand ); + break; + } + } + + } + +// ----------------------------------------------------------------------------- +// DIscChannel::CopyFromUserBuffer +// Copy data from user-thread memory space. +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscChannel::CopyFromUserBuffer( + const TDesC8& aUserBuffer, + TDes8& aKernelBuffer, + const TInt aOffset ) + { + C_TRACE( ( _T( "DIscChannel::CopyFromUserBuffer(0x%x, 0x%x, 0x%x) channelPtr 0x%x" ), &aUserBuffer, &aKernelBuffer, aOffset, this ) ); + return Kern::ThreadDesRead( iThread, ( TAny* )&aUserBuffer, aKernelBuffer, aOffset, KChunkShiftBy0 ); + + } + +// ----------------------------------------------------------------------------- +// DIscChannel::ThreadWrite +// Writes data/frames to clients buffer +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscChannel::ThreadWrite( + TAny* dest, + const TDesC8* src, + const TInt aOffset ) + { + C_TRACE( ( _T( "DIscChannel::ThreadWrite(0x%x, 0x%x, 0x%x)" ), dest, src, aOffset ) ); + C_TRACE( ( _T( "DIscChannel::ThreadWrite writeLen 0x%x" ), src->Length() ) ); + + return Kern::ThreadDesWrite( iThread, dest, *src, aOffset, iThread ); + + } + +// ----------------------------------------------------------------------------- +// DIscChannel::ResetBuffers +// Resets buffers +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscChannel::ResetBuffers() + { + // Delete pending send frames + iIscDevice->CancelSending( iChannelNumber, this ); + + // Empty receive queue + if ( iFrameRxQueue ) + { + while ( !iFrameRxQueue->Empty() ) + { + TDes8* tempPtr = ( TDes8* ) iFrameRxQueue->GetFirst(); + iFrameRxQueue->DeleteFirst(); + iIscDevice->ReleaseMemoryBlock( tempPtr ); + } + } + + // Empty data receive queue + if ( iDataFrameRxQueue ) + { + while ( !iDataFrameRxQueue->Empty() ) + { + TDes8* tempPtr = ( TDes8* ) iDataFrameRxQueue->GetFirst(); + iDataFrameRxQueue->DeleteFirst(); + iIscDevice->ReleaseMemoryBlock( tempPtr ); + } + } + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/src/IscChannelContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/src/IscChannelContainer.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,279 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: An example implementation for ISC Driver Reference +* +*/ + + + +// INCLUDE FILES + +#include +#include +#include "IscChannel.h" +#include "IscChannelContainer.h" +#include "IscTrace.h" + +#ifdef __WINS__ +#include +#endif + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS +const TInt KChannelComplitionDfcPriority( 2 ); + +// MACROS + +// LOCAL CONSTANTS AND MACROS +DIscChannel* IscChannelContainer::iIscChannels[KIscNumberOfUnits][KIscMaxNumberOfChannelSharers]; +TDfc* IscChannelContainer::iDfc = NULL; + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +#ifdef __WINS__ +CRITICAL_SECTION g_IscCriticalSection; +#endif + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// IscChannelContainer::SetChannel +// Set pointer to channel +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt IscChannelContainer::SetChannel( + DIscChannel* aChannel, + const TUint16 aUnit ) + { + C_TRACE( ( _T( "IscChannelContainer::SetChannel(0x%x, 0x%x)" ), aChannel, aUnit ) ); + TInt error( KErrNoMemory ); + + //check values + if ( aUnit < KIscNumberOfUnits ) + { + for ( TInt i( 0 ); i < KIscMaxNumberOfChannelSharers; i++ ) + { + if ( !iIscChannels[aUnit][i] ) + { + iIscChannels[aUnit][i] = aChannel; + error = KErrNone; + break; + } + } + } + else + { + ASSERT_RESET_ALWAYS( 0, "IscDriver",EIscPanicSetChannel ); + } + + C_TRACE( ( _T( "IscChannelContainer::SetChannel - return 0x%x" ), error ) ); + return error; + } + +// ----------------------------------------------------------------------------- +// IscChannelContainer::Channel +// Return pointer to channel +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +DIscChannel* IscChannelContainer::Channel( + const TUint16 aChannel, + const TUint16 aChannelSharingIndex ) + { + TRACE_ASSERT( aChannel < KIscNumberOfUnits ); + TRACE_ASSERT( aChannelSharingIndex < KIscMaxNumberOfChannelSharers ); + return( iIscChannels[ aChannel ][ aChannelSharingIndex ] ); + } + +// ----------------------------------------------------------------------------- +// IscChannelContainer::RemoveChannel +// +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt IscChannelContainer::RemoveChannel + ( + DIscChannel* aChannel + ) + { + + TRACE_ASSERT( aChannel ); + C_TRACE( ( _T( "IscChannelContainer::RemoveChannel(0x%x)" ), aChannel ) ); + TUint16 channelNumber = aChannel->GetChannelNumber(); + + TInt error( KErrNotFound ); + for ( TInt i( KErrNone ); ( i < KIscMaxNumberOfChannelSharers ) && ( KErrNone != error ); i++ ) + { + if ( iIscChannels[channelNumber][i] == aChannel ) + { + iIscChannels[channelNumber][i] = NULL; + error = KErrNone; + } + } + + C_TRACE( ( _T( "IscChannelContainer::RemoveChannel - return %d" ), error ) ); + return error; + + } + +// ----------------------------------------------------------------------------- +// IscChannelContainer::ChannelComplition +// Goes through channels and open ones are emptied +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void IscChannelContainer::ChannelComplition( + TAny* /*a*/ ) + { + C_TRACE( ( _T( "IscChannelContainer::ChannelComplition()" ) ) ); +#ifdef __WINS__ + EnterCriticalSection( &g_IscCriticalSection ); +#endif + + DIscChannel* channelPtr = NULL; + + for ( TUint16 channel( KIscFirstChannel ) ; channel < KIscNumberOfUnits; channel++ ) + { + for ( TUint16 i( 0 ); i < KIscMaxNumberOfChannelSharers; i++ ) + { + channelPtr = iIscChannels[channel][i]; + if ( channelPtr ) + { + channelPtr->EmptyBuffers(); + } + } + } +#ifdef __WINS__ + LeaveCriticalSection( &g_IscCriticalSection ); +#endif + + C_TRACE( ( _T( "IscChannelContainer::ChannelComplition - return 0x%x" ), KErrNone ) ); + + } + +// ----------------------------------------------------------------------------- +// IscChannelContainer::AddDfc +// Adds ChannelComplition Dfc +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void IscChannelContainer::AddDfc() + { + C_TRACE( ( _T( "IscChannelContainer::AddDfc()" ) ) ); + + if ( NKern::CurrentContext() == NKern::EInterrupt ) + { + iDfc->Add(); + } + else + { + iDfc->Enque(); + } + + } + +// ----------------------------------------------------------------------------- +// IscChannelContainer::Initialize +// Allocates Dfc function dynamically and formats data tables. +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void IscChannelContainer::Initialize() + { + C_TRACE( ( _T( "IscChannelContainer::Initialize()" ) ) ); + + if ( !iDfc ) + { + iDfc = new TDfc( IscChannelContainer::ChannelComplition, NULL, Kern::DfcQue0(), + KChannelComplitionDfcPriority ); + ASSERT_RESET_ALWAYS( iDfc, "IscDriver",EIscMemoryAllocationFailure ); + } + + for ( TUint16 channel( 0 ); channel < KIscNumberOfUnits; channel++ ) + { + for ( TUint16 i( 0 ); i < KIscMaxNumberOfChannelSharers; i++ ) + { + iIscChannels[channel][i] = NULL; + } + } + +#ifdef __WINS__ + InitializeCriticalSection( &g_IscCriticalSection ); +#endif + } + +// ----------------------------------------------------------------------------- +// IscChannelContainer::DeActivate +// Deallocates Dfc function +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void IscChannelContainer::DeActivate() + { + if ( iDfc ) + { + delete iDfc; + iDfc = NULL; + } +#ifdef __WINS__ + DeleteCriticalSection( &g_IscCriticalSection ); +#endif + + } + +// ----------------------------------------------------------------------------- +// IscChannelContainer::ValidateChannel +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt IscChannelContainer::ValidateChannel( + DIscChannel* aChannelPtr ) + { + C_TRACE( ( _T( "IscChannelContainer::ValidateChannel(0x%x)" ), aChannelPtr ) ); + TInt error( KErrNotFound ); + if( !aChannelPtr ) + { + C_TRACE( ( _T( "IscChannelContainer::ValidateChannel aChannelPtr was NULL" ) ) ); + error = KErrArgument; + } + else + { + for ( TUint16 channelNumber( 0 ); channelNumber < KIscNumberOfUnits ; channelNumber++ ) + { + for ( TInt i( KErrNone ); i < KIscMaxNumberOfChannelSharers ; i++ ) + { + if ( iIscChannels[channelNumber][i] == aChannelPtr ) + { + error = KErrNone; + break; + } + } + } + } + + C_TRACE( ( _T( "IscChannelContainer::ValidateChannel - return %d" ), error ) ); + return error; + + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/src/IscDevice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/src/IscDevice.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,927 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: An example implementation for ISC Driver Reference +* +*/ + + + +// INCLUDE FILES + +#include +#include +#include +#include + +#include "IscMainRcvBuffer.h" +#include "IscQueue.h" +#include "IscSendQueue.h" +#include "IscDevice.h" +#include "IscChannel.h" +#include "IscChannelContainer.h" +#include "IscTrace.h" + +#ifdef __WINS__ +#include +#endif + + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS +_LIT( KIscDriverName, "IscDriver" ); + +// MACROS + +// LOCAL CONSTANTS AND MACROS +const TInt KSendDfcPriority( 4 ); +const TInt KNotifyDfcPriority( 5 ); +const TInt KIscInterruptLevelTwo( 2 ); + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + + +DIscDataTransmissionBase* DIscDevice::iIscDataTransmissionInterface = NULL; +DIscMultiplexerBase* DIscDevice::iIscMultiplexerInterface = NULL; +DIscSendQueue* DIscDevice::iSendQueue=NULL; +DIscSendQueue* DIscDevice::iTempQueue=NULL; +DIscSendQueue* DIscDevice::iControlSendQueue=NULL; +TDfc* DIscDevice::iSendDfc = NULL; +TDfc* DIscDevice::iNotifyDfc = NULL; +TInt DIscDevice::iConnectionStatus = EIscConnectionNotOk; + +#ifdef __WINS__ +CRITICAL_SECTION g_IscDTBCriticalSection; +#endif + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// DIscDevice::DIscDevice +// C++ default constructor +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C DIscDevice::DIscDevice() + :DLogicalDevice(), + iSend( NULL ), + iTempSend( NULL ), + iControlSend( NULL ), + iSendFrameParameters( NULL ), + iTempFrameParameters( NULL ), + iControlFrameParameters( NULL ), + iIscMainRcvBuffer( NULL ) + { + C_TRACE( ( _T( "DIscDevice::DIscDevice()" ) ) ); + + iVersion = TVersion( KMajorVersionNumber, KMinorVersionNumber, + KBuildVersionNumber ); + iParseMask |= KDeviceAllowUnit; + iParseMask |= KDeviceAllowInfo; + +#ifdef __WINS__ + InitializeCriticalSection( &g_IscDTBCriticalSection ); +#endif + } + +// Destructor +EXPORT_C DIscDevice::~DIscDevice() + { + C_TRACE( ( _T( "DIscDevice::~DIscDevice()" ) ) ); + + IscChannelContainer::DeActivate(); + + if ( iIscMainRcvBuffer ) + { + delete iIscMainRcvBuffer; + iIscMainRcvBuffer = NULL; + } + + + iIscDataTransmissionInterface = NULL; + iIscMultiplexerInterface = NULL; + + delete iTempSend; + delete iControlSend; + delete iSendQueue; + delete iTempQueue; + delete iControlSendQueue; + delete iSendDfc; + delete iNotifyDfc; + +#ifdef __WINS__ + DeleteCriticalSection( &g_IscDTBCriticalSection ); +#endif + + } + + +// ----------------------------------------------------------------------------- +// DIscDevice::Install +// Complete the installation of driver +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscDevice::Install() + { + C_TRACE( ( _T( "DIscDevice::Install()" ) ) ); + + // Dfc for sending frames + iSendDfc = new TDfc( Flush, this, Kern::DfcQue0(), KSendDfcPriority ); + iNotifyDfc = new TDfc( NotifyConnection, this, Kern::DfcQue0(), KNotifyDfcPriority ); + ASSERT_RESET_ALWAYS( iSendDfc, "IscDriver",EIscMemoryAllocationFailure ); + + //Initialize IscChannelContainer + IscChannelContainer::Initialize(); + + // connect to multiplexer and data transmission driver + TInt r = InitializeLdd2LddInterface(); + if ( r != KErrNone ) + { + TRACE_ASSERT_ALWAYS; + return r; + } + + return ( SetName( &KIscDriverName ) ); + } + +// ----------------------------------------------------------------------------- +// DIscDevice::Initialize +// Complete the initialization of driver +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscDevice::Initialize() + { + C_TRACE( ( _T( "DIscDevice::Initialize()" ) ) ); + + TInt i( 0 ); + + // Get buffer configuration data from multiplexer + TIscConfiguration configData; + iIscMultiplexerInterface->GetConfiguration( configData ); + + // Create main buffer + iIscMainRcvBuffer = new DIscMainRcvBuffer( this, configData.mainRcvQueueSize ); + ASSERT_RESET_ALWAYS( iIscMainRcvBuffer, "IscDriver",EIscMemoryAllocationFailure ); + + // Do second phase installation + iIscMainRcvBuffer->DoCreate(); + + // Create queue for sending frames + iSend = new TUint32*[configData.channelSendQueueSize]; + ASSERT_RESET_ALWAYS( iSend, "IscDriver",EIscMemoryAllocationFailure ); + + iSendFrameParameters = new TIscSendFrameInfo*[configData.channelSendQueueSize]; + for ( i = 0; i < configData.channelSendQueueSize; i++ ) + { + iSendFrameParameters[i] = new TIscSendFrameInfo; + } + ASSERT_RESET_ALWAYS( iSendFrameParameters, "IscDriver",EIscMemoryAllocationFailure ); + + iSendQueue = new DIscSendQueue( iSend, iSendFrameParameters, configData.channelSendQueueSize ); + ASSERT_RESET_ALWAYS( iSendQueue, "IscDriver",EIscMemoryAllocationFailure ); + + + // create temporary queue + iTempSend = new TUint32*[configData.channelSendQueueSize]; + ASSERT_RESET_ALWAYS( iTempSend, "IscDriver",EIscMemoryAllocationFailure ); + + iTempFrameParameters = new TIscSendFrameInfo*[configData.channelSendQueueSize]; + for ( i =0; i < configData.channelSendQueueSize; i++ ) + { + iTempFrameParameters[i] = new TIscSendFrameInfo; + } + ASSERT_RESET_ALWAYS( iTempFrameParameters, "IscDriver",EIscMemoryAllocationFailure ); + + iTempQueue = new DIscSendQueue( iTempSend, iTempFrameParameters, configData.channelSendQueueSize ); + ASSERT_RESET_ALWAYS( iTempQueue, "IscDriver",EIscMemoryAllocationFailure ); + + + // Create send queue for control channel + iControlSend = new TUint32*[configData.channelSendQueueSize]; + ASSERT_RESET_ALWAYS( iControlSend, "IscDriver",EIscMemoryAllocationFailure ); + + iControlFrameParameters = new TIscSendFrameInfo*[configData.channelSendQueueSize]; + for ( i = 0; i < configData.channelSendQueueSize; i++ ) + { + iControlFrameParameters[i] = new TIscSendFrameInfo; + } + ASSERT_RESET_ALWAYS( iControlFrameParameters, "IscDriver",EIscMemoryAllocationFailure ); + + iControlSendQueue = new DIscSendQueue( iControlSend, iControlFrameParameters, configData.channelSendQueueSize ); + ASSERT_RESET_ALWAYS( iControlSendQueue, "IscDriver",EIscMemoryAllocationFailure ); + + iIscDataTransmissionInterface->AllocBuffers( configData.bufferConfig ); + + iConnectionStatus = iIscDataTransmissionInterface->ConnectionStatus(); + + iIscMultiplexerInterface->NotifyConnectionStatus( iConnectionStatus ); + C_TRACE( ( _T( "DIscDevice::Initialize - return void" ) ) ); + } +// ----------------------------------------------------------------------------- +// DIscDevice::GetCaps +// +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscDevice::GetCaps( + TDes8& /*aDes*/ ) const + { + // GetCaps implemented to keep compiler happy + } + +// ----------------------------------------------------------------------------- +// DEcsDevice::Create +// From DLogicalDevice +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscDevice::Create( + DLogicalChannelBase*& aChannel ) + { + aChannel=new DIscChannel( this ); + return aChannel?KErrNone:KErrNoMemory; + } + +// ----------------------------------------------------------------------------- +// DIscDevice::Receive +// Frames coming from Domestic OS +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscDevice::Receive( + TDesC8* aData ) const + { + DIscMainRcvBuffer::MsgReceive( aData ); + } + + +// ----------------------------------------------------------------------------- +// DIscDevice::ReserveMemoryBlock +// Get message block from buffers allocated in IscDataTransmissionBase.dll +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscDevice::ReserveMemoryBlock( TDes8*& aPtr, TUint16 aSize ) + { + iIscDataTransmissionInterface->ReserveMemoryBlock( aPtr, aSize ); + } + +// ----------------------------------------------------------------------------- +// DIscDevice::ReleaseMemoryBlock +// Release memory block allocated with ReserveMemoryBlock +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscDevice::ReleaseMemoryBlock( + TDes8* aPtr ) + { + C_TRACE( ( _T( "DIscDevice::ReleaseMemoryBlock(0x%x)" ), aPtr ) ); + + if ( iIscDataTransmissionInterface ) + { + iIscDataTransmissionInterface->ReleaseMemoryBlock( aPtr ); + } + } + +// ----------------------------------------------------------------------------- +// DIscDevice::NotifyConnectionStatus +// Connection status change function +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscDevice::NotifyConnectionStatus( const TInt aStatus ) + { + C_TRACE( ( _T( "DIscDevice::NotifyConnectionStatus(0x%x)" ), aStatus ) ); + if ( iConnectionStatus != aStatus ) + { + iConnectionStatus = aStatus; + if ( NKern::CurrentContext() == NKern::EInterrupt ) + { + iNotifyDfc->Add(); + } + else + { + iNotifyDfc->Enque(); + } + } + + C_TRACE( ( _T( "DIscDevice::NotifyConnectionStatus() return" ) ) ); + } + +// ----------------------------------------------------------------------------- +// DIscDevice::NotifyConnection +// Connection status change DFC function. +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscDevice::NotifyConnection( TAny* ) + { + C_TRACE( ( _T( "DIscDevice::NotifyConnection(0x%x)" ), iConnectionStatus ) ); + + iIscMultiplexerInterface->NotifyConnectionStatus( iConnectionStatus ); + DIscChannel* tempPtr = NULL; + for ( TUint16 i = KIscFirstChannel; i < KIscNumberOfUnits; i++ ) + { + for ( TUint16 ii( 0 ); ii < KIscMaxNumberOfChannelSharers; ii++ ) + { + tempPtr = IscChannelContainer::Channel( i, ii ); + if ( tempPtr ) + { + tempPtr->NotifyConnectionStatus( iConnectionStatus ); + tempPtr = NULL; + } + } + } + C_TRACE( ( _T( "DIscDevice::NotifyConnection() return" ) ) ); + + } + +// ----------------------------------------------------------------------------- +// DIscDevice::ULFlowControl +// Function to notify client about uplink flow control status +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscDevice::ULFlowControl( + const TInt aULFlowStatus, + const TUint16 aChannelId, + const TAny* aChannelPtr ) + { + C_TRACE( ( _T( "DIscDevice::ULFlowControl(0x%x, 0x%x, 0x%x)" ), aULFlowStatus, aChannelId, aChannelPtr ) ); + + DIscChannel* tempPtr = NULL; + TBool channelFound(EFalse); + + if ( !aChannelPtr ) + { + // All channels. + for ( TUint16 i(0); i < KIscMaxNumberOfChannelSharers; i++ ) + { + tempPtr = IscChannelContainer::Channel( aChannelId, i ); + if ( tempPtr ) + { + tempPtr->NotifyFlowControl( aULFlowStatus ); + tempPtr = NULL; + channelFound = ETrue; + } + else + { + //Do nothing + } + } + } + else + { + // Single channel. + for ( TUint16 i(0); i < KIscMaxNumberOfChannelSharers; i++ ) + { + tempPtr = IscChannelContainer::Channel( aChannelId, i ); + if ( tempPtr == ( DIscChannel* )aChannelPtr ) + { + tempPtr->NotifyFlowControl( aULFlowStatus ); + tempPtr = NULL; + channelFound = ETrue; + break; + } + else + { + //Do nothing + } + } + } + + if ( channelFound == EFalse ) + TRACE_ASSERT_ALWAYS; + + } + +// ----------------------------------------------------------------------------- +// DIscDevice::IsPending +// Function to check if asycnhronous request is active +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DIscDevice::IsPending( + const TUint16 aReqNumber, + const TAny* aChannelPtr ) + { + C_TRACE( ( _T( "DIscDevice::IsPending(0x%x, 0x%x)" ), aReqNumber, aChannelPtr ) ); + + DIscChannel* tempPtr = ( DIscChannel* )aChannelPtr; + TInt error = IscChannelContainer::ValidateChannel( tempPtr ); + if( error == KErrNone ) + { + error = tempPtr->IsPending( aReqNumber ); + } + C_TRACE( ( _T( "DIscDevice::IsPending - return %d" ), error ) ); + return error; + + } + +// ----------------------------------------------------------------------------- +// DIscDevice::DLFlowControl +// Notify multiplexer about down link flow control +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscDevice::DLFlowControlNotify( + const TInt aDLFlowStatus, + const TUint16 aChannel, + const TAny* aChannelPtr ) + { + C_TRACE( ( _T( "DIscDevice::DLFlowControlNotify(0x%x, 0x%x)" ), aDLFlowStatus, aChannel ) ); + if ( aChannel >= KIscFirstChannel + && aChannel < KIscNumberOfUnits ) + { + if ( aDLFlowStatus == EIscFlowControlOn ) + { + iIscMultiplexerInterface->DLFlowControl( EIscFlowControlOn, aChannel, aChannelPtr ); + } + else + { + iIscMultiplexerInterface->DLFlowControl( EIscFlowControlOff, aChannel, aChannelPtr ); + } + } + else + { + + if ( aChannel == 0x00 ) + { + // control channel, no flow control used + } + else + { + // should never came here + TRACE_ASSERT_ALWAYS; + } + } + } + +// ----------------------------------------------------------------------------- +// DIscDevice::InitializeLdd2LddInterface +// Function to connect to DataTransmission and Multiplexer ldds +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscDevice::InitializeLdd2LddInterface() + { + C_TRACE( ( _T( "DIscDevice::InitializeLdd2LddInterface()" ) ) ); + + // Find pointer to second level LDD. + DObjectCon* lDevices = Kern::Containers()[ ELogicalDevice ]; + TKName driverName; + ASSERT_RESET_ALWAYS( lDevices, "IscDriver", EIscLogicalDevicesNotFound ); + + TInt err( KErrNone ); + //TInt driverHandle( KErrNone ); // API change in SOS9.2 WK08 + TFindHandle driverHandle; + // Find pointer to ISC Multiplexer. + err = lDevices->FindByName( driverHandle, KIscMultiplexerName, driverName ); + if( KErrNone != err ) + { + C_TRACE( ( _T( "DIscDevice::InitializeLdd2LddInterface() ISC Multiplexer Not Found!" ) ) ); + ASSERT_RESET_ALWAYS( 0, "IscDriver" ,EIscMultiplexerNotFound ); + } + + iIscMultiplexerInterface = static_cast( lDevices->At( driverHandle ) ); + ASSERT_RESET_ALWAYS( iIscMultiplexerInterface, "IscDriver", EIscMultiplexerNotFound ); + + //TInt secondDriverHandle( KErrNone ); // API change in SOS9.2 WK08 + TFindHandle secondDriverHandle; + // Find pointer to Data Transmission Plugin. + err = lDevices->FindByName( secondDriverHandle, KIscDataTransmissionDriverName, driverName ); + if( KErrNone != err ) + { + C_TRACE( ( _T( "DIscDevice::InitializeLdd2LddInterface() Data Transmission Plug-In Not Found!" ) ) ); + ASSERT_RESET_ALWAYS( 0, "IscDriver", EIscDataTransmissionDriverNotFound ); + } + + iIscDataTransmissionInterface = static_cast( lDevices->At( secondDriverHandle ) ); + ASSERT_RESET_ALWAYS( iIscDataTransmissionInterface, "IscDriver", EIscDataTransmissionDriverNotFound ); + + iIscDataTransmissionInterface->Connect( this ); + iIscMultiplexerInterface->Connect( this ); + + C_TRACE( ( _T( "DIscDevice::InitializeLdd2LddInterface - return 0x%x" ), err ) ); + return err; + + } + +// ----------------------------------------------------------------------------- +// DIscDevice::QueueFrame +// Queue frames that will be sent to Domestic OS +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DIscDevice::QueueFrame( + const TUint16 aChannelId, + const TDesC8* aFrame, + const TAny* aChannelPtr, + TAny* aFrameInfo ) + { + C_TRACE( ( _T( "DIscDevice::QueueFrame(0x%x, 0x%x, 0x%x, 0x%x)" ), aChannelId, aFrame, aChannelPtr, aFrameInfo ) ); + + TInt error = KErrNone; + + // control channel frame ( highest priority ) + if ( aChannelId == KIscControlChannel ) + { + C_TRACE( ( _T( "DIscDevice::QueueFrame control frame queue" ) ) ); + //add to control frame queue + error = iControlSendQueue->Add( ( TDes8* )aFrame, aChannelId, ( DIscChannel* )aChannelPtr, aFrameInfo ); + } + else + { + C_TRACE( ( _T( "DIscDevice::QueueFrame send queue" ) ) ); + // add to send queue + error = iSendQueue->Add( ( TDes8* )aFrame, aChannelId, ( DIscChannel* )aChannelPtr, aFrameInfo ); + } + + C_TRACE( ( _T( "DIscDevice::QueueFrame - return 0x%x" ), error ) ); + return error; + } + + +// ----------------------------------------------------------------------------- +// DIscDevice::CancelSending +// Cancels sending of frames to Domestic OS +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DIscDevice::CancelSending( const TUint16 aChannelId, const TAny* aChannelPtr ) + { + C_TRACE( ( _T( "DIscDevice::CancelSending - Caller is channel: %d (0x%x)" ), aChannelId, aChannelPtr ) ); + + TInt error( KErrNotFound ); + TInt irqLevel( 0 ); + + TInt counterA( 0 ); + TInt counterB( 0 ); + + TIscSendFrameInfo* temp = NULL; + TDes8* frame = NULL; + + irqLevel = DisableIrqs(); + + if ( KIscControlChannel == aChannelId ) + { + // empty control send queue + while ( !iControlSendQueue->Empty() ) + { + temp = iControlSendQueue->GetFirstFrameInfo(); + frame = ( TDes8* )iControlSendQueue->RemoveFirst(); + if ( temp && frame ) + { + if ( temp->iChannelId == aChannelId && + temp->iChannelPtr == ( DIscChannel* )aChannelPtr ) + { + // sender found, no need to store the frame + counterB++; + } + else + { + iTempQueue->Add( frame, temp->iChannelId, temp->iChannelPtr, temp->iFrameInfo ); + } + } + else + { + // should never came here + TRACE_ASSERT_ALWAYS; + } + counterA++; + temp = NULL; + frame = NULL; + } + + while ( !iTempQueue->Empty() ) + { + temp = iTempQueue->GetFirstFrameInfo(); + frame = ( TDes8* )iTempQueue->RemoveFirst(); + if ( temp && frame ) + { + iControlSendQueue->Add( frame, temp->iChannelId, temp->iChannelPtr, temp->iFrameInfo ); + } + else + { + // should never came here + TRACE_ASSERT_ALWAYS; + } + temp = NULL; + frame = NULL; + } + } + else + { + // empty normal send queue + while ( !iSendQueue->Empty() ) + { + temp = iSendQueue->GetFirstFrameInfo(); + frame = ( TDes8* )iSendQueue->RemoveFirst(); + if ( temp && frame ) + { + if ( temp->iChannelId == aChannelId && + temp->iChannelPtr == ( DIscChannel* )aChannelPtr ) + { + // sender found, no need to store frame + counterB++; + } + else + { + iTempQueue->Add( frame, temp->iChannelId, temp->iChannelPtr, temp->iFrameInfo ); + } + } + else + { + // should never came here + TRACE_ASSERT_ALWAYS; + } + counterA++; + temp = NULL; + frame = NULL; + } + + while ( !iTempQueue->Empty() ) + { + temp = iTempQueue->GetFirstFrameInfo(); + frame = ( TDes8* )iTempQueue->RemoveFirst(); + if ( temp && frame ) + { + iSendQueue->Add( frame, temp->iChannelId, temp->iChannelPtr, temp->iFrameInfo ); + } + else + { + // should never came here + TRACE_ASSERT_ALWAYS; + } + + temp = NULL; + frame = NULL; + } + } + + RestoreIrqs( irqLevel ); + + C_TRACE( ( _T( "DIscDevice::CancelSending() - Frames in queue: Before: %d, After: %d" ), counterA, ( counterA-counterB ) ) ); + C_TRACE( ( _T( "DIscDevice::CancelSending() - So channel 0x%x 0x%x had %d pending messages!" ), aChannelId, aChannelPtr, counterB ) ); + + // if there weren't any frames that were cancelled return KErrNotFound, otherwise return KErrNone + if ( counterB > 0 ) + { + error = KErrNone; + } + + return error; + + } + +// ----------------------------------------------------------------------------- +// DIscDevice::FlushQueues +// Adds Dfc to empty queues +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscDevice::FlushQueues() + { + C_TRACE( ( _T( "DIscDevice::FlushQueues()" ) ) ); + + if ( NKern::CurrentContext() == NKern::EInterrupt ) + { + iSendDfc->Add(); + } + else + { + iSendDfc->Enque(); + } + + } + +// ----------------------------------------------------------------------------- +// DIscDevice::CompleteRequest +// Function to complete user side asynchronous request +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +// This method has been modified to allow channel sharing between application. +// The completion routine uses directly a pointer on a DLogicalChannel instead of a channel index +// +EXPORT_C void DIscDevice::CompleteRequest( + TUint16 aOperation, + TInt aCompleteStatus, + const TAny* aChannelPtr ) + { + C_TRACE( ( _T( "DIscDevice::CompleteRequest(0x%x, 0x%x, 0x%x)" ), aOperation, aCompleteStatus, aChannelPtr ) ); + + DIscChannel* tempPtr = ( DIscChannel* )aChannelPtr; + TInt error = IscChannelContainer::ValidateChannel( tempPtr ); + if( error == KErrNone ) + { + tempPtr->CompleteRequest( aOperation, aCompleteStatus ); + } + + C_TRACE( ( _T( "DIscDevice::CompleteRequest - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// DIscDevice::CopyFromUserBuffer +// +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DIscDevice::CopyFromUserBuffer( + const TDesC8& aUserBuffer, + TDes8& aKernelBuffer, + const TAny* aChannelPtr, + const TInt aOffset ) + { + C_TRACE( ( _T( "DIscDevice::CopyFromUserBuffer(0x%x, 0x%x, 0x%x, 0x%x)" ), &aUserBuffer, &aKernelBuffer, aChannelPtr, aOffset ) ); + + // Check if channel pointer is valid. + DIscChannel* tempPtr = ( DIscChannel* )aChannelPtr; + TInt error = IscChannelContainer::ValidateChannel( tempPtr ); + if( error == KErrNone ) + { + error = tempPtr->CopyFromUserBuffer( aUserBuffer, aKernelBuffer, aOffset ); + } + C_TRACE( ( _T( "DIscDevice::CopyFromUserBuffer - return %d" ), error ) ); + return error; + + } + +// ----------------------------------------------------------------------------- +// DIscDevice::CopyToUserBuffer +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DIscDevice::CopyToUserBuffer( + TAny* aUserBuffer, + const TDesC8& aKernelBuffer, + const TAny* aChannelPtr, + const TInt aOffset ) + { + C_TRACE( ( _T( "DIscDevice::CopyToUserBuffer(0x%x, 0x%x, 0x%x)" ), aUserBuffer, &aKernelBuffer, aChannelPtr ) ); + + DIscChannel* tempPtr = ( DIscChannel* )aChannelPtr; + TInt error = IscChannelContainer::ValidateChannel( tempPtr ); + if( KErrNone == error ) + { + error = tempPtr->ThreadWrite( aUserBuffer, &aKernelBuffer, aOffset ); + } + C_TRACE( ( _T( "DIscDevice::CopyToUserBuffer - return %d" ), error ) ); + return error; + + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::GetThreadPtr +// Returns user side thread. Ownership is not given. +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C DThread* DIscDevice::GetThreadPtr( const TAny* aChannelPtr ) + { + C_TRACE( ( _T( "DIscMultiplexerBase::GetThreadPtr(0x%x)" ), aChannelPtr ) ); + DIscChannel* tempPtr = ( DIscChannel* )aChannelPtr; + TInt error = IscChannelContainer::ValidateChannel( tempPtr ); + DThread* tmp = NULL; + if( KErrNone == error ) + { + tmp = tempPtr->GetDThread(); + } + else + { + C_TRACE( ( _T( "DIscMultiplexerBase::GetThreadPtr failed return NULL" ) ) ); + } + C_TRACE( ( _T( "DIscMultiplexerBase::GetThreadPtr return 0x%x" ), tmp ) ); + return tmp; + + } + +// ----------------------------------------------------------------------------- +// DIscDevice::Flush +// Dfc to empty control channel and other send queues +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscDevice::Flush( TAny* aPtr ) + { + C_TRACE( ( _T( "DIscDevice::Flush(0x%x)" ), aPtr ) ); + DIscDevice* device = ( DIscDevice* )aPtr; + + TDes8* frame = NULL; + TIscSendFrameInfo* temp = NULL; + + TInt irqLevel(0); + + // If transmission is asynchronous and there can't be + // several requests at the same time + if ( !iIscDataTransmissionInterface->IsWritePending() ) + { + irqLevel = DisableIrqs(); + if ( !iControlSendQueue->Empty() ) + { + temp = iControlSendQueue->GetFirstFrameInfo(); + frame = ( TDes8* )iControlSendQueue->RemoveFirst(); + } + else + { + temp = iSendQueue->GetFirstFrameInfo(); + frame = ( TDes8* )iSendQueue->RemoveFirst(); + } + RestoreIrqs( irqLevel ); + C_TRACE( ( _T( "DIscDevice::Flush after RESTOREIRQS" ) ) ); + if ( frame ) + iIscDataTransmissionInterface->SendFrame( *frame, device->iSendDfc, temp->iFrameInfo ); + } + C_TRACE( ( _T( "DIscDevice::Flush - return 0x0" ) ) ); + + } + + +// ----------------------------------------------------------------------------- +// DIscDevice::ConnectionStatus +// Function to tell current status of connection to Domestic OS +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscDevice::ConnectionStatus() + { + return iConnectionStatus; + } + +// ----------------------------------------------------------------------------- +// DIscDevice::DisableIrqs +// Function to disable interrupts +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscDevice::DisableIrqs() + { +#ifndef __WINS__ + return NKern::DisableInterrupts( KIscInterruptLevelTwo ); +#else //__WINS__ + EnterCriticalSection( &g_IscDTBCriticalSection ); + return KErrNone; +#endif//__WINS__ + } + +// ----------------------------------------------------------------------------- +// DIscDevice::RestoreIrqs +// Function to restore interrupts +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +#ifndef __WINS__ +void DIscDevice::RestoreIrqs( + TInt aLevel ) + { + NKern::RestoreInterrupts( aLevel ); + +#else //__WINS__ +void DIscDevice::RestoreIrqs( + TInt ) + { + LeaveCriticalSection( &g_IscDTBCriticalSection ); +#endif//__WINS__ + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// E32Dll +// Epoc Kernel Architecture 2 style entry point +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +DECLARE_STANDARD_LDD() + { + DLogicalDevice* device = new DIscDevice; + if ( !device ) + { + ASSERT_RESET_ALWAYS( 0,"IscDriver",EIscPanicCreateLogicalDevice ); + } + return device; + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/src/IscDriverExtensionDevice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/src/IscDriverExtensionDevice.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Reference implementation for ISC Driver extension +* +*/ + + + +// INCLUDE FILES + +#include "IscDriverExtensionDevice.h" +#include "IscChannel.h" +#include "IscTrace.h" +#include "kern_priv.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS +_LIT( KIscDriverExtensionName,"IscDriverExtension" ); +_LIT( KIscDriverName,"IscDriver" ); + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// DIscDriverExtensionDevice::DIscDriverExtensionDevice +// C++ default constructor +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +DIscDriverExtensionDevice::DIscDriverExtensionDevice() + : iIscDriverDevice( NULL ) + { + C_TRACE( ( _T( "DIscDriverExtensionDevice::DIscDriverExtensionDevice()" ) ) ); + iParseMask |= KDeviceAllowUnit; + iParseMask |= KDeviceAllowInfo; + } + +// Destructor +DIscDriverExtensionDevice::~DIscDriverExtensionDevice() + { + + } + + +// ----------------------------------------------------------------------------- +// DIscDriverExtensionDevice::Install +// Complete the installation of driver +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscDriverExtensionDevice::Install() + { + C_TRACE( ( _T( "DIscDriverExtensionDevice::Install()" ) ) ); + + // Find pointer to ISC Driver. + TInt err( KErrNone ); + DObjectCon* lDevices = Kern::Containers()[ELogicalDevice]; + TKName driverName; + + ASSERT_RESET_ALWAYS( lDevices, "IscDriverExtension", EIscLogicalDevicesNotFound ); + + //TInt driverHandle( KErrNone ); // API change in SOS9.2 WK08 + TFindHandle driverHandle; + err = lDevices->FindByName( driverHandle, KIscDriverName, driverName ); + if( KErrNone != err ) + { + C_TRACE( ( _T( "DIscDriverExtensionDevice::Install() Pointer to IscDriver not found!" ) ) ); + ASSERT_RESET_ALWAYS( 0, "IscDriverExtension", EIscDriverNotFound ); + } + iIscDriverDevice = static_cast( lDevices->At( driverHandle ) ); + ASSERT_RESET_ALWAYS( iIscDriverDevice, "IscDriverExtension", EIscDriverNotFound ) + return ( SetName( &KIscDriverExtensionName ) ); + + } + +// ----------------------------------------------------------------------------- +// DIscDevice::Create +// Create a logical channel +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscDriverExtensionDevice::Create( + DLogicalChannelBase*& aChannel ) + { + aChannel=new DIscChannel( iIscDriverDevice ); + return aChannel?KErrNone:KErrNoMemory; + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= +// ----------------------------------------------------------------------------- +// E32Dll +// Epoc Kernel Architecture 2 style entry point +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +DECLARE_STANDARD_LDD() + { + DLogicalDevice* device = new DIscDriverExtensionDevice; + ASSERT_RESET_ALWAYS( device,"IscDriverExtension",EIscPanicCreateLogicalDevice ); + return device; + + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/src/IscMainRcvBuffer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/src/IscMainRcvBuffer.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,230 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: An example implementation for ISC Driver Reference +* +*/ + + + +// INCLUDE FILES +#include +#include +#include "IscMainRcvBuffer.h" +#include "IscQueue.h" +#include "IscDevice.h" +#include "IscChannel.h" +#include "IscChannelContainer.h" +#include "IscTrace.h" + + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS +DIscMainRcvBuffer* DIscMainRcvBuffer::iThisPointer = NULL; +const TInt KBufferCleanUpDfcPriority( 4 ); + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// DIscMainRcvBuffer::DIscMainRcvBuffer +// C++ default constructor +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +DIscMainRcvBuffer::DIscMainRcvBuffer( DIscDevice *aDevice, TUint16 aIscMainRcvBufferQueueSize ) + :iDevice ( aDevice ), + iDfc( NULL ), + iMainRcvBufferQueue( NULL ) + { + iIscMainRcvBufferQueueSize = aIscMainRcvBufferQueueSize; + iMainRcvBuffer = new TUint32*[iIscMainRcvBufferQueueSize]; + ASSERT_RESET_ALWAYS( iMainRcvBuffer, "IscDriver",EIscMemoryAllocationFailure ); + + for ( TInt i = 0; i < iIscMainRcvBufferQueueSize; i++ ) + { + iMainRcvBuffer[i] = NULL; + } + } + + +// ----------------------------------------------------------------------------- +// DIscMainRcvBuffer::DoCreate +// Second-phase constructor to complete construction. +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscMainRcvBuffer::DoCreate() + { + if ( iThisPointer ) //Only one instance of this class is allowed + { + ASSERT_RESET_ALWAYS( 0,"IscDriver",EIscMainRcvBufferInitialize ); + } + + iDfc = new TDfc( BufferCleanUp, this, Kern::DfcQue0(), KBufferCleanUpDfcPriority ); + ASSERT_RESET_ALWAYS( iDfc, "IscDriver",EIscMemoryAllocationFailure ); + + iMainRcvBufferQueue = new DIscQueue( iMainRcvBuffer, iIscMainRcvBufferQueueSize ); + ASSERT_RESET_ALWAYS( iMainRcvBufferQueue, "IscDriver",EIscMemoryAllocationFailure ); + + //Store pointer of this instance that can be used from static functions + iThisPointer = this; + } + +//Destructor +DIscMainRcvBuffer::~DIscMainRcvBuffer() + { + delete iDfc; + delete iMainRcvBufferQueue; + iDfc = NULL; + iMainRcvBufferQueue = NULL; + iThisPointer = NULL; + iDevice = NULL; + } + +// ----------------------------------------------------------------------------- +// DIscMainRcvBuffer::MsgReceive +// Function that should be called to store incoming frame +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscMainRcvBuffer::MsgReceive( TDesC8* aData ) + { + E_TRACE( ( _T( "IMRB:MR(0x%x)" ), aData ) ); + //Check that instance of this class is created + if ( !iThisPointer ) + { + // MainRcvBuffer not initialized -> panic + ASSERT_RESET_ALWAYS( 0,"IscDriver",EIscMainRcvBufferInitialize ); + } + + TInt r = iThisPointer->iMainRcvBufferQueue->Add( aData ); + ASSERT_RESET_ALWAYS( r == KErrNone, "IscDriver",EIscMainRcvBufferOverflow ); + iThisPointer->AddDfc(); + } + +// ----------------------------------------------------------------------------- +// DIscMainRcvBuffer::AddDfc +// Function for adding Dfc +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscMainRcvBuffer::AddDfc() + { +#ifndef __WINS__ + if ( NKern::CurrentContext() == NKern::EInterrupt ) + { + iDfc->Add(); + } + else + { + iDfc->Enque(); + } +#else + // Have to do DoEnque since Enque() & Add() cannot be called from pure + // win32 thread context. And this call might come directly in win32 thread + // since the implementation of ISC Data Transmission API can do virtually + // anything in WINS + iDfc->DoEnque(); +#endif + } + +// ----------------------------------------------------------------------------- +// DIscMainRcvBuffer::BufferCleanUp +// Function to empty messages in main buffer +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +void DIscMainRcvBuffer::BufferCleanUp( TAny* aPtr ) + { + C_TRACE( ( _T( "DIscMainRcvBuffer::BufferCleanUp(0x%x)" ), aPtr ) ); + + DIscMainRcvBuffer* Buffer = ( DIscMainRcvBuffer* )aPtr; + + + TUint16 rcvChannelId( KIscFrameReceiverNotFound ); + TAny* channelPtr = NULL; + DIscChannel* tempPtr = NULL; + TBool channelFound( EFalse ); + + TDesC8* ptr = NULL; + ptr = ( TDesC8* )Buffer->iMainRcvBufferQueue->RemoveFirst(); + + while ( ptr ) + { + Buffer->iDevice->iIscMultiplexerInterface->GetRcvChannelId( *ptr, rcvChannelId, channelPtr ); + + C_TRACE( ( _T( "DIscMainRcvBuffer::BufferCleanUp channelId (0x%x) channelPtr (0x%x)" ), rcvChannelId, channelPtr ) ); + if ( rcvChannelId >= KIscFirstChannel && rcvChannelId < KIscNumberOfUnits && channelPtr ) + { + channelFound = EFalse; + for ( TUint16 i( 0 ); ( i < KIscMaxNumberOfChannelSharers ) && ( !channelFound ); i++ ) + { + tempPtr = IscChannelContainer::Channel( rcvChannelId, i ); + if ( tempPtr == channelPtr ) + { + // correct channel found + ( ( DIscChannel* )channelPtr )->StoreFrame( ptr ); + channelFound = ETrue; + } + tempPtr = NULL; + } + if ( !channelFound ) + { + TRACE_ASSERT_ALWAYS; + // correct channel was not found -> release frame + Buffer->iDevice->ReleaseMemoryBlock( ( TDes8* ) ptr ); + } + } + else if ( rcvChannelId == KIscFrameReceiverNotFound ) + { + C_TRACE( ( _T( "DIscMainRcvBuffer::BufferCleanUp Frame Receiver not found!" ) ) ); + Buffer->iDevice->ReleaseMemoryBlock( ( TDes8* ) ptr ); + } + // Frame going to control channel + else if ( rcvChannelId == 0x00 ) + { + Buffer->iDevice->iIscMultiplexerInterface->HandleControlFrame( *ptr ); + } + else + { + TRACE_ASSERT_ALWAYS; + Buffer->iDevice->ReleaseMemoryBlock( ( TDes8* ) ptr ); + } + + // get the next frame from the queue + ptr = ( TDes8* )Buffer->iMainRcvBufferQueue->RemoveFirst(); + } + + IscChannelContainer::ChannelComplition( NULL ); + + C_TRACE( ( _T( "DIscMainRcvBuffer::BufferCleanUp - return 0x%x" ) ) ); + + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/src/IscQueue.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/src/IscQueue.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,295 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: An example implementation for ISC Driver Reference +* +*/ + + + +// INCLUDE FILES + +#include +#ifdef __WINS__ +#include +#endif + +#include +#include "IscQueue.h" +#include "IscTrace.h" + + +// EXTERNAL DATA STRUCTURES +#ifdef __WINS__ +extern CRITICAL_SECTION g_IscCriticalSection; +#endif + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS +const TInt KIscInterruptLevelTwo( 2 ); + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// DIscQueue::DIscQueue +// C++ default constructor +// ----------------------------------------------------------------------------- +// +DIscQueue::DIscQueue() + :iHead( 0 ),iTail( 0 ),iCount( 0 ),iSize( 0 ),iQueue( NULL ) + { + } + +// ----------------------------------------------------------------------------- +// DIscQueue::DIscQueue +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C DIscQueue::DIscQueue( TUint32** aQueue, TUint16 Size ) + :iHead( 0 ),iTail( 0 ),iCount( 0 ),iSize( Size ),iQueue( aQueue ) + { + E_TRACE( ( _T( "IQ:IQ %d 0x%x" ), iSize, iQueue ) ); + } + +// Destructor +EXPORT_C DIscQueue::~DIscQueue() + { + iHead = 0; + iTail = 0; + iCount = 0; + iQueue = NULL; + iSize = 0; + } + + +// ----------------------------------------------------------------------------- +// DIscQueue::Add +// Function to add element to queue +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DIscQueue::Add( TAny* anEntry ) + { + E_TRACE( ( _T( "IQ:A %d 0x%x" ), iCount, iQueue ) ); + + TInt irqLevel = DisableIrqs(); + + if ( iCount == iSize || iSize == 0 ) + { + RestoreIrqs( irqLevel ); + return KErrNoMemory;//EFalse; + } + + /* place the buffer into the queue */ + iQueue[ iTail ] = ( TUint32* )( anEntry ); + + if ( iSize > 0 ) + { + /* adjust tail pointer */ + iTail = ++iTail % iSize; + + /* remember the amount of the requests in the queue */ + iCount++; + } + else + { + ASSERT_RESET_ALWAYS( 0, "IscDriver", EIscBufferAllocationFailure ) + } + + RestoreIrqs( irqLevel ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// DIscQueue::Remove +// Removes first element from the queue +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TAny* DIscQueue::RemoveFirst() + { + E_TRACE( ( _T( "IQ:R %d %d" ), iCount, iSize ) ); + + TAny* result = NULL; + TInt irqLevel = DisableIrqs(); + + if ( iCount == 0 || iSize == 0 ) + { + RestoreIrqs( irqLevel ); + return NULL; + } + // Get an element from the queue. + result = ( TAny* )iQueue[ iHead ]; + + iQueue[ iHead ] = NULL; + + // Adjust the head of the queue. + iHead = ++iHead % iSize; + // Decrease counter. + iCount--; + + RestoreIrqs( irqLevel ); + + return result; + + } + +// ----------------------------------------------------------------------------- +// DIscQueue::GetFirst +// Fetches first element from the queue +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TAny* DIscQueue::GetFirst() + { + E_TRACE( ( _T( "IQ:G %d %d" ), iCount, iSize ) ); + + TAny* result; + TInt irqLevel = DisableIrqs(); + + if ( iCount == 0 || iSize == 0 ) + { + RestoreIrqs( irqLevel ); + return NULL; + } + // Get an element from the queue. + result = ( TAny* )iQueue[ iHead ]; + + RestoreIrqs( irqLevel ); + + return result; + + } + +// ----------------------------------------------------------------------------- +// DIscQueue::DeleteFirst +// Deletes first element from the queue +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscQueue::DeleteFirst() + { + E_TRACE( ( _T( "IQ:D %d %d" ), iCount, iSize ) ); + + TInt irqLevel = DisableIrqs(); + + iQueue[ iHead ] = NULL; + + if ( iSize > 0 ) + { + // Adjust the head of the queue. + iHead = ++iHead % iSize; + // decrease counter. + iCount--; + } + else + { + ASSERT_RESET_ALWAYS( 0, "IscDriver", EIscBufferAllocationFailure ) + } + + RestoreIrqs( irqLevel ); + + } + +// ----------------------------------------------------------------------------- +// DIscQueue::Empty +// Checks if queue is empty +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool DIscQueue::Empty() + { + TInt result; + TInt irqLevel = DisableIrqs(); + result = iCount == 0 ? ETrue : EFalse; + RestoreIrqs( irqLevel ); + + return result; + } + +// ----------------------------------------------------------------------------- +// DIscQueue::NextBufferLenth +// Gets length of next frame in queue +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint16 DIscQueue::NextBufferLength() + { + TUint16 length; + + TInt irqLevel = DisableIrqs(); + + if ( iCount == 0 ) + { + RestoreIrqs( irqLevel ); + return 0; + } + + length = ( TUint16 )( ( ( TDes8* )iQueue[ iHead ] )->Length() ); + + + RestoreIrqs( irqLevel ); + + return length; + } + +// ----------------------------------------------------------------------------- +// DIscQueue::DisableIrqs +// Function to disable interrupts +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +TInt DIscQueue::DisableIrqs() + { +#ifndef __WINS__ + return NKern::DisableInterrupts( KIscInterruptLevelTwo ); +#else //__WINS__ + EnterCriticalSection( &g_IscCriticalSection ); + return KErrNone; +#endif//__WINS__ + } + +// ----------------------------------------------------------------------------- +// DIscQueue::RestoreIrqs +// Function to restore interrupts +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +#ifndef __WINS__ +void DIscQueue::RestoreIrqs( + TInt aLevel ) + { + NKern::RestoreInterrupts( aLevel ); +#else //__WINS__ +void DIscQueue::RestoreIrqs( + TInt ) +{ + LeaveCriticalSection( &g_IscCriticalSection ); +#endif//__WINS__ + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscDriver/src/IscSendQueue.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscDriver/src/IscSendQueue.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: An example implementation for ISC Driver Reference +* +*/ + + + +// INCLUDE FILES +#include +#include "IscSendQueue.h" +#include "IscTrace.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS +const TInt KImpossibleChannelId( 255 ); + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// DIscSendQueue::DIscSendQueue +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C DIscSendQueue::DIscSendQueue( TUint32** aQueue, TIscSendFrameInfo** aParameterQueue, TUint16 aSize ) + :iParameterQueue( aParameterQueue ) + { + iHead = 0; + iTail = 0; + iCount = 0; + iQueue = aQueue; + iSize = aSize; + for ( TInt i( 0 ); i < aSize; i++ ) + { + iParameterQueue[i]->iChannelId = KImpossibleChannelId; + iParameterQueue[i]->iChannelPtr = NULL; + iParameterQueue[i]->iFrameInfo = NULL; + } + E_TRACE( ( _T( "ISQ:ISQ %d 0x%x" ), iSize, iQueue ) ); + } + +// Destructor +EXPORT_C DIscSendQueue::~DIscSendQueue() + { + iHead = 0; + iTail = 0; + iCount = 0; + iQueue = NULL; + iParameterQueue = NULL; + iSize = 0; + } + + +// ----------------------------------------------------------------------------- +// DIscSendQueue::Add +// Function to add element to queue +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DIscSendQueue::Add( TAny* anEntry, TUint16 aId, DIscChannel* aChannelPtr, TAny* aFrameInfo ) + { + E_TRACE( ( _T( "ISQ:A %d, 0x%x" ), iCount, iQueue ) ); + + TInt irqLevel = DisableIrqs(); + + if ( iCount == iSize || iSize == 0 ) + { + RestoreIrqs( irqLevel ); + return KErrNoMemory;//EFalse; + } + + /* place the buffer into the queue */ + iQueue[ iTail ] = ( TUint32* )( anEntry ); + + TIscSendFrameInfo* tmp = iParameterQueue[ iTail ]; + // Set additional info for send frame + tmp->iChannelId = aId; + + tmp->iChannelPtr = aChannelPtr; + + tmp->iFrameInfo = aFrameInfo; + + /* adjust tail pointer */ + iTail = ++iTail % iSize; + + /* remember the amount of the requests in the queue */ + iCount++; + + RestoreIrqs( irqLevel ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// DIscSendQueue::GetFirstFrameInfo +// Returns a frist frame info from list. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TIscSendFrameInfo* DIscSendQueue::GetFirstFrameInfo() + { + E_TRACE( ( _T( "ISQ:G(%d, 0x%x)" ), iCount, iQueue ) ); + + TIscSendFrameInfo* result; + + TInt irqLevel = DisableIrqs(); + + if ( iCount == 0 || iSize == 0 ) + { + RestoreIrqs( irqLevel ); + return NULL; + } + + result = iParameterQueue[ iHead ]; + + RestoreIrqs( irqLevel ); + + return result; + } + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscMultiplexerBase/inc/IscMultiplexerBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscMultiplexerBase/inc/IscMultiplexerBase.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,446 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef ISCMULTIPLEXERBASE_H +#define ISCMULTIPLEXERBASE_H + +// INCLUDES +#include +#include + +// CONSTANTS +_LIT( KIscMultiplexerName,"IscMultiplexer" ); + +const TUint16 KIscBufferAmount = 10; +// MACROS + +// DATA TYPES + +typedef struct +{ + TIscFrameType frameType; + TIscFrameConcatenation concatenation; + TUint16 totalLength; + TUint16 writeStartIndex; + TUint16 writeLength; +} TIscFrameInfo; + +typedef struct +{ + TUint16 size; + TUint16 count; +} TIscBufferEntry; + +typedef struct +{ + TUint16 mainRcvQueueSize; + TUint16 channelRcvQueueSize; + TUint16 channelDataRcvQueueSize; + TUint16 channelSendQueueSize; + TIscBufferEntry bufferConfig[KIscBufferAmount]; +} TIscConfiguration; + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class DIscDevice; + +// CLASS DECLARATION + +/** +* DIscMultiplexerBase defines the ISC Multiplexer Plug-In API. +* This class defines the base class for Multiplexer( s ) used in +* conjunction with ISC Driver +* +* @lib IscMultiplexerBase.LIB +* @since 2.8 +*/ +class DIscMultiplexerBase : public DLogicalDevice + { + public: // Constructors and destructor + + /** + * C++ default constructor. + */ + IMPORT_C DIscMultiplexerBase(); + + /** + * Destructor + */ + IMPORT_C virtual ~DIscMultiplexerBase(); + + public: // Functions from base class + + /** + * Implementation of pure-virtual Install from DLogicalDevice. This + * function calls Install2ndPhase. + * @since 2.8 + * @return TInt KErrNone + */ + IMPORT_C TInt Install(); + + public: // New functions + /** + * Second phase initialization, called during ISC Multiplexer loading + * ISC Multiplexer must do all initialization here that are normally + * done in Install() + * @since 2.8 + * @return TInt KErrNone if successful + */ + virtual TInt Install2ndPhase() = 0; + + /** + * Multiplexers "pre" intialization before Data transmission driver + * initialization has been done ( e.g. if buffer configurations are given from isc_config.ini ) + * @since 2.8 + * @param aParameters Additional parameters passed to multiplexer + * @return void + */ + IMPORT_C virtual void SetInitializationParameters( const TDesC8& aParameters ); + + /** + * Multiplexer intialization + * @since 2.8 + * @param aOperation The asynchronous request to complete after + * multiplexer intialization is complete + * @param aParameters Additional parameters passed to multiplexer + * @param aChannelPtr DIscChannel pointer + * @return void + */ + virtual void InitializeMultiplexer( const TUint16 aOperation, + const TDesC8& aParameters, + const TAny* aChannelPtr ) = 0; + + /** + * Open data link connection with the modem + * @since 2.8 + * @param aDLCI The channel id to open + * @param aOpenParams Additional open parameters given by the ISC user, + * NULL if omitted + * @param aChannelPtr DIscChannel pointer + * @return void + */ + virtual void OpenDLC( const TUint16 aDLCI, + const TDesC8* aOpenParams, + const TAny* aChannelPtr ) = 0; + + /** + * Close data link connection + * @since 2.8 + * @param aDLCI The channel id to close + * @param aChannelPtr DIscChannel pointer + * @return void + */ + virtual void CloseDLC( const TUint16 aDLCI, + const TAny* aChannelPtr ) = 0; + + /** + * Send data to Domestic OS + * @since 2.8 + * @param aOperation Used to distinguish whether it is a synchronous + * or asynchronous Send request ( EIscSyncSend / EIscAsyncSend ) + * @param aSenderChannel Sender channel id + * @param aData Data to be sent + * @param aChannelPtr DIscChannel pointer + * @return KErrNone if successful + */ + virtual TInt Send( const TUint16 aOperation, + const TUint16 aSenderChannel, + const TDesC8& aData, + const TAny* aChannelPtr ) = 0; + /** + * Send data to Domestic OS + * @since 2.8 + * @param aOperation Used to distinguish whether it is a synchronous + * or asynchronous Send request ( EIscSyncDataSend / EIscAsyncDataSend ) + * @param aSenderChannel Sender channel id + * @param aData Data to be sent + * @param aChannelPtr DIscChannel pointer + * @return KErrNone if successful + */ + virtual TInt DataSend( const TUint16 aOperation, + const TUint16 aSenderChannel, + const TDesC8& aData, + const TAny* aChannelPtr ) = 0; + + + /** + * Retrieve information on the incoming frame + * @since 2.8 + * @param aFrame Frame which info to retrieve + * @param aFrameInfo Structure that the multiplexer must fill + * @return void + */ + virtual void GetFrameInfo( const TDesC8& aFrame, + TIscFrameInfo& aFrameInfo ) const = 0; + + /** + * Retrieve the channel this frame belongs to + * @since 2.8 + * @param aFrame Frame to check + * @param aRcvChannelId Receiver channel id has to written into this + * variable. Value should be between 0 and 63. KIscFrameReceiverNotFound + * should be returned if multiplexer could not determine correct receiver + * or multiplexer just wants to delete the frame. For multiplexer's purposes + * channel ids higher than 63 are also possible + * @param aRcvChannelPtr Receiver channel pointer. If routing to control channel + * NULL should be returned an 0 to aRcvChannelId + * @return void + */ + virtual void GetRcvChannelId( const TDesC8& aFrame, + TUint16& aRcvChannelId, + TAny*& aRcvChannelPtr ) = 0; + + /** + * Set flow control to specified state + * @since 2.8 + * @param aFlowStatus EIscFlowControlOn / EIscFlowControlOff + * @param aChannelId Channel who requested to DL flow control change + * @param aChannelPtr DIscChannel pointer for corresponding channel + * @return void + */ + virtual void DLFlowControl( const TInt aFlowStatus, + const TUint16 aChannelId, + const TAny* aChannelPtr ) = 0; + + /** + * Handle frames going to control channel ( channel zero ) + * @since 2.8 + * @param aFrame Control frame to be handled + * @return void + */ + virtual void HandleControlFrame( const TDesC8& aFrame ) = 0; + + /** + * Notify multiplexer that some asynchronous operation has been + * cancelled + * @since 2.8 + * @param aChannelId Channel id which has cancelled the operation + * @param aOperation The operation that has been cancelled + * @param aChannelPtr Channel pointer which has cancelled the operation + * @return void + */ + virtual void CancelNotify( const TUint16 aChannelId, + const TUint16 aOperation, + const TAny* aChannelPtr ) = 0; + + /** + * API extension function + * @since 2.8 + * @param aChannelId Channel id that is executing the operation + * @param aOperation Which custom operation to execute + * @param aParameters Additional parameters, NULL if omitted + * @param aChannelPtr Pointer to DIscChannel + * @return TInt KErrNone if successful. KErrNotSupported if the + * operation that was requested is not supported by the multiplexer + */ + IMPORT_C virtual TInt CustomFunction( const TUint16 aChannelId, + const TUint16 aOperation, + TAny* aParameters, + const TAny* aChannelPtr ); + + /** + * Get information on specified channel + * @since 2.8 + * @param aChannelNumber The channel, which information is required + * @param aInfo Buffer in client address space where to write the data + * @return TInt KErrNone if successful. KErrNotSupported if not supported + * by the multiplexer + */ + IMPORT_C virtual TInt GetChannelInfo( const TUint16 aChannelNumber, + TDes8& aInfo ); + + /** + * Get maximun data size ( for sending and receiving ) + * @since 2.8 + * @param aChannelId Channel which needed maximum data size is queried + * @return TInt Maximun data size in bytes + */ + virtual TInt MaximumDataSize( const TUint16 aChannelId ) = 0; + + /** + * Inform multiplexer on connection status changes + * @since 2.8 + * @param aConnectionStatus EIscConnectionOk / EIscConnectionNotOk + * @return void + */ + virtual void NotifyConnectionStatus( const TInt aConnectionStatus ) = 0; + + /** + * Connect ISC Driver to ISC Multiplexer + * @since 2.8 + * @param aDevice Pointer to DIscDevice class of ISC Driver + * @return void + */ + IMPORT_C virtual void Connect( DIscDevice* aDevice ); + + /** + * Get buffer configurations from ISC Multiplexer + * @since 2.8 + * @param aConfig Configuration data structure that the multiplexer must fill + * @return void + */ + virtual void GetConfiguration( TIscConfiguration& aConfig ) = 0; + + + protected: // New functions + + /** + * Complete specified asynchronous request + * @since 2.8 + * @param aReqNumber Request to complete ( possible values in + * IscDefinitions.h ) + * @param aStatus Error code, KErrNone if the operation in question + * was successful + * @param aChannelPtr The channel, which request to complete + * @return void + */ + IMPORT_C void CompleteRequest( TUint16 aReqNumber, + TInt aStatus, + const TAny* aChannelPtr ); + + /** + * Check if specified request is pending in ISC Driver + * @since 2.8 + * @param aReqNumber Request to check if pending + * @param aChannelId The channel, which to check for the request + * @return TInt KRequestPending if the request is pending. KErrNone if + * request is not pending + */ + IMPORT_C TInt IsPending( const TUint16 aReqNumber, + const TAny* aChannelId ); + + /** + * Queue frame for sending + * @since 2.8 + * @param aChannelId On which channels queue to add the frame. Value + * must be between 0 and 63. 0( zero ) refers to the control channel. + * @param aFrame Frame to send + * @param aMultiplexerDfc Dfc to run when frame transmission to modem has been done + * @param aMultiplexerErrorCode error if data transmsission was succesful or not + * @return TInt KErrNone if successful. KErrNotFound if the channel + * in question was not open + */ + IMPORT_C TInt QueueFrame( const TUint16 aChannelId, + const TDesC8* aFrame, + const TAny* aChannelPtr, + TAny* aFrameInfo = NULL ); + + /** + * Start sending the frames + * @since 2.8 + * @return void + */ + IMPORT_C void FlushQueues(); + + /** + * Notify flow control changes to ISC Driver + * @since 2.8 + * @param aULFlowStatus Uplink flow control status, + * EIscFlowControlOff/EIscFlowControlOn + * @param aChannelId Channel to be affected by the flow control + * @param aChannel Channel to be affected by the flow control, NULL if wanted to have + * effect on all channels within this id. By default it affects all channels + * @return void + */ + IMPORT_C void ULFlowControl( const TInt aULFlowStatus, + const TUint16 aChannelId, + TAny* aChannelPtr = NULL ); + + /** + * Reserve memory block + * @since 2.8 + * @param aPtr Pointer to reserved memory block, NULL if not successful + * @param aSize Required minimun size of the block + * @return void + */ + IMPORT_C void ReserveMemoryBlock( TDes8*& aPtr, + const TUint16 aSize ); + + /** + * Release memory block allocated with ReserveMemoryBlock + * @since 2.8 + * @param aPtr Pointer to memory block to be released + * @return void + */ + IMPORT_C void ReleaseMemoryBlock( TDes8* aPtr ); + + + /** + * Copy data from user buffer to kernel side buffer by multiplexer. + * This method will be deprecated in the future. + * It is preffered to use GetThreadPtr instead. + * @since 2.8 + * @param aUserBuffer pointer to source descriptor + * @param aKernelBuffer pointer to destination descriptor + * @param aChannelPtr DIscChannel pointer + * @param aOffset Offset of the source buffer + * @return KErrNone if successful + */ + IMPORT_C TInt CopyFromUserBuffer( const TDesC8& aUserBuffer, + TDes8& aKernelBuffer, + const TAny* aChannelPtr, + const TInt aOffset = 0 ); + + /** + * Copy data to user side buffer from kernel side by multiplexer. + * This method will be deprecated in the future. + * It is preffered to use GetThreadPtr instead. + * @since 2.8 + * @param aUserBuffer pointer to destination descriptor + * @param aKernelBuffer pointer to source descriptor + * @param aChannelPtr DIscChannel pointer + * @param aOffset Offset of the destination buffer + * @return KErrNone if succesful + */ + IMPORT_C TInt CopyToUserBuffer( TAny* aUserBuffer, + const TDesC8& aKernelBuffer, + const TAny* aChannelPtr, + const TInt aOffset = 0 ); + + + /** + * Description_here + * @since 2.8 + * @param aChannelId Channel whose queued send frames should be deleted + * @param aChannelPtr Corresponding DIscChannel pointer + * @return TInt KErrNone if succesful + */ + IMPORT_C TInt CancelSending( const TUint16 aChannelId, const TAny* aChannelPtr ); + + + /** + * Returns a user side thread of a given channel. Returns NULL if channelptr + * is not valid or if the channel is not found. + * @since 3.0 + * @param const TAny* aChannelPtr, channel pointer (DIscChannel). + * @return DThread&, user side clients thread. Ownership is not given. + */ + IMPORT_C DThread* GetThreadPtr( const TAny* aChannelPtr ); + + + protected: // Data + + // pointer to DIscDevice class from ISC Driver + DIscDevice* iDevice; // No ownership + + }; + +#endif // ISCMULTIPLEXERBASE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscMultiplexerBase/inc/IscTrace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscMultiplexerBase/inc/IscTrace.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef ISCTRACE_H +#define ISCTRACE_H + +// INCLUDES +// CONSTANTS + +// MACROS + +#ifdef TRACE_MODE_KERNEL + + // INCLUDES + #include + + #define _T(a) a +#else + + // INCLUDES + #include // RDebug + #include + + #define _T(a) _L(a) + +#endif // TRACE_MODE_KERNEL + +#ifdef _DEBUG + + #ifdef TRACE_MODE_KERNEL + #define __TRACE_PRINTF(a) Kern::Printf a + #else + #define __TRACE_PRINTF(a) RDebug::Print a + #endif + +#else + #define __TRACE_PRINTF(a) +#endif // _DEBUG + + +#ifdef _DEBUG + + void BuildTraceFunc( const TDesC& aPrefix ); + void DataDumpTraceFunc( const TDesC& aPrefix, const TDesC8& aData ); + + #define BUILD_TRACE( a ) BuildTraceFunc( a ) + #define DATA_DUMP_TRACE( a, b ) DataDumpTraceFunc( a, b ) + + #ifdef TRACE_MODE_KERNEL + + // define assertions + #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled=" __DATE__" "__TIME__, __LINE__ )) + + #else + + // define assertions + #ifdef __WINS__ + #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF((_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__)) + #else + #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF((_L("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__ __TIME__""),__LINE__ )) + #endif //__WINS__ + + #endif // TRACE_MODE_KERNEL + + + #if defined COMPONENT_TRACE_FLAG + #define C_TRACE(a) __TRACE_PRINTF(a) + #else + #define C_TRACE(a) + #endif // COMPONENT_TRACE_FLAG + + #if defined API_TRACE_FLAG + #define A_TRACE(a) __TRACE_PRINTF(a) + #else + #define A_TRACE(a) + #endif // API_TRACE_FLAG + + #if defined EXTENDED_TRACE_FLAG + #define E_TRACE(a) __TRACE_PRINTF(a) + #else + #define E_TRACE(a) + #endif // EXTENDED_TRACE_FLAG + +#else + #define TRACE_ASSERT(a) + #define C_TRACE(a) + #define A_TRACE(a) + #define E_TRACE(a) + #define BUILD_TRACE(a) + #define DATA_DUMP_TRACE(a, b) +#endif // _DEBUG + + +// Resets are made both in UDEB and UREL (traces only in udeb) +#ifdef TRACE_MODE_KERNEL + #define ASSERT_RESET_ALWAYS(a,b,c) if(!(a)) { __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__)); Kern::Fault(b,c); } + #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( ("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__) ) +#else + #ifdef __WINS__ + #define ASSERT_RESET_ALWAYS(a,b,c) error + #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__) ) + #else + #define ASSERT_RESET_ALWAYS(a,b,c) error + #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file=%s, line=%d, compiled=%s %s "),__FILE__, __LINE__, __DATE__, __TIME__) ) + #endif +#endif // kernel + + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +#endif // ISCTRACE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/IscMultiplexerBase/src/IscMultiplexerBase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/IscMultiplexerBase/src/IscMultiplexerBase.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,348 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of DIscMultiplexerBase class +* +*/ + + + +// INCLUDE FILES +#include +#include +#include "IscMultiplexerBase.h" +#include "IscTrace.h" + + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::DIscMultiplexerBase +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C DIscMultiplexerBase::DIscMultiplexerBase() + :iDevice( NULL ) + { + C_TRACE( ( _T( "DIscMultiplexerBase::DIscMultiplexerBase()" ) ) ); + C_TRACE( ( _T( "DIscMultiplexerBase::DIscMultiplexerBase - return 0x%x" ) ) ); + } + +// Destructor +EXPORT_C DIscMultiplexerBase::~DIscMultiplexerBase() + { + C_TRACE( ( _T( "DIscMultiplexerBase::~DIscMultiplexerBase()" ) ) ); + C_TRACE( ( _T( "DIscMultiplexerBase::~DIscMultiplexerBase - return 0x%x" ) ) ); + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::CustomFunction +// API extension function +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +#ifndef API_TRACE_FLAG +EXPORT_C TInt DIscMultiplexerBase::CustomFunction( + const TUint16, + const TUint16 aOperation, + TAny* , + const TAny* aChannelPtr ) +#else +EXPORT_C TInt DIscMultiplexerBase::CustomFunction( + const TUint16 aChannelId, + const TUint16 aOperation, + TAny* aParameters, + const TAny* aChannelPtr ) +#endif + { + A_TRACE( ( _T( "DIscMultiplexerBase::CustomFunction(0x%x, 0x%x, 0x%x, 0x%x)" ), aChannelId, aOperation, aParameters, aChannelPtr ) ); + CompleteRequest( aOperation, KErrNotSupported, aChannelPtr ); + return KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::GetChannelInfo +// Get information on specified channel +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +#ifndef API_TRACE_FLAG +EXPORT_C TInt DIscMultiplexerBase::GetChannelInfo( + const TUint16, + TDes8& ) +#else +EXPORT_C TInt DIscMultiplexerBase::GetChannelInfo( + const TUint16 aChannelNumber, + TDes8& aInfo ) +#endif + + { + A_TRACE( ( _T( "DIscMultiplexerBase::GetChannelInfo(0x%x, 0x%x)" ), aChannelNumber, &aInfo ) ); + return KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::CompleteRequest +// Complete specified asynchronous request +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +// This method has been modified to allow channel sharing between application. +// The completion routine uses directly a pointer on a DLogicalChannel instead of a channel index +// +EXPORT_C void DIscMultiplexerBase::CompleteRequest( + TUint16 aReqNumber, + TInt aStatus, + const TAny* aChannelPtr ) + { + A_TRACE( ( _T( "DIscMultiplexerBase::CompleteRequest(0x%x, 0x%x, 0x%x)" ), aReqNumber, aStatus, aChannelPtr ) ); + iDevice->CompleteRequest( aReqNumber, aStatus, aChannelPtr ); + A_TRACE( ( _T( "DIscMultiplexerBase::CompleteRequest - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::IsPending +// Check if specified request is pending in ISC Driver +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DIscMultiplexerBase::IsPending( + const TUint16 aReqNumber, + const TAny* aChannelPtr ) + { + A_TRACE( ( _T( "DIscMultiplexerBase::IsPending(0x%x, 0x%x)" ), aReqNumber, aChannelPtr ) ); + return iDevice->IsPending( aReqNumber, aChannelPtr ); + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::QueueFrame +// Queue frame for sending +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DIscMultiplexerBase::QueueFrame( + const TUint16 aChannelId, + const TDesC8* aFrame, + const TAny* aChannelPtr, + TAny* aFrameInfo ) + { + A_TRACE( ( _T( "DIscMultiplexerBase::QueueFrame(0x%x, 0x%x, 0x%x, 0x%x)" ), aChannelId, aFrame, aChannelPtr, aFrameInfo ) ); + TInt error( KErrNone ); + if ( !aFrame ) + { + error = KErrBadDescriptor; + } + else + { + error = iDevice->QueueFrame( aChannelId, aFrame, aChannelPtr, aFrameInfo ); + } + + return error; + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::FlushQueue +// Start sending the frames +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscMultiplexerBase::FlushQueues() + { + A_TRACE( ( _T( "DIscMultiplexerBase::FlushQueue()" ) ) ); + iDevice->FlushQueues(); + A_TRACE( ( _T( "DIscMultiplexerBase::FlushQueue - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::ULFlowControl +// Notify flow control changes to ISC Driver +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscMultiplexerBase::ULFlowControl( + const TInt aULFlowStatus, + TUint16 aChannelId, + TAny* aChannelPtr ) + { + A_TRACE( ( _T( "DIscMultiplexerBase::ULFlowControl(0x%x, 0x%x)" ), aULFlowStatus, aChannelPtr ) ); + iDevice->ULFlowControl( aULFlowStatus, aChannelId, aChannelPtr ); + A_TRACE( ( _T( "DIscMultiplexerBase::ULFlowControl - return void" ) ) ); + } + + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::ReserveMemoryBlock +// Reserve memory block +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscMultiplexerBase::ReserveMemoryBlock( + TDes8*& aPtr, + const TUint16 aSize ) + { + A_TRACE( ( _T( "DIscMultiplexerBase::ReserveMemoryBlock(0x%x, 0x%x)" ), aPtr, aSize ) ); + iDevice->ReserveMemoryBlock( aPtr,aSize ); + A_TRACE( ( _T( "DIscMultiplexerBase::ReserveMemoryBlock - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::ReleaseMemoryBlock +// Release the reserved memory block +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscMultiplexerBase::ReleaseMemoryBlock( + TDes8* aPtr ) + { + A_TRACE( ( _T( "DIscMultiplexerBase::ReleaseMemoryBlock(0x%x)" ), aPtr ) ); + iDevice->ReleaseMemoryBlock( aPtr ); + A_TRACE( ( _T( "DIscMultiplexerBase::ReleaseMemoryBlock - return void" ) ) ); + } + + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::CopyFromUserBuffer +// Due to GetThreadPtr this method will be deprecated in the future. +// It is preffered to use GetThreadPtr instead. +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DIscMultiplexerBase::CopyFromUserBuffer( + const TDesC8& aUserBuffer, + TDes8& aKernelBuffer, + const TAny* aChannelPtr, + const TInt aOffset ) + { + A_TRACE( ( _T( "DIscMultiplexerBase::CopyFromUserBuffer(0x%x, 0x%x, 0x%x, 0x%x)" ), &aUserBuffer, &aKernelBuffer, aChannelPtr, aOffset ) ); + return iDevice->CopyFromUserBuffer( aUserBuffer, aKernelBuffer, aChannelPtr, aOffset ); + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::CopyToUserBuffer +// Due to GetThreadPtr this method will be deprecated in the future. +// It is preffered to use GetThreadPtr instead. +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DIscMultiplexerBase::CopyToUserBuffer( + TAny* aUserBuffer, + const TDesC8& aKernelBuffer, + const TAny* aChannelPtr, + const TInt aOffset ) + { + A_TRACE( ( _T( "DIscMultiplexerBase::CopyToUserBuffer(0x%x, 0x%x, 0x%x, 0x%x)" ), aUserBuffer, &aKernelBuffer, aChannelPtr, aOffset ) ); + return iDevice->CopyToUserBuffer( aUserBuffer, aKernelBuffer, aChannelPtr, aOffset ); + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::GetThreadPtr +// Returns user side thread pointer no owenership is given. +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C DThread* DIscMultiplexerBase::GetThreadPtr( const TAny* aChannelPtr ) + { + A_TRACE( ( _T( "DIscMultiplexerBase::DIscMultiplexerBase::GetThreadPtr(0x%x)" ), aChannelPtr ) ); + TRACE_ASSERT( aChannelPtr ); + return iDevice->GetThreadPtr( aChannelPtr ); + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::CancelSending +// +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DIscMultiplexerBase::CancelSending( + const TUint16 aChannelId, + const TAny* aChannelPtr ) + { + A_TRACE( ( _T( "DIscMultiplexerBase::CancelSending(0x%x, 0x%x)" ), aChannelId, aChannelPtr ) ); + return iDevice->CancelSending( aChannelId, aChannelPtr ); + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::Connect +// Connect ISC Driver to ISC Multiplexer +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C void DIscMultiplexerBase::Connect( + DIscDevice* aDevice ) + { + A_TRACE( ( _T( "DIscMultiplexerBase::Connect(0x%x)" ), aDevice ) ); + ASSERT_RESET_ALWAYS( aDevice, "IscMultiplexerBase",EIscNullIscDriverPointer ); + iDevice = aDevice; + A_TRACE( ( _T( "DIscMultiplexerBase::Connect - return void" ) ) ); + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::SetInitializationParameters +// Initialization string to multiplexer in case if needed before datatransmission driver has been initialized +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +#ifndef API_TRACE_FLAG +EXPORT_C void DIscMultiplexerBase::SetInitializationParameters( const TDesC8&) +#else +EXPORT_C void DIscMultiplexerBase::SetInitializationParameters( const TDesC8& aParameters ) +#endif + { + A_TRACE( ( _T( "DIscMultiplexerBase::SetInitializationParameters not supported(0x%x)" ), &aParameters ) ); + } + +// ----------------------------------------------------------------------------- +// DIscMultiplexerBase::Install +// Install from DLogicalDevice +// ( other items were commented in a header ). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DIscMultiplexerBase::Install() + { + A_TRACE( ( _T( "DIscMultiplexerBase::Install()" ) ) ); + SetName( &KIscMultiplexerName ); + TInt r = Install2ndPhase(); + C_TRACE( ( _T( "DIscMultiplexerBase::Install - return 0x%x" ), r ) ); + return r; + } + +// ================= E32Dll ============== +// E32Dll +// Dll entry point. +// Returns: TInt Invariably return KErrNone. +// +#if defined( __WINSCW__ ) +DECLARE_STANDARD_LDD() + { + return NULL; + } +#endif +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/group/IscApi.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/group/IscApi.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + +TARGET IscApi.dll +TARGETTYPE dll +UID 0x10000079 0x1020209F +VENDORID VID_DEFAULT + +#ifdef WINSCW +deffile /epoc32/include/def/bwins/iscapi.def +#else +deffile /epoc32/include/def/eabi/iscapi.def +#endif + +CAPABILITY ALL + +SOURCEPATH ../IscApi/src +SOURCE IscApi.cpp + +USERINCLUDE ../IscApi/inc + +// System include macro +OS_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib efsrv.lib + +START WINS +win32_library kernel32.lib +END + +// flag to enable trace of components API calls +//MACRO API_TRACE_FLAG + +// flag to enable normal trace inside component +//MACRO COMPONENT_TRACE_FLAG + + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/group/IscDataTransmissionBaseReference.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/group/IscDataTransmissionBaseReference.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A reference implementation for ISC data transmission base +* reference. +* +*/ + + +#include + +#include "kernel/kern_ext.mmh" + +#if defined(WINSCW) +TARGET IscDataTransmissionBase.ldd +TARGETTYPE ldd +UID 0x100000AF 0x102020A2 +DEFFILE IscDataTransmissionBaseCW.def +#else +TARGET IscDataTransmissionBase.dll +TARGETTYPE kdll +UID 0x10000079 0x102020A2 +DEFFILE IscDataTransmissionBase.def +#endif + +VENDORID VID_DEFAULT + +CAPABILITY ALL + +SOURCEPATH ../IscDataTransmissionBase/src +SOURCE IscDataTransmissionBase.cpp +SOURCE IscBufferAllocator.cpp +SOURCE IscBufferQueue.cpp + + +USERINCLUDE ../IscDriver/inc +USERINCLUDE ../IscDataTransmissionBase/inc +USERINCLUDE ../IscMultiplexerBase/inc + +OS_LAYER_KERNEL_SYSTEMINCLUDE + +LIBRARY IscDriver.lib + +START WINS +win32_library kernel32.lib +#if defined(VC32) +win32_library libc.lib +#endif + +END + +// Do not remove this flag unless you are sure what you are doing. +macro TRACE_MODE_KERNEL + +// flag to enable trace of components API calls +//macro API_TRACE_FLAG + +// flag to enable normal trace inside component +//macro COMPONENT_TRACE_FLAG + +// flag to enable unsafe trace inside component (i.e. prints when context is unknown, might be irq) +//macro EXTENDED_TRACE_FLAG + + +EPOCALLOWDLLDATA diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/group/IscDriverExtensionReference.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/group/IscDriverExtensionReference.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A reference implementation for ISC Driver Extension +* +*/ + + +#include + +#include "kernel/kern_ext.mmh" + +TARGET IscDriverExtension.ldd +TARGETTYPE ldd +UID 0x100000AF 0x102020A1 +VENDORID VID_DEFAULT +CAPABILITY ALL + +DEFFILE IscDriverExtension.def + +SOURCEPATH ../IscDriver/src +SOURCE IscDriverExtensionDevice.cpp + +USERINCLUDE ../IscDriver/inc +USERINCLUDE ../IscDataTransmissionBase/inc +USERINCLUDE ../IscMultiplexerBase/inc + +OS_LAYER_KERNEL_SYSTEMINCLUDE + +LIBRARY IscDriver.lib + +START WINS +win32_library kernel32.lib +END + +// Do not remove this flag unless you are sure what you are doing. +macro TRACE_MODE_KERNEL + +// flag to enable trace of components API calls +//MACRO API_TRACE_FLAG + +// flag to enable normal trace inside component +//MACRO COMPONENT_TRACE_FLAG + + + +EPOCALLOWDLLDATA diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/group/IscDriverReference.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/group/IscDriverReference.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: An example implementation for ISC Driver Reference +* +*/ + + +#include + +#include "kernel/kern_ext.mmh" + +TARGET IscDriver.ldd +TARGETTYPE ldd +UID 0x100000AF 0x102020A0 +VENDORID VID_DEFAULT +CAPABILITY ALL + +DEFFILE IscDriver.def + +SOURCEPATH ../IscDriver/src +SOURCE IscDevice.cpp +SOURCE IscChannel.cpp +SOURCE IscChannelContainer.cpp +SOURCE IscMainRcvBuffer.cpp +SOURCE IscQueue.cpp +SOURCE IscSendQueue.cpp + +USERINCLUDE ../IscDriver/inc +USERINCLUDE ../IscMultiplexerBase/inc +USERINCLUDE ../IscDataTransmissionBase/inc + +OS_LAYER_KERNEL_SYSTEMINCLUDE + +START WINS +win32_library kernel32.lib +END + +// Do not remove this flag unless you are sure what you are doing. +macro TRACE_MODE_KERNEL + +// flag to enable trace of components API calls +//macro API_TRACE_FLAG + +// flag to enable normal trace inside component +//macro COMPONENT_TRACE_FLAG + +// flag to enable unsafe trace inside component (i.e. prints that context is unknown, might be irq) +//macro EXTENDED_TRACE_FLAG + + +EPOCALLOWDLLDATA diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/group/IscMultiplexerBaseReference.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/group/IscMultiplexerBaseReference.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A reference implementation for ISC multiplexer base. +* +*/ + + +#include + +#include "kernel/kern_ext.mmh" + +#if defined(WINSCW) +TARGET IscMultiplexerBase.ldd +TARGETTYPE ldd +UID 0x100000AF 0x102020A3 +DEFFILE IscMultiplexerBaseCW.def +#else +TARGET IscMultiplexerBase.dll +TARGETTYPE kdll +UID 0x10000079 0x102020A3 +DEFFILE IscMultiplexerBase.def +#endif + +VENDORID VID_DEFAULT + +CAPABILITY ALL + +SOURCEPATH ../IscMultiplexerBase/src +SOURCE IscMultiplexerBase.cpp + + +USERINCLUDE ../IscMultiplexerBase/inc +USERINCLUDE ../IscDriver/inc + +OS_LAYER_KERNEL_SYSTEMINCLUDE + +LIBRARY IscDriver.lib + +START WINS +win32_library kernel32.lib +#if defined(VC32) +win32_library libc.lib +#endif + +END +// Do not remove this flag unless you are sure what you are doing. +macro TRACE_MODE_KERNEL + +// flag to enable trace of components API calls +//MACRO API_TRACE_FLAG + +// flag to enable normal trace inside component +//MACRO COMPONENT_TRACE_FLAG + + +EPOCALLOWDLLDATA diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project ISC_IF +* +*/ + + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/rom/isc_if_api.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/rom/isc_if_api.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef ISC_IF_API_IBY +#define ISC_IF_API_IBY + +file=ABI_DIR\BUILD_DIR\IscApi.dll SHARED_LIB_DIR\IscApi.dll + +#endif // ISC_IF_API_IBY + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/examplecommonisc/rom/isc_if_drivers_reference.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/examplecommonisc/rom/isc_if_drivers_reference.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef ISC_IF_DRIVERS_REFERENCE_IBY +#define ISC_IF_DRIVERS_REFERENCE_IBY + +device[VARID]=KERNEL_DIR\BUILD_DIR\IscDriver.ldd SHARED_LIB_DIR\IscDriver.ldd +device[VARID]=KERNEL_DIR\BUILD_DIR\IscDriverExtension.ldd SHARED_LIB_DIR\IscDriverExtension.ldd +device[VARID]=KERNEL_DIR\BUILD_DIR\IscMultiplexerBase.dll SHARED_LIB_DIR\IscMultiplexerBase.dll +device[VARID]=KERNEL_DIR\BUILD_DIR\IscDataTransmissionBase.dll SHARED_LIB_DIR\IscDataTransmissionBase.dll + +#endif // ISC_IF_DRIVERS_REFERENCE_IBY + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/bwins/exampledsyu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/bwins/exampledsyu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCDosFactoryBase@@XZ @ 1 NONAME ; class CDosFactoryBase * LibEntryL(void) + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/data/dosserver.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/data/dosserver.ini Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,1 @@ +ExampleDSY.dsy \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/eabi/exampledsyu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/eabi/exampledsyu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,17 @@ +EXPORTS + _Z9LibEntryLv @ 1 NONAME + _ZTI14CDosMtcExample @ 2 NONAME ; ## + _ZTI14CDosSaeExample @ 3 NONAME ; ## + _ZTI17CDosHelperExample @ 4 NONAME ; ## + _ZTI18CDosFactoryExample @ 5 NONAME ; ## + _ZTI19CDosSelfTestExample @ 6 NONAME ; ## + _ZTI19CDosSysUtilsExample @ 7 NONAME ; ## + _ZTI20CDosExtensionExample @ 8 NONAME ; ## + _ZTV14CDosMtcExample @ 9 NONAME ; ## + _ZTV14CDosSaeExample @ 10 NONAME ; ## + _ZTV17CDosHelperExample @ 11 NONAME ; ## + _ZTV18CDosFactoryExample @ 12 NONAME ; ## + _ZTV19CDosSelfTestExample @ 13 NONAME ; ## + _ZTV19CDosSysUtilsExample @ 14 NONAME ; ## + _ZTV20CDosExtensionExample @ 15 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +#ifndef RD_STARTUP_CHANGE + +PRJ_EXPORTS +../data/DosServer.ini /epoc32/release/winscw/udeb/z/private/101f6efa/DosServer.ini +../data/DosServer.ini /epoc32/release/winscw/urel/z/private/101f6efa/DosServer.ini +../data/DosServer.ini /epoc32/data/z/private/101f6efa/DosServer.ini +../rom/exampledsy.iby CORE_OS_LAYER_IBY_EXPORT_PATH(exampledsy.iby) + +PRJ_MMPFILES +../group/ExampleDSY.mmp + +#endif // RD_STARTUP_CHANGE diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/group/exampledsy.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/group/exampledsy.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + +TARGET ExampleDSY.dsy + +TARGETTYPE DLL +UID 0x1000008D 0x101f6efe +VENDORID VID_DEFAULT + +CAPABILITY CAP_GENERAL_DLL + +LANG SC +SOURCEPATH ../src +USERINCLUDE ../inc + +OS_LAYER_SYSTEMINCLUDE + +SOURCE DsyFactory.cpp +SOURCE DsyExtension.cpp + +SOURCE DsySysUtils.cpp +SOURCE DsyHelper.cpp +SOURCE DsyMtc.cpp +SOURCE DsySelfTest.cpp + +SOURCE Dsysae.cpp + +LIBRARY euser.lib +LIBRARY DosSrv.lib +LIBRARY efsrv.lib + +DEBUGLIBRARY flogger.lib // File logging services diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/inc/dsydebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/inc/dsydebug.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file defines logging macros for DSY plugin. +* +*/ + + +#ifndef DSYDEBUG_H +#define DSYDEBUG_H + +#include + + +#ifdef _DEBUG + +// Enable this to enable memory tracing +// for BT Phone Host Interface +//#define MEMTRACE + +#ifdef __WINS__ +#define __FLOGGING__ // File logging for WINS +#else +#define __CLOGGING__ // Logging with RDebug for target HW +#endif //__WINS__ + +#endif // _DEBUG + + +// File logging +// +#if defined(__FLOGGING__) + +#include + +_LIT(KLogFile,"doslog.txt"); +_LIT(KLogDirFullName,"c:\\logs\\bt\\"); +_LIT(KLogDir,"BT"); + +#include +#include + +#define FLOG(a) { FPrint(a); } +#define FTRACE(a) { a; } + +// Declare the FPrint function +inline void FPrint(const TRefByValue aFmt, ...) + { + VA_LIST list; + VA_START(list,aFmt); + RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); + +#ifdef MEMTRACE // If memory tracing is activated. + TInt size; + User::Heap().AllocSize(size); + RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, _L("[TBTPHI]\t MEM\tMemory usage: %d high: %d"), size, User::Heap().Size()); +#endif + } + + +// RDebug logging +// +#elif defined(__CLOGGING__) + +#include + +#define FLOG(a) { RDebug::Print(a); } +#define FLOGHEX(a) +#define FTRACE(a) { a; } + +// Declare the FPrint function +inline void FPrint(const TRefByValue aFmt, ...) + { + VA_LIST list; + VA_START(list,aFmt); + TInt tmpInt = VA_ARG(list, TInt); + TInt tmpInt2 = VA_ARG(list, TInt); + TInt tmpInt3 = VA_ARG(list, TInt); + VA_END(list); + RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3); + } + + +// No loggings --> Reduced binary size +// +#else +#define FLOG(a) +#define FLOGHEX(a) +#define FTRACE(a) +#endif + +#endif // DSYDEBUG_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/inc/dsyextension.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/inc/dsyextension.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It describes the CDosExtensionExample class +* +*/ + + +#ifndef __DSYEXTENSION_H__ +#define __DSYEXTENSION_H__ + +#include "DosExtensionBase.h" + +/** +* Plug-in class that implements the MDosExtensionBaseDSY class and to +* satisfy the RDosExtension requests from the client side. +*/ +class CDosExtensionExample : public CDosExtensionBase +{ +public: + /** + * NewL function that creates the object. + * @return The newly created object. + */ + static CDosExtensionExample* NewL(); + + //====================================================== + // See MDosExtensionBaseDSY class for a description of + // the following functions. + //====================================================== + TInt CallFunctionL(TInt aFunc , TAny *aParameter , TInt aParLength, TBool& aParameterModified); + void CallFunctionAndCompleteL(TInt aFunc , TAny *aParameter , TInt aParLength, const RMessage2& aMessage); + +private: + /** + * Symbian two-phased constructor. + */ + void ConstructL(); +}; + + +#endif //__DSYEXTENSION_H__ diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/inc/dsyfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/inc/dsyfactory.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It describes the CDosFactoryExample class +* +*/ + + +#ifndef __DSYFACTORY_H__ +#define __DSYFACTORY_H__ + +#include "DosFactoryBase.h" + +/** +* Plug-in class that implements the MDosFactoryBaseDSY class and +* creates all the other plug-in services. +*/ +class CDosFactoryExample : public CDosFactoryBase +{ +public: + /** + * NewL function that creates the object. + * @return The newly created object. + */ + static CDosFactoryExample* NewL(); + + //====================================================== + // See MDosFactoryBaseDSY class for a description of + // the following functions. + //====================================================== + + CDosSysUtilsBase* NewSysUtilsServiceL(); + CDosHelperBase* NewHelperServiceL(); + CDosMtcBase* NewMtcServiceL(); + CDosSelfTestBase* NewSelfTestServiceL(); + + CDosSaeBase* NewSaeServiceL(); + + CDosExtensionBase* NewExtensionServiceL(); + +private: + /** + * Symbian two-phased constructor. + */ + void ConstructL(); +}; + +#endif //__DSYFACTORY_H__ diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/inc/dsyhelper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/inc/dsyhelper.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It describes the CDosHelperExample class +* +*/ + + +#ifndef __DSYHELPER_H__ +#define __DSYHELPER_H__ + +#include "DosHelperBase.h" + +/** +* Plug-in class that implements the MDosHelperBaseDSY class and +* satisfies the RDosHelper requests from the clients. +*/ +class CDosHelperExample : public CDosHelperBase +{ +public: + /** + * NewL function that creates the object. + * @return The newly created object. + */ + static CDosHelperExample* NewL(); + + //====================================================== + // See MDosHelperBaseDSY class for a description of + // the following functions. + //====================================================== + TInt GetStartupReasonL(TInt& aReason); + TInt GetSWStartupReasonL(TInt16& aReason); + TInt SetSWStartupReasonL(TInt16 aReason); + TBool HiddenResetL(); + TInt GetRTCStatusL(TBool& aStatus); + TInt GenerateGripEventL(); + +private: + /** + * Symbian two-phased constructor. + */ + void ConstructL(); +}; + +#endif //__DSYHELPER_H__ diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/inc/dsymtc.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/inc/dsymtc.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It describes the CDosMtcExample class +* +*/ + + +#ifndef __DSYMTC_H__ +#define __DSYMTC_H__ + +#include "DosMtcBase.h" + +/** +* Plug-in class that implements the MDosMtcBaseDSY class and +* satisfies the RDosMtc requests from the clients. +*/ +class CDosMtcExample : public CDosMtcBase +{ +public: + /** + * NewL function that creates the object. + * @return The newly created object. + */ + static CDosMtcExample* NewL(); + + //====================================================== + // See MDosMtcBaseDSY class for a description of + // the following functions. + //====================================================== + TInt PowerOnL(); + TInt PowerOffL(); + TInt DosSyncL(); + TInt ResetGenerateL(); + TInt SetStateL(const TInt aStateType); + + TInt SetStateFlagL(const TDosStateFlag aFlag); + TInt GetStateFlagL(TDosStateFlag& aFlag); + +private: + /** + * Symbian two-phased constructor. + */ + void ConstructL(); +}; + +#endif //__DSYMTC_H__ diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/inc/dsysae.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/inc/dsysae.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It describes the CDosSaeExample class +* +*/ + + +#ifndef __DSYSAE_H__ +#define __DSYSAE_H__ + +#include "DosSaeBase.h" + +//Class for the SAE Service + +/** +* Plug-in class that implements the MDosSaeBaseDSY class and +* satisfies the RDosSae requests from the clients. +*/ +class CDosSaeExample : public CDosSaeBase +{ +public: + /** + * NewL function that creates the object. + * @return The newly created object. + */ + static CDosSaeExample* NewL(); + + //====================================================== + // See MDosSaeBaseDSY class for a description of + // the following function. + //====================================================== + TInt StartSaeL(); + +private: + /** + * Symbian two-phased constructor. + */ + void ConstructL(); +}; + + +#endif //__DSYSAE_H__ diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/inc/dsyselftest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/inc/dsyselftest.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It describes the CDosSelfTestExample class +* +*/ + + +#ifndef __DSYSELFTEST_H__ +#define __DSYSELFTEST_H__ + +#include "DosSelfTestBase.h" + + +/** +* Plug-in class that implements the MDosSelfTestBaseDSY class and +* satisfies the RDosSelftTest requests from the clients. +*/ +class CDosSelfTestExample : public CDosSelfTestBase +{ +public: + /** + * NewL function that creates the object. + * @return The newly created object. + */ + static CDosSelfTestExample* NewL(); + + //====================================================== + // See MDosSelfTestBaseDSY class for a description of + // the following function. + //====================================================== + TInt PerformSelfTestL(); + +private: + /** + * Symbian two-phased constructor. + */ + void ConstructL(); +}; + + + +#endif //__DSYSELFTEST_H__ diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/inc/dsysysutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/inc/dsysysutils.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It describes the CDosSysUtilsExample class +* +*/ + + +#ifndef __DSYSYSUTILS_H__ +#define __DSYSYSUTILS_H__ + +#include "DosSysUtilsBase.h" + +/** +* Plug-in class that implements the MDosSysUtilsBaseDSY class and +* satisfies the RDosSysUtils requests from the clients. +*/ +class CDosSysUtilsExample : public CDosSysUtilsBase +{ +public: + /** + * NewL function that creates the object. + * @return The newly created object. + */ + static CDosSysUtilsExample* NewL(); + + //====================================================== + // See MDosSysUtilsBaseDSY class for a description of + // the following functions. + //====================================================== + TInt GetSimLanguageL(TInt& aSimLanguage); + void PerformDosRfsL(TUint aReason, const RMessagePtr2 aMessage); + TInt SetDosAlarmL(TTime* aAlarmTime); + +private: + /** + * Symbian two-phased constructor. + */ + void ConstructL(); +}; + +#endif //__DSYSYSUTILS_H__ diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/rom/exampledsy.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/rom/exampledsy.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __ExampleDsy_IBY__ +#define __ExampleDsy_IBY__ + +#ifndef __COMMON_DSY + +file=ABI_DIR\BUILD_DIR\ExampleDsy.dsy SHARED_LIB_DIR\ExampleDsy.dsy + +data=ZPRIVATE\101f6efa\DosServer.ini \private\101f6efa\dosserver.ini + +#endif + +#endif + + \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/src/dsyextension.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/src/dsyextension.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It implements the class CDosExtensionExample. +* +*/ + + +#include "DsyExtension.h" +#include "DsyDebug.h" + +// +// --------------------------------------------------------- +// CDosExtensionExample::NewL +// --------------------------------------------------------- +// +CDosExtensionExample* CDosExtensionExample::NewL() +{ + FLOG(_L("CDosExtensionExample::NewL()")); + + CDosExtensionExample* result = new (ELeave) CDosExtensionExample; + + CleanupStack::PushL(result); + result->ConstructL(); + CleanupStack::Pop(); + + return result; +} + +// +// --------------------------------------------------------- +// CDosExtensionExample::ConstructL +// --------------------------------------------------------- +// +void CDosExtensionExample::ConstructL() +{ + FLOG(_L("CDosExtensionExample::ConstructL()")); +} + + +// +// --------------------------------------------------------- +// CDosExtensionExample::CallFunctionL +// --------------------------------------------------------- +// +TInt CDosExtensionExample::CallFunctionL(TInt /*aFunc*/ , TAny* /*aParameter*/ , TInt /*aParLength*/, TBool& /*aParameterModified*/) +{ + FLOG(_L("CDosExtensionExample::CallFunctionL()")); + + return KErrNone; +} + + +// +// --------------------------------------------------------- +// CDosExtensionExample::CallFunctionAndCompleteL +// --------------------------------------------------------- +// +void CDosExtensionExample::CallFunctionAndCompleteL(TInt /*aFunc*/ , TAny* /*aParameter*/ , TInt /*aParLength*/, const RMessage2& aMessage) +{ + FLOG(_L("CDosExtensionExample::CallFunctionAndCompleteL()")); + + CompleteRequest(aMessage,KErrNone); +} diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/src/dsyfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/src/dsyfactory.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It implements the class CDosFactoryExample. +* +*/ + + +#include "DsySysUtils.h" +#include "DsyHelper.h" +#include "DsyMtc.h" +#include "DsySelfTest.h" + +#include "DsySae.h" + +#include "DsyExtension.h" +#include "DsyFactory.h" +#include "DsyDebug.h" +// +// --------------------------------------------------------- +// CDosFactoryExample::NewL +// --------------------------------------------------------- +// +CDosFactoryExample* CDosFactoryExample::NewL() +{ + FLOG(_L("CDosFactoryExample::NewL()")); + + CDosFactoryExample* result = new (ELeave) CDosFactoryExample; + + CleanupStack::PushL(result); + result->ConstructL(); + CleanupStack::Pop(); + + return result; +} + +// +// --------------------------------------------------------- +// CDosFactoryExample::ConstructL +// --------------------------------------------------------- +// +void CDosFactoryExample::ConstructL() +{ + FLOG(_L("CDosFactoryExample::ConstructL()")); +} + + +// +// --------------------------------------------------------- +// CDosFactoryExample::NewSysUtilsServiceL +// --------------------------------------------------------- +// +CDosSysUtilsBase* CDosFactoryExample::NewSysUtilsServiceL() +{ + FLOG(_L("CDosFactoryExample::NewSysUtilsServiceL()")); + + return CDosSysUtilsExample::NewL(); +} + +// +// --------------------------------------------------------- +// CDosFactoryExample::NewHelperServiceL +// --------------------------------------------------------- +// +CDosHelperBase* CDosFactoryExample::NewHelperServiceL() +{ + FLOG(_L("CDosFactoryExample::NewHelperServiceL()")); + + return CDosHelperExample::NewL(); +} + +// +// --------------------------------------------------------- +// CDosFactoryExample::NewMtcServiceL +// --------------------------------------------------------- +// +CDosMtcBase* CDosFactoryExample::NewMtcServiceL() +{ + FLOG(_L("CDosFactoryExample::NewMtcServiceL()")); + + return CDosMtcExample::NewL(); +} + +// +// --------------------------------------------------------- +// CDosFactoryExample::NewSelfTestServiceL +// --------------------------------------------------------- +// +CDosSelfTestBase* CDosFactoryExample::NewSelfTestServiceL() +{ + FLOG(_L("CDosFactoryExample::NewSelfTestServiceL()")); + + return CDosSelfTestExample::NewL(); +} + +// +// --------------------------------------------------------- +// CDosFactoryExample::NewSaeServiceL +// --------------------------------------------------------- +// +CDosSaeBase* CDosFactoryExample::NewSaeServiceL() +{ + FLOG(_L("CDosFactoryExample::NewSaeServiceL()")); + + return CDosSaeExample::NewL(); +} + +// +// --------------------------------------------------------- +// CDosFactoryExample::NewExtensionServiceL +// --------------------------------------------------------- +// +CDosExtensionBase* CDosFactoryExample::NewExtensionServiceL() +{ + FLOG(_L("CDosFactoryExample::NewExtensionServiceL()")); + + return CDosExtensionExample::NewL(); +} + +// +// --------------------------------------------------------- +// Polymorphic Dll Entry Point +// --------------------------------------------------------- +// +EXPORT_C CDosFactoryBase* LibEntryL() +{ + FLOG(_L("CDosFactoryExample::LibEntryL()")); + + return CDosFactoryExample::NewL(); +} diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/src/dsyhelper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/src/dsyhelper.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It implements the class CDosHelperExample. +* +*/ + + +#include "DsyHelper.h" +#include "DsyDebug.h" + +// +// --------------------------------------------------------- +// CDosHelperExample::NewL +// --------------------------------------------------------- +// +CDosHelperExample* CDosHelperExample::NewL() +{ + FLOG(_L("CDosHelperExample::NewL()")); + + CDosHelperExample* result = new (ELeave) CDosHelperExample; + + CleanupStack::PushL(result); + result->ConstructL(); + CleanupStack::Pop(); + + return result; +} + +// +// --------------------------------------------------------- +// CDosHelperExample::ConstructL +// --------------------------------------------------------- +// +void CDosHelperExample::ConstructL() +{ + FLOG(_L("CDosHelperExample::ConstructL()")); +} + +// +// --------------------------------------------------------- +// CDosHelperExample::GetStartupReasonL +// --------------------------------------------------------- +// +TInt CDosHelperExample::GetStartupReasonL(TInt& aReason) +{ + FLOG(_L("CDosHelperExample::GetStartupReasonL()")); + +/*Returns the Startup Reason from the DOS point of view. These are the values (defined in + startupreasons.h): + + ENormal + EAlarm + EMidnightAlarm + EHiddenReset + ECharger + ETest + ELocal + ESelftestFail + ENotReadFromHardware + ENotKnown +*/ + aReason = 0; //ENormal + + return KErrNone; +} + + +// +// --------------------------------------------------------- +// CDosHelperExample::GetSWStartupReasonL +// --------------------------------------------------------- +// +TInt CDosHelperExample::GetSWStartupReasonL(TInt16& aReason) +{ + FLOG(_L("CDosHelperExample::GetSWStartupReasonL()")); + + // provide a list with the Possible Startup Reasons + + + //Retrieve from one previousily stored in SetSWStartupReason + aReason = 100; //Normal + + + return KErrNone; +} + +// +// --------------------------------------------------------- +// CDosHelperExample::SetSWStartupReasonL +// --------------------------------------------------------- +// +TInt CDosHelperExample::SetSWStartupReasonL(TInt16 /*aReason*/) +{ + FLOG(_L("CDosHelperExample::SetSWStartupReasonL()")); + + //Store the value to be got from GetSWStartupReason + + return KErrNone; +} + + +// +// --------------------------------------------------------- +// CDosHelperExample::HiddenResetL +// --------------------------------------------------------- +// +TBool CDosHelperExample::HiddenResetL() +{ + FLOG(_L("CDosHelperExample::HiddenResetL()")); + + //Checks if the last reset was hidden or not. + return EFalse; +} + + +// +// --------------------------------------------------------- +// CDosHelperExample::GetRTCStatusL +// --------------------------------------------------------- +// +TInt CDosHelperExample::GetRTCStatusL(TBool& aStatus) +{ + FLOG(_L("CDosHelperExample::GetRTCStatusL()")); + + // EFalse asks time and date in startup + aStatus = ETrue; + + return KErrNone; +} + + +// +// --------------------------------------------------------- +// CDosHelperExample::GenerateGripEventL +// --------------------------------------------------------- +// +TInt CDosHelperExample::GenerateGripEventL() +{ + FLOG(_L("CDosHelperExample::GenerateGripEventL()")); + + return KErrNone; +} diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/src/dsymtc.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/src/dsymtc.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,221 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It implements the class CDosMtcExample. +* +*/ + + +#include "DsyMtc.h" +#include "DsyDebug.h" +#include + +_LIT( KExampleDSYMTCStateFlagFile, "KExampleDSYMTCStateFlagFile.dat"); + + +// +// --------------------------------------------------------- +// CDosMtcExample::NewL +// --------------------------------------------------------- +// +CDosMtcExample* CDosMtcExample::NewL() +{ + FLOG(_L("CDosMtcExample::NewL()")); + + CDosMtcExample* result = new (ELeave) CDosMtcExample; + + CleanupStack::PushL(result); + result->ConstructL(); + CleanupStack::Pop(); + + return result; +} + + +// +// --------------------------------------------------------- +// CDosMtcExample::ConstructL +// --------------------------------------------------------- +// +void CDosMtcExample::ConstructL() +{ + FLOG(_L("CDosMtcExample::ConstructL()")); +} + +// +// --------------------------------------------------------- +// CDosMtcExample::PowerOnL +// --------------------------------------------------------- +// +TInt CDosMtcExample::PowerOnL() +{ + FLOG(_L("CDosMtcExample::PowerOnL()")); + + return KErrNone; +} + + +// +// --------------------------------------------------------- +// CDosMtcExample::PowerOffL +// --------------------------------------------------------- +// +TInt CDosMtcExample::PowerOffL() +{ + FLOG(_L("CDosMtcExample::PowerOffL()")); + + return KErrNone; +} + + +// +// --------------------------------------------------------- +// CDosMtcExample::DosSyncL +// --------------------------------------------------------- +// +TInt CDosMtcExample::DosSyncL() +{ + FLOG(_L("CDosMtcExample::DosSyncL()")); + + return KErrNone; +} + + +// +// --------------------------------------------------------- +// CDosMtcExample::ResetGenerateL +// --------------------------------------------------------- +// +TInt CDosMtcExample::ResetGenerateL() +{ + FLOG(_L("CDosMtcExample::ResetGenerateL()")); + + return KErrNone; +} + +// +// --------------------------------------------------------- +// CDosMtcExample::SetStateL +// --------------------------------------------------------- +// +TInt CDosMtcExample::SetStateL(const TInt /*aStateType*/) +{ + FLOG(_L("CDosMtcExample::SetStateL()")); + + return KErrNone; +} + +// +// --------------------------------------------------------- +// CDosMtcExample::SetStateFlagL +// --------------------------------------------------------- +// + +TInt CDosMtcExample::SetStateFlagL(const TDosStateFlag aFlag) +{ + FLOG(_L("CDosMtcExample::SetStateFlagL() - Write state to disk")); + + RFs fsSession; + TInt err = fsSession.Connect(); + + if ( err == KErrNone ) + { + RFile file; + err = file.Open( fsSession, KExampleDSYMTCStateFlagFile, EFileWrite); + + if ( err == KErrNotFound) // file does not exist - create it + { + err = file.Create( fsSession, KExampleDSYMTCStateFlagFile, EFileWrite); + FLOG(_L("CDosMtcExample::SetStateFlagL() - file doesn't exist, create file")); + } + + if ( err == KErrNone ) + { + // write stateflag to disk + TBuf8<1> buf; + buf.Append((TInt8)aFlag); + err = file.Write( buf, 1); + } + + //close file + file.Close(); + } + + if ( err != KErrNone) // file does not exist or read fails - aFlag is EDosOfflineStateFlagFalse and return + { + FLOG(_L("CDosMtcExample::SetStateFlagL() - flag value write fails")); + } + + //close session + fsSession.Close(); + + return KErrNone; +} + + +// +// --------------------------------------------------------- +// CDosMtcExample::GetStateFlagL +// +// --------------------------------------------------------- +// + + +TInt CDosMtcExample::GetStateFlagL(TDosStateFlag& aFlag) +{ + FLOG(_L("CDosMtcExample::GetStateFlagL() - Read state from disk")); + + // set default value + aFlag = EDosOfflineStateFlagFalse; + + RFs fsSession; + TInt err = fsSession.Connect(); + + if ( err == KErrNone ) + { + RFile file; + err = file.Open( fsSession, KExampleDSYMTCStateFlagFile, EFileRead); + + if ( err == KErrNone ) + { + // read stateflag status from disk + TBuf8<1> buf(1); + err = file.Read( buf, 1); + if ( err == KErrNone && buf.Size() > 0) + { + if ( buf[0] == (TInt8)EDosOfflineStateFlagTrue ) + { + aFlag = EDosOfflineStateFlagTrue; + } + } + } + + //close file + file.Close(); + } + + + if ( err != KErrNone) // file does not exist or read fails - aFlag is EDosOfflineStateFlagFalse and return + { + FLOG(_L("CDosMtcExample::GetStateFlagL() - file read fails, default value EDosOfflineStateFlagFalse returned")); + } + + + // close session + fsSession.Close(); + + return KErrNone; +} + + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/src/dsysae.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/src/dsysae.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It implements the class CDosSaeExample. +* +*/ + + +#include +#include "DosEventManager.h" +#include "DsySae.h" +#include "DsyDebug.h" + +// +// --------------------------------------------------------- +// CDosSaeExample::NewL +// --------------------------------------------------------- +// +CDosSaeExample* CDosSaeExample::NewL() +{ + FLOG(_L("CDosSaeExample::NewL()")); + + CDosSaeExample* result = new (ELeave) CDosSaeExample; + + CleanupStack::PushL(result); + result->ConstructL(); + CleanupStack::Pop(); + + return result; +} + + +// +// --------------------------------------------------------- +// CDosSaeExample::ConstructL +// --------------------------------------------------------- +// +void CDosSaeExample::ConstructL() +{ + FLOG(_L("CDosSaeExample::ConstructL()")); +} + + +// +// --------------------------------------------------------- +// CDosSaeExample::StartSaeL +// --------------------------------------------------------- +// +TInt CDosSaeExample::StartSaeL() +{ + FLOG(_L("CDosSaeExample::StartSaeL()")); + + EventManager()->PhonePowerOn(); + EventManager()->SimState(ESimStateOk); + EventManager()->SecurityCode(EPSSecurityCodeNotRequired); + EventManager()->SimPresentStateChangedL(ESimPresentTrue); + + return KErrNone; +} + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/src/dsyselftest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/src/dsyselftest.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It implements the class CDosSelfTestExample. +* +*/ + + +#include "DsySelfTest.h" +#include "DosEventManager.h" +#include "DsyDebug.h" + +// +// --------------------------------------------------------- +// CDosSelfTestExample::NewL +// --------------------------------------------------------- +// +CDosSelfTestExample* CDosSelfTestExample::NewL() +{ + FLOG(_L("CDosSelfTestExample::NewL()")); + + CDosSelfTestExample* result = new (ELeave) CDosSelfTestExample; + + CleanupStack::PushL(result); + result->ConstructL(); + CleanupStack::Pop(); + + return result; +} + + +// +// --------------------------------------------------------- +// CDosSelfTestExample::ConstructL +// --------------------------------------------------------- +// +void CDosSelfTestExample::ConstructL() +{ + FLOG(_L("CDosSelfTestExample::ConstructL()")); +} + + +// +// --------------------------------------------------------- +// CDosSelfTestExample::PerformSelfTestL +// --------------------------------------------------------- +// +TInt CDosSelfTestExample::PerformSelfTestL() +{ + FLOG(_L("CDosSelfTestExample::PerformSelfTestL()")); + EventManager()->NotifySelfTestStatus(3); //EStartupSTOk = 3 + return KErrNone; +} diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/exampledsy/src/dsysysutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/exampledsy/src/dsysysutils.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It implements the class CDosSysUtilsExample. +* +*/ + + +#include "DsySysUtils.h" +#include "DsyDebug.h" + +// +// --------------------------------------------------------- +// CDosSysUtilsExample::NewL +// --------------------------------------------------------- +// +CDosSysUtilsExample* CDosSysUtilsExample::NewL() +{ + FLOG(_L("CDosSysUtilsExample::NewL()")); + + CDosSysUtilsExample* result = new (ELeave) CDosSysUtilsExample; + + CleanupStack::PushL(result); + result->ConstructL(); + CleanupStack::Pop(); + + return result; +} + + +// +// --------------------------------------------------------- +// CDosSysUtilsExample::ConstructL +// --------------------------------------------------------- +// +void CDosSysUtilsExample::ConstructL() +{ + FLOG(_L("CDosSysUtilsExample::ConstructL()")); +} + +// +// --------------------------------------------------------- +// CDosSysUtilsExample::GetSimLanguageL +// --------------------------------------------------------- +// +TInt CDosSysUtilsExample::GetSimLanguageL(TInt& aSimLanguage) +{ + FLOG(_L("CDosSysUtilsExample::GetSimLanguageL()")); + + //Checks the default language in the SIM card and returns it. + + aSimLanguage = 1; + + return KErrNone; +} + +// +// --------------------------------------------------------- +// CDosSysUtilsExample::PerformDosRfsL +// --------------------------------------------------------- +// +void CDosSysUtilsExample::PerformDosRfsL(TUint /*aReason*/, const RMessagePtr2 aMessage) +{ + FLOG(_L("CDosSysUtilsExample::PerformDosRfsL()")); + + RequestComplete(aMessage,KErrNone); +} + + +// +// --------------------------------------------------------- +// CDosSysUtilsExample::SetDosAlarmL +// --------------------------------------------------------- +// +TInt CDosSysUtilsExample::SetDosAlarmL(TTime* /*aAlarmTime*/) +{ + FLOG(_L("CDosSysUtilsExample::SetDosAlarmL()")); + + return KErrNone; +} + + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +#include "../ddcaccessstub/group/bld.inf" +#include "../TVOutConfig/group/bld.inf" +#include "../accessorypolicyreference/group/bld.inf" +#include "../asyreference/group/bld.inf" +#include "../examplecommonisc/group/bld.inf" +#include "../exampledsy/group/bld.inf" +#include "../featuremanagerstub/group/bld.inf" +#include "../hwrmstubplugins/group/bld.inf" +#include "../hwrmhapticsstubplugin/group/bld.inf" +#include "../sensorchannelsreference/group/bld.inf" +#include "../ssyreference/group/bld.inf" +#include "../startupadaptationstub/group/bld.inf" +#include "../tiltcompensationstub/group/bld.inf" +#include "../tvoutbehaviour/group/bld.inf" +#include "../wiredbearerreference/group/bld.inf" + +PRJ_TESTMMPFILES + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/data/10205040.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/data/10205040.rss Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware Resource Manager stub plugins ECom resource file +* +*/ + + +#include "ecom/registryinfov2.rh" + +// Declares info for two implementations +RESOURCE REGISTRY_INFO theInfo + { + // UID for the DLL. See HWRMStubPlugins.mmp + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x10205040; + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = 0x10205028; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x1020503F; + version_no = 1; + display_name = "Light plugin stub"; + default_data = "HWRMLight"; + opaque_data = ""; + rom_only = 1; + }, + IMPLEMENTATION_INFO + { + implementation_uid = 0x1020503E; + version_no = 1; + display_name = "Vibra plugin stub"; + default_data = "HWRMVibra"; + opaque_data = ""; + rom_only = 1; + }, + IMPLEMENTATION_INFO + { + implementation_uid = 0x2000BF15; + version_no = 1; + display_name = "Fmtx plugin stub"; + default_data = "HWRMFmTx"; + opaque_data = ""; + rom_only = 1; + } + }; + }, + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = 0x10205042; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x1020503D; + version_no = 1; + display_name = "Power State Test plugin"; + default_data = "HWRMPowerState"; + opaque_data = ""; + rom_only = 1; + } + }; + } + }; + } \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/data/HWRMLightsPolicy.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/data/HWRMLightsPolicy.ini Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +// This is product specific policy file for lights. +// Products need to include this in builds, +// if required. +// This empty file is exported by hwrmstubplugins diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/data/HWRMVibraPolicy.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/data/HWRMVibraPolicy.ini Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,9 @@ +// This is product specific policy file for vibra. +// Products need to include this in builds, +// if required. +// This empty file is exported by hwrmstubplugins + +// Devsound adaptation SID should be added here with high priority, +// For example, assuming devsound SID is 0x12345678, add row: +// 10 0x12345678 + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/group/HWRMStubPlugins.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/group/HWRMStubPlugins.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware Resource Manager stub plugins Project definition file +* +*/ + + +#include + +TARGET HWRMStubPlugins.dll +TARGETTYPE PLUGIN + +UID 0x10009D8D 0x10205040 + +VENDORID VID_DEFAULT + +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../src +SOURCE proxy.cpp +SOURCE LightPlugin.cpp +SOURCE VibraPlugin.cpp +SOURCE PluginTimer.cpp +SOURCE PowerStatePlugin.cpp +SOURCE FmtxPlugin.cpp + +START RESOURCE ../data/10205040.rss +TARGET HWRMStubPlugins.rsc +END + +USERINCLUDE ../inc +OS_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib + +LANG SC + +// Trace macros +//MACRO API_TRACE_FLAG // Uncomment during testing to get API traces. +//MACRO COMPONENT_TRACE_FLAG // Uncomment during testing to get COMPONENT traces. + +// Test macro +//MACRO ENABLE_NOTIFICATIONS // Uncomment during testing to receive periodic notifications + +//MACRO PUBLISH_STATE_INFO // Uncomment before running HWRM module tests to get proper results diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware Resource Manager stub plugins bld file +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../data/HWRMLightsPolicy.ini /epoc32/RELEASE/winscw/UDEB/Z/private/101f7a02/HWRMLightsPolicy.ini +../data/HWRMVibraPolicy.ini /epoc32/RELEASE/winscw/UDEB/Z/private/101f7a02/HWRMVibraPolicy.ini +../data/HWRMLightsPolicy.ini /epoc32/RELEASE/winscw/UREL/Z/private/101f7a02/HWRMLightsPolicy.ini +../data/HWRMVibraPolicy.ini /epoc32/RELEASE/winscw/UREL/Z/private/101f7a02/HWRMVibraPolicy.ini +../rom/HWRMStubPlugins.iby CORE_IBY_EXPORT_PATH(stubs,HWRMStubPlugins.iby) + +PRJ_MMPFILES +../group/HWRMStubPlugins.mmp + + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/inc/FmtxPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/inc/FmtxPlugin.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware Resource Manager stub plugins fmtx plugin +* implementation. +* +*/ + + +#ifndef __FMTXPLUGIN_H_ +#define __FMTXPLUGIN_H_ + +#include +#include +#include "PluginTimer.h" + +#ifdef PUBLISH_STATE_INFO +#include +const TUint32 KHWRMTestFmtxCommand = 0x44440001; +const TUint32 KHWRMTestFmtxDataPckg = 0x44440002; +#endif // PUBLISH_STATE_INFO + +class CPluginTimer; + +class CFmtxPlugin : public CHWRMPluginService, + public MPluginTimerCallback + { + public: + + static CFmtxPlugin* NewL(); + ~CFmtxPlugin(); + + /** + * Method to invoke a particular command in the plugin + * @param aCommandId Command ID + * @param aTransId Transaction ID + * @param aData Data associated with command + */ + virtual void ProcessCommandL(const TInt aCommandId, + const TUint8 aTransId, + TDesC8& aData); + + /** + * Method to cancel a particular command + * @param aTransId Transaction ID + * @param aCommandId Command ID to optionally double check with the + * transaction ID + */ + virtual void CancelCommandL(const TUint8 aTransId, + const TInt aCommandId); + + // From MPluginTimerCallback + void GenericTimerFired(MHWRMPluginCallback* aService, + const TInt aCommandId, + const TUint8 aTransId, + TInt aRetVal); + + private: // Construction + + CFmtxPlugin(); + void ConstructL(); + + TInt CheckFrequencyWithinRange(TDesC8& aData); + + RPointerArray iTimers; + +#ifdef PUBLISH_STATE_INFO + RProperty iCmdProperty; // for publishing command ID + RProperty iDataProperty; // for publishing data +#endif // PUBLISH_STATE_INFO + + HWRMFmTxCommand::TFmTxCmd iLastCommand; // the on-going command, if any + + HWRMFmTxCommand::TFmTxHwState iHwState; // the current hardware state + + TInt iFrequency; // the requested frequency + + TInt iStatusIndTransId; // the trans ID of last status indication request + + // RSSI scanning + TInt iChannelsRequested; // the number of clear frequencies requested + TUint32 iClearFrequency; // for returning scan responses + + TBuf<1024> iBuf; + }; + +#endif /* __FMTXPLUGIN_H_ */ diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/inc/LightPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/inc/LightPlugin.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware Resource Manager stub plugins Light plugin header +* +*/ + + +#ifndef __LIGHTPLUGIN_H_ +#define __LIGHTPLUGIN_H_ + +#include +#include "PluginTimer.h" + +#ifdef PUBLISH_STATE_INFO +#include +#include + +// Each target has own set of these two keys +// Bytes 2-4 contain target >-----------------------vvv +const TUint32 KHWRMTestLightCommand = 0x00000001; +const TUint32 KHWRMTestLightDataPckg = 0x00000002; + +const TUint32 KHWRMTestLightIntensityValue = 0x10000007; +const TUint32 KHWRMTestLightSensitivityValue = 0x10000008; + +const TInt KHWRMLightMaxTargets(4); +#endif // PUBLISH_STATE_INFO + +class CPluginTimer; + +class CLightPlugin : public CHWRMPluginService, + public MPluginTimerCallback + { + public: + + static CLightPlugin* NewL(); + virtual ~CLightPlugin(); + + /** + * Method to invoke a particular command in the plugin + * @param aCommandId Command ID + * @param aTransId Transaction ID + * @param aData Data associated with command + */ + virtual void ProcessCommandL( const TInt aCommandId, + const TUint8 aTransId, + TDesC8& aData ); + + /** + * Method to cancel a particular command + * @param aTransId Transaction ID + * @param aCommandId Command ID to optionally double check with the + * transaction ID + */ + virtual void CancelCommandL( const TUint8 aTransId, + const TInt aCommandId); + + // From MPluginTimerCallback + void GenericTimerFired(MHWRMPluginCallback* aService, + const TInt aCommandId, + const TUint8 aTransId, + TInt aRetVal); + + private: // Construction + + CLightPlugin(); + void ConstructL(); + + RPointerArray iTimers; + +#ifdef PUBLISH_STATE_INFO + void PublishStateInfo(TInt aTargetMask, + const TInt aCommandId, + TDesC8& aData ); + RProperty iCmdProperty[KHWRMLightMaxTargets]; // for publishing command ID + RProperty iDataProperty[KHWRMLightMaxTargets]; // for publishing data + RProperty iIntensityProperty; + RProperty iSensitivityProperty; + TInt iDefaultIntensity; +#endif // PUBLISH_STATE_INFO + + + }; + +#endif // __LIGHTPLUGIN_H_ \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/inc/PluginTimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/inc/PluginTimer.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware Resource Manager stub plugins timer definition +* +*/ + + + +#ifndef __PLUGINTIMER_H_ +#define __PLUGINTIMER_H_ + +#include + +/** +* An interface for handling timer expiration events. +*/ +class MPluginTimerCallback + { + public: + /** + * Called when the timer fires + */ + virtual void GenericTimerFired(MHWRMPluginCallback* aService, + TInt aCommandId, + TUint8 aTransId, + TInt aRetVal) = 0; + }; + + +class CPluginTimer : public CTimer + { + public: + CPluginTimer(TInt aPriority, + MHWRMPluginCallback* aService, + TInt aCommandId, + TUint8 aTransId, + TInt aRetVal, + MPluginTimerCallback* aCallback + ); + + ~CPluginTimer(); + + CPluginTimer(TInt aPriority); + + static CPluginTimer* NewL(const TTimeIntervalMicroSeconds32& anInterval, + MHWRMPluginCallback* aService, + TInt aCommandId, + TUint8 aTransId, + TInt aRetVal, + MPluginTimerCallback* aCallback); + + void ConstructL(); + + void RunL(); + + inline TUint8 TransId() const + { + return iTransId; + }; + + private: + + MHWRMPluginCallback* iService; // Not owned + + TInt iCommandId; + TUint8 iTransId; + TInt iRetVal; + + MPluginTimerCallback* iCallback; // Not owned + + }; + + +#endif // __PLUGINTIMER_H_ \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/inc/PowerStatePlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/inc/PowerStatePlugin.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware Resource Manager stub plugins PowerState plugin header +* +*/ + + +#ifndef __POWERSTATEPLUGIN_H_ +#define __POWERSTATEPLUGIN_H_ + +#include + + +class CPowerStatePlugin : public CHWRMPowerStatePlugin + { + public: + + static CPowerStatePlugin* NewL(); + ~CPowerStatePlugin(); + + // Callback used by CPeriodic + static TInt Callback(TAny* aPtr); + + private: // Construction + + CPowerStatePlugin(); + void ConstructL(); + + // Helper to increment the key and/or the value + // to cover all cases. + void IncrementKeyAndValue(); + + // Timer used to fire notifications + CPeriodic* iPeriodic; + + // key name for next notification + TUint32 iKey; + // Value for key + TInt iKeyValue; + }; + +#endif // __POWERSTATEPLUGIN_H_ \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/inc/Trace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/inc/Trace.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is debug macro definition file for HWRM +* +*/ + + +#ifndef TRACE_H +#define TRACE_H + +// INCLUDES +#include + +// PC-LINT OPTIONS +// Removes null statement not in line by itself warnings from +// COMPONENT_TRACE macros +//lint -esym(960,54) + +// Removes "area too small" pointer cast warnings. +//lint -e826 + + + +// CONSTANTS +// MACROS +#ifdef _DEBUG + + #ifdef COMPONENT_TRACE_FLAG + + #define COMPONENT_TRACE( a ) RDebug::Print a + + #else // #ifdef COMPONENT_TRACE_FLAG + + #define COMPONENT_TRACE( a ) + + #endif //#ifdef COMPONENT_TRACE_FLAG + + #ifdef API_TRACE_FLAG + + #define API_TRACE( a ) RDebug::Print a + + #else //#ifdef API_TRACE_FLAG + + #define API_TRACE( a ) + + #endif //#ifdef API_TRACE_FLAG + +#else // #ifdef _DEBUG + + #define COMPONENT_TRACE( a ) + #define API_TRACE( a ) + +#endif //#ifdef _DEBUG + + +// DATA TYPES +// FUNCTION PROTOTYPES +// FORWARD DECLARATIONS + +#endif //#ifndef TRACE_H + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/inc/VibraPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/inc/VibraPlugin.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware Resource Manager stub plugins Vibra plugin header +* +*/ + + +#ifndef __VIBRAPLUGIN_H_ +#define __VIBRAPLUGIN_H_ + +#include +#include "PluginTimer.h" + +#ifdef PUBLISH_STATE_INFO +#include +#include +const TUint32 KHWRMTestVibraCommand = 0x11110001; +const TUint32 KHWRMTestVibraDataPckg = 0x11110002; +#endif // PUBLISH_STATE_INFO + +class CPluginTimer; + +class CVibraPlugin : public CHWRMPluginService, + public MPluginTimerCallback + { + public: + + static CVibraPlugin* NewL(); + ~CVibraPlugin(); + + /** + * Method to invoke a particular command in the plugin + * @param aCommandId Command ID + * @param aTransId Transaction ID + * @param aData Data associated with command + */ + virtual void ProcessCommandL( const TInt aCommandId, + const TUint8 aTransId, + TDesC8& aData ); + + /** + * Method to cancel a particular command + * @param aTransId Transaction ID + * @param aCommandId Command ID to optionally double check with the + * transaction ID + */ + virtual void CancelCommandL( const TUint8 aTransId, + const TInt aCommandId); + + // From MPluginTimerCallback + void GenericTimerFired(MHWRMPluginCallback* aService, + const TInt aCommandId, + const TUint8 aTransId, + TInt aRetVal); + + private: // Construction + + CVibraPlugin(); + void ConstructL(); + + RPointerArray iTimers; + +#ifdef PUBLISH_STATE_INFO + RProperty iCmdProperty; // for publishing command ID + RProperty iDataProperty; // for publishing data +#endif // PUBLISH_STATE_INFO + + }; + +#endif // __VIBRAPLUGIN_H_ \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/rom/HWRMStubPlugins.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/rom/HWRMStubPlugins.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: HWRMStubPlugins provide dummy implementation for emulator +* environment to be used instead of proper HWRM plugins. +* +*/ + + +#ifndef __HWRMSTUBPLUGINS_IBY__ +#define __HWRMSTUBPLUGINS_IBY__ + +ECOM_PLUGIN( HWRMStubPlugins.dll , 10205040.rsc ) + +#endif // __HWRMSTUBPLUGINS_IBY__ + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/src/FmtxPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/src/FmtxPlugin.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,528 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware Resource Manager stub plugins fmtx plugin +* implementation. +* +*/ + + + +#include +#include "FmtxPlugin.h" +#include "PluginTimer.h" +#include "Trace.h" + +const TUint32 KFmTxStubPluginFreqMax = 107900; // KHz +const TUint32 KFmTxStubPluginFreqMin = 88100; // KHz +const TUint32 KFmTxStubPluginStepSize = 50; // KHz +const TInt KMaxLengthMarker = 63; + +#ifdef PUBLISH_STATE_INFO +const TUid KPSUidHWResourceNotification = {0x101F7A01}; // HWRM private PS Uid +#endif /* PUBLISH_STATE_INFO */ + + +CFmtxPlugin* CFmtxPlugin::NewL() + { + COMPONENT_TRACE(( _L("CFmtxPlugin::NewL()") )); + + CFmtxPlugin* self = new(ELeave) CFmtxPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + + +CFmtxPlugin::~CFmtxPlugin() + { + COMPONENT_TRACE(( _L("CFmtxPlugin::~CFmtxPlugin()") )); + + iTimers.ResetAndDestroy(); +#ifdef PUBLISH_STATE_INFO + iCmdProperty.Close(); + iDataProperty.Close(); +#endif /* PUBLISH_STATE_INFO */ + } + + +CFmtxPlugin::CFmtxPlugin() : iLastCommand(HWRMFmTxCommand::ENoCommandId), + iHwState(HWRMFmTxCommand::EFmTxHwStateOff), + iClearFrequency(KFmTxStubPluginFreqMin) + { + COMPONENT_TRACE(( _L("CFmtxPlugin::CFmtxPlugin()") )); + } + + +void CFmtxPlugin::ConstructL() + { + COMPONENT_TRACE(( _L("CFmtxPlugin::ConstructL") )); + +#ifdef PUBLISH_STATE_INFO + RProperty::Define(KPSUidHWResourceNotification, KHWRMTestFmtxCommand, RProperty::EInt); + RProperty::Define(KPSUidHWResourceNotification, KHWRMTestFmtxDataPckg, RProperty::EByteArray, 512); + iCmdProperty.Attach(KPSUidHWResourceNotification, KHWRMTestFmtxCommand); + iDataProperty.Attach(KPSUidHWResourceNotification, KHWRMTestFmtxDataPckg); +#endif /* PUBLISH_STATE_INFO */ + } + + +TInt CFmtxPlugin::CheckFrequencyWithinRange(TDesC8& aData) + { + HWRMFmTxCommand::TSetFrequencyPackage pckg; + pckg.Copy(aData); + TInt frequency = pckg(); + + if ( frequency < KFmTxStubPluginFreqMin || + frequency > KFmTxStubPluginFreqMax ) + { + COMPONENT_TRACE((_L("CFmtxPlugin::CheckFrequencyWithinRange, frequency %d is out of range"), frequency)); + return KErrArgument; + } + else + { + iFrequency = frequency; + return KErrNone; + } + } + + +void CFmtxPlugin::ProcessCommandL(const TInt aCommandId, + const TUint8 aTransId, + TDesC8& aData) + { + COMPONENT_TRACE((_L("CFmtxPlugin::ProcessCommandL, command: 0x%x, TransId: 0x%x"), aCommandId, aTransId)); + + TInt retVal(KErrNone); + + switch (aCommandId) + { + case HWRMFmTxCommand::ETxOnCmdId: + { + COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ETxOnCmdId")); + + // check TSetFrequencyPackage param + if ( iHwState != HWRMFmTxCommand::EFmTxHwStateOff ) + { + retVal = KErrInUse; + } + else + { + retVal = CheckFrequencyWithinRange(aData); + } + } + break; + + case HWRMFmTxCommand::ETxOffCmdId: + { + COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ETxOffCmdId")); + + if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOff ) + { + retVal = KErrNotReady; + } + } + break; + + case HWRMFmTxCommand::ESetTxFrequencyCmdId: + { + COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ESetTxFrequencyCmdId")); + + if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn ) + { + // check TSetFrequencyPackage param + retVal = CheckFrequencyWithinRange(aData); + } + else + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState)); + retVal = KErrNotReady; + } + } + break; + + case HWRMFmTxCommand::ETxScanRequestCmdId: + { + COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ETxScanRequestCmdId")); + + if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn ) + { + // check TScanRequestPackage param + HWRMFmTxCommand::TScanRequestPackage pckg; + pckg.Copy(aData); + TUint channelsRequested = pckg(); + if( channelsRequested > 10 ) + { + // Should not come here because input verified in client end + retVal = KErrArgument; + } + iChannelsRequested = ( channelsRequested <= 10 ) ? channelsRequested : 10; + } + else + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState)); + retVal = KErrNotReady; + } + } + break; + + case HWRMFmTxCommand::EGetTxFrequencyRangeCmdId: + { + COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed EGetTxFrequencyRangeCmdId")); + + // No params to check + } + break; + + case HWRMFmTxCommand::ESetTxRdsPsCmdId: + { + COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ESetTxRdsPsCmdId")); + + if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn ) + { + // check TRdsPsPackage param + } + else + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState)); + retVal = KErrNotReady; + } + } + break; + + case HWRMFmTxCommand::ESetTxRdsPtyCmdId: + { + COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ESetTxRdsPtyCmdId")); + + if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn ) + { + // Check TRdsPtyPackage param + HWRMFmTxCommand::TRdsPtyPackage pckg; + pckg.Copy(aData); + TInt programType = pckg(); + const TInt KRdsPtyFirst = 0; + const TInt KRdsPtyLast = 31; + + if( programType < KRdsPtyFirst || programType > KRdsPtyLast ) + { + // Should not come here because input verified in client end + retVal = KErrArgument; + } + } + else + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState)); + retVal = KErrNotReady; + } + } + break; + + case HWRMFmTxCommand::ESetTxRdsPtynCmdId: + { + COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ESetTxRdsPtynCmdId")); + + if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn ) + { + // Check TRdsPtynPackage param + HWRMFmTxCommand::TRdsPtynPackage pckg; + pckg.Copy(aData); + HWRMFmTxCommand::TRdsPtyn prgTypeName = pckg(); + const TInt KMaxRdsPtynLength = 8; + if( prgTypeName.Length() > KMaxRdsPtynLength ) + { + // Should not come here because input verified in client end + retVal = KErrArgument; + } + } + else + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState)); + retVal = KErrNotReady; + } + } + break; + + case HWRMFmTxCommand::ESetTxRdsMsCmdId: + { + COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ESetTxRdsMsCmdId")); + + if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn ) + { + // No params to check + } + else + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState)); + retVal = KErrNotReady; + } + } + break; + + case HWRMFmTxCommand::ESetTxRdsLangIdCmdId: + { + COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ESetTxRdsLangIdCmdId")); + + if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn ) + { + // Check TRdsLangIdPackage param + HWRMFmTxCommand::TRdsLangIdPackage pckg; + pckg.Copy(aData); + TInt languageId = pckg(); + const TInt KRdsLanguageFirst = 0x00; + const TInt KRdsLanguageLast = 0x7F; + + if( languageId < KRdsLanguageFirst || languageId > KRdsLanguageLast ) + { + // Should not come here because input verified in client end + User::Leave(KErrArgument); + } + } + else + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState)); + retVal = KErrNotReady; + } + } + break; + + case HWRMFmTxCommand::ESetTxRtCmdId: + { + COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ESetTxRtCmdId")); + + if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn ) + { + // Check TRtPackage params + HWRMFmTxCommand::TRtPackage pckg; + pckg.Copy(aData); + HWRMFmTxCommand::TRtData rtData = pckg(); + + if( rtData.iTag1.iContentType > KMaxLengthMarker || rtData.iTag2.iContentType > KMaxLengthMarker || + rtData.iTag1.iLengthMarker > KMaxLengthMarker || rtData.iTag2.iLengthMarker > KMaxLengthMarker ) + { + retVal = KErrArgument; + } + } + else + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState)); + retVal = KErrNotReady; + } + } + break; + + case HWRMFmTxCommand::EClearTxRtCmdId: + { + COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed EClearTxRtCmdId")); + + if ( iHwState != HWRMFmTxCommand::EFmTxHwStateOn ) + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState)); + retVal = KErrNotReady; + } + // No params to check + } + break; + + case HWRMFmTxCommand::ENoCommandId: // fall through + default : + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: Unknown Command: 0x%x"), aCommandId)); + } + break; + } + + // Check for concurrent requests. Scan request (ETxScanRequestCmdId) may precede + // set frequency (ESetTxFrequencyCmdId), because it is handled as a split command. + if ( iLastCommand != HWRMFmTxCommand::ENoCommandId && + !(iLastCommand == HWRMFmTxCommand::ETxScanRequestCmdId && aCommandId == HWRMFmTxCommand::ESetTxFrequencyCmdId) ) + { + COMPONENT_TRACE(_L("HWRM FmtxPlugin: Not ready due to concurrent command")); + retVal = KErrNotReady; + } + iLastCommand = static_cast(aCommandId); + + TInt timeout(500); // microseconds + + // Increase timeout for scan requests + if (HWRMFmTxCommand::ETxScanRequestCmdId == aCommandId) + { + timeout = 2*1000*1000; // 2 seconds + } + +#ifdef PUBLISH_STATE_INFO + // publish + iCmdProperty.Set(aCommandId); + iDataProperty.Set(aData); +#endif /* PUBLISH_STATE_INFO */ + + // create new timer + CPluginTimer* timer = CPluginTimer::NewL(timeout, iResponseCallback, aCommandId, aTransId, retVal, this); + CleanupStack::PushL(timer); + iTimers.AppendL(timer); + CleanupStack::Pop(timer); + + COMPONENT_TRACE((_L("HWRM FmtxPlugin: Processing command - return"))); + } + + +void CFmtxPlugin::CancelCommandL(const TUint8 aTransId, +#if defined(_DEBUG) && defined(COMPONENT_TRACE_FLAG) + const TInt aCommandId) +#else + const TInt /*aCommandId*/) +#endif + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: Cancelling command: 0x%x, TransId: 0x%x"), aCommandId, aTransId)); + COMPONENT_TRACE((_L("HWRM FmtxPlugin: Cancelling command - iTimers.Count(): %d "), iTimers.Count())); + + for( TInt i = 0; i < iTimers.Count(); i++ ) + { + if ( iTimers[i]->TransId() == aTransId ) + { + delete iTimers[i]; + iTimers.Remove(i); + COMPONENT_TRACE((_L("HWRM FmtxPlugin: Cancelling command - Removed command: 0x%x, TransId: 0x%x"), aCommandId, aTransId)); + break; + } + } + + if ( iTimers.Count() == 0 ) + { + // no more commands on-going + iLastCommand = HWRMFmTxCommand::ENoCommandId; + } + } + +void CFmtxPlugin::GenericTimerFired(MHWRMPluginCallback* aService, + TInt aCommandId, + const TUint8 aTransId, + TInt aRetVal) + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: GenericTimerFired (0x%x, 0x%x, %d)"), aCommandId, aTransId, aRetVal)); + + __ASSERT_ALWAYS(aService != NULL, User::Invariant() ); + + TInt err = KErrNone; + + HWRMFmTxCommand::TFmTxHwState tempState = HWRMFmTxCommand::EFmTxHwStateOff; + + switch (aCommandId) + { + case HWRMFmTxCommand::EGetTxFrequencyRangeCmdId: + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: Returning freq range"))); + HWRMFmTxCommand::TFrequencyRangeData freqRange; + freqRange.iErrorCode = KErrNone; + freqRange.iMinFrequency = KFmTxStubPluginFreqMin; + freqRange.iMaxFrequency = KFmTxStubPluginFreqMax; + freqRange.iStepSize = KFmTxStubPluginStepSize; + HWRMFmTxCommand::TFrequencyRangePackage freqRangePckg(freqRange); + TRAP(err, aService->ProcessResponseL(aCommandId, aTransId, freqRangePckg)); + } + break; + + case HWRMFmTxCommand::ETxScanRequestCmdId: + { + HWRMFmTxCommand::TScanResponseData scanData; + scanData.iErrorCode = aRetVal; + if ( aRetVal == KErrNone ) + { + if ( (iClearFrequency += KFmTxStubPluginStepSize) > KFmTxStubPluginFreqMax ) + { + iClearFrequency = KFmTxStubPluginFreqMin; + } + scanData.iErrorCode = KErrNone; + scanData.iFrequenciesFound = iChannelsRequested; + TUint32 clearFrequency = iClearFrequency; + for(TInt i=0; i KFmTxStubPluginFreqMax ) + { + clearFrequency = KFmTxStubPluginFreqMin; + } + } + COMPONENT_TRACE((_L("HWRM FmtxPlugin: Returning 1 clear frequency"))); + } + else + { + scanData.iFrequenciesFound = 0; + COMPONENT_TRACE((_L("HWRM FmtxPlugin: Returning 0 clear frequencies"))); + } + HWRMFmTxCommand::TScanResponsePackage scanPckg(scanData); + TRAP(err, aService->ProcessResponseL(aCommandId, aTransId, scanPckg)); + } + break; + + case HWRMFmTxCommand::ETxOnCmdId: // fall through + case HWRMFmTxCommand::ESetTxFrequencyCmdId: + tempState = HWRMFmTxCommand::EFmTxHwStateOn; // fall through + case HWRMFmTxCommand::ETxOffCmdId: + { + if ( aRetVal == KErrNone) + { + iHwState = tempState; + + if ( iStatusIndTransId ) // if request successful, and status indication has been requested + { + // also send frequency/state changed indications for these + COMPONENT_TRACE((_L("HWRM FmtxPlugin: sending status indication"))); + HWRMFmTxCommand::TFmTxStatusData statusData; + statusData.state = tempState; + statusData.frequency = iFrequency; + HWRMFmTxCommand::TStatusIndicationPackage statusIndPckg(statusData); + TInt tempTransId = iStatusIndTransId; // status indication may be reissued immediately... + iStatusIndTransId = 0; // ...so null here first + TRAP(err, aService->ProcessResponseL(HWRMFmTxCommand::ETxStatusIndId, tempTransId, statusIndPckg)); + if ( err != KErrNone ) + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: Error sending status indication"))); + } + } + } + } // fall through + + case HWRMFmTxCommand::ESetTxRdsPsCmdId: + case HWRMFmTxCommand::ESetTxRtCmdId: + default : + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: Returning error code %d, Command: 0x%x"), aRetVal, aCommandId)); + HWRMFmTxCommand::TErrorCodeResponsePackage retvalPackage(aRetVal); + TRAP(err, aService->ProcessResponseL(aCommandId, aTransId, retvalPackage)); + } + break; + } + + if ( err != KErrNone ) + { + COMPONENT_TRACE((_L("HWRM FmtxPlugin: Error in ProcessResponseL: %d"), err)); + } + + // delete obsolete timers + for( TInt i = (iTimers.Count()-1); i > -1 ; i-- ) + { + if ( !iTimers[i]->IsActive() ) + { + delete iTimers[i]; + iTimers.Remove(i); + COMPONENT_TRACE((_L("HWRM FmtxPlugin: GenericTimerFired - Removed obsolete timer"))); + } + } + + if ( iTimers.Count() == 0 ) + { + // no more commands on-going + iLastCommand = HWRMFmTxCommand::ENoCommandId; + } + } diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/src/LightPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/src/LightPlugin.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,270 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware Resource Manager stub plugins light plugin +* implementation. +* +*/ + + +#include "LightPlugin.h" +#include +#include "PluginTimer.h" +#include "Trace.h" + +#ifdef PUBLISH_STATE_INFO +const TUid KPSUidHWResourceNotification = {0x101F7A01}; // HWRM private PS Uid +#endif // PUBLISH_STATE_INFO + +CLightPlugin* CLightPlugin::NewL() + { + CLightPlugin* self = new(ELeave) CLightPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +CLightPlugin::~CLightPlugin() + { + iTimers.ResetAndDestroy(); +#ifdef PUBLISH_STATE_INFO + for ( TInt i=0; i< KHWRMLightMaxTargets; i++ ) + { + iCmdProperty[i].Close(); + iDataProperty[i].Close(); + } + iIntensityProperty.Close(); + iSensitivityProperty.Close(); +#endif // PUBLISH_STATE_INFO + } + +CLightPlugin::CLightPlugin() + { + } + +void CLightPlugin::ConstructL() + { +#ifdef PUBLISH_STATE_INFO + TInt currentTarget(0x00010000); + for ( TInt i=0; i< KHWRMLightMaxTargets; i++ ) + { + RProperty::Define(KPSUidHWResourceNotification, (KHWRMTestLightCommand | currentTarget), RProperty::EInt); + RProperty::Define(KPSUidHWResourceNotification, (KHWRMTestLightDataPckg | currentTarget), RProperty::EByteArray, 512); + iCmdProperty[i].Attach(KPSUidHWResourceNotification, (KHWRMTestLightCommand | currentTarget)); + iDataProperty[i].Attach(KPSUidHWResourceNotification, (KHWRMTestLightDataPckg | currentTarget)); + currentTarget <<= 1; + } + + RProperty::Define(KPSUidHWResourceNotification, KHWRMTestLightIntensityValue, RProperty::EInt); + RProperty::Define(KPSUidHWResourceNotification, KHWRMTestLightSensitivityValue, RProperty::EInt); + iIntensityProperty.Attach(KPSUidHWResourceNotification, KHWRMTestLightIntensityValue); + iSensitivityProperty.Attach(KPSUidHWResourceNotification, KHWRMTestLightSensitivityValue); +#endif // PUBLISH_STATE_INFO + } + + +void CLightPlugin::ProcessCommandL( const TInt aCommandId, + const TUint8 aTransId, +#ifdef PUBLISH_STATE_INFO + TDesC8& aData ) +#else + TDesC8& /*aData*/ ) +#endif // PUBLISH_STATE_INFO + { + COMPONENT_TRACE((_L("HWRM LightPlugin: Processing command: 0x%x, TransId: 0x%x"), aCommandId, aTransId)); + +#ifdef PUBLISH_STATE_INFO + TInt targetMask(0); +#endif // PUBLISH_STATE_INFO + switch ( aCommandId ) + { + case HWRMLightCommand::ELightsOnCmdId: + { + COMPONENT_TRACE(_L("HWRM LightPlugin: Processed ELightsOnCmdId")); +#ifdef PUBLISH_STATE_INFO + HWRMLightCommand::TLightsOnCmdPackage pckg; + pckg.Copy(aData); + HWRMLightCommand::TLightsOnData data = pckg(); + if ( data.iIntensity == KHWRMDefaultIntensity ) + { + data.iIntensity = iDefaultIntensity; + } + + targetMask = data.iTarget << 16; + HWRMLightCommand::TLightsOnCmdPackage pckg2(data); + PublishStateInfo(targetMask, aCommandId, pckg2); +#endif // PUBLISH_STATE_INFO + } + break; + case HWRMLightCommand::ELightsOnSensorCmdId: + { + COMPONENT_TRACE(_L("HWRM LightPlugin: Processed ELightsOnSensorCmdId")); +#ifdef PUBLISH_STATE_INFO + HWRMLightCommand::TLightsOnSensorCmdPackage pckg; + pckg.Copy(aData); + HWRMLightCommand::TLightsOnSensorData data = pckg(); + + targetMask = data.iTarget << 16; + PublishStateInfo(targetMask, aCommandId, pckg); +#endif // PUBLISH_STATE_INFO + } + break; + case HWRMLightCommand::ELightsBlinkCmdId: + { + COMPONENT_TRACE(_L("HWRM LightPlugin: Processed ELightsBlinkCmdId")); +#ifdef PUBLISH_STATE_INFO + HWRMLightCommand::TLightsBlinkCmdPackage pckg; + pckg.Copy(aData); + HWRMLightCommand::TLightsBlinkData data = pckg(); + if ( data.iIntensity == KHWRMDefaultIntensity ) + { + data.iIntensity = iDefaultIntensity; + } + + targetMask = data.iTarget << 16; + HWRMLightCommand::TLightsBlinkCmdPackage pckg2(data); + PublishStateInfo(targetMask, aCommandId, pckg2); +#endif // PUBLISH_STATE_INFO + } + break; + case HWRMLightCommand::ELightsOffCmdId: + { + COMPONENT_TRACE(_L("HWRM LightPlugin: Processed ELightsOffCmdId")); +#ifdef PUBLISH_STATE_INFO + HWRMLightCommand::TLightsOffCmdPackage pckg; + pckg.Copy(aData); + HWRMLightCommand::TLightsOffData data = pckg(); + + targetMask = data.iTarget << 16; + PublishStateInfo(targetMask, aCommandId, pckg); +#endif // PUBLISH_STATE_INFO + } + break; + case HWRMLightCommand::ESetLightsIntensityCmdId: + { + COMPONENT_TRACE(_L("HWRM LightPlugin: Processed ESetLightsIntensityCmdId")); +#ifdef PUBLISH_STATE_INFO + HWRMLightCommand::TLightsIntensityCmdPackage pckg; + pckg.Copy(aData); + HWRMLightCommand::TLightsIntensityData data = pckg(); + + iDefaultIntensity = data.iIntensity; + COMPONENT_TRACE( (_L("HWRM LightPlugin: Intensity: %d"), iDefaultIntensity)); + + // Currently only general intensity is supported, so ignore target parameter, + // it is always all supported targets + iIntensityProperty.Set(iDefaultIntensity); + +#endif // PUBLISH_STATE_INFO + } + break; + case HWRMLightCommand::ESetLightsSensorSensitivityCmdId: + { + COMPONENT_TRACE(_L("HWRM LightPlugin: Processed ESetLightsSensorSensitivityCmdId")); +#ifdef PUBLISH_STATE_INFO + HWRMLightCommand::TLightsSensorSensitivityCmdPackage pckg; + pckg.Copy(aData); + TInt data = pckg(); + + iSensitivityProperty.Set(data); +#endif // PUBLISH_STATE_INFO + } + break; + default : + { + COMPONENT_TRACE((_L("HWRM LightPlugin: Unknown Command: 0x%x"), aCommandId)); + } + break; + } + TInt retval(KErrNone); + TInt timeout(500); // microseconds + + // create new timer + CPluginTimer* timer = CPluginTimer::NewL(timeout, iResponseCallback, aCommandId, aTransId, retval, this); + CleanupStack::PushL(timer); + iTimers.AppendL(timer); + CleanupStack::Pop(timer); + } + +#ifdef PUBLISH_STATE_INFO +void CLightPlugin::PublishStateInfo(TInt aTargetMask, + const TInt aCommandId, + TDesC8& aData ) + { + // publish + TInt currentTarget(0x10000); + for ( TInt i=0; i< KHWRMLightMaxTargets; i++ ) + { + if ( aTargetMask & currentTarget ) + { + iCmdProperty[i].Set(aCommandId); + iDataProperty[i].Set(aData); + } + currentTarget <<= 1; + } + } +#endif // PUBLISH_STATE_INFO + +void CLightPlugin::CancelCommandL( const TUint8 aTransId, +#if defined(_DEBUG) && defined(COMPONENT_TRACE_FLAG) + const TInt aCommandId) +#else + const TInt /*aCommandId*/) +#endif + { + COMPONENT_TRACE((_L("HWRM LightPlugin: Cancelling command: 0x%x, TransId: 0x%x"), aCommandId, aTransId)); + COMPONENT_TRACE((_L("HWRM LightPlugin: Cancelling command - iTimers.Count(): %d "), iTimers.Count())); + + for( TInt i = 0; i < iTimers.Count(); i++ ) + { + if ( iTimers[i]->TransId() == aTransId ) + { + delete iTimers[i]; + iTimers.Remove(i); + COMPONENT_TRACE((_L("HWRM LightPlugin: Cancelling command - Removed command: 0x%x, TransId: 0x%x"), aCommandId, aTransId)); + break; + } + } + } + +void CLightPlugin::GenericTimerFired(MHWRMPluginCallback* aService, + TInt aCommandId, + TUint8 aTransId, + TInt aRetVal) + { + COMPONENT_TRACE((_L("HWRM LightPlugin: GenericTimerFired (0x%x, 0x%x, %d)"), aCommandId, aTransId, aRetVal)); + + __ASSERT_ALWAYS(aService != NULL, User::Invariant() ); + + HWRMLightCommand::TErrorCodeResponsePackage retvalPackage(aRetVal); + + TRAPD(err, aService->ProcessResponseL(aCommandId, aTransId, retvalPackage)); + + if ( err != KErrNone ) + { + COMPONENT_TRACE((_L("HWRM LightPlugin: Error in ProcessResponseL: %d"), err)); + } + + // delete obsolete timers + for( TInt i = (iTimers.Count()-1); i > -1 ; i-- ) + { + if ( !iTimers[i]->IsActive() ) + { + delete iTimers[i]; + iTimers.Remove(i); + COMPONENT_TRACE((_L("HWRM LightPlugin: GenericTimerFired - Removed obsolete timer"))); + } + } + } + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/src/PluginTimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/src/PluginTimer.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware Resource Manager stub plugins timer implementation +* +*/ + + +#include "PluginTimer.h" +#include +#include +#include "Trace.h" + +CPluginTimer* CPluginTimer::NewL(const TTimeIntervalMicroSeconds32& anInterval, + MHWRMPluginCallback* aService, + TInt aCommandId, + TUint8 aTransId, + TInt aRetVal, + MPluginTimerCallback* aCallback) + { + CPluginTimer* self = new( ELeave ) CPluginTimer(0, aService, aCommandId, aTransId, aRetVal, aCallback); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + CActiveScheduler::Add(self); + + COMPONENT_TRACE((_L("HWRM Plugin - CPluginTimer::NewL - Setting timer: %d"), anInterval)); + + self->After(anInterval); + + return self; + } + +CPluginTimer::~CPluginTimer() + { + // PCLint demands + iCallback = NULL; + iService = NULL; + } + +CPluginTimer::CPluginTimer(TInt aPriority, + MHWRMPluginCallback* aService, + TInt aCommandId, + TUint8 aTransId, + TInt aRetVal, + MPluginTimerCallback* aCallback) + : CTimer(aPriority), + iService(aService), + iCommandId(aCommandId), + iTransId(aTransId), + iRetVal(aRetVal), + iCallback(aCallback) + { + } + +void CPluginTimer::ConstructL() + { + CTimer::ConstructL(); + } + + +void CPluginTimer::RunL( ) + { + iCallback->GenericTimerFired(iService, iCommandId, iTransId, iRetVal ); + + } + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/src/PowerStatePlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/src/PowerStatePlugin.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware Resource Manager stub plugins Power State plugin +* implementation. +* +*/ + + +#include +#include "PowerStatePlugin.h" + + +//CONSTANTS +#ifdef ENABLE_NOTIFICATIONS + // Timer begins triggering notifications after this time period + const TInt KDelay(5000000); //5 seconds + // Timer triggers notifications at this time interval + const TInt KInterval(5000000); //5 seconds +#endif + + +CPowerStatePlugin* CPowerStatePlugin::NewL() + { + CPowerStatePlugin* self = new(ELeave) CPowerStatePlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +CPowerStatePlugin::~CPowerStatePlugin() + { +#ifdef ENABLE_NOTIFICATIONS + delete iPeriodic; +#endif + } + +CPowerStatePlugin::CPowerStatePlugin() : iKey( KHWRMBatteryLevel ), + iKeyValue( EBatteryLevelUnknown ) + { + } + +void CPowerStatePlugin::ConstructL() + { + // Only send periodic notifications if flag is defined +#ifdef ENABLE_NOTIFICATIONS + RDebug::Print( _L("HWRM PowerStatePlugin: Notifications enabled.") ); + // Use CPeriodic to generate state changes + iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + + // Start the timer after KDelay and for every KInterval + iPeriodic->Start( KDelay, KInterval, + TCallBack( CPowerStatePlugin::Callback, this ) ); +#else + RDebug::Print( _L("HWRM PowerStatePlugin: Notifications disabled.") ); +#endif + } + +TInt CPowerStatePlugin::Callback( TAny* aPtr ) + { + CPowerStatePlugin* ptr = (CPowerStatePlugin*) aPtr; + // use callback to call the notification method in the plugin callback + RDebug::Print( _L("HWRM PowerStatePlugin: Key=%d, Value=%d"), ptr->iKey, ptr->iKeyValue ); + TRAPD( err, ptr->iNotificationCallback->NotifyStateChange( + ptr->iKey, ptr->iKeyValue ) ); + ptr->IncrementKeyAndValue(); + + return err; + } + +void CPowerStatePlugin::IncrementKeyAndValue() + { + switch( iKey ) + { + case KHWRMBatteryLevel: + { + // key has values -1 to 7 + if( iKeyValue == EBatteryLevelLevel7 ) + { + // last value so set next key + iKey = KHWRMBatteryStatus; + iKeyValue = EBatteryStatusUnknown; + } + else + { + // Otherwise just increment it + iKeyValue++; + } + break; + } + case KHWRMBatteryStatus: + { + // key has values -1 to 2 + if( iKeyValue == EBatteryStatusEmpty ) + { + // last value so set next key + iKey = KHWRMChargingStatus; + iKeyValue = EChargingStatusError; + } + else + { + // Otherwise just increment it + iKeyValue++; + } + break; + } + case KHWRMChargingStatus: + { + // key has values -1 to 5 + if( iKeyValue == EChargingStatusChargingContinued ) + { + // last value so set next key + iKey = KHWRMBatteryLevel; + iKeyValue = EBatteryLevelUnknown; + } + else + { + // Otherwise just increment it + iKeyValue++; + } + break; + } + default: + break; + } + } diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/src/VibraPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/src/VibraPlugin.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,171 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware Resource Manager stub plugins vibra plugin +* implementation. +* +*/ + + +#include "VibraPlugin.h" +#include "PluginTimer.h" +#include +#include "Trace.h" + + +#ifdef PUBLISH_STATE_INFO +const TUid KPSUidHWResourceNotification = {0x101F7A01}; // HWRM private PS Uid +#endif // PUBLISH_STATE_INFO + + +CVibraPlugin* CVibraPlugin::NewL() + { + CVibraPlugin* self = new(ELeave) CVibraPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +CVibraPlugin::~CVibraPlugin() + { + iTimers.ResetAndDestroy(); +#ifdef PUBLISH_STATE_INFO + iCmdProperty.Close(); + iDataProperty.Close(); +#endif // PUBLISH_STATE_INFO + } + +CVibraPlugin::CVibraPlugin() + { + } + +void CVibraPlugin::ConstructL() + { +#ifdef PUBLISH_STATE_INFO + RProperty::Define(KPSUidHWResourceNotification, KHWRMTestVibraCommand, RProperty::EInt); + RProperty::Define(KPSUidHWResourceNotification, KHWRMTestVibraDataPckg, RProperty::EByteArray, 512); + iCmdProperty.Attach(KPSUidHWResourceNotification, KHWRMTestVibraCommand); + iDataProperty.Attach(KPSUidHWResourceNotification, KHWRMTestVibraDataPckg); +#endif // PUBLISH_STATE_INFO + } + + +void CVibraPlugin::ProcessCommandL( const TInt aCommandId, + const TUint8 aTransId, +#ifdef PUBLISH_STATE_INFO + TDesC8& aData ) +#else + TDesC8& /*aData*/ ) +#endif // PUBLISH_STATE_INFO + { + COMPONENT_TRACE((_L("HWRM VibraPlugin: Processing command: 0x%x, TransId: 0x%x"), aCommandId, aTransId)); + + switch ( aCommandId ) + { + case HWRMVibraCommand::EStartVibraCmdId: + { + COMPONENT_TRACE(_L("HWRM VibraPlugin: Processed EStartVibraCmdId")); + } + break; + case HWRMVibraCommand::EStartVibraWithDefaultSettingsCmdId: + { + COMPONENT_TRACE(_L("HWRM VibraPlugin: Processed EStartVibraWithDefaultSettingsCmdId")); + } + break; + case HWRMVibraCommand::EPulseVibraCmdId: + { + COMPONENT_TRACE(_L("HWRM VibraPlugin: Processed EPulseVibraCmdId")); + } + break; + case HWRMVibraCommand::EStopVibraCmdId: + { + COMPONENT_TRACE(_L("HWRM VibraPlugin: Processed EStopVibraCmdId")); + } + break; + + default : + { + COMPONENT_TRACE((_L("HWRM VibraPlugin: Unknown Command: 0x%x"), aCommandId)); + } + break; + } + + TInt retval(KErrNone); + TInt timeout(500); // microseconds + +#ifdef PUBLISH_STATE_INFO + // publish + iCmdProperty.Set(aCommandId); + iDataProperty.Set(aData); +#endif // PUBLISH_STATE_INFO + + // create new timer + CPluginTimer* timer = CPluginTimer::NewL(timeout, iResponseCallback, aCommandId, aTransId, retval, this); + CleanupStack::PushL(timer); + iTimers.AppendL(timer); + CleanupStack::Pop(timer); + } + +void CVibraPlugin::CancelCommandL( const TUint8 aTransId, +#if defined(_DEBUG) && defined(COMPONENT_TRACE_FLAG) + const TInt aCommandId) +#else + const TInt /*aCommandId*/) +#endif + { + COMPONENT_TRACE((_L("HWRM VibraPlugin: Cancelling command: 0x%x, TransId: 0x%x"), aCommandId, aTransId)); + COMPONENT_TRACE((_L("HWRM VibraPlugin: Cancelling command - iTimers.Count(): %d "), iTimers.Count())); + + for( TInt i = 0; i < iTimers.Count(); i++ ) + { + if ( iTimers[i]->TransId() == aTransId ) + { + delete iTimers[i]; + iTimers.Remove(i); + COMPONENT_TRACE((_L("HWRM VibraPlugin: Cancelling command - Removed command: 0x%x, TransId: 0x%x"), aCommandId, aTransId)); + break; + } + } + } + +void CVibraPlugin::GenericTimerFired(MHWRMPluginCallback* aService, + TInt aCommandId, + const TUint8 aTransId, + TInt aRetVal) + { + COMPONENT_TRACE((_L("HWRM VibraPlugin: GenericTimerFired (0x%x, 0x%x, %d)"), aCommandId, aTransId, aRetVal)); + + __ASSERT_ALWAYS(aService != NULL, User::Invariant() ); + + HWRMVibraCommand::TErrorCodeResponsePackage retvalPackage(aRetVal); + + TRAPD(err, aService->ProcessResponseL(aCommandId, aTransId, retvalPackage)); + + if ( err != KErrNone ) + { + COMPONENT_TRACE((_L("HWRM VibraPlugin: Error in ProcessResponseL: %d"), err)); + } + + // delete obsolete timers + for( TInt i = (iTimers.Count()-1); i > -1 ; i-- ) + { + if ( !iTimers[i]->IsActive() ) + { + delete iTimers[i]; + iTimers.Remove(i); + COMPONENT_TRACE((_L("HWRM VibraPlugin: GenericTimerFired - Removed obsolete timer"))); + } + } + + } diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/hwrmstubplugins/src/proxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/hwrmstubplugins/src/proxy.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Hardware Resource Manager stub plugins proxy definition file +* +*/ + + +#include +#include + +#include "LightPlugin.h" +#include "VibraPlugin.h" +#include "FmtxPlugin.h" +#include "PowerStatePlugin.h" + +// Map the interface implementation UIDs to implementation factory functions +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(0x1020503F, CLightPlugin::NewL), + IMPLEMENTATION_PROXY_ENTRY(0x1020503E, CVibraPlugin::NewL), + IMPLEMENTATION_PROXY_ENTRY(0x2000BF15, CFmtxPlugin::NewL), + IMPLEMENTATION_PROXY_ENTRY(0x1020503D, CPowerStatePlugin::NewL) + }; + +// Exported proxy for instantiation method resolution. +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/layers.sysdef.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,30 @@ + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/data/10205053.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/data/10205053.rss Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Registry info resource file for StartupAdaptationStub ECOM +* plugin. +* +*/ + + + +// INCLUDES +#include "ecom/registryinfov2.rh" + +// RESOURCE DEFINITIONS +// --------------------------------------------------------- +// +// startupadaptationstub_registry_info +// Registry info resource. +// +// --------------------------------------------------------- +// +RESOURCE REGISTRY_INFO startupadaptationstub_registry_info + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x10205053; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x101F8768; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10205055; + version_no = 1; + display_name = "StartupAdaptationStub"; + default_data = ""; + opaque_data = ""; + rom_only = 1; + } + }; + } + }; + } + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build info file for the StartupAdaptationStub ECom plugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/startupadaptationstub.iby CORE_IBY_EXPORT_PATH(stubs,startupadaptationstub.iby) + +PRJ_MMPFILES +startupadaptationstub.mmp + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/group/startupadaptationstub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/group/startupadaptationstub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project StartupAdaptationStub +* +*/ + + +// To get the OS_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET startupadaptationstub.dll +CAPABILITY CAP_ECOM_PLUGIN +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10205053 +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE StartupAdaptationStub.cpp +SOURCE StartupAdaptationStubModel.cpp +SOURCE CommandProcessingEngine.cpp +SOURCE ImplementationFactory.cpp +SOURCE sastubeventlistener.cpp + +USERINCLUDE ../inc + +OS_LAYER_SYSTEMINCLUDE + +START RESOURCE ../data/10205053.rss +TARGET startupadaptationstub.rsc +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib + +LANG SC + +// >>> define to enable the tracing +// MACRO __TRACE_ALL__ +// <<< define to enable the tracing + +// >>> define to enable module test support +// MACRO __STARTER_MODULE_TEST_SUPPORT__ +// <<< define to enable module test support diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/inc/CommandProcessingEngine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/inc/CommandProcessingEngine.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CCommandProcessingEngine class declaration. +* +*/ + + + +#ifndef __COMMANDPROCESSINGENGINE_H__ +#define __COMMANDPROCESSINGENGINE_H__ + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MCommandProcessingObserver; + +// CLASS DECLARATION + +/** +* ?one_line_short_description. CCommandProcessingEngine +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class CCommandProcessingEngine : public CActive + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aObserver Command processing completion observer. + */ + static CCommandProcessingEngine* NewL( + MCommandProcessingObserver& aObserver ); + + /** + * Destructor. + */ + virtual ~CCommandProcessingEngine(); + + public: // New functions + + /** + * Append command to queue. + * + * @param aCommandId Command ID from the client. + * @param aDuration Timeout value in milliseconds. + */ + void ExecuteCommandL( const TInt aCommandId, const TInt aDuration ); + + public: // Functions from base classes + + /** + * From CActive. + * Handles an active object’s request completion event. + */ + void RunL(); + + /** + * From CActive. + * Handles a leave occurring in the request completion event handler + * RunL(). + * @param aError The leave code. + */ + TInt RunError( TInt aError ); + + /** + * From CActive. + * Implements cancellation of an outstanding request. + */ + void DoCancel(); + + private: + + /** + * C++ default constructor. + * @param aObserver Command processing completion observer. + */ + CCommandProcessingEngine( MCommandProcessingObserver& aObserver ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Set the timer and activate. + * + * @param aDuration Timeout value in milliseconds. + */ + void ActivateWithTimeout( const TInt aDuration ); + + private: // Data + + struct TCommandInfo + { + TInt iCommandId; + TInt iDuration; + }; + + typedef RArray RCommandArray; + + RCommandArray iCommands; // List of commands to process. + + RTimer iTimer; // A timer for emulating command processing time. + + // Command processing completion observer. + MCommandProcessingObserver& iObserver; + }; + +#endif // __COMMANDPROCESSINGENGINE_H__ + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/inc/CommandProcessingObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/inc/CommandProcessingObserver.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MCommandProcessingObserver class declaration. +* +*/ + + +#ifndef __COMMANDPROCESSINGOBSERVER_H__ +#define __COMMANDPROCESSINGOBSERVER_H__ + +// INCLUDES +#include + +/** +* An observer interface... +* +* @lib ? +* @since Series 60 3.0 +*/ +class MCommandProcessingObserver + { + public: + + /** + * A command has been processed. + * @param aCommandId A command identifier. + */ + virtual void CommandProcessedL( + const TInt aCommandId ) = 0; + + }; + +#endif // __COMMANDPROCESSINGOBSERVER_H__ + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/inc/StartupAdaptationStub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/inc/StartupAdaptationStub.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CStartupAdaptationStub class declaration. +* +*/ + + + +#ifndef __STARTUPADAPTATIONSTUB_H__ +#define __STARTUPADAPTATIONSTUB_H__ + +// INCLUDES +#include "CommandProcessingObserver.h" +#include "sastubeventsender.h" +#include + +// FORWARD DECLARATIONS +class CCommandProcessingEngine; +class CStartupAdaptationStubModel; +class CSAStubEventListener; + +// CLASS DECLARATION + +/** +* A stub implementation of CStartupAdaptation interface. +* +* @lib StartupAdaptationStub.lib +* @since Series 60 3.0 +*/ +class CStartupAdaptationStub : + public CStartupAdaptation, + public MCommandProcessingObserver, + public MSAStubEventSender + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aConstructionParameters Construction parameters from the + * client. + */ + static CStartupAdaptationStub* NewL( TAny* aConstructionParameters ); + + /** + * Destructor. + */ + virtual ~CStartupAdaptationStub(); + + public: // Functions from base classes + + /** + * From CStartupAdaptation. + * Issue a command to startup adaptation. + * + * @param aCommandId A command identifier. + * @param aData Data associated with the command. + */ + virtual void CommandL( + const StartupAdaptation::TCommand aCommandId, + TDesC8& aData ); + + /** + * From CStartupAdaptation. + * Cancel a command. + * + * @param aCommandId A command identifier. + */ + virtual void CancelCommandL( + const StartupAdaptation::TCommand aCommandId ); + + /** + * From CStartupAdaptation. + * Get plugin implementation version. Major and minor version numbers + * are relevant. + * + * @return The plugin implementation version. + */ + virtual TVersion Version() const; + + /** + * From MCommandProcessingObserver. + * A command has been processed. + * @param aCommandId A command identifier. + */ + virtual void CommandProcessedL( + const TInt aCommandId ); + + /** + * From MSAStubEventSender. + * Send an event. + * + * @since S60 4.0 + * @param aEvent Identifies the event to send. + * @param aArg Optional paraneter for the event. + */ + virtual void SendEvent( const TInt aEvent, const TInt aArg ); + + private: + + /** + * C++ default constructor. + * @param anObserver Observer for command responses and events. + */ + CStartupAdaptationStub( MStartupAdaptationObserver* anObserver ); + + /** + * Performs the second phase construction of a CStartupAdaptationStub + * object. + */ + void ConstructL(); + + private: // Data + + // Observer for command responses and events. Not owned. + MStartupAdaptationObserver* iObserver; + + // The engine class that handles the 'processing' of requests. + CCommandProcessingEngine* iEngine; + + // Model containg the response values for the commands. + CStartupAdaptationStubModel* iModel; + + // Observer for indications to send events. + CSAStubEventListener* iEventListener; + }; + +// CLASS DECLARATION + +#endif // __STARTUPADAPTATIONSTUB_H__ + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/inc/StartupAdaptationStubDebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/inc/StartupAdaptationStubDebug.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Macros for debugging. +* +*/ + + + +#ifndef __STARTUPADAPTATIONSTUBDEBUG_H__ +#define __STARTUPADAPTATIONSTUBDEBUG_H__ + +// MACROS +#ifdef _DEBUG + #include + #define ERROR_DEBUG(X) RDebug::Print(X) + #define ERROR_DEBUG_1(X,Y1) RDebug::Print(X,Y1) + #define ERROR_DEBUG_2(X,Y1,Y2) RDebug::Print(X,Y1,Y2) +#else + #define ERROR_DEBUG(X) + #define ERROR_DEBUG_1(X,Y) + #define ERROR_DEBUG_2(X,Y1,Y2) +#endif + +#if defined _DEBUG && defined __TRACE_ALL__ + #include + #define RDEBUG(X) RDebug::Print(X) + #define RDEBUG_1(X,Y1) RDebug::Print(X,Y1) + #define RDEBUG_2(X,Y1,Y2) RDebug::Print(X,Y1,Y2) +#else + #define RDEBUG(X) + #define RDEBUG_1(X,Y) + #define RDEBUG_2(X,Y1,Y2) +#endif + +#endif // __STARTUPADAPTATIONSTUBDEBUG_H__ + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/inc/StartupAdaptationStubModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/inc/StartupAdaptationStubModel.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CStartupAdaptationStubModel class declaration. +* +*/ + + +#ifndef __STARTUPADAPTATIONSTUBMODEL_H__ +#define __STARTUPADAPTATIONSTUBMODEL_H__ + +#include +#include + +const TInt KNumResponseLists = 16; + +/** +* A model containing data used by the StartupAdaptationStub. +* +* @lib StartupAdaptationStub.lib +* @since Series 60 3.0 +*/ +NONSHARABLE_CLASS( CStartupAdaptationStubModel ) : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CStartupAdaptationStubModel* NewL(); + + /** + * Destructor. + */ + virtual ~CStartupAdaptationStubModel(); + + public: // New functions + + TInt GetGlobalStateChangeResponse(); + void GetSecurityStateChangeResponse( + StartupAdaptation::TSecurityStateResponse& aResponse ); + void GetStartupModeResponse( + StartupAdaptation::TGlobalStartupModeResponse& aResponse ); + TInt GetSelftestResponse(); + void GetLanguageListResponse( + StartupAdaptation::RLanguageListResponse& aResponse ); + TInt GetRTCTimeValidityResponse(); + void GetSimChangedResponse( + StartupAdaptation::TBooleanResponse& aResponse ); + void GetSimOwnedResponse( + StartupAdaptation::TBooleanResponse& aResponse ); + TInt GetSetAlarmResponse(); + TInt GetCancelAlarmResponse(); + TInt GetResetResponse(); + TInt GetShutdownResponse(); + TInt GetRFSResponse(); + TInt GetActivateRfResponse(); + TInt GetDeactivateRfResponse(); + void GetHiddenResetResponse( + StartupAdaptation::TBooleanResponse& aResponse ); + + TInt GetDurationForNextCall( const TInt aCommandId ); + + private: + + typedef CArrayFixFlat CStructuredList; + + /** + * C++ default constructor. + */ + CStartupAdaptationStubModel(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Read settings from config file. + */ + void ReadConfigFileL(); + + /** + * Initialize to default values (if config file does not exist or is + * corrupted). + */ + void InitToDefaultL(); + + TInt GetSimpleResponse( const TInt aIndex ); + TInt CalculateCurrentBaseIndex( const TInt aIndex ); + void UpdateCounter( const TInt aIndex ); + + static void ReadStructuredListL( + const TInt aNumParts, + TLex& aLexer, + CStructuredList& aList ); + + static TInt ReadDurationL( TLex& aLexer ); + + private: // Data + + struct TResponseData + { + TInt iParts; + TInt iCounter; + CStructuredList* iList; // Not owned + }; + + TResponseData iResponses[KNumResponseLists]; + + }; + +// CLASS DECLARATION + +#endif // __STARTUPADAPTATIONSTUBMODEL_H__ + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/inc/sastubeventlistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/inc/sastubeventlistener.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of CSAStubEventListener class. +* +*/ + + +#ifndef __SASTUBEVENTLISTENER_H__ +#define __SASTUBEVENTLISTENER_H__ + +#include +#include + +class MSAStubEventSender; + +/** + * Observer for Starter module test events. + * + * @lib None + * @since S60 4.0 + */ +class CSAStubEventListener : public CActive + { + +public: + + /** + * Second phase constructor. + * + * @param aSender Object that can send an event in response to an + * indication received from P&S. + * @since S60 4.0 + */ + static CSAStubEventListener* NewL( MSAStubEventSender& aSender ); + + virtual ~CSAStubEventListener(); + +protected: + + /** + * From CActive. + * Implements cancellation of an outstanding request. + * + * @since S60 4.0 + */ + virtual void DoCancel(); + + /** + * From CActive. + * Handles an active object's request completion event. + * Never leaves. + * + * @since S60 4.0 + */ + virtual void RunL(); + +private: + + /** + * First phase constructor. + * + * @param aSender Object that can send an event in response to an + * indication received from P&S. + * @since S60 4.0 + */ + CSAStubEventListener( MSAStubEventSender& aSender ); + + void ConstructL(); + +private: // data + + /** + * Handle to Publish&Subscribe key to observe. + */ + RProperty iProperty; + + /** + * Object that can send an event in response to an indication received from + * P&S. + */ + MSAStubEventSender& iSender; + + }; + +#endif // __SASTUBEVENTLISTENER_H__ diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/inc/sastubeventsender.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/inc/sastubeventsender.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of MSAStubEventSender interface class. +* +*/ + + +#ifndef __SASTUBEVENTSENDER_H__ +#define __SASTUBEVENTSENDER_H__ + +#include + +/** + * Interface representing object capable of sending Startup Adaptation events. + * + * @lib None + * @since S60 4.0 + */ +class MSAStubEventSender + { + +public: + + /** + * Send an event. + * + * @since S60 4.0 + * @param aEvent Identifies the event to send. + * @param aArg Optional paraneter for the event. + */ + virtual void SendEvent( const TInt aEvent, const TInt aArg ) = 0; + + }; + +#endif // __SASTUBEVENTSENDER_H__ diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/rom/startupadaptationstub.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/rom/startupadaptationstub.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: StartupAdaptationStub provides dummy implementation of +* StartupAdaptation plugin interface. +* +*/ + + +#ifndef __STARTUPADAPTATIONSTUB_IBY__ +#define __STARTUPADAPTATIONSTUB_IBY__ + +ECOM_PLUGIN( startupadaptationstub.dll, startupadaptationstub.rsc ) + +#endif // __STARTUPADAPTATIONSTUB_IBY__ diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/src/CommandProcessingEngine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/src/CommandProcessingEngine.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,178 @@ +/* +* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of CCommandProcessingEngine class. +* +*/ + + + +// INCLUDE FILES +#include "CommandProcessingEngine.h" +#include "CommandProcessingObserver.h" +#include "StartupAdaptationStubDebug.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCommandProcessingEngine::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCommandProcessingEngine* CCommandProcessingEngine::NewL( + MCommandProcessingObserver& aObserver ) + { + CCommandProcessingEngine* self = + new( ELeave ) CCommandProcessingEngine( aObserver ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// Destructor +CCommandProcessingEngine::~CCommandProcessingEngine() + { + Cancel(); + iTimer.Close(); + iCommands.Close(); + } + + +// ----------------------------------------------------------------------------- +// CCommandProcessingEngine::ExecuteCommandL +// +// ----------------------------------------------------------------------------- +// +void CCommandProcessingEngine::ExecuteCommandL( + const TInt aCommandId, + const TInt aDuration ) + { + RDEBUG_2( _L( "CCommandProcessingEngine::ExecuteCommandL( %d, %d )." ), aCommandId, aDuration ); + + TCommandInfo info; + info.iCommandId = aCommandId; + info.iDuration = aDuration; + iCommands.AppendL( info ); + + if ( !IsActive() ) // If already active, this happens at the end of RunL. + { + ActivateWithTimeout( aDuration ); + } + + RDEBUG( _L( "CCommandProcessingEngine::ExecuteCommandL finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CCommandProcessingEngine::RunL +// +// ----------------------------------------------------------------------------- +// +void CCommandProcessingEngine::RunL() + { + RDEBUG( _L( "CCommandProcessingEngine::RunL." ) ); + RDEBUG_1( _L( "Command count: %d." ), iCommands.Count() ); + + __ASSERT_ALWAYS( iCommands.Count() > 0, User::Invariant() ); + + const TInt& cmd = iCommands[0].iCommandId; + RDEBUG_1( _L( "Processed command( %d )." ), cmd ); + + iObserver.CommandProcessedL( cmd ); + + iCommands.Remove( 0 ); + + if ( iCommands.Count() > 0 ) // Check if there are more + { // commands waiting to be processed. + ActivateWithTimeout( iCommands[0].iDuration ); + } + + RDEBUG( _L( "CCommandProcessingEngine::RunL finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CCommandProcessingEngine::RunError +// +// ----------------------------------------------------------------------------- +// +TInt CCommandProcessingEngine::RunError( TInt aError ) + { + RDEBUG_1( _L( "CCommandProcessingEngine::RunError( %d )." ), aError ); + aError = aError; //To prevent compiler warning. + RDEBUG( _L( "CCommandProcessingEngine::RunError finished." ) ); + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CCommandProcessingEngine::DoCancel +// +// ----------------------------------------------------------------------------- +// +void CCommandProcessingEngine::DoCancel() + { + RDEBUG( _L( "CCommandProcessingEngine::DoCancel." ) ); + + iTimer.Cancel(); + + RDEBUG( _L( "CCommandProcessingEngine::DoCancel finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CCommandProcessingEngine::CCommandProcessingEngine +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCommandProcessingEngine::CCommandProcessingEngine( + MCommandProcessingObserver& aObserver ) + : CActive( EPriorityStandard ), iObserver( aObserver ) + { + CActiveScheduler::Add( this ); + } + + +// ----------------------------------------------------------------------------- +// CCommandProcessingEngine::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCommandProcessingEngine::ConstructL() + { + User::LeaveIfError( iTimer.CreateLocal() ); + } + + +// ----------------------------------------------------------------------------- +// CCommandProcessingEngine::ActivateWithTimeout +// +// ----------------------------------------------------------------------------- +// +void CCommandProcessingEngine::ActivateWithTimeout( const TInt aDuration ) + { + RDEBUG( _L( "CCommandProcessingEngine::ActivateWithTimeout." ) ); + + iTimer.After( iStatus, 1000 * aDuration ); + SetActive(); + + RDEBUG( _L( "CCommandProcessingEngine::ActivateWithTimeout finished." ) ); + } + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/src/ImplementationFactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/src/ImplementationFactory.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: StartupAdaptationStub ECOM implementation factory. +* +*/ + + + +// INCLUDE FILES +#include "StartupAdaptationStub.h" +#include + +// LOCAL CONSTANTS AND MACROS + +// Define the interface UIDs. +const TImplementationProxy ImplementationTable[] = + { + // Remove PCLint note "C-style cast" + //lint -e1924 + // Remove PCLint warning "Suspicious cast" + //lint -e611 + IMPLEMENTATION_PROXY_ENTRY( 0x10205055, CStartupAdaptationStub::NewL ) + //lint +e1924 + //lint +e611 + }; + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// ImplementationGroupProxy. +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + return ImplementationTable; + } + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/src/StartupAdaptationStub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/src/StartupAdaptationStub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,352 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of CStartupAdaptationStub class. +* +*/ + + + +// INCLUDE FILES +#include "StartupAdaptationStub.h" +#include "CommandProcessingEngine.h" +#include "StartupAdaptationStubModel.h" +#include "sastubeventlistener.h" +#include "StartupAdaptationStubDebug.h" +#include + +using namespace StartupAdaptation; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStub::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CStartupAdaptationStub* CStartupAdaptationStub::NewL( TAny* aConstructionParameters ) + { + RDEBUG( _L( "CStartupAdaptationStub::NewL." ) ); + + CStartupAdaptationStub* self = + new( ELeave ) CStartupAdaptationStub( + static_cast( aConstructionParameters ) ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + RDEBUG( _L( "CStartupAdaptationStub::NewL finished." ) ); + + return self; + } + + +// Destructor +CStartupAdaptationStub::~CStartupAdaptationStub() + { + RDEBUG( _L( "CStartupAdaptationStub::~CStartupAdaptationStub." ) ); + + delete iEventListener; + delete iModel; + delete iEngine; + + RDEBUG( _L( "CStartupAdaptationStub::~CStartupAdaptationStub finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStub::CommandL +// +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStub::CommandL( + const TCommand aCommandId, + TDesC8& /*aData*/ ) + { + RDEBUG_1( _L( "CStartupAdaptationStub::CommandL( %d )." ), aCommandId ); + + TInt duration = iModel->GetDurationForNextCall( aCommandId ); + iEngine->ExecuteCommandL( aCommandId, duration ); + + RDEBUG( _L( "CStartupAdaptationStub::CommandL finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStub::CommandL +// +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStub::CancelCommandL( + const TCommand /*aCommandId*/ ) + { + RDEBUG( _L( "CStartupAdaptationStub::CancelCommandL." ) ); + + iEngine->Cancel(); + + RDEBUG( _L( "CStartupAdaptationStub::CancelCommandL finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStub::Version +// +// ----------------------------------------------------------------------------- +// +TVersion CStartupAdaptationStub::Version() const + { + return TVersion( 0, 1, 0 ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStub::CommandProcessedL +// +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStub::CommandProcessedL( + const TInt aCommandId ) + { + RDEBUG_1( _L( "CStartupAdaptationStub::CommandProcessedL( %d )." ), aCommandId ); + + switch ( aCommandId ) + { + case EGlobalStateChange: + { + TResponsePckg responsePckg( + iModel->GetGlobalStateChangeResponse() ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + case EExecuteSelftests: + { + TResponsePckg responsePckg( iModel->GetSelftestResponse() ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + case EValidateRTCTime: + { + TResponsePckg responsePckg( + iModel->GetRTCTimeValidityResponse() ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + case ESetWakeupAlarm: + { + TResponsePckg responsePckg( iModel->GetSetAlarmResponse() ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + case ECancelWakeupAlarm: + { + TResponsePckg responsePckg( KErrNone ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + case EExecuteReset: + { + TResponsePckg responsePckg( iModel->GetResetResponse() ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + case EExecuteShutdown: + { + TResponsePckg responsePckg( iModel->GetShutdownResponse() ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + case EExecuteDOSRfs: + { + TResponsePckg responsePckg( iModel->GetRFSResponse() ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + case EGetSimChanged: + { + TBooleanResponse response; + iModel->GetSimChangedResponse( response ); + TBooleanResponsePckg responsePckg( response ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + case EGetSimOwned: + { + TBooleanResponse response; + iModel->GetSimOwnedResponse( response ); + TBooleanResponsePckg responsePckg( response ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + case ESecurityStateChange: + { + TSecurityStateResponse response; + iModel->GetSecurityStateChangeResponse( response ); + TSecurityStateResponsePckg responsePckg( response ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + case EGetGlobalStartupMode: + { + TGlobalStartupModeResponse response; + iModel->GetStartupModeResponse( response ); + TGlobalStartupModeResponsePckg responsePckg( response ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + case EGetSIMLanguages: + { + RLanguageListResponse response; + CleanupClosePushL( response ); + iModel->GetLanguageListResponse( response ); + TLanguageListResponsePckg responsePckg( response ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + CleanupStack::PopAndDestroy(); + break; + } + case EActivateRfForEmergencyCall: + { + TResponsePckg responsePckg( iModel->GetActivateRfResponse() ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + case EDeactivateRfAfterEmergencyCall: + { + TResponsePckg responsePckg( iModel->GetDeactivateRfResponse() ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + case EGetHiddenReset: + { + TBooleanResponse response; + iModel->GetHiddenResetResponse( response ); + TBooleanResponsePckg responsePckg( response ); + iObserver->ResponseL( + static_cast( aCommandId ), + responsePckg ); + break; + } + default: + RDEBUG_1( _L( "CStartupAdaptationStub: Unexpected command: %d." ), aCommandId ); + User::Panic( _L( "Unexpected command" ), KErrNotSupported ); + break; + }; + + + RDEBUG( _L( "CStartupAdaptationStub::CommandProcessedL finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStub::SendEvent +// +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStub::SendEvent( const TInt aEvent, const TInt aArg ) + { + RDEBUG_2( _L( "CStartupAdaptationStub: SendEvent 0x%08x, 0x%08x." ), aEvent, aArg ); + + TInt errorCode = KErrNone; + TEvent eventID = static_cast( aEvent ); + if ( eventID == EFatalError ) + { + TFatalErrorTypePckg params( static_cast( aArg ) ); + TRAP( errorCode, iObserver->EventL( eventID, params ) ); + } + else if ( eventID == ESimEvent ) + { + TSimEventTypePckg params( static_cast( aArg ) ); + TRAP( errorCode, iObserver->EventL( eventID, params ) ); + } + else + { + TBuf8<1> dummy; + TRAP( errorCode, iObserver->EventL( eventID, dummy ) ); + } + + if ( errorCode != KErrNone ) + { + RDEBUG_1( _L( "CStartupAdaptationStub: EventL leave code %d." ), errorCode ); + } + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStub::CStartupAdaptationStub +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CStartupAdaptationStub::CStartupAdaptationStub( + MStartupAdaptationObserver* anObserver ) + : iObserver( anObserver ), + iEventListener( NULL ) + { + RDEBUG( _L( "CStartupAdaptationStub::CStartupAdaptationStub." ) ); + + __ASSERT_ALWAYS( anObserver, User::Invariant() ); + + RDEBUG( _L( "CStartupAdaptationStub::CStartupAdaptationStub finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStub::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStub::ConstructL() + { + RDEBUG( _L( "CStartupAdaptationStub::ConstructL." ) ); + + iEngine = CCommandProcessingEngine::NewL( *this ); + iModel = CStartupAdaptationStubModel::NewL(); + +#ifdef __STARTER_MODULE_TEST_SUPPORT__ + iEventListener = CSAStubEventListener::NewL( *this ); +#endif // __STARTER_MODULE_TEST_SUPPORT__ + + RDEBUG( _L( "CStartupAdaptationStub::ConstructL finished." ) ); + } + + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/src/StartupAdaptationStubModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/src/StartupAdaptationStubModel.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,781 @@ +/* +* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CStartupAdaptationStubModel class definition. +* +*/ + + + +// INCLUDE FILES +#include "StartupAdaptationStubModel.h" +#include "StartupAdaptationStubDebug.h" +#include + +// CONSTANTS + +_LIT( KConfigFile, "C:\\private\\2000D766\\StartupAdaptationStubConf.txt" ); +const TInt KDefaultDuration( 1 ); // Default command duration in ms. + +const TInt KGlobalStateChangeIndex( 0 ); +const TInt KSecurityStateChangeIndex( 1 ); +const TInt KGlobalStartupModeIndex( 2 ); +const TInt KSelftestIndex( 3 ); +const TInt KLanguageListIndex( 4 ); +const TInt KRTCTimeIndex( 5 ); +const TInt KSimChangedIndex( 6 ); +const TInt KSimOwnedIndex( 7 ); +const TInt KSetAlarmIndex( 8 ); +const TInt KCancelAlarmIndex( 9 ); +const TInt KResetIndex( 10 ); +const TInt KShutdownIndex( 11 ); +const TInt KRFSIndex( 12 ); +const TInt KActivateRfIndex( 13 ); +const TInt KDeactivateRfIndex( 14 ); +const TInt KHiddenResetIndex( 15 ); + +using namespace StartupAdaptation; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CStartupAdaptationStubModel* CStartupAdaptationStubModel::NewL() + { + RDEBUG( _L( "CStartupAdaptationStubModel::NewL." ) ); + + CStartupAdaptationStubModel* self = + new( ELeave ) CStartupAdaptationStubModel(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + RDEBUG( _L( "CStartupAdaptationStubModel::NewL finished." ) ); + + return self; + } + + +// Destructor +CStartupAdaptationStubModel::~CStartupAdaptationStubModel() + { + RDEBUG( _L( "CStartupAdaptationStubModel::~CStartupAdaptationStubModel." ) ); + + for ( TInt i = 0; i < KNumResponseLists; i++ ) + { + delete iResponses[i].iList; + } + + RDEBUG( _L( "CStartupAdaptationStubModel::~CStartupAdaptationStubModel finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetGlobalStateChangeResponse +// +// ----------------------------------------------------------------------------- +// +TInt CStartupAdaptationStubModel::GetGlobalStateChangeResponse() + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetGlobalStateChangeResponse." ) ); + + TInt response = GetSimpleResponse( KGlobalStateChangeIndex ); + + RDEBUG_1( _L( "CStartupAdaptationStubModel::GetGlobalStateChangeResponse finished with %d." ), response ); + return response; + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetSecurityStateChangeResponse +// +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStubModel::GetSecurityStateChangeResponse( + StartupAdaptation::TSecurityStateResponse& aResponse ) + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetSecurityStateChangeResponse." ) ); + + const TInt index = KSecurityStateChangeIndex; + __ASSERT_DEBUG( iResponses[index].iList != NULL, User::Invariant() ); + + CStructuredList& list = *( ( iResponses[index] ).iList ); + const TInt currentIndex = CalculateCurrentBaseIndex( index );; + + __ASSERT_DEBUG( list.Count() > 0, User::Invariant() ); + __ASSERT_DEBUG( currentIndex < list.Count() - 2, User::Invariant() ); + + aResponse.iErrorCode = list[currentIndex + 1 ]; + aResponse.iValue = + static_cast( list[currentIndex + 2 ] ); + + UpdateCounter( index ); + + RDEBUG( _L( "CStartupAdaptationStubModel::GetSecurityStateChangeResponse finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetStartupModeResponse +// +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStubModel::GetStartupModeResponse( + StartupAdaptation::TGlobalStartupModeResponse& aResponse ) + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetStartupModeResponse." ) ); + + const TInt index = KGlobalStartupModeIndex; + __ASSERT_DEBUG( iResponses[index].iList != NULL, User::Invariant() ); + + CStructuredList& list = *( ( iResponses[index] ).iList ); + const TInt currentIndex = CalculateCurrentBaseIndex( index );; + + __ASSERT_DEBUG( list.Count() > 0, User::Invariant() ); + __ASSERT_DEBUG( currentIndex < list.Count() - 2, User::Invariant() ); + + aResponse.iErrorCode = list[currentIndex + 1 ]; + aResponse.iValue = + static_cast( list[currentIndex + 2 ] ); + + UpdateCounter( index ); + + RDEBUG( _L( "CStartupAdaptationStubModel::GetStartupModeResponse finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetSelftestResponse +// +// ----------------------------------------------------------------------------- +// +TInt CStartupAdaptationStubModel::GetSelftestResponse() + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetSelftestResponse." ) ); + + TInt response = GetSimpleResponse( KSelftestIndex ); + + RDEBUG_1( _L( "CStartupAdaptationStubModel::GetSelftestResponse finished with %d." ), response ); + return response; + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetLanguageListResponse +// +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStubModel::GetLanguageListResponse( + StartupAdaptation::RLanguageListResponse& aResponse ) + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetLanguageListResponse." ) ); + + const TInt index = KLanguageListIndex; + __ASSERT_DEBUG( iResponses[index].iList != NULL, User::Invariant() ); + + CStructuredList& list = *( ( iResponses[index] ).iList ); + const TInt currentIndex = CalculateCurrentBaseIndex( index );; + + __ASSERT_DEBUG( list.Count() > 0, User::Invariant() ); + __ASSERT_DEBUG( currentIndex < list.Count() - iResponses[ index ].iParts, + User::Invariant() ); + + aResponse.iErrorCode = list[ currentIndex + 1 ]; + for ( TInt i = 0; i < list[ currentIndex + 2 ]; i++ ) + { + aResponse.iLanguages.Append( + static_cast( list[ currentIndex + i + 3 ] ) ); + } + + UpdateCounter( index ); + + RDEBUG( _L( "CStartupAdaptationStubModel::GetLanguageListResponse finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetRTCTimeValidityResponse +// +// ----------------------------------------------------------------------------- +// +TInt CStartupAdaptationStubModel::GetRTCTimeValidityResponse() + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetRTCTimeValidityResponse." ) ); + + TInt response = GetSimpleResponse( KRTCTimeIndex ); + + RDEBUG_1( _L( "CStartupAdaptationStubModel::GetRTCTimeValidityResponse finished with %d." ), response ); + return response; + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetSimChangedResponse +// +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStubModel::GetSimChangedResponse( + StartupAdaptation::TBooleanResponse& aResponse ) + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetSimChangedResponse." ) ); + + const TInt index = KSimChangedIndex; + __ASSERT_DEBUG( iResponses[index].iList != NULL, User::Invariant() ); + + CStructuredList& list = *( ( iResponses[index] ).iList ); + const TInt currentIndex = CalculateCurrentBaseIndex( index );; + + __ASSERT_DEBUG( list.Count() > 0, User::Invariant() ); + __ASSERT_DEBUG( currentIndex < list.Count() - 2, User::Invariant() ); + + aResponse.iErrorCode = list[currentIndex + 1]; + aResponse.iValue = static_cast( list[currentIndex + 2 ] ); + + UpdateCounter( index ); + + RDEBUG( _L( "CStartupAdaptationStubModel::GetSimChangedResponse finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetSimOwnedResponse +// +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStubModel::GetSimOwnedResponse( + StartupAdaptation::TBooleanResponse& aResponse ) + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetSimOwnedResponse." ) ); + + const TInt index = KSimOwnedIndex; + __ASSERT_DEBUG( iResponses[index].iList != NULL, User::Invariant() ); + + CStructuredList& list = *( ( iResponses[index] ).iList ); + const TInt currentIndex = CalculateCurrentBaseIndex( index );; + + __ASSERT_DEBUG( list.Count() > 0, User::Invariant() ); + __ASSERT_DEBUG( currentIndex < list.Count() - 2, User::Invariant() ); + + aResponse.iErrorCode = list[currentIndex + 1 ]; + aResponse.iValue = static_cast( list[currentIndex + 2 ] ); + + UpdateCounter( index ); + + RDEBUG( _L( "CStartupAdaptationStubModel::GetSimOwnedResponse finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetSetAlarmResponse +// +// ----------------------------------------------------------------------------- +// +TInt CStartupAdaptationStubModel::GetSetAlarmResponse() + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetSetAlarmResponse." ) ); + + TInt response = GetSimpleResponse( KSetAlarmIndex ); + + RDEBUG_1( _L( "CStartupAdaptationStubModel::GetSetAlarmResponse finished with %d." ), response ); + return response; + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetCancelAlarmResponse +// +// ----------------------------------------------------------------------------- +// +TInt CStartupAdaptationStubModel::GetCancelAlarmResponse() + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetCancelAlarmResponse." ) ); + + TInt response = GetSimpleResponse( KCancelAlarmIndex ); + + RDEBUG_1( _L( "CStartupAdaptationStubModel::GetCancelAlarmResponse finished with %d." ), response ); + return response; + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetResetResponse +// +// ----------------------------------------------------------------------------- +// +TInt CStartupAdaptationStubModel::GetResetResponse() + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetResetResponse." ) ); + + TInt response = GetSimpleResponse( KResetIndex ); + + RDEBUG_1( _L( "CStartupAdaptationStubModel::GetResetResponse finished with %d." ), response ); + return response; + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetShutdownResponse +// +// ----------------------------------------------------------------------------- +// +TInt CStartupAdaptationStubModel::GetShutdownResponse() + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetShutdownResponse." ) ); + + TInt response = GetSimpleResponse( KShutdownIndex ); + + RDEBUG_1( _L( "CStartupAdaptationStubModel::GetShutdownResponse finished with %d." ), response ); + return response; + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetRFSResponse +// +// ----------------------------------------------------------------------------- +// +TInt CStartupAdaptationStubModel::GetRFSResponse() + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetRFSResponse." ) ); + + TInt response = GetSimpleResponse( KRFSIndex ); + + RDEBUG_1( _L( "CStartupAdaptationStubModel::GetRFSResponse finished with %d." ), response ); + return response; + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetActivateRfResponse +// +// ----------------------------------------------------------------------------- +// +TInt CStartupAdaptationStubModel::GetActivateRfResponse() + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetActivateRfResponse." ) ); + + TInt response = GetSimpleResponse( KActivateRfIndex ); + + RDEBUG_1( _L( "CStartupAdaptationStubModel::GetActivateRfResponse finished with %d." ), response ); + return response; + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetDeactivateRfResponse +// +// ----------------------------------------------------------------------------- +// +TInt CStartupAdaptationStubModel::GetDeactivateRfResponse() + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetDeactivateRfResponse." ) ); + + TInt response = GetSimpleResponse( KDeactivateRfIndex ); + + RDEBUG_1( _L( "CStartupAdaptationStubModel::GetDeactivateRfResponse finished with %d." ), response ); + return response; + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetHiddenResetResponse +// +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStubModel::GetHiddenResetResponse( + StartupAdaptation::TBooleanResponse& aResponse ) + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetHiddenResetResponse." ) ); + + const TInt index = KHiddenResetIndex; + __ASSERT_DEBUG( iResponses[index].iList != NULL, User::Invariant() ); + + CStructuredList& list = *( ( iResponses[index] ).iList ); + const TInt currentIndex = CalculateCurrentBaseIndex( index );; + + __ASSERT_DEBUG( list.Count() > 0, User::Invariant() ); + __ASSERT_DEBUG( currentIndex < list.Count() - 2, User::Invariant() ); + + aResponse.iErrorCode = list[currentIndex + 1 ]; + aResponse.iValue = static_cast( list[currentIndex + 2 ] ); + + UpdateCounter( index ); + + RDEBUG( _L( "CStartupAdaptationStubModel::GetHiddenResetResponse finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetDurationForNextCall +// +// ----------------------------------------------------------------------------- +// +TInt CStartupAdaptationStubModel::GetDurationForNextCall( const TInt aCommandId ) + { + RDEBUG_1( _L( "CStartupAdaptationStubModel::GetDurationForNextCall( %d )" ), aCommandId ); + + TInt index = aCommandId - EGlobalStateChange; + if ( aCommandId >= EValidateRTCTime ) + { + // Skip the missing two commands. + index -= ( EValidateRTCTime - EGetSIMLanguages ); + } + + __ASSERT_DEBUG( iResponses[index].iList != NULL, User::Invariant() ); + + CStructuredList& list = *( ( iResponses[index] ).iList ); + const TInt currentIndex = CalculateCurrentBaseIndex( index );; + + __ASSERT_DEBUG( list.Count() > 0, User::Invariant() ); + __ASSERT_DEBUG( currentIndex < list.Count(), User::Invariant() ); + + const TInt duration = list[currentIndex]; + + RDEBUG_1( _L( "CStartupAdaptationStubModel::GetDurationForNextCall finished with %d." ), duration ); + return duration; + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::CStartupAdaptationStubModel +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CStartupAdaptationStubModel::CStartupAdaptationStubModel() + { + RDEBUG( _L( "CStartupAdaptationStubModel::CStartupAdaptationStubModel." ) ); + + for ( TInt i = 0; i < KNumResponseLists; i++ ) + { + iResponses[i].iCounter = 0; + } + + iResponses[ KGlobalStateChangeIndex ].iParts = 1; + iResponses[ KSecurityStateChangeIndex ].iParts = 2; + iResponses[ KGlobalStartupModeIndex ].iParts = 2; + iResponses[ KSelftestIndex ].iParts = 1; + iResponses[ KLanguageListIndex ].iParts = 16; + iResponses[ KRTCTimeIndex ].iParts = 1; + iResponses[ KSimChangedIndex ].iParts = 2; + iResponses[ KSimOwnedIndex ].iParts = 2; + iResponses[ KSetAlarmIndex ].iParts = 1; + iResponses[ KCancelAlarmIndex ].iParts = 1; + iResponses[ KResetIndex ].iParts = 1; + iResponses[ KShutdownIndex ].iParts = 1; + iResponses[ KRFSIndex ].iParts = 1; + iResponses[ KActivateRfIndex ].iParts = 1; + iResponses[ KDeactivateRfIndex ].iParts = 1; + iResponses[ KHiddenResetIndex ].iParts = 2; + + RDEBUG( _L( "CStartupAdaptationStubModel::CStartupAdaptationStubModel finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStubModel::ConstructL() + { + RDEBUG( _L( "CStartupAdaptationStubModel::ConstructL." ) ); + + for ( TInt i = 0; i < KNumResponseLists; i++ ) + { + iResponses[i].iList = + new ( ELeave ) CStructuredList( iResponses[i].iParts + 1 ); + } + + TRAPD( errorCode, ReadConfigFileL() ); + if ( errorCode != KErrNone ) + { + RDEBUG_1( _L( "Configuration file does not exist or is corrupt (error code %d). Initializing to default configuration." ), errorCode ); + + InitToDefaultL(); + } + + RDEBUG( _L( "CStartupAdaptationStubModel::ConstructL finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::ReadConfigFileL +// +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStubModel::ReadConfigFileL() + { + RDEBUG( _L( "CStartupAdaptationStubModel::ReadConfigFileL." ) ); + + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + RFile file; + User::LeaveIfError( file.Open( fs, KConfigFile, EFileShareReadersOnly ) ); + CleanupClosePushL( file ); + + TFileText reader; + reader.Set( file ); + + TBuf<256> buf; + TLex lex( buf ); + + for ( TInt i = 0; i < KNumResponseLists; i++ ) + { + User::LeaveIfError( reader.Read( buf ) ); + + RDEBUG_1( _L( "CStartupAdaptationStubModel: Config line: %S." ), &buf ); + + lex.Assign( buf ); + ReadStructuredListL( + iResponses[ i ].iParts, lex, *( iResponses[ i ].iList ) ); + } + + CleanupStack::PopAndDestroy( 2 ); // file, fs + + RDEBUG( _L( "CStartupAdaptationStubModel::ReadConfigFileL finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::InitToDefaultL +// +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStubModel::InitToDefaultL() + { + RDEBUG( _L( "CStartupAdaptationStubModel::InitToDefaultL." ) ); + + for ( TInt i = 0; i < KNumResponseLists; i++ ) + { + iResponses[i].iList->Reset(); + } + + iResponses[KGlobalStateChangeIndex].iList->AppendL( KDefaultDuration ); + iResponses[KGlobalStateChangeIndex].iList->AppendL( KErrNone ); + + iResponses[KSecurityStateChangeIndex].iList->AppendL( KDefaultDuration ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( KErrNone ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( EYes ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( KDefaultDuration ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( KErrNone ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( ENoValue ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( KDefaultDuration ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( KErrNone ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( ENo ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( KDefaultDuration ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( KErrNone ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( ENo ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( KDefaultDuration ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( KErrNone ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( ENo ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( KDefaultDuration ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( KErrNone ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( ENoValue ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( KDefaultDuration ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( KErrNone ); + iResponses[KSecurityStateChangeIndex].iList->AppendL( ESimLockOk ); + + iResponses[KGlobalStartupModeIndex].iList->AppendL( KDefaultDuration ); + iResponses[KGlobalStartupModeIndex].iList->AppendL( KErrNone ); + iResponses[KGlobalStartupModeIndex].iList->AppendL( ENormal ); + + iResponses[KSelftestIndex].iList->AppendL( KDefaultDuration ); + iResponses[KSelftestIndex].iList->AppendL( KErrNone ); + + iResponses[KLanguageListIndex].iList->AppendL( KDefaultDuration ); + iResponses[KLanguageListIndex].iList->AppendL( KErrNotFound ); + for ( TInt i = 0; i < 15; i++ ) + { + iResponses[KLanguageListIndex].iList->AppendL( 0 ); + } + iResponses[KLanguageListIndex].iList->AppendL( KDefaultDuration ); + iResponses[KLanguageListIndex].iList->AppendL( KErrNotFound ); + for ( TInt i = 0; i < 15; i++ ) + { + iResponses[KLanguageListIndex].iList->AppendL( 0 ); + } + iResponses[KLanguageListIndex].iList->AppendL( KDefaultDuration ); + iResponses[KLanguageListIndex].iList->AppendL( KErrNotFound ); + for ( TInt i = 0; i < 15; i++ ) + { + iResponses[KLanguageListIndex].iList->AppendL( 0 ); + } + + iResponses[KRTCTimeIndex].iList->AppendL( KDefaultDuration ); + iResponses[KRTCTimeIndex].iList->AppendL( 0 ); + + iResponses[KSimChangedIndex].iList->AppendL( KDefaultDuration ); + iResponses[KSimChangedIndex].iList->AppendL( KErrNotFound ); + iResponses[KSimChangedIndex].iList->AppendL( EFalse ); + + iResponses[KSimOwnedIndex].iList->AppendL( KDefaultDuration ); + iResponses[KSimOwnedIndex].iList->AppendL( KErrNotFound ); + iResponses[KSimOwnedIndex].iList->AppendL( EFalse ); + + for ( TInt i = 8; i < KNumResponseLists - 1; i++ ) + { + iResponses[i].iList->AppendL( KDefaultDuration ); + iResponses[i].iList->AppendL( 0 ); + } + + iResponses[KHiddenResetIndex].iList->AppendL( KDefaultDuration ); + iResponses[KHiddenResetIndex].iList->AppendL( KErrNotSupported ); + iResponses[KHiddenResetIndex].iList->AppendL( EFalse ); + + RDEBUG( _L( "CStartupAdaptationStubModel::InitToDefaultL finished." ) ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::GetSimpleResponse +// +// ----------------------------------------------------------------------------- +// +TInt CStartupAdaptationStubModel::GetSimpleResponse( const TInt aIndex ) + { + RDEBUG( _L( "CStartupAdaptationStubModel::GetSimpleResponse." ) ); + __ASSERT_DEBUG( iResponses[aIndex].iList != NULL, User::Invariant() ); + + CStructuredList& list = *( ( iResponses[aIndex] ).iList ); + const TInt currentIndex = CalculateCurrentBaseIndex( aIndex );; + + RDEBUG_1( _L( "CStartupAdaptationStubModel: count = %d" ), list.Count() ); + + __ASSERT_DEBUG( list.Count() > 0, User::Invariant() ); + __ASSERT_DEBUG( currentIndex < list.Count() + 1, User::Invariant() ); + + TInt response = list[currentIndex + 1]; + + UpdateCounter( aIndex ); + + RDEBUG_1( _L( "CStartupAdaptationStubModel::GetSimpleResponse finished with %d." ), response ); + return response; + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::CalculateCurrentBaseIndex +// +// ----------------------------------------------------------------------------- +// +TInt CStartupAdaptationStubModel::CalculateCurrentBaseIndex( const TInt aIndex ) + { + RDEBUG_1( _L( "CStartupAdaptationStubModel::CalculateCurrentBaseIndex( %d )" ), aIndex ); + + const TInt counter = iResponses[aIndex].iCounter; + const TInt parts = iResponses[aIndex].iParts; + const TInt currentBaseIndex = counter * ( parts + 1 ); + + RDEBUG_1( _L( "CStartupAdaptationStubModel::CalculateCurrentBaseIndex finished with %d." ), currentBaseIndex ); + return currentBaseIndex; + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::UpdateCounter +// +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStubModel::UpdateCounter( const TInt aIndex ) + { + RDEBUG( _L( "CStartupAdaptationStubModel::UpdateCounter." ) ); + __ASSERT_DEBUG( iResponses[aIndex].iList != NULL, User::Invariant() ); + + CStructuredList& list = *( ( iResponses[aIndex] ).iList ); + TInt counter = iResponses[aIndex].iCounter; + const TInt parts = iResponses[aIndex].iParts; + + __ASSERT_DEBUG( list.Count() > 0, User::Invariant() ); + __ASSERT_DEBUG( counter * ( parts + 1 ) < list.Count(), User::Invariant() ); + + counter++; + + if ( counter == ( list.Count() / ( parts + 1 ) ) ) + { + iResponses[aIndex].iCounter = 0; + } + else + { + iResponses[aIndex].iCounter = counter; + } + + RDEBUG_1( _L( "CStartupAdaptationStubModel::UpdateCounter finished. New counter is %d" ), iResponses[aIndex].iCounter ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::ReadStructuredListL +// +// ----------------------------------------------------------------------------- +// +void CStartupAdaptationStubModel::ReadStructuredListL( + const TInt aNumParts, + TLex& aLexer, + CStructuredList& aList ) + { + RDEBUG( _L( "CStartupAdaptationStubModel::ReadStructuredListL." ) ); + + while ( !aLexer.Eos() ) + { + aList.AppendL( ReadDurationL( aLexer ) ); + + TUint val( 0 ); + User::LeaveIfError( aLexer.Val( val, EHex ) ); + aList.AppendL( val ); + + for ( TInt i = 0; i < aNumParts - 1; i++ ) + { + if ( aLexer.Get() != ',' ) User::Leave( KErrCorrupt ); + + User::LeaveIfError( aLexer.Val( val, EHex ) ); + aList.AppendL( val ); + } + + if ( !aLexer.Eos() && aLexer.Get() != ';' ) User::Leave( KErrCorrupt ); + } + + if ( aList.Count() == 0 ) User::Leave( KErrCorrupt ); + + RDEBUG_1( _L( "CStartupAdaptationStubModel::ReadStructuredListL finished. List length: %d" ), aList.Count() ); + } + + +// ----------------------------------------------------------------------------- +// CStartupAdaptationStubModel::ReadDurationL +// +// ----------------------------------------------------------------------------- +// +TInt CStartupAdaptationStubModel::ReadDurationL( TLex& aLexer ) + { + RDEBUG( _L( "CStartupAdaptationStubModel::ReadDurationL." ) ); + + TInt val = KDefaultDuration; + if ( aLexer.Peek() == '[' ) // Duration value is written to file + { + aLexer.Inc(); + User::LeaveIfError( aLexer.Val( val ) ); + if ( aLexer.Get() != ']' ) + { + User::Leave( KErrCorrupt ); + } + } + + RDEBUG_1( _L( "CStartupAdaptationStubModel::ReadDurationL finished with %d." ), val ); + return val; + } diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/startupadaptationstub/src/sastubeventlistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/startupadaptationstub/src/sastubeventlistener.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of CSAStubEventListener class. +* +*/ + + +#ifdef __STARTER_MODULE_TEST_SUPPORT__ + +#include "sastubeventlistener.h" +#include "sastubeventsender.h" +#include "startupadaptationstubdebug.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// ?description_if_needed +// --------------------------------------------------------------------------- +// +CSAStubEventListener::CSAStubEventListener( MSAStubEventSender& aSender ) + : CActive( EPriorityStandard ), + iSender( aSender ) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// ?description_if_needed +// --------------------------------------------------------------------------- +// +void CSAStubEventListener::ConstructL() + { + RProperty::Define( TUid::Uid( 0x0AA01499 ), 1, 0 ); + User::LeaveIfError( iProperty.Attach( TUid::Uid( 0x0AA01499 ), 1 ) ); + + iProperty.Subscribe( iStatus ); + SetActive(); + } + +// --------------------------------------------------------------------------- +// ?description_if_needed +// --------------------------------------------------------------------------- +// +CSAStubEventListener* CSAStubEventListener::NewL( MSAStubEventSender& aSender ) + { + CSAStubEventListener* self = new( ELeave ) CSAStubEventListener( aSender ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// ?description_if_needed +// --------------------------------------------------------------------------- +// +CSAStubEventListener::~CSAStubEventListener() + { + Cancel(); + + iProperty.Close(); + } + +// --------------------------------------------------------------------------- +// From class CActive. +// --------------------------------------------------------------------------- +// +void CSAStubEventListener::DoCancel() + { + iProperty.Cancel(); + } + +// --------------------------------------------------------------------------- +// From class CActive. +// --------------------------------------------------------------------------- +// +void CSAStubEventListener::RunL() + { + if ( iStatus == KErrNone ) + { + TInt newValue; + TInt errorCode = iProperty.Get( newValue ); + + if ( errorCode == KErrNone ) + { + RDEBUG_1( _L( "CStartupAdaptationStub: Event: 0x%08x." ), newValue ); + + iProperty.Set( 0 ); + TInt event = newValue & 0xFFFF0000; + event = event >> 16; + TInt arg = newValue & 0x0000FFFF; + + iSender.SendEvent( event, arg ); + } + } + + if ( iStatus != KErrCancel ) + { + iProperty.Subscribe( iStatus ); + SetActive(); + } + } + +#endif // __STARTER_MODULE_TEST_SUPPORT__ diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/sysdef_1_4_0.dtd Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/tvoutbehaviour/BWINS/tvoutbehaviouru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/tvoutbehaviour/BWINS/tvoutbehaviouru.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?NewL@CTvOutBehaviour@@SAPAV1@XZ @ 1 NONAME ; class CTvOutBehaviour * CTvOutBehaviour::NewL(void) + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/tvoutbehaviour/EABI/tvoutbehaviouru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/tvoutbehaviour/EABI/tvoutbehaviouru.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,3 @@ +EXPORTS + _ZN15CTvOutBehaviour4NewLEv @ 1 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/tvoutbehaviour/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/tvoutbehaviour/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for tvoutbehaviour stub. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +tvoutbehaviour + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/tvoutbehaviour/group/tvoutbehaviour.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/tvoutbehaviour/group/tvoutbehaviour.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for tvoutbehaviour stub. +* +*/ + + +#include + +TARGET tvoutbehaviour.dll +TARGETTYPE dll +UID 0x1000008D 0x101f6e00 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +MW_LAYER_SYSTEMINCLUDE +USERINCLUDE ../inc + +SOURCEPATH ../src +SOURCE tvoutbehaviour.cpp +SOURCE tvoutbehaviourimpl.cpp + +LIBRARY euser.lib + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/tvoutbehaviour/inc/tvoutbehaviourimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/tvoutbehaviour/inc/tvoutbehaviourimpl.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CTvOutBehaviourImpl class declaration. +* +*/ + + +#ifndef __TVOUTBEHAVIOURIMPL_H__ +#define __TVOUTBEHAVIOURIMPL_H__ + +// INCLUDE FILES +#include +#include "tvoutbehaviour.h" + +// CLASS DECLARATION + +/** + * TV Out Behaviour Stub implementation. + * + * @lib tvoutbehaviour.lib + * @since S60 TB9.2 + */ +NONSHARABLE_CLASS(CTvOutBehaviourImpl) : public CTvOutBehaviour + { +public: + + /** + * Symbian two phased constructors. + * + * @since S60 TB9.2 + * @param None. + * @return CTvOutBehaviourImpl + */ + static CTvOutBehaviourImpl* NewL(); + + /** + * C++ destructor. + */ + virtual ~CTvOutBehaviourImpl(); + +protected: // From CTvOutBehaviour + + virtual TInt SetTvOutSettings(const TTvOutSettings& aParams); + virtual TInt DeActivateSettings(); + virtual TUint GetTvOutScreenDevices(); + virtual TInt GetTvOutDisplayNumber(); + virtual TInt GetTvOutSettings(TTvOutSettings& aParams); + virtual TInt SettingsListener(TRequestStatus& aStatus); + virtual TInt CancelSettingsListener(); + virtual TInt GetTvOutDefaultSettings(TTvOutSettings& aParams); + +private: + + CTvOutBehaviourImpl(); + }; + +#endif //__TVOUTBEHAVIOURIMPL_H__ + +// End of File + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/tvoutbehaviour/rom/tvoutbehaviour.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/tvoutbehaviour/rom/tvoutbehaviour.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: tvoutbehaviour ROM files. +* +*/ + +#ifndef TVOUTBEHAVIOUR_IBY +#define TVOUTBEHAVIOUR_IBY + +file=ABI_DIR\BUILD_DIR\tvoutbehaviour.dll sys\bin\tvoutbehaviour.dll + +#endif // TVOUTBEHAVIOUR_IBY +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/tvoutbehaviour/src/tvoutbehaviour.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/tvoutbehaviour/src/tvoutbehaviour.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CTvOutBehaviour class implementation. +* +*/ + +#include "tvoutbehaviour.h" +#include "tvoutbehaviourimpl.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Symbian two phased constructor. +// --------------------------------------------------------------------------- +// +EXPORT_C CTvOutBehaviour* CTvOutBehaviour::NewL() + { + return CTvOutBehaviourImpl::NewL(); + } + +// End of File + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/tvoutbehaviour/src/tvoutbehaviourimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/tvoutbehaviour/src/tvoutbehaviourimpl.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CTvOutBehaviourImpl class implementation. +* +*/ + +#include "tvoutbehaviourimpl.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Symbian two phased constructor. +// --------------------------------------------------------------------------- +// +CTvOutBehaviourImpl* CTvOutBehaviourImpl::NewL() + { + CTvOutBehaviourImpl* self = new (ELeave) CTvOutBehaviourImpl(); + CleanupStack::Pop( self ); + return self; + } + +//--------------------------------------------------------------------------- +// CTvOutBehaviourImpl::~CTvOutBehaviourImpl +// +CTvOutBehaviourImpl::~CTvOutBehaviourImpl() + { + } + +//--------------------------------------------------------------------------- +// CTvOutBehaviourImpl::SetTvOutSettings +// +TInt CTvOutBehaviourImpl::SetTvOutSettings( const TTvOutSettings& /*aParams*/ ) + { + return KErrNotSupported; + } + +//--------------------------------------------------------------------------- +// CTvOutBehaviourImpl::DeActivateSettings +// +TInt CTvOutBehaviourImpl::DeActivateSettings() + { + return KErrNotSupported; + } + +//--------------------------------------------------------------------------- +// CTvOutBehaviourImpl::GetTvOutScreenDevices +// +TUint CTvOutBehaviourImpl::GetTvOutScreenDevices() + { + return EScreenNone; + } + +//--------------------------------------------------------------------------- +// CTvOutBehaviourImpl::GetTvOutDisplayNumber +// +TInt CTvOutBehaviourImpl::GetTvOutDisplayNumber() + { + return KErrNotSupported; + } + +//--------------------------------------------------------------------------- +// CTvOutBehaviourImpl::GetTvOutSettings +// +TInt CTvOutBehaviourImpl::GetTvOutSettings( TTvOutSettings& /*aParams*/ ) + { + return KErrNotSupported; + } + +//--------------------------------------------------------------------------- +// CTvOutBehaviourImpl::SettingsListener +// +TInt CTvOutBehaviourImpl::SettingsListener( TRequestStatus& /*aStatus*/ ) + { + return KErrNotSupported; + } + +//--------------------------------------------------------------------------- +// CTvOutBehaviourImpl::CancelSettingsListener +// +TBool CTvOutBehaviourImpl::CancelSettingsListener() + { + return EFalse; + } + +//--------------------------------------------------------------------------- +// CTvOutBehaviourImpl::GetTvOutDefaultSettings +// +TInt CTvOutBehaviourImpl::GetTvOutDefaultSettings( TTvOutSettings& /*aParams*/ ) + { + return KErrNotSupported; + } + +//--------------------------------------------------------------------------- +// CTvOutBehaviourImpl::CTvOutBehaviourImpl +// +CTvOutBehaviourImpl::CTvOutBehaviourImpl() + { + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/wiredbearerreference/data/10205074.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/wiredbearerreference/data/10205074.rss Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation. +* +*/ + + +// INCLUDE FILES +#include + +// RESOURCE DEFINITIONS +// +RESOURCE REGISTRY_INFO REMCONBEARERPLUGIN + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x10205074; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10204546; + implementations = + { + // Accessory key event handler + IMPLEMENTATION_INFO + { + implementation_uid = 0x10205075; + version_no = 1; + display_name = "Wired Bearer Reference"; + default_data = ""; + opaque_data = ""; + rom_only = 1; + } + }; + } + }; + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/wiredbearerreference/group/WiredBearerReference.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/wiredbearerreference/group/WiredBearerReference.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation. +* +*/ + + +#include + +TARGET WiredBearerReference.dll +#include +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10205074 +VENDORID VID_DEFAULT + +START RESOURCE ../data/10205074.rss +TARGET WiredBearerReference.rsc +END + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +SOURCEPATH ../src +SOURCE WiredBearerReferencePluginProxy.cpp +SOURCE WiredAccessoryKeyEventHandler.cpp +SOURCE AdaptationMessage.cpp + +LIBRARY euser.lib +LIBRARY remconbearerplugin.lib +LIBRARY remcontypes.lib + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/wiredbearerreference/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/wiredbearerreference/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation. +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../rom/WiredBearerReference.iby CORE_OS_LAYER_IBY_EXPORT_PATH(WiredBearerReference.iby) + +PRJ_MMPFILES +WiredBearerReference.mmp +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/wiredbearerreference/inc/AdaptationMessage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/wiredbearerreference/inc/AdaptationMessage.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation. +* +*/ + + + +#ifndef ADAPTATIONMESSAGE_H +#define ADAPTATIONMESSAGE_H + +// INCLUDES +#include +#include "AdaptationMessageDefinitions.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION +NONSHARABLE_CLASS( TAdaptationMessage ); + +/** +* TASYMessage +* This class declarates the TASYMessage, which is a generic message class example. +* message class. +* +*/ +class TAdaptationMessage + { + public: // Constructors and destructor + + /** + * Constructor. + * @param aGroup Message group. + * @param aID Message ID. + * @param aData Pointer to data. + */ + TAdaptationMessage( const TUint32 aGroupId, const TUint32 aMessageId, + TDesC8& aData ); + + public: // New functions + + /** + * Returns message group + * @return Message group + */ + TUint32 GroupId(); + + /** + * Returns message id + * @return Message id + */ + TUint32 MessageId(); + + /** + * Returns message data + * @return Message data + */ + TDesC8& Data(); + + + private: // Data + // Group id + TUint32 iGroupId; + + // Message id + TUint32 iMessageId; + + // Message data + TDesC8& iData; + + }; + +#endif // ADAPTATIONMESSAGE_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/wiredbearerreference/inc/AdaptationMessageDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/wiredbearerreference/inc/AdaptationMessageDefinitions.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation. +* +*/ + + +#ifndef ADAPTATIONMESSAGEDEFINITIONS_H +#define ADAPTATIONMESSAGEDEFINITIONS_H + +// INCLUDES +#include // TRemConKeyEventData from accessoryremotecontrol (S60). + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +const TUint32 KBearerMessageGroupAccessoryEvent = 0x00010002; /* Message group for Accessory events */ +const TUint32 KBearerMessageGroupAccessoryKeyEvent = 0x00010014; /* Message group for Accessory key events */ + +// RemCon event definitions +// ----------------------------------------------------------------------------- +const TUint32 KBearerMsgAccessoryKeyEvent = 0x02000001; +typedef TPckgBuf< TRemConKeyEventData > TBearerMsgAccessoryKeyEventBuf; +// ----------------------------------------------------------------------------- + + +#endif // ADAPTATIONMESSAGEDEFINITIONS_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/wiredbearerreference/inc/MAdaptation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/wiredbearerreference/inc/MAdaptation.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of MAdaptation class. MAdaptation class +* defines an example interface to receive events from Domestic OS. +* +*/ + + + +#ifndef MADAPTATION_H +#define MADAPTATION_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class TAdaptationMessage; + +// CLASS DECLARATION + +/** +* MASYAdaptation +*/ +class MAdaptation + { + + public: // New functions + + /** + * Indicates bearer about received response message + * @return none + */ + virtual void ProcessResponseL( TAdaptationMessage& aMessage ) = 0; + + /** + * Indicates bearer about received error response message + * @return none + */ + virtual void ProcessErrorResponseL( TInt aErrorCode, TAdaptationMessage& aMessage ) = 0; + + /** + * Indicates bearer about received key event message. + * @return none + */ + virtual void RaiseEventL( TAdaptationMessage& aMessage ) = 0; + }; + +#endif // MADAPTATION_H + +// End of File \ No newline at end of file diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/wiredbearerreference/inc/WiredAccessoryKeyEventHandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/wiredbearerreference/inc/WiredAccessoryKeyEventHandler.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,245 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation. +* +*/ + + + +#ifndef WIREDACCESSORYKEYEVENTHANDLER_H +#define WIREDACCESSORYKEYEVENTHANDLER_H + +// INCLUDES +#include +#include +#include +#include // from RemCon +#include +#include "MAdaptation.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class TBearerParams; +class TAdaptationMessage; + +// CLASS DECLARATION + +/** +* Declaration of CWiredAccessoryKeyEventHandler class. +*/ +class CWiredAccessoryKeyEventHandler : public CRemConBearerPlugin, public MAdaptation, public MRemConBearerInterface + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aBearerParams + */ + static CWiredAccessoryKeyEventHandler* NewL( TBearerParams& aBearerParams ); + + /** + * Destructor. + */ + virtual ~CWiredAccessoryKeyEventHandler(); + + private: // Constructors + + /** + * C++ constructor. + * @param aBearerParams + */ + CWiredAccessoryKeyEventHandler( TBearerParams& aBearerParams ); + + /** + * Symbian 2nd phase constructor. + * @return void + */ + void ConstructL(); + + private: // Functions from base classes + + /** + * From CRemConBearerPlugin + * + * Called by RemCon server to get a pointer to + * an object which implements the bearer API + * @param aUid + * @return TAny* + */ + TAny* GetInterface( TUid aUid ); + + /** + * From MRemConBearerInterface + * + * Called by RemCon to retrieve a response on a + * connection. Must only be called as a result + * of a NewResponse up-call. + * @param aInterfaceUid + * @param aTransactionId + * @param aOperationId + * @param aData, On success, ownership is returned. + * @param aAddr + * @return Error code. + */ + TInt GetResponse( TUid& aInterfaceUid, + TUint& aTransactionId, + TUint& aOperationId, + RBuf8& aData, + TRemConAddress& aAddr ); + + /** + * From MRemConBearerInterface + * + * Called by RemCon to retrieve a command on a + * connection. Must only be called as a result of + * a NewCommand up-call. + * @param aInterfaceUid + * @param aTransactionId + * @param aOperationId + * @param aCommandData, On success, ownership is returned. + * @param aAddr + * @return Error code. + */ + TInt GetCommand( TUid& aInterfaceUid, + TUint& aTransactionId, + TUint& aOperationId, + RBuf8& aCommandData, + TRemConAddress& aAddr ); + + /** + * From MRemConBearerInterface + * + * Called by RemCon to send a command on a connection. + * The connection is not assumed to exist- the bearer + * is responsible for bringing up the requested. + * connection if necessary. + * @param aInterfaceUid + * @param aOperationId + * @param aTransactionId + * @param aData, On success, ownership is passed. + * @param aAddr + * @return Error code. + */ + TInt SendCommand( TUid aInterfaceUid, + TUint aOperationId, + TUint aTransactionId, + RBuf8& aData, + const TRemConAddress& aAddr ); + + /** + * From MRemConBearerInterface + * + * Called by RemCon to send a response on a connection. + * The connection is not assumed to exist- the bearer is + * responsible for bringing up the requested connection if necessary. + * @param aInterfaceUid + * @param aOperationId + * @param aTransactionId + * @param aData, On success, ownership is passed. + * @param aAddr + * @return Error code. + */ + TInt SendResponse( TUid aInterfaceUid, + TUint aOperationId, + TUint aTransactionId, + RBuf8& aData, + const TRemConAddress& aAddr ); + + /** + * From MRemConBearerInterface + * + * Called by RemCon to establish a bearer-level + * connection to another party. Completion is signalled + * back in ConnectConfirm. + * @param aAddr + * @return void + */ + void ConnectRequest( const TRemConAddress& aAddr ); + + /** + * From MRemConBearerInterface + * + * Called by RemCon to destroy a bearer-level connection to another party. + * Completion is signalled back in DisconnectConfirm. + * @param aAddr + * @return void + */ + void DisconnectRequest( const TRemConAddress& aAddr ); + + /** + * From MRemConBearerInterface + * + * Called by RemCon when either (a) the number of controller clients changes + * from 0 to 1 or from 1 to 0, or (b) the number of target clients changes + * from 0 to 1 or from 1 to 0. + * @param aControllerPresent + * @param aTargetPresent + */ + void ClientStatus( TBool aControllerPresent, TBool aTargetPresent ); + + /** + * From MRemConBearerInterface + * + * Called by RemCon to get the capabilities required to make/destroy + * connections over the bearer, and to send and receive messages over + * the bearer. + * @return TSecurityPolicy + */ + TSecurityPolicy SecurityPolicy() const; + + private: // Enumerations + + // internal states + enum TAccKeyEventHandlerState + { + EAccKeyEventHandlerStateUnknown = -1, + EAccKeyEventHandlerStateReady, + EAccKeyEventHandlerStateNewCommand + }; + + private: // Functions from base classes + + /** + * From MAdaptation + */ + + void ProcessResponseL( TAdaptationMessage& aMessage ); + + void ProcessErrorResponseL( TInt aErrorCode, TAdaptationMessage& aMessage ); + + void RaiseEventL( TAdaptationMessage& aMessage ); + + private: // Data + + // internal state + TAccKeyEventHandlerState iState; + + // event data + TUid iInterfaceUid; + TUint iOperationId; + TUint iTransactionId; + TBuf8<64> iData; + + }; + +#endif // WIREDACCESSORYKEYEVENTHANDLER_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/wiredbearerreference/inc/acc_debug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/wiredbearerreference/inc/acc_debug.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,234 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Macro definitions for tracing and debugging purposes. +* +*/ + + +#ifndef ACC_DEBUG_H +#define ACC_DEBUG_H + +#ifdef _DEBUG + +// INCLUDES +#include + +// CONSTANTS +_LIT( KComponent, "[AccFW:Component]" ); +_LIT( KThisFile, "[AccFW:Component] - Trace this file: %s, line: %d, compiled: %s %s" ); +_LIT( KAssertion, "[AccFW:Component] - Assertion failed: File: %s, line: %d, compiled: %s %s" ); +_LIT( KPanic, "[AccFW:Component] - Panic occurred: File: %s, line: %d, compiled: %s %s" ); +_LIT8( KDATE, __DATE__ ); +_LIT8( KTIME, __TIME__ ); + +// DATA TYPES +enum TTraceType + { + ETraceInit, + ETraceAssert, + ETracePanic + }; + +// INLINE FUNCTIONS + + // ----------------------------------------------------------------------------- + // ThisFileFunc + // ----------------------------------------------------------------------------- + inline void ThisFileFunc( const TDesC8& aFile, + TInt aLine, + TTraceType aType = ETraceInit ) + { + HBufC* fileBuf = HBufC::New( aFile.Length() + 1 ); + HBufC* dateBuf = HBufC::New( 32 ); + HBufC* timeBuf = HBufC::New( 32 ); + + if ( fileBuf != NULL && dateBuf != NULL && timeBuf != NULL ) + { + fileBuf->Des().Copy( aFile ); + timeBuf->Des().Copy( KTIME ); + dateBuf->Des().Copy( KDATE ); + + if ( aType == ETraceInit ) + { + RDebug::Print( KThisFile, + fileBuf->Des().PtrZ(), + aLine, + dateBuf->Des().PtrZ(), + timeBuf->Des().PtrZ() ); + } + + else if ( aType == ETraceAssert ) + { + RDebug::Print( KAssertion, + fileBuf->Des().PtrZ(), + aLine, + dateBuf->Des().PtrZ(), + timeBuf->Des().PtrZ() ); + } + + else if ( aType == ETracePanic ) + { + RDebug::Print( KPanic, + fileBuf->Des().PtrZ(), + aLine, + dateBuf->Des().PtrZ(), + timeBuf->Des().PtrZ() ); + } + + else + { + + } + } + + else + { + RDebug::Print( _L( "Assertion and memory allocation failed!" ) ); + } + + delete fileBuf; + delete dateBuf; + delete timeBuf; + } + + // ----------------------------------------------------------------------------- + // TraceAssertFunc + // ----------------------------------------------------------------------------- + inline void TraceAssertFunc( const TDesC8& aFile, TInt aLine ) + { + ThisFileFunc( aFile, aLine, ETraceAssert ); + } + + // ----------------------------------------------------------------------------- + // TracePanicFunc + // ----------------------------------------------------------------------------- + inline void TracePanicFunc( const TDesC8& aFile, TInt aLine ) + { + ThisFileFunc( aFile, aLine, ETracePanic ); + User::Panic( KComponent, KErrGeneral ); + } + +// MACROS + #define PANIC_IF_FALSE( a ) if ( !( a ) )\ + TracePanicFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ ) + + #define PANIC_IF_TRUE( a ) if ( ( a ) )\ + TracePanicFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ ) + + #define PANIC_ALWAYS\ + TracePanicFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ ) + + // ----------------------------------------------------------------------------- + // COMPONENT_TRACE_FLAG + // ----------------------------------------------------------------------------- + #ifdef COMPONENT_TRACE_FLAG + + #define COMPONENT_TRACE_THIS_FILE\ + ThisFileFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ ) + + #define COM_TRACE_( AAA ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr ); } while ( 0 ) + + #define COM_TRACE_1( AAA, BBB ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB ); } while ( 0 ) + + #define COM_TRACE_2( AAA, BBB, CCC ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC ); } while ( 0 ) + + #define COM_TRACE_3( AAA, BBB, CCC, DDD ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD ); } while ( 0 ) + + #define COM_TRACE_4( AAA, BBB, CCC, DDD, EEE ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD, EEE ); } while ( 0 ) + + #else + + #define COMPONENT_TRACE_THIS_FILE + + #define COM_TRACE_( AAA ) + #define COM_TRACE_1( AAA, BBB ) + #define COM_TRACE_2( AAA, BBB, CCC ) + #define COM_TRACE_3( AAA, BBB, CCC, DDD ) + #define COM_TRACE_4( AAA, BBB, CCC, DDD, EEE ) + + #endif // COMPONENT_TRACE_FLAG + + #define TRACE_ASSERT( a ) if ( !( a ) )\ + TraceAssertFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ ) + + #define TRACE_ASSERT_RETURN( a ) if ( !( ( a ) == KErrNone ) )\ + TraceAssertFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ ) + + #define TRACE_ASSERT_ALWAYS\ + TraceAssertFunc( TPtrC8( ( TText8* ) __FILE__ ), __LINE__ ) + + // ----------------------------------------------------------------------------- + // API_TRACE_FLAG + // ----------------------------------------------------------------------------- + #ifdef API_TRACE_FLAG + + #define API_TRACE_( AAA ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr ); } while ( 0 ) + + #define API_TRACE_1( AAA, BBB ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB ); } while ( 0 ) + + #define API_TRACE_2( AAA, BBB, CCC ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC ); } while ( 0 ) + + #define API_TRACE_3( AAA, BBB, CCC, DDD ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD ); } while ( 0 ) + + #define API_TRACE_4( AAA, BBB, CCC, DDD, EEE ) do\ + { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD, EEE ); } while ( 0 ) + + #else + + #define API_TRACE_( AAA ) + #define API_TRACE_1( AAA, BBB ) + #define API_TRACE_2( AAA, BBB, CCC ) + #define API_TRACE_3( AAA, BBB, CCC, DDD ) + #define API_TRACE_4( AAA, BBB, CCC, DDD, EEE ) + + #endif // API_TRACE_FLAG + +#else // _DEBUG + + #define TRACE_ASSERT( a ) + #define TRACE_ASSERT_RETURN( a ) a + #define TRACE_ASSERT_ALWAYS + + #define COM_TRACE_( AAA ) + #define COM_TRACE_1( AAA, BBB ) + #define COM_TRACE_2( AAA, BBB, CCC ) + #define COM_TRACE_3( AAA, BBB, CCC, DDD ) + #define COM_TRACE_4( AAA, BBB, CCC, DDD, EEE ) + + #define API_TRACE_( AAA ) + #define API_TRACE_1( AAA, BBB ) + #define API_TRACE_2( AAA, BBB, CCC ) + #define API_TRACE_3( AAA, BBB, CCC, DDD ) + #define API_TRACE_4( AAA, BBB, CCC, DDD, EEE ) + + #define COMPONENT_TRACE_THIS_FILE + + #define PANIC_IF_FALSE( a ) + #define PANIC_IF_TRUE( a ) + #define PANIC_ALWAYS + +#endif // _DEBUG + +#endif // ACC_DEBUG_H + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/wiredbearerreference/rom/WiredBearerReference.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/wiredbearerreference/rom/WiredBearerReference.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef WIREDBEARERREFERENCE_IBY +#define WIREDBEARERREFERENCE_IBY + +ECOM_PLUGIN(WiredBearerReference.dll, WiredBearerReference.rsc) + +#endif // WIREDBEARERREFERENCE_IBY + +// End of File + diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/wiredbearerreference/src/AdaptationMessage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/wiredbearerreference/src/AdaptationMessage.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The implementation of TAdaptationMessage example clas.s +* +*/ + + + +// INCLUDE FILES +#include "AdaptationMessage.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// TSASMessage::TSASMessage +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +TAdaptationMessage::TAdaptationMessage( const TUint32 aGroupId, const TUint32 aMessageId, TDesC8& aData ) + : iGroupId( aGroupId ), + iMessageId( aMessageId ), + iData( aData ) + { + } + +// ----------------------------------------------------------------------------- +// TSASMessage::GroupId() +// ----------------------------------------------------------------------------- +// +TUint32 TAdaptationMessage::GroupId() + { + + return iGroupId; + + } + +// ----------------------------------------------------------------------------- +// TSASMessage::MessageId() +// ----------------------------------------------------------------------------- +// +TUint32 TAdaptationMessage::MessageId() + { + + return iMessageId; + + } + +// ----------------------------------------------------------------------------- +// TSASMessage::Data() +// ----------------------------------------------------------------------------- +// +TDesC8& TAdaptationMessage::Data() + { + + return iData; + + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/wiredbearerreference/src/WiredAccessoryKeyEventHandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/wiredbearerreference/src/WiredAccessoryKeyEventHandler.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,380 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation. +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include "WiredAccessoryKeyEventHandler.h" +#include "AdaptationMessage.h" + +#include "AdaptationMessageDefinitions.h" +#include "acc_debug.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CWiredAccessoryKeyEventHandler::CWiredAccessoryKeyEventHandler +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CWiredAccessoryKeyEventHandler::CWiredAccessoryKeyEventHandler( TBearerParams& aBearerParams ) + : CRemConBearerPlugin( aBearerParams ) + , iState( EAccKeyEventHandlerStateUnknown ) + , iOperationId( 0 ) + , iTransactionId( 0 ) + { + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::CWiredAccessoryKeyEventHandler() - Enter" ); + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::CWiredAccessoryKeyEventHandler() - Return" ); + + } + +// ----------------------------------------------------------------------------- +// CWiredAccessoryKeyEventHandler::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CWiredAccessoryKeyEventHandler::ConstructL() + { + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::ConstructL() - Enter" ); + // + // initialization of event subscribe(s) can be done here. + // + iState = EAccKeyEventHandlerStateReady; + + + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::ConstructL() - Return" ); + + } + +// ----------------------------------------------------------------------------- +// CWiredAccessoryKeyEventHandler::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CWiredAccessoryKeyEventHandler* CWiredAccessoryKeyEventHandler::NewL( TBearerParams& aBearerParams ) + { + CWiredAccessoryKeyEventHandler* self = new (ELeave) CWiredAccessoryKeyEventHandler( aBearerParams ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// Destructor +CWiredAccessoryKeyEventHandler::~CWiredAccessoryKeyEventHandler() + { + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::~CWiredAccessoryKeyEventHandler() - Enter" ); + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::~CWiredAccessoryKeyEventHandler() - Return" ); + } + +// ----------------------------------------------------------------------------- +// CWiredAccessoryKeyEventHandler::GetInterface +// ----------------------------------------------------------------------------- +// +TAny* CWiredAccessoryKeyEventHandler::GetInterface( TUid aUid ) + { + + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::GetInterface() - Enter" ); + + + TAny* bearer = NULL; + + if ( aUid == TUid::Uid( KRemConBearerInterface1 ) ) + { + bearer = reinterpret_cast( static_cast( this ) ); + } + else + { + // Interface is not supported! + } + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::GetInterface() - Return" ); + + return bearer; + } + +// ----------------------------------------------------------------------------- +// CWiredAccessoryKeyEventHandler::GetResponse +// ----------------------------------------------------------------------------- +// +TInt CWiredAccessoryKeyEventHandler::GetResponse( TUid& aInterfaceUid, + TUint& aTransactionId, + TUint& aOperationId, + RBuf8& aCommandData, + TRemConAddress& aAddr ) + { + + // Only events are forwarded, thus no need to implement get response + TInt err ( KErrNotSupported ); + + ( void ) aTransactionId; + ( void ) aOperationId; + ( void ) aCommandData; + ( void ) aAddr; + ( void ) aInterfaceUid; + + return err; + } + +// ----------------------------------------------------------------------------- +// CSACAccessoryKeyEventHandler::GetCommand +// ----------------------------------------------------------------------------- +// +TInt CWiredAccessoryKeyEventHandler::GetCommand( TUid& aInterfaceUid, + TUint& aTransactionId, + TUint& aOperationId, + RBuf8& aCommandData, + TRemConAddress& aAddr ) + { + + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::GetCommand() - Enter" ); + TInt err ( KErrNone ); + + if ( iState != EAccKeyEventHandlerStateNewCommand ) + { + err = KErrNotReady; + } + else + { + aInterfaceUid = iInterfaceUid; + aTransactionId = iTransactionId++; + aOperationId = iOperationId; + + aAddr.BearerUid() = Uid(); + aAddr.Addr() = KNullDesC8(); + + iState = EAccKeyEventHandlerStateReady; + + TRAP( err, aCommandData.CreateL( iData ) ); + + if ( err != KErrNone ) + { + //GetCommand - failed to create data + } + } + + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::GetCommand() - Return" ); + return err; + } + +// ----------------------------------------------------------------------------- +// CWiredAccessoryKeyEventHandler::SendCommand +// ----------------------------------------------------------------------------- +// +TInt CWiredAccessoryKeyEventHandler::SendCommand( TUid aInterfaceUid, + TUint aOperationId, + TUint aTransactionId, + RBuf8& aData, + const TRemConAddress& aAddr ) + { + + // Only events are forwarded, thus no need to implement send command + TInt err ( KErrNotSupported ); + + ( void ) aTransactionId; + ( void ) aOperationId; + ( void ) aAddr; + ( void ) aInterfaceUid; + ( void ) aData; + + return err; + } + +// ----------------------------------------------------------------------------- +// CWiredAccessoryKeyEventHandler::SendResponse +// ----------------------------------------------------------------------------- +// +TInt CWiredAccessoryKeyEventHandler::SendResponse( TUid aInterfaceUid, + TUint aOperationId, + TUint aTransactionId, + RBuf8& aData, + const TRemConAddress& aAddr ) + { + + // Only events are forwarded, thus no need to implement send response + TInt err ( KErrNotSupported ); + + ( void ) aTransactionId; + ( void ) aOperationId; + ( void ) aAddr; + ( void ) aInterfaceUid; + ( void ) aData; + + return err; + } + +// ----------------------------------------------------------------------------- +// CWiredAccessoryKeyEventHandler::ConnectRequest +// ----------------------------------------------------------------------------- +// +void CWiredAccessoryKeyEventHandler::ConnectRequest( const TRemConAddress& aAddr ) + { + + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::ConnectRequest() - Enter" ); + + + TInt err = Observer().ConnectConfirm( aAddr, KErrNone ); + + if ( err != KErrNone ) + { + // ConnectConfirm failed + } + + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::ConnectRequest() - Return" ); + } + +// ----------------------------------------------------------------------------- +// CWiredAccessoryKeyEventHandler::DisconnectRequest +// ----------------------------------------------------------------------------- +// +void CWiredAccessoryKeyEventHandler::DisconnectRequest( const TRemConAddress& aAddr ) + { + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::DisconnectRequest() - Enter" ); + + Observer().DisconnectConfirm( aAddr, KErrNone ); + + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::DisconnectRequest() - Return" ); + } + +// ----------------------------------------------------------------------------- +// CWiredAccessoryKeyEventHandler::ClientStatus +// ----------------------------------------------------------------------------- +// +void CWiredAccessoryKeyEventHandler::ClientStatus( TBool aControllerPresent, TBool aTargetPresent ) + { + ( void ) aTargetPresent; + ( void ) aControllerPresent; + } + +// ----------------------------------------------------------------------------- +// CWiredAccessoryKeyEventHandler::SecurityPolicy +// ----------------------------------------------------------------------------- +// +TSecurityPolicy CWiredAccessoryKeyEventHandler::SecurityPolicy() const + { + + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::SecurityPolicy() - Enter" ); + TSecurityPolicy securityPolicy ( ECapabilitySwEvent ); + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::SecurityPolicy() - Return" ); + return securityPolicy; + } + +// ----------------------------------------------------------------------------- +// CWiredAccessoryKeyEventHandler::ProcessResponseL +// ----------------------------------------------------------------------------- +// +void CWiredAccessoryKeyEventHandler::ProcessResponseL( TAdaptationMessage& aMessage ) + { + ( void ) aMessage; + } + +// ----------------------------------------------------------------------------- +// CWiredAccessoryKeyEventHandler::ProcessErrorResponseL +// ----------------------------------------------------------------------------- +// +void CWiredAccessoryKeyEventHandler::ProcessErrorResponseL( TInt aErrorCode, + TAdaptationMessage& aMessage ) + { + ( void ) aErrorCode; + ( void ) aMessage; + } + +// ----------------------------------------------------------------------------- +// CWiredAccessoryKeyEventHandler::RaiseEventL +// ----------------------------------------------------------------------------- +// +void CWiredAccessoryKeyEventHandler::RaiseEventL( TAdaptationMessage& aMessage ) + { + + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::RaiseEventL() - Enter" ); + //Accessory key events are received from Accessory Driver/Domestic OS. + + if ( iState != EAccKeyEventHandlerStateReady ) + { + User::Leave( KErrNotReady ); + } + + // only key events are supported + if ( aMessage.GroupId() != KBearerMessageGroupAccessoryEvent && aMessage.MessageId() != KBearerMessageGroupAccessoryKeyEvent ) + { + User::Leave( KErrArgument ); + } + + TRemConMessageType type( ERemConCommand ); + + // Note! + // following uid 0x102069AA should be used if platform key event converter is used, + // uid is hard coded to platfrom converter which is returned to remotecontrol. + // Data should give as format defined in S60_Accessory_Key_Event_Handling_API_Specification_C.doc. + const TInt KWireBearerUid = 0x102069AA; + + TInt err = Observer().BearerToInterface( TUid::Uid( KWireBearerUid ), + aMessage.Data(), + aMessage.Data(), + iInterfaceUid, + iOperationId, + type, + iData ); + if ( err == KErrNotSupported ) + { + + } + else if ( err == KErrNone ) + { + iState = EAccKeyEventHandlerStateNewCommand; + + TRemConAddress addr; + addr.BearerUid() = Uid(); + addr.Addr() = KNullDesC8(); + + err = Observer().NewCommand( addr ); + + if ( err != KErrNone ) + { + User::Leave( err ); + } + } + else + // leave if converting fails + { + User::Leave( err ); + } + + COM_TRACE_( "[AccFW:WiredBearerReference] CWiredAccessoryKeyEventHandler::RaiseEventL() - Return" ); + } + +// End of File diff -r 000000000000 -r 0ce1b5ce9557 systemswstubs/wiredbearerreference/src/WiredBearerReferencePluginProxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemswstubs/wiredbearerreference/src/WiredBearerReferencePluginProxy.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used as an reference implementation. +* +*/ + + +// INCLUDE FILES +#include +#include "WiredAccessoryKeyEventHandler.h" + +// CONSTANTS +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10205075, CWiredAccessoryKeyEventHandler::NewL )//lint !e611 + }; + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// TImplementationProxy* ImplementationGroupProxy +// ----------------------------------------------------------------------------- +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aCount ) + { + aCount = sizeof ( ImplementationTable ) / sizeof ( TImplementationProxy ); + + return ImplementationTable; + } + +// End of File + diff -r 000000000000 -r 0ce1b5ce9557 tactileclickplugin_stub/bwins/tactileclickpluginu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tactileclickplugin_stub/bwins/tactileclickpluginu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?CreateClickMakerL@@YAPAVCClickMaker@@XZ @ 1 NONAME ; class CClickMaker * CreateClickMakerL(void) + ?Instance@MTactileFeedbackServer@@SAPAV1@XZ @ 2 NONAME ; class MTactileFeedbackServer * MTactileFeedbackServer::Instance(void) + diff -r 000000000000 -r 0ce1b5ce9557 tactileclickplugin_stub/eabi/tactileclickpluginu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tactileclickplugin_stub/eabi/tactileclickpluginu.def Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + _Z17CreateClickMakerLv @ 1 NONAME + _ZN22MTactileFeedbackServer8InstanceEv @ 2 NONAME + diff -r 000000000000 -r 0ce1b5ce9557 tactileclickplugin_stub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tactileclickplugin_stub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for click maker plugin stub. +* Part of: Tactile Feedback. +* +*/ + +#ifdef RD_TACTILE_FEEDBACK + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/tactileclickpluginstub.iby CORE_IBY_EXPORT_PATH(stubs,tactileclickpluginstub.iby) + +PRJ_MMPFILES +tactileclickpluginstub.mmp + +#endif // RD_TACTILE_FEEDBACK diff -r 000000000000 -r 0ce1b5ce9557 tactileclickplugin_stub/group/tactileclickpluginstub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tactileclickplugin_stub/group/tactileclickpluginstub.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is stub for compilation and running of Tactile Feedback +* dependent components, when the real implementation is not +* available. +* Part of: Tactile Feedback. +* +*/ + + +#include + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET tactileclickplugin.dll +TARGETTYPE DLL +UID 0x10004F63 0x2000B493 + +CAPABILITY ALL -TCB +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE tactileclickpluginstub.cpp +SOURCE tactilefeedbackserverstub.cpp + +USERINCLUDE ../inc + +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib + diff -r 000000000000 -r 0ce1b5ce9557 tactileclickplugin_stub/inc/tactileclickpluginstub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tactileclickplugin_stub/inc/tactileclickpluginstub.h Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,173 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The click maker plugin, which +* handles key events at window server process. +* Part of: Tactile Feedback. +* +*/ + + +#ifndef C_TACTILECLICKPLUGIN_H +#define C_TACTILECLICKPLUGIN_H + + + +#include + +#include "tactilefeedbackserver.h" + + + +/** + * The click maker plugin to be used as stub when the real plugin is + * not available. + * + * All connections fail with KErrNotSupported, which will essentially + * disable feedback support on client side. + * + * @lib tactilefeedbackresolver.dll + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CTactileClickPlugin ): + public CClickMaker, + public MTactileFeedbackServer + { +public: + + static CTactileClickPlugin* NewL(); + + virtual ~CTactileClickPlugin(); + +// from base class CClickMaker + + /** + * From CClickMaker. + * This function is called by the window server whenever there is a + * key event, to generate the sound. + * + * The key events are not used by this plugin actually, because this + * plug-in's purpose is to handle only pointer events. + * + * @since S60 v5.0 + * @param aType - The type of the key event. + * @param aEvent - The key event details. + */ + void KeyEvent( TEventCode aType,const TKeyEvent& aEvent ); + + /** + * From CClickMaker. + * This function is called by the window server whenever there is a + * pointer event, to generate the sound. + * + * Not used by this plug-in because there is not enough information in + * the pointer event for resolving the actual area and window where + * pointer event was hit. Intead pointer events are handled in + * OtherEvent -function. + * + * @since S60 v5.0 + * @param aEvent - The pointer event details. + */ + void PointerEvent( const TPointerEvent& aEvent ); + + /** + * From CClickMaker. + * This function is a "future expansion" or the original click maker API, + * and it has been taken into use by this plugin for getting more + * information about the pointer event than what is possible to pass as + * parameter to PointerEvent -function. + * + * This stub ignores all events. + * + * @since S60 v5.0 + * @param aType - The type of the event. + * @param aParam - Pointer to data package containing the pointer event, + * window identifier where pointer event hit, and window + * group identifier of the window group where the window + * belongs to. + */ + void OtherEvent( TInt aType, TAny* aParam=NULL ); + + /** + * From CClickMaker. + * Implemented to enable this plug-in to communicate with the window + * server client. + * + * Area registry management communication (such as creating or closing + * an application) is communicated through this function. + * + * In practice communication is done between this plug-in, and + * Tactile Feedback Client API implementation. + * + * This plugin completes connect requests with KErrNotSupported, and all + * other requests with KErrNone without actually doing any actions. + * + * @since S60 v5.0 + * @param aOpcode - Opcode of the command sent by Client API + * @param aArgs - Pointer to the data sent by client. + */ + TInt CommandReplyL( TInt aOpcode, TAny* aArgs ); + + +// from base class MTactileFeedbackServer + + /** + * From MTactileFeedbackServer. + * Direct feedback service for Anim Dll plugins. + * + * This stub ignores all instant feedback requests. + * + * @since S60 v5.0 + * @param aType - Logical feedback type to play. + */ + void InstantFeedback( TTouchLogicalFeedback aType ); + +private: + + CTactileClickPlugin(); + + void ConstructL(); + + /** + * Handles data parsing when new client connects to this plugin. + * + * No real functionality in this stub. + * + * @param aArgs - Pointer to the data sent by client. + * @return Always KErrNotSupported in this stub. + */ + TInt HandleConnectL( TAny* aArgs ); + + /** + * Handles data parsing when new client connects to this plugin. + * + * No real functionality in this stub. + * + * @param aArgs - Pointer to the data sent by client. + */ + void HandleDisconnectL( TAny* aArgs ); + + /** + * Handles direct feedback request from Tactile Client API. + * + * No real functionality in this stub. + * + * @param aArgs - Pointer to the data sent by client. + * @return KErrNone if operation succeeded, otherwise one of standand + * Symbian OS error codes. + */ + TInt HandleImmediateFeedbackL( TAny* aArgs ); + }; + + +#endif // C_TACTILECLICKPLUGIN_H diff -r 000000000000 -r 0ce1b5ce9557 tactileclickplugin_stub/layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tactileclickplugin_stub/layers.sysdef.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,14 @@ + + +]> + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 tactileclickplugin_stub/rom/tactileclickpluginstub.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tactileclickplugin_stub/rom/tactileclickpluginstub.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is the IBY file of Tactile Click Plugin stub. +* Part of: Tactile Feedback. +* +*/ + + + +#ifndef TACTILECLICKPLUGIN_IBY +#define TACTILECLICKPLUGIN_IBY + +#ifdef RD_TACTILE_FEEDBACK + +#include + +file=ABI_DIR\BUILD_DIR\tactileclickplugin.dll SHARED_LIB_DIR\tactileclickplugin.dll + +#endif // RD_TACTILE_FEEDBACK + +#endif // TACTILECLICKPLUGIN_IBY diff -r 000000000000 -r 0ce1b5ce9557 tactileclickplugin_stub/src/tactileclickpluginstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tactileclickplugin_stub/src/tactileclickpluginstub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The click maker plugin, which +* handles key events at window server process. +* Part of: Tactile Feedback. +* +*/ + + + +#include +#include "tactileclickpluginstub.h" + + +/** + * These are used as opcodes (function number) in IPC communication + * between Tactile Feedback Client and the server hosting + * Tactile Area Registry (currently window server) + */ +enum TTactileFeedbackOpCodes + { + ETactileOpCodeConnect = 200, + ETactileOpCodeDisconnect = 201, + ETactileOpCodeImmediateFeedback = 202 + }; + + + +// ======== MEMBER FUNCTIONS ======== + + +CTactileClickPlugin::CTactileClickPlugin() + { + } + + +void CTactileClickPlugin::ConstructL() + { + // We need to store ourselves to thead local storage, so that + // Anim Dll plugins can access the feedback functionality + Dll::SetTls( this ); + } + + +// --------------------------------------------------------------------------- +// We really have to trap ConstructL, because construction of click maker +// plug-in must not fail (otherwise WSERV will panic, resulting in KERN 4 and +// re-boot of whole device). +// --------------------------------------------------------------------------- +// +CTactileClickPlugin* CTactileClickPlugin::NewL() + { + CTactileClickPlugin* self = new( ELeave ) CTactileClickPlugin; + TRAP_IGNORE( self->ConstructL() ); + return self; + } + + +CTactileClickPlugin::~CTactileClickPlugin() + { + } + + +// --------------------------------------------------------------------------- +// From class CClickMaker. +// No implementation needed +// --------------------------------------------------------------------------- +// +void CTactileClickPlugin::KeyEvent( + TEventCode /*aType*/, const TKeyEvent& /*aEvent*/ ) + { + } + +// --------------------------------------------------------------------------- +// From class CClickMaker. +// No implementation needed +// --------------------------------------------------------------------------- +// +void CTactileClickPlugin::PointerEvent( const TPointerEvent& /*aEvent*/ ) + { + } + +// --------------------------------------------------------------------------- +// From class CClickMaker. +// --------------------------------------------------------------------------- +// +void CTactileClickPlugin::OtherEvent( TInt /*aType*/, TAny* /*aParam*/ ) + { + } + + +// --------------------------------------------------------------------------- +// From class CClickMaker. +// This is run when client calls RSoundPlugin::CommandReply -function. +// +// Handling of individual commands has been moved to dedicated functions, +// because data handling requires some effort and relively complex code. +// This is due to the mistake in CClickMaker API design, as the data is +// not delivered in the same format as it was passed to RSoundPlugin on +// client side (client gives data in descriptor, but here the descriptor +// needs to be re-built from TAny* pointer, and in addition the lenght +// of data needs to be known based on command id). +// --------------------------------------------------------------------------- +// +TInt CTactileClickPlugin::CommandReplyL( TInt aOpcode, TAny* aArgs ) + { + TInt errCode = KErrNone; + + switch ( aOpcode ) + { + case ETactileOpCodeConnect: + errCode = HandleConnectL( aArgs ); + break; + case ETactileOpCodeDisconnect: + HandleDisconnectL( aArgs ); + break; + case ETactileOpCodeImmediateFeedback: + errCode = HandleImmediateFeedbackL( aArgs ); + break; + default: + break; + } + + return errCode; + }; + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CTactileClickPlugin::InstantFeedback( TTouchLogicalFeedback /*aType*/ ) + { + } + + +// --------------------------------------------------------------------------- +// This is not real plugin --> Always return KErrNotSupported +// --------------------------------------------------------------------------- +// +TInt CTactileClickPlugin::HandleConnectL( TAny* /*aArgs*/ ) + { + return KErrNotSupported; + } + + +// --------------------------------------------------------------------------- +// No need to do anything here +// --------------------------------------------------------------------------- +// +void CTactileClickPlugin::HandleDisconnectL( TAny* /*aArgs*/ ) + { + } + + +// --------------------------------------------------------------------------- +// No need to do anything here +// --------------------------------------------------------------------------- +// +TInt CTactileClickPlugin::HandleImmediateFeedbackL( TAny* /*aArgs*/ ) + { + return KErrNone; + } + + +// ======== GLOBAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Function with this signature needs to be the first exported function +// in click maker plugin DLLs. +// +// Constructs and returns an instance to tactile click maker plugin. +// --------------------------------------------------------------------------- +// +EXPORT_C CClickMaker* CreateClickMakerL() + { + CTactileClickPlugin* clickMaker = CTactileClickPlugin::NewL(); + return clickMaker; + } diff -r 000000000000 -r 0ce1b5ce9557 tactileclickplugin_stub/src/tactilefeedbackserverstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tactileclickplugin_stub/src/tactilefeedbackserverstub.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the method for accessing +* MTactileFeedbackServer -instance +* Part of: Tactile Feedback. +* +*/ + + +#include "tactileclickpluginstub.h" +#include "tactilefeedbackserver.h" + + + + +EXPORT_C MTactileFeedbackServer* MTactileFeedbackServer::Instance() + { + CTactileClickPlugin* clickPlugin = NULL; + + TAny* tmpPtr = Dll::Tls(); + + if ( tmpPtr ) + { + clickPlugin = static_cast( tmpPtr ); + } + + return clickPlugin; + } + + diff -r 000000000000 -r 0ce1b5ce9557 tactileclickplugin_stub/sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tactileclickplugin_stub/sysdef_1_4_0.dtd Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 wlanhwinit_stub/bwinscw/wlanhwinitU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanhwinit_stub/bwinscw/wlanhwinitU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,9 @@ +EXPORTS + ??1CWlanHwInit@@UAE@XZ @ 1 NONAME ; CWlanHwInit::~CWlanHwInit(void) + ?GetHwInitData@CWlanHwInit@@UAEXPAPBEAAI01@Z @ 2 NONAME ; void CWlanHwInit::GetHwInitData(unsigned char const * *, unsigned int &, unsigned char const * *, unsigned int &) + ?GetHwTestData@CWlanHwInit@@UAEHIAAVTDes8@@@Z @ 3 NONAME ; int CWlanHwInit::GetHwTestData(unsigned int, class TDes8 &) + ?GetHwTestInitData@CWlanHwInit@@UAEXPAPBEAAI01@Z @ 4 NONAME ; void CWlanHwInit::GetHwTestInitData(unsigned char const * *, unsigned int &, unsigned char const * *, unsigned int &) + ?GetMacAddress@CWlanHwInit@@UAEHAAUTMacAddr@@@Z @ 5 NONAME ; int CWlanHwInit::GetMacAddress(struct TMacAddr &) + ?NewL@CWlanHwInit@@SAPAV1@XZ @ 6 NONAME ; class CWlanHwInit * CWlanHwInit::NewL(void) + ?SetHwTestData@CWlanHwInit@@UAEHIAAVTDesC8@@@Z @ 7 NONAME ; int CWlanHwInit::SetHwTestData(unsigned int, class TDesC8 &) + diff -r 000000000000 -r 0ce1b5ce9557 wlanhwinit_stub/eabi/wlanhwinitU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanhwinit_stub/eabi/wlanhwinitU.DEF Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,16 @@ +EXPORTS + _ZN11CWlanHwInit13GetHwInitDataEPPKhRjS2_S3_ @ 1 NONAME + _ZN11CWlanHwInit13GetHwTestDataEjR5TDes8 @ 2 NONAME + _ZN11CWlanHwInit13GetMacAddressER8TMacAddr @ 3 NONAME + _ZN11CWlanHwInit13SetHwTestDataEjR6TDesC8 @ 4 NONAME + _ZN11CWlanHwInit17GetHwTestInitDataEPPKhRjS2_S3_ @ 5 NONAME + _ZN11CWlanHwInit4NewLEv @ 6 NONAME + _ZN11CWlanHwInitD0Ev @ 7 NONAME + _ZN11CWlanHwInitD1Ev @ 8 NONAME + _ZN11CWlanHwInitD2Ev @ 9 NONAME + _ZThn4_N11CWlanHwInit13GetHwInitDataEPPKhRjS2_S3_ @ 10 NONAME ; ## + _ZThn4_N11CWlanHwInit13GetHwTestDataEjR5TDes8 @ 11 NONAME ; ## + _ZThn4_N11CWlanHwInit13GetMacAddressER8TMacAddr @ 12 NONAME ; ## + _ZThn4_N11CWlanHwInit13SetHwTestDataEjR6TDesC8 @ 13 NONAME ; ## + _ZThn4_N11CWlanHwInit17GetHwTestInitDataEPPKhRjS2_S3_ @ 14 NONAME ; ## + diff -r 000000000000 -r 0ce1b5ce9557 wlanhwinit_stub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanhwinit_stub/group/bld.inf Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Component definition file used for building the WLAN HW Init +* +*/ + +/* +* %version: 11 % +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +// Export iby file +../rom/wlanhwinit.iby CORE_IBY_EXPORT_PATH(stubs,wlanhwinit.iby) + +PRJ_MMPFILES +wlanhwinit.mmp diff -r 000000000000 -r 0ce1b5ce9557 wlanhwinit_stub/group/wlanhwinit.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanhwinit_stub/group/wlanhwinit.mmp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for the WLAN HW Init +* +*/ + +/* +* %version: 7 % +*/ + +#include + +TARGET wlanhwinit.dll +TARGETTYPE dll +UID 0x1000008d 0x10207267 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +#if defined( ARMCC ) +DEFFILE ../eabi/ +#elif defined( WINSCW ) +DEFFILE ../bwinscw/ +#elif defined( WINS ) +DEFFILE ../bwins/ +#else +DEFFILE ../bmarm/ +#endif + +SOURCEPATH ../src +SOURCE wlanhwinit.cpp + +USERINCLUDE ../inc +OS_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib diff -r 000000000000 -r 0ce1b5ce9557 wlanhwinit_stub/layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanhwinit_stub/layers.sysdef.xml Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,14 @@ + + +]> + + + + + + + + + + diff -r 000000000000 -r 0ce1b5ce9557 wlanhwinit_stub/rom/wlanhwinit.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanhwinit_stub/rom/wlanhwinit.iby Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: IBY file for the WLAN HW Init +* +*/ + +/* +* %version: 4 % +*/ + +#ifndef WLANHWINIT_IBY +#define WLANHWINIT_IBY + +file=ABI_DIR\BUILD_DIR\wlanhwinit.dll SHARED_LIB_DIR\wlanhwinit.dll + +#endif // WLANHWINIT_IBY diff -r 000000000000 -r 0ce1b5ce9557 wlanhwinit_stub/src/wlanhwinit.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanhwinit_stub/src/wlanhwinit.cpp Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The implementation of CWlanHwInit class +* +*/ + +/* +* %version: 5 % +*/ + +#include + +// ============================ MEMBER FUNCTIONS =============================== + +CWlanHwInit::CWlanHwInit() : + iMain( NULL ) + { + } + +void CWlanHwInit::ConstructL() + { + } + +EXPORT_C CWlanHwInit* CWlanHwInit::NewL() + { + CWlanHwInit* self = new( ELeave ) CWlanHwInit; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +EXPORT_C CWlanHwInit::~CWlanHwInit() + { + } + +// ----------------------------------------------------------------------------- +// CWlanHwInit::GetHwInitData +// ----------------------------------------------------------------------------- +// +EXPORT_C void CWlanHwInit::GetHwInitData( + const TUint8** aInitData, + TUint& aInitLength, + const TUint8** aFwData, + TUint& aFwLength ) + { + *aInitData = NULL; + aInitLength = 0; + *aFwData = NULL; + aFwLength = 0; + } + +// ----------------------------------------------------------------------------- +// CWlanHwInit::GetMacAddress +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CWlanHwInit::GetMacAddress( + TMacAddr& aMacAddress ) + { + aMacAddress.iMacAddress[0] = 0x00; + aMacAddress.iMacAddress[1] = 0xE0; + aMacAddress.iMacAddress[2] = 0xDE; + aMacAddress.iMacAddress[3] = 0xAD; + aMacAddress.iMacAddress[4] = 0xBE; + aMacAddress.iMacAddress[5] = 0xEF; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CWlanHwInit::GetHwTestInitData +// ----------------------------------------------------------------------------- +// +EXPORT_C void CWlanHwInit::GetHwTestInitData( + const TUint8** aInitData, + TUint& aInitLength, + const TUint8** aFwData, + TUint& aFwLength ) + { + *aInitData = NULL; + aInitLength = 0; + *aFwData = NULL; + aFwLength = 0; + } + +// ----------------------------------------------------------------------------- +// CWlanHwInit::GetHwTestData +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CWlanHwInit::GetHwTestData( + TUint /*aId*/, + TDes8& /*aData*/ ) + { + return KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// CWlanHwInit::SetHwTestData +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CWlanHwInit::SetHwTestData( + TUint /*aId*/, + TDesC8& /*aData*/ ) + { + return KErrNotSupported; + } diff -r 000000000000 -r 0ce1b5ce9557 wlanhwinit_stub/sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanhwinit_stub/sysdef_1_4_0.dtd Thu Jan 14 07:14:53 2010 +0200 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +