sl@0: /* sl@0: * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: Implementation of the listenerlocation effect class sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: // INCLUDE FILES sl@0: sl@0: #ifdef _DEBUG sl@0: #include sl@0: #endif sl@0: sl@0: #include sl@0: #include sl@0: #include "SourceLocationProxy.h" sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #ifdef _DEBUG sl@0: #define DEBPRN0 RDebug::Printf( "%s", __PRETTY_FUNCTION__); sl@0: #define DEBPRN1(str) RDebug::Printf( "%s %s", __PRETTY_FUNCTION__, str ); sl@0: #else sl@0: #define DEBPRN0 sl@0: #define DEBPRN1(str) sl@0: #endif sl@0: sl@0: // ============================ MEMBER FUNCTIONS =============================== sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSourceLocation::CSourceLocation sl@0: // C++ default constructor can NOT contain any code, that sl@0: // might leave. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CSourceLocation::CSourceLocation() sl@0: { sl@0: } sl@0: sl@0: // Destructor sl@0: EXPORT_C CSourceLocation::~CSourceLocation() sl@0: { sl@0: } sl@0: sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSourceLocation::NewL sl@0: // Static function for creating an instance of the SourceLocation object. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CSourceLocation* CSourceLocation::NewL( sl@0: CMdaAudioInputStream& aUtility ) sl@0: { sl@0: sl@0: DEBPRN0; sl@0: CSourceLocationProxy* sourceLocationProxy = (CSourceLocationProxy*)aUtility.CustomInterface(KUidSourceLocationEffect); sl@0: sl@0: if (sourceLocationProxy == NULL) sl@0: { sl@0: DEBPRN1("No Adaptation Support - leaving"); sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: return sourceLocationProxy; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSourceLocation::NewL sl@0: // Static function for creating an instance of the SourceLocation object. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CSourceLocation* CSourceLocation::NewL( sl@0: CMdaAudioOutputStream& aUtility ) sl@0: { sl@0: sl@0: DEBPRN0; sl@0: CSourceLocationProxy* sourceLocationProxy = (CSourceLocationProxy*)aUtility.CustomInterface(KUidSourceLocationEffect); sl@0: sl@0: if (sourceLocationProxy == NULL) sl@0: { sl@0: DEBPRN1("No Adaptation Support - leaving"); sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: return sourceLocationProxy; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSourceLocation::NewL sl@0: // Static function for creating an instance of the SourceLocation object. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CSourceLocation* CSourceLocation::NewL( sl@0: CMdaAudioConvertUtility& aUtility ) sl@0: { sl@0: sl@0: DEBPRN0; sl@0: CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility); sl@0: CleanupStack::PushL(customInterface); sl@0: sl@0: CSourceLocationProxy* sourceLocationProxy = (CSourceLocationProxy*)customInterface->CustomInterface(KUidSourceLocationEffect); sl@0: sl@0: if ( !sourceLocationProxy ) sl@0: { sl@0: DEBPRN1("No Adaptation Support - leaving"); sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: CleanupStack::Pop(customInterface); sl@0: sl@0: return sourceLocationProxy; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSourceLocation::NewL sl@0: // Static function for creating an instance of the SourceLocation object. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CSourceLocation* CSourceLocation::NewL( sl@0: CMdaAudioPlayerUtility& aUtility ) sl@0: { sl@0: sl@0: DEBPRN0; sl@0: CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility); sl@0: CleanupStack::PushL(customInterface); sl@0: sl@0: CSourceLocationProxy* sourceLocationProxy = (CSourceLocationProxy*)customInterface->CustomInterface(KUidSourceLocationEffect); sl@0: sl@0: if ( !sourceLocationProxy ) sl@0: { sl@0: DEBPRN1("No Adaptation Support - leaving"); sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: CleanupStack::Pop(customInterface); sl@0: sl@0: return sourceLocationProxy; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSourceLocation::NewL sl@0: // Static function for creating an instance of the SourceLocation object. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CSourceLocation* CSourceLocation::NewL( sl@0: CMdaAudioRecorderUtility& aUtility, sl@0: TBool aRecordStream ) sl@0: { sl@0: sl@0: DEBPRN0; sl@0: CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility, aRecordStream); sl@0: CleanupStack::PushL(customInterface); sl@0: sl@0: CSourceLocationProxy* sourceLocationProxy = (CSourceLocationProxy*)customInterface->CustomInterface(KUidSourceLocationEffect); sl@0: sl@0: if ( !sourceLocationProxy ) sl@0: { sl@0: DEBPRN1("No Adaptation Support - leaving"); sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: CleanupStack::Pop(customInterface); sl@0: sl@0: return sourceLocationProxy; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSourceLocation::NewL sl@0: // Static function for creating an instance of the SourceLocation object. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CSourceLocation* CSourceLocation::NewL( sl@0: CMdaAudioToneUtility& aUtility) sl@0: { sl@0: sl@0: DEBPRN0; sl@0: CSourceLocationProxy* sourceLocationProxy = (CSourceLocationProxy*)aUtility.CustomInterface(KUidSourceLocationEffect); sl@0: sl@0: if (sourceLocationProxy == NULL) sl@0: { sl@0: DEBPRN1("No Adaptation Support - leaving"); sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: return sourceLocationProxy; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSourceLocation::NewL sl@0: // Static function for creating an instance of the SourceLocation object. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CSourceLocation* CSourceLocation::NewL( sl@0: CMMFDevSound& aDevSound ) sl@0: { sl@0: sl@0: DEBPRN0; sl@0: CSourceLocationProxy* sourceLocationProxy = (CSourceLocationProxy*)aDevSound.CustomInterface(KUidSourceLocationEffect); sl@0: sl@0: if (sourceLocationProxy == NULL) sl@0: { sl@0: DEBPRN1("No Adaptation Support - leaving"); sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: return sourceLocationProxy; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSourceLocation::NewL sl@0: // Static function for creating an instance of the SourceLocation object. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CSourceLocation* CSourceLocation::NewL( sl@0: CCustomCommandUtility* aUtility ) sl@0: { sl@0: sl@0: DEBPRN0; sl@0: CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility); sl@0: CleanupStack::PushL(customInterface); sl@0: sl@0: CSourceLocationProxy* sourceLocationProxy = (CSourceLocationProxy*)customInterface->CustomInterface(KUidSourceLocationEffect); sl@0: sl@0: if ( !sourceLocationProxy ) sl@0: { sl@0: DEBPRN1("No Adaptation Support - leaving"); sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: CleanupStack::Pop(customInterface); sl@0: sl@0: return sourceLocationProxy; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSourceLocation::NewL sl@0: // Static function for creating an instance of the SourceLocation object. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CSourceLocation* CSourceLocation::NewL( sl@0: MCustomInterface& aCustomInterface ) sl@0: { sl@0: sl@0: DEBPRN0; sl@0: CSourceLocationProxy* sourceLocationProxy = (CSourceLocationProxy*)aCustomInterface.CustomInterface(KUidSourceLocationEffect); sl@0: sl@0: if ( !sourceLocationProxy ) sl@0: { sl@0: DEBPRN1("No Adaptation Support - leaving"); sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: return sourceLocationProxy; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSourceLocation::NewL sl@0: // Static function for creating an instance of the SourceLocation object. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CSourceLocation* CSourceLocation::NewL( sl@0: CMidiClientUtility& aUtility ) sl@0: { sl@0: sl@0: DEBPRN0; sl@0: CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility); sl@0: CleanupStack::PushL(customInterface); sl@0: sl@0: CSourceLocationProxy* sourceLocationProxy = (CSourceLocationProxy*)customInterface->CustomInterface(KUidSourceLocationEffect); sl@0: sl@0: if ( !sourceLocationProxy ) sl@0: { sl@0: DEBPRN1("No Adaptation Support - leaving"); sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: CleanupStack::Pop(customInterface); sl@0: sl@0: return sourceLocationProxy; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSourceLocation::NewL sl@0: // Static function for creating an instance of the SourceLocation object. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CSourceLocation* CSourceLocation::NewL( sl@0: CDrmPlayerUtility& aUtility ) sl@0: { sl@0: sl@0: DEBPRN0; sl@0: CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility); sl@0: CleanupStack::PushL(customInterface); sl@0: sl@0: CSourceLocationProxy* sourceLocationProxy = (CSourceLocationProxy*)customInterface->CustomInterface(KUidSourceLocationEffect); sl@0: sl@0: if ( !sourceLocationProxy ) sl@0: { sl@0: DEBPRN1("No Adaptation Support - leaving"); sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: CleanupStack::Pop(customInterface); sl@0: sl@0: return sourceLocationProxy; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSourceLocation::NewL sl@0: // Static function for creating an instance of the SourceLocation object. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CSourceLocation* CSourceLocation::NewL( sl@0: CVideoPlayerUtility& aUtility ) sl@0: { sl@0: sl@0: DEBPRN0; sl@0: CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility); sl@0: CleanupStack::PushL(customInterface); sl@0: sl@0: CSourceLocationProxy* sourceLocationProxy = (CSourceLocationProxy*)customInterface->CustomInterface(KUidSourceLocationEffect); sl@0: sl@0: if ( !sourceLocationProxy ) sl@0: { sl@0: DEBPRN1("No Adaptation Support - leaving"); sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: CleanupStack::Pop(customInterface); sl@0: sl@0: return sourceLocationProxy; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSourceLocation::Uid sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TUid CSourceLocation::Uid() const sl@0: { sl@0: return KUidSourceLocationEffect; sl@0: } sl@0: sl@0: sl@0: // ========================== OTHER EXPORTED FUNCTIONS ========================= sl@0: sl@0: // End of File sl@0: