mmfenh/advancedaudiocontroller/audiotonecontrollerplugin/src/mmfaudiotonecontroller.cpp
--- a/mmfenh/advancedaudiocontroller/audiotonecontrollerplugin/src/mmfaudiotonecontroller.cpp Tue Aug 31 15:43:02 2010 +0300
+++ b/mmfenh/advancedaudiocontroller/audiotonecontrollerplugin/src/mmfaudiotonecontroller.cpp Wed Sep 01 12:23:00 2010 +0100
@@ -22,9 +22,6 @@
#include <mmf/common/mmfpaniccodes.h>
#include "mmfaudiotonecontroller.h"
#include <mmf/server/mmfaudiooutput.h>
-#include <ConfigurationComponentsFactory.h>
-#include <AudioOutputControlUtility.h>
-#include <mmf/server/mmffile.h>
/*
A list of panic codes for the Audio Tone Controller
@@ -114,7 +111,6 @@
void CMMFAudioToneController::ConstructL()
{
iSourceAndSinkAdded = EFalse;
- iDataSink = NULL;
// Construct custom command parsers
CMMFAudioPlayDeviceCustomCommandParser* audPlayDevParser = CMMFAudioPlayDeviceCustomCommandParser::NewL(*this);
@@ -131,22 +127,6 @@
CleanupStack::PushL(audPlayConSetRepeatsParser);
AddCustomCommandParserL(*audPlayConSetRepeatsParser);
CleanupStack::Pop(audPlayConSetRepeatsParser);
- // for drm CR/Error 417-45879/ESLM-82JAHL
- TInt err = CConfigurationComponentsFactory::CreateFactoryL(iFactory);
- User::LeaveIfError(err);
-
- if (iFactory)
- {
- User::LeaveIfError(iFactory->CreateAudioOutputControlUtility(iAudioOutputControlUtility));
- }
- //end drm cr
-
-
- //For Error : Update s60 tone controller to update the DRM rights
- CMMFDRMCustomCommandParser* drmParser = CMMFDRMCustomCommandParser::NewL(*this);
- CleanupStack::PushL(drmParser);
- AddCustomCommandParserL(*drmParser);
- CleanupStack::Pop(drmParser);
// [ assert the invariant now that we are constructed ]
__ASSERT_ALWAYS( Invariant(), Panic( EStateNotConstructed));
@@ -170,8 +150,6 @@
*/
CMMFAudioToneController::~CMMFAudioToneController()
{
- delete iAudioOutputControlUtility;
- delete iFactory;
delete iMMFDevSound;
delete iToneSequenceData;
delete iMessage;
@@ -244,9 +222,6 @@
//Only support playing to audio output
if (aSink.DataSinkType() != KUidMmfAudioOutput)
User::Leave( KErrNotSupported );
-
-
- iDataSink = &aSink;
iMMFDevSound = CMMFDevSound::NewL();
@@ -292,33 +267,7 @@
User::Leave(err);
}
}
-
- //For Error : Update s60 tone controller to update the DRM rights
- if (iDataSource->DataSourceType()==KUidMmfFileSource)
- {
- CMMFFile* file = static_cast<CMMFFile*>(iDataSource);
- // we only support protected files for playback
- if (file->IsProtectedL())
- {
- if (iDataSink->DataSinkType()!=KUidMmfAudioOutput)
- {
- // Conversion is not allowed for DRM protected files
- User::Leave(KErrNotSupported);
- }
- }
- }
-
- // for drm CR/Error 417-45879/ESLM-82JAHL
- if (iDataSource->DataSourceType()==KUidMmfFileSource)
- {
- CMMFFile* file = static_cast<CMMFFile*>(iDataSource);
-
- if (file->IsProtectedL())
- {
- User::LeaveIfError(iAudioOutputControlUtility->SetDataSource(iDataSource));
- }
- }
- // end drm cr
+
__ASSERT_ALWAYS( Invariant(), Panic( EStateNotPrimed ) );
}
@@ -397,30 +346,7 @@
// [ assert the Invariant ]
__ASSERT_ALWAYS( Invariant(), Panic(EStateNotReadyToPlay));
- // for drm CR/Error 417-45879/ESLM-82JAHL
- //configure Devsound with output restriction for a DRM protected file
- if (iDataSource->DataSourceType()==KUidMmfFileSource)
- {
- CMMFFile* file = static_cast<CMMFFile*>(iDataSource);
-
- if (file->IsProtectedL())
- {
- iAudioOutputControlUtility->Configure(*iMMFDevSound); //ignoring errors since rouitng changes are only suggestions to adaptation
- }
- }
-
- //For Error : Update s60 tone controller to update the DRM rights
- //Getting the Intent for Play if AutomaticIntent is Enabled
- if (!iDisableAutoIntent && iDataSource->DataSourceType()==KUidMmfFileSource)
- {
- CMMFFile* file = static_cast<CMMFFile*>(iDataSource);
- TInt err = file->ExecuteIntent(ContentAccess::EPlay);
- if (err != KErrNone)
- {
- User::LeaveIfError(err);
- }
- }
-
+
if(State() == EPausePlaying && iIsResumeSupported)
{
User::LeaveIfError(iMMFDevSound->Resume());
@@ -454,18 +380,6 @@
__ASSERT_ALWAYS(iMMFDevSound, Panic(EMMFAudioControllerPanicDataSinkDoesNotExist));
- //For Error : Update s60 tone controller to update the DRM rights
- //Getting the Intent for Pause if AutomaticIntent is Enabled
- if (!iDisableAutoIntent && iDataSource->DataSourceType()==KUidMmfFileSource)
- {
- CMMFFile* file = static_cast<CMMFFile*>(iDataSource);
- TInt err = file->ExecuteIntent(ContentAccess::EPause);
-
- if (err != KErrNone)
- {
- User::LeaveIfError(err);
- }
- }
if(iIsResumeSupported)
{
iMMFDevSound->Pause();
@@ -502,19 +416,6 @@
// Due to the asynchronous nature of the controller
// interaction the response to stopped when stopped
// should not be an error ]
-
-
- //For Error : Update s60 tone controller to update the DRM rights
- //Getting the Intent for Stop if AutomaticIntent is Enabled
- if (!iDisableAutoIntent && iDataSource->DataSourceType()==KUidMmfFileSource)
- {
- CMMFFile* file = static_cast<CMMFFile*>(iDataSource);
- TInt err = file->ExecuteIntent(ContentAccess::EStop);
- if (err != KErrNone)
- {
- User::LeaveIfError(err);
- }
- }
if (State() != EStopped)
{
//[ update state to stopped propogate to devsound ]
@@ -1126,63 +1027,3 @@
}
return err;
}
-
-//For Error : Update s60 tone controller to update the DRM rights
-//Methods from MMMFDRMCustomCommandImplementor
-//Checking for the Intents if AutomaticIntent is Disabled
-
-TInt CMMFAudioToneController::MdcExecuteIntent(ContentAccess::TIntent aIntent)
- {
-
- if (iDataSource->DataSourceType()==KUidMmfFileSource)
- {
- CMMFFile* file = static_cast<CMMFFile*>(iDataSource);
- TInt err = file->ExecuteIntent(aIntent);
- return err;
- }
- else
- {
- // Evaluating intent will always succeed on sinks that
- // don't support DRM
- return KErrNone;
- }
-
- }
-
-TInt CMMFAudioToneController::MdcEvaluateIntent(ContentAccess::TIntent aIntent)
- {
- if (iDataSource->DataSourceType()==KUidMmfFileSource)
- {
- CMMFFile* file = static_cast<CMMFFile*>(iDataSource);
- TInt err = file->EvaluateIntent(aIntent);
- return err;
- }
- else
- {
- // Evaluating intent will always succeed on sinks that
- // don't support DRM
- return KErrNone;
- }
- }
-
-TInt CMMFAudioToneController::MdcDisableAutomaticIntent(TBool aDisableAutoIntent)
- {
- iDisableAutoIntent = aDisableAutoIntent;
- return KErrNone;
- }
-
-
-TInt CMMFAudioToneController::MdcSetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue)
- {
- if (iDataSource->DataSourceType()==KUidMmfFileSource)
- {
- CMMFFile* file = static_cast<CMMFFile*>(iDataSource);
- TInt err = file->SetAgentProperty(aProperty, aValue);
- return err;
- }
- else
- {
- return KErrNone;
- }
- }
-