1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/inc/MdaAudioSampleEditor.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,744 @@
1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef MDAAUDIOSAMPLEEDITOR_H
1.20 +#define MDAAUDIOSAMPLEEDITOR_H
1.21 +
1.22 +
1.23 +
1.24 +#include <e32std.h>
1.25 +#include <f32file.h>
1.26 +#include <mmf/common/mmfbase.h>
1.27 +#include <mmf/common/mmfaudio.h>
1.28 +#include <mmf/common/mmfstandardcustomcommands.h>
1.29 +#include <mmf/common/mmfdrmcustomcommands.h>
1.30 +
1.31 +#include <mda/client/resource.h>
1.32 +#include <mda/client/utility.h>
1.33 +#include <mda/common/audio.h>
1.34 +#include <mmfclntutility.h>
1.35 +#include <mmf/common/mmfdurationinfocustomcommands.h>
1.36 +
1.37 +class CMdaServer;
1.38 +
1.39 +/**
1.40 + * @publishedAll
1.41 + * @deprecated
1.42 + *
1.43 + * Dummy class - not supported in 7.0s
1.44 + */
1.45 +class CMdaAudioType : public CBase
1.46 + {
1.47 +public:
1.48 + /**
1.49 + Destructor
1.50 + */
1.51 + IMPORT_C ~CMdaAudioType();
1.52 + };
1.53 +
1.54 +/**
1.55 +@publishedAll
1.56 +@released
1.57 +
1.58 +This class is used by both the audio recorder and audio converter. This class should not be used,
1.59 +other than the TState enum.
1.60 +
1.61 +Prior to 7.0s the pure virtual functions in this class were implemented virtual functions. In 7.0s
1.62 +this changed, so now any classes derived from this one must implement the functions themselves.
1.63 +
1.64 +@see CMdaAudioRecorderUtility
1.65 +@see CMdaAudioConvertUtility
1.66 +*/
1.67 +class CMdaAudioClipUtility : public CBase,
1.68 + public MMMFClientUtility
1.69 + {
1.70 +public:
1.71 + /**
1.72 + Defines the possible state of the audio data sample.
1.73 + */
1.74 + enum TState
1.75 + {
1.76 + /** The audio clip recorder or audio converter has been constructed but no file or descriptor
1.77 + has been opened.
1.78 + */
1.79 + ENotReady = 0,
1.80 + /** Files or descriptors are open but no playing or recording operation is in progress.
1.81 + */
1.82 + EOpen,
1.83 + /** Audio sample data is playing.
1.84 + */
1.85 + EPlaying,
1.86 + /** New audio sample data is being recorded.
1.87 + */
1.88 + ERecording
1.89 + };
1.90 +
1.91 +public:
1.92 + /**
1.93 + @internalTechnology
1.94 +
1.95 + Returns the current state of the audio sample data.
1.96 +
1.97 + @return The state of the audio sample data.
1.98 +
1.99 + @since 5.0
1.100 + */
1.101 + virtual TState State()=0;
1.102 +
1.103 + /**
1.104 + @internalTechnology
1.105 +
1.106 + Releases any currently open audio sample data.
1.107 +
1.108 + @since 5.0
1.109 + */
1.110 + virtual void Close()=0;
1.111 +
1.112 + /**
1.113 + @internalTechnology
1.114 +
1.115 + Begins playback of audio sample data at the current playback position using the current volume,
1.116 + gain and priority settings.
1.117 +
1.118 + @since 5.0
1.119 + */
1.120 + virtual void PlayL()=0;
1.121 +
1.122 + /**
1.123 + @internalTechnology
1.124 +
1.125 + Starts appending new audio sample data.
1.126 +
1.127 + The new audio sample data is appended to the existing audio sample data in the same format as
1.128 + the existing audio sample data. If existing data is to be overwritten, then it should be cropped
1.129 + to the appropriate length before appending the new data.
1.130 +
1.131 + Note, before starting to record, make sure that the gain is set by calling
1.132 + CMdaAudioRecorderUtility::SetGain(), as the initial gain is undefined. The gain might also
1.133 + have been modified by another client application.
1.134 +
1.135 +
1.136 + @since 5.0
1.137 + @see CMdaAudioRecorderUtility
1.138 + @see CMdaAudioRecorderUtility::SetGain()
1.139 + */
1.140 + virtual void RecordL()=0;
1.141 +
1.142 + /**
1.143 + @internalTechnology
1.144 +
1.145 + Stops the playback or recording operation.
1.146 +
1.147 + The operation is stopped at the current location. For a playback operation, the head is positioned at the last played data.
1.148 +
1.149 + @since 5.0
1.150 + */
1.151 + virtual void Stop()=0;
1.152 +
1.153 + /**
1.154 + @internalTechnology
1.155 +
1.156 + Deletes all audio sample data after the current head position. The effects of the function cannot be undone.
1.157 +
1.158 + The function is synchronous and can leave if there is a problem. The leave code depends on the configuration.
1.159 +
1.160 + @since 5.0
1.161 + */
1.162 + virtual void CropL()=0;
1.163 +
1.164 + /**
1.165 + @internalTechnology
1.166 +
1.167 + Sets the head position.
1.168 +
1.169 + The playback head is moved to a position which is defined in terms of a time interval measured
1.170 + from the beginning of the audio sample data. A subsequent call to PlayL() starts from
1.171 + this new position.
1.172 +
1.173 +
1.174 + @since 5.0
1.175 + */
1.176 + virtual void SetPosition(const TTimeIntervalMicroSeconds& aPosition)=0;
1.177 +
1.178 + /**
1.179 + @internalTechnology
1.180 +
1.181 + Returns the current head position.
1.182 +
1.183 + The head position is defined in terms of a time interval measured from the beginning of the audio sample data.
1.184 +
1.185 + @since 5.0
1.186 + */
1.187 + virtual const TTimeIntervalMicroSeconds& Position()=0;
1.188 +
1.189 + /**
1.190 + @internalTechnology
1.191 +
1.192 + Returns the recording time available for the selected file or descriptor and encoding format.
1.193 +
1.194 + @since 5.0
1.195 + */
1.196 + virtual const TTimeIntervalMicroSeconds& RecordTimeAvailable()=0;
1.197 +
1.198 + /**
1.199 + @internalTechnology
1.200 +
1.201 + Returns the duration of the audio sample data.
1.202 +
1.203 + @since 5.0
1.204 + */
1.205 + virtual const TTimeIntervalMicroSeconds& Duration()=0;
1.206 +
1.207 + /**
1.208 + @internalTechnology
1.209 +
1.210 + Defines a window on the audio sample data.
1.211 +
1.212 + The window is defined in terms of a start and end position.
1.213 + When the current playback position reaches the window end position, or Stop() is called, the
1.214 + current playback position is set to the window start position and playback stops.
1.215 +
1.216 + The current playback position is not affected by a call to SetPlayWindow() unless it is outside
1.217 + the new playback window, in which case it is set to the window start or end position depending
1.218 + on which one is closer.
1.219 +
1.220 + The window persists until ClearPlayWindow() is called.
1.221 + Loading new audio sample data without adjusting or clearing the window will result in
1.222 + playback errors if the window is outside the new data.
1.223 +
1.224 + @param aStart
1.225 + The position defining the start of the window, measured in microseconds. If this
1.226 + value is less than zero, it is set to zero. If this value is greater than aEnd,
1.227 + then it is swapped with aEnd.
1.228 + @param aEnd
1.229 + The position defining the end of the window, measured in microseconds. If this value
1.230 + is greater than the value returned by Duration(), it is set to the value of Duration().
1.231 + If this value is less than aStart, then it is swapped with aStart.
1.232 +
1.233 + @since 5.0
1.234 + */
1.235 + virtual void SetPlayWindow(const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd)=0;
1.236 +
1.237 + /**
1.238 + @internalTechnology
1.239 +
1.240 + Removes any window defined on the audio sample data.
1.241 +
1.242 + All subsequent playing, position setting and position querying requests are mapped to the whole of the audio sample data.
1.243 +
1.244 + @since 5.0
1.245 + */
1.246 + virtual void ClearPlayWindow()=0;
1.247 +
1.248 + /**
1.249 + @internalTechnology
1.250 +
1.251 + Sets the number of times the audio sample is to be repeated during the PlayL() operation.
1.252 +
1.253 + A period of silence can follow each playing of the audio sample. The audio sample can be repeated
1.254 + indefinitely or until stopped.
1.255 +
1.256 + @param aRepeatNumberOfTimes
1.257 + The number of times the audio sample, together with the trailing silence, is to
1.258 + be repeated. If this is set to KMdaRepeatForever, then the audio sample, together with
1.259 + the trailing silence, is repeated indefinitely. If this is set to zero, then the audio
1.260 + sample is not repeated.
1.261 + @param aTrailingSilence
1.262 + The length of the trailing silence in microseconds.
1.263 +
1.264 + @since 5.0
1.265 + */
1.266 + virtual void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence)=0;
1.267 +
1.268 + /**
1.269 + @internalTechnology
1.270 +
1.271 + This function is no longer supported. It is provided for binary compatibility with previous
1.272 + releases and always leaves with KErrNotSupported.
1.273 +
1.274 + @return Always returns NULL.
1.275 +
1.276 + @since 5.0
1.277 + */
1.278 + virtual CMdaAudioType* TypeL();
1.279 +
1.280 + /**
1.281 + @internalTechnology
1.282 +
1.283 + Sets the maximum size for a file that is being recorded.
1.284 +
1.285 + When this limit is reached, MMF stops recording and notifies the client application. Notification is caused
1.286 + by MMdaObjectStateChangeObserver::MoscoStateChangeEvent() with the error code KErrEof.
1.287 +
1.288 + This function is provided so that applications such as recorders can limit the amount of file storage/memory
1.289 + that should be allocated.
1.290 +
1.291 + @param aMaxWriteLength
1.292 + The maximum file size in kilobytes. If the default value is used, there is no maximum file size.
1.293 +
1.294 + @since 5.0
1.295 + */
1.296 + virtual void SetMaxWriteLength(TInt aMaxWriteLength = KMdaClipLocationMaxWriteLengthNone)=0;
1.297 +
1.298 + /**
1.299 + @internalTechnology
1.300 +
1.301 + Deletes all audio sample data from the beginning of the audio clip. The effects of the function cannot be undone.
1.302 +
1.303 + The function is synchronous and can leave if there is a problem. The leave code depends on the configuration.
1.304 +
1.305 + @since 5.0
1.306 + */
1.307 + virtual void CropFromBeginningL()=0;
1.308 +public:
1.309 + // Reserved functions - do not call - to allow virtual additional functions to be added to class
1.310 +
1.311 + /**
1.312 + @internalTechnology
1.313 +
1.314 + Reserved function
1.315 + */
1.316 + virtual void ClipUtil_Reserved3();
1.317 +
1.318 + /**
1.319 + @internalTechnology
1.320 +
1.321 + Reserved function
1.322 + */
1.323 + virtual void ClipUtil_Reserved4();
1.324 + };
1.325 +
1.326 +
1.327 +class CMMFMdaAudioRecorderUtility;
1.328 +
1.329 +/**
1.330 +@publishedAll
1.331 +@released
1.332 +
1.333 +Plays back, records and edits audio sample data.
1.334 +
1.335 +The class offers an interface to play, record and edit audio sample data. This data can be supplied
1.336 +either in a file or as a descriptor. The functions that start and stop playback and recording are
1.337 +defined in the base class CMdaAudioClipUtility.
1.338 +
1.339 +While this class is abstract, the static NewL() function constructs, initialises and returns a
1.340 +pointer to an instance of a concrete class derived from this abstract class. This concrete class
1.341 +is part of the MMF implementation and is private.
1.342 +
1.343 +*/
1.344 +class CMdaAudioRecorderUtility : public CMdaAudioClipUtility
1.345 + {
1.346 +public:
1.347 +
1.348 + /**
1.349 + Device mode. Used by SetAudioDeviceMode method which is not used from 7.0s
1.350 + @since 5.0
1.351 + */
1.352 + enum TDeviceMode
1.353 + {
1.354 + /**
1.355 + The default behaviour.
1.356 +
1.357 + When recording:
1.358 + If a telephony call is in progress, an attempt is made to connect to the telephony downlink
1.359 + plus the device microphone. If there is no telephony call in progress or a connection to the
1.360 + telephony downlink fails, an attempt is made to connect to the device microphone only.
1.361 +
1.362 + When playing:
1.363 + If a telephony call is in progress, an attempt is made to connect to the telephony uplink.
1.364 + If there is no telephony call in progress or a connection to the telephony uplink fails, an
1.365 + attempt is made to connect to the device speaker.
1.366 + */
1.367 + EDefault = 0,
1.368 + /** See EDefault.
1.369 + */
1.370 + ETelephonyOrLocal = EDefault,
1.371 + /**
1.372 + When recording:
1.373 + If a telephony call is in progress the audio source is the telephony downlink mixed with
1.374 + the device microphone. If there is no telephony call in progress or a connection to the telephony
1.375 + downlink fails, no attempt is made to connect to the microphone.
1.376 +
1.377 + When playing:
1.378 + If a telephony call is in progress the audio sample data is played to the telephony uplink and
1.379 + the device speaker. If there is no telephony call in progress or a connection to the telephony
1.380 + uplink fails, no attempt is made to connect to the device speaker.
1.381 + */
1.382 + ETelephonyMixed = 1,
1.383 + /**
1.384 + When recording, the audio source is the telephony downlink and is not mixed with the device microphone.
1.385 +
1.386 + When playing, the audio sample data is played to the telephony uplink and is not mixed with the
1.387 + device speaker.
1.388 + */
1.389 + ETelephonyNonMixed = 2,
1.390 + /**
1.391 + When recording, the audio source is the device microphone.
1.392 +
1.393 + When playing, the audio sample data is played to the device speaker.
1.394 + */
1.395 + ELocal = 3
1.396 + };
1.397 +
1.398 + virtual ~CMdaAudioRecorderUtility();
1.399 +
1.400 + IMPORT_C static CMdaAudioRecorderUtility* NewL(
1.401 + MMdaObjectStateChangeObserver& aObserver,
1.402 + CMdaServer* aServer = NULL,
1.403 + TInt aPriority = EMdaPriorityNormal,
1.404 + TInt aPref = EMdaPriorityPreferenceTimeAndQuality);
1.405 +
1.406 + virtual void OpenFileL(const TDesC& aFileName);
1.407 + IMPORT_C void OpenFileL(const RFile& aFile);
1.408 +
1.409 + IMPORT_C void OpenFileL(const TMMSource& aSource);
1.410 +
1.411 + virtual void OpenDesL(const TDesC8& aDescriptor);
1.412 +
1.413 + IMPORT_C void OpenDesL(TDes8& aDescriptor);
1.414 +
1.415 + virtual void OpenL(TMdaClipLocation* aLocation,
1.416 + TMdaClipFormat* aFormat,
1.417 + TMdaPackage* aArg1 = NULL,
1.418 + TMdaPackage* aArg2 = NULL);
1.419 +
1.420 + virtual void SetAudioDeviceMode(TDeviceMode aMode);
1.421 +
1.422 + virtual TInt MaxVolume();
1.423 +
1.424 + virtual TInt MaxGain();
1.425 +
1.426 + virtual TInt SetVolume(TInt aVolume);
1.427 +
1.428 + virtual void SetGain(TInt aGain);
1.429 +
1.430 + virtual void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration);
1.431 +
1.432 + IMPORT_C void OpenFileL(const TDesC& aFileName,
1.433 + TUid aRecordControllerUid, // controller to use
1.434 + TUid aPlaybackControllerUid=KNullUid, // playback controller (if different)
1.435 + TUid aDestinationFormatUid=KNullUid, // Data format
1.436 + TFourCC aDestinationDataType = KFourCCNULL); // data type for recording
1.437 +
1.438 + IMPORT_C void OpenFileL(const RFile& aFile,
1.439 + TUid aRecordControllerUid, // controller to use
1.440 + TUid aPlaybackControllerUid=KNullUid, // playback controller (if different)
1.441 + TUid aDestinationFormatUid=KNullUid, // Data format
1.442 + TFourCC aDestinationDataType = KFourCCNULL); // data type for recording
1.443 +
1.444 + IMPORT_C void OpenFileL(const TMMSource& aSource,
1.445 + TUid aRecordControllerUid, // controller to use
1.446 + TUid aPlaybackControllerUid=KNullUid, // playback controller (if different)
1.447 + TUid aDestinationFormatUid=KNullUid, // Data format
1.448 + TFourCC aDestinationDataType = KFourCCNULL); // data type for recording
1.449 +
1.450 + IMPORT_C void OpenDesL(TDes8& aDescriptor,
1.451 + TUid aRecordControllerUid, // controller to use
1.452 + TUid aPlaybackControllerUid=KNullUid, // playback controller (if different)
1.453 + TUid aDestinationFormatUid=KNullUid, // Data format
1.454 + TFourCC aDestinationDataType = KFourCCNULL); // data type for recording
1.455 +
1.456 + IMPORT_C void OpenUrlL(const TDesC& aUrl,
1.457 + TInt aIapId, // internet access point
1.458 + TUid aRecordControllerUid, // controller to use
1.459 + TUid aPlaybackControllerUid=KNullUid, // playback controller (if different)
1.460 + TUid aDestinationFormatUid=KNullUid, // Data format
1.461 + TFourCC aDestinationDataType = KFourCCNULL); // data type for recording
1.462 +
1.463 + IMPORT_C void OpenUrlL(const TDesC& aUrl,
1.464 + TInt aIapId =KUseDefaultIap,
1.465 + const TDesC8& aMimeType = KNullDesC8);
1.466 +
1.467 + IMPORT_C TInt GetGain(TInt& aGain);
1.468 +
1.469 + IMPORT_C TInt GetVolume(TInt& aVolume);
1.470 +
1.471 + IMPORT_C TInt SetPlaybackBalance(TInt aBalance = KMMFBalanceCenter);
1.472 +
1.473 + IMPORT_C TInt GetPlaybackBalance(TInt& aBalance);
1.474 +
1.475 + IMPORT_C TInt SetRecordBalance(TInt aBalance = KMMFBalanceCenter);
1.476 +
1.477 + IMPORT_C TInt GetRecordBalance(TInt& aBalance);
1.478 +
1.479 + IMPORT_C TInt GetNumberOfMetaDataEntries(TInt& aNumEntries);
1.480 +
1.481 + IMPORT_C CMMFMetaDataEntry* GetMetaDataEntryL(TInt aMetaDataIndex);
1.482 +
1.483 + IMPORT_C void AddMetaDataEntryL(CMMFMetaDataEntry& aMetaDataEntry);
1.484 +
1.485 + IMPORT_C TInt RemoveMetaDataEntry(TInt aMetaDataIndex);
1.486 +
1.487 + IMPORT_C void ReplaceMetaDataEntryL(TInt aMetaDataIndex, CMMFMetaDataEntry& aMetaDataEntry);
1.488 +
1.489 + IMPORT_C void SetPriority(TInt aPriority, TInt aPref);
1.490 +
1.491 + //DataType support
1.492 +
1.493 + IMPORT_C void GetSupportedDestinationDataTypesL(RArray<TFourCC>& aSupportedDataTypes);
1.494 +
1.495 + IMPORT_C void SetDestinationDataTypeL(TFourCC aDataType);
1.496 +
1.497 + IMPORT_C TFourCC DestinationDataTypeL();
1.498 +
1.499 + // Bit rate support
1.500 +
1.501 + IMPORT_C void SetDestinationBitRateL(TUint aBitRate);
1.502 +
1.503 + IMPORT_C TUint DestinationBitRateL();
1.504 +
1.505 + IMPORT_C TUint SourceBitRateL();
1.506 +
1.507 + IMPORT_C void GetSupportedBitRatesL(RArray<TUint>& aSupportedBitRates);
1.508 +
1.509 + // Sample rate support
1.510 +
1.511 + IMPORT_C void SetDestinationSampleRateL(TUint aSampleRate);
1.512 +
1.513 + IMPORT_C TUint DestinationSampleRateL();
1.514 +
1.515 + IMPORT_C void GetSupportedSampleRatesL(RArray<TUint>& aSupportedSampleRates);
1.516 + // Format support
1.517 +
1.518 + IMPORT_C void SetDestinationFormatL(TUid aFormatUid);
1.519 +
1.520 + IMPORT_C TUid DestinationFormatL();
1.521 +
1.522 + // Number of channels
1.523 + IMPORT_C void SetDestinationNumberOfChannelsL(TUint aNumberOfChannels);
1.524 +
1.525 + IMPORT_C TUint DestinationNumberOfChannelsL();
1.526 +
1.527 + IMPORT_C void GetSupportedNumberOfChannelsL(RArray<TUint>& aSupportedNumChannels);
1.528 +
1.529 + virtual TState State();
1.530 +
1.531 + virtual void Close();
1.532 +
1.533 + virtual void PlayL();
1.534 +
1.535 + virtual void RecordL();
1.536 +
1.537 + virtual void Stop();
1.538 +
1.539 + virtual void CropL();
1.540 +
1.541 + virtual void SetPosition(const TTimeIntervalMicroSeconds& aPosition);
1.542 +
1.543 + virtual const TTimeIntervalMicroSeconds& Position();
1.544 +
1.545 + virtual const TTimeIntervalMicroSeconds& RecordTimeAvailable();
1.546 +
1.547 + virtual const TTimeIntervalMicroSeconds& Duration();
1.548 +
1.549 + IMPORT_C TMMFDurationInfo Duration(TTimeIntervalMicroSeconds& aDuration);
1.550 +
1.551 + virtual void SetPlayWindow(const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd);
1.552 +
1.553 + virtual void ClearPlayWindow();
1.554 +
1.555 + virtual void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
1.556 +
1.557 + virtual void SetMaxWriteLength(TInt aMaxWriteLength = KMdaClipLocationMaxWriteLengthNone);
1.558 +
1.559 + virtual void CropFromBeginningL();
1.560 +
1.561 + IMPORT_C void RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback);
1.562 +
1.563 + IMPORT_C void GetAudioLoadingProgressL(TInt& aPercentageComplete);
1.564 +
1.565 + IMPORT_C const CMMFControllerImplementationInformation& AudioPlayControllerImplementationInformationL();
1.566 +
1.567 + IMPORT_C const CMMFControllerImplementationInformation& AudioRecorderControllerImplementationInformationL();
1.568 +
1.569 + IMPORT_C TInt RecordControllerCustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
1.570 +
1.571 + IMPORT_C TInt RecordControllerCustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
1.572 +
1.573 + IMPORT_C void RecordControllerCustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
1.574 +
1.575 + IMPORT_C void RecordControllerCustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
1.576 +
1.577 + IMPORT_C TInt PlayControllerCustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
1.578 +
1.579 + IMPORT_C TInt PlayControllerCustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
1.580 +
1.581 + IMPORT_C void PlayControllerCustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
1.582 +
1.583 + IMPORT_C void PlayControllerCustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
1.584 +
1.585 + IMPORT_C MMMFDRMCustomCommand* GetDRMCustomCommand();
1.586 +
1.587 + IMPORT_C TInt RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback& aCallback,TUid aNotificationEventUid,const TDesC8& aNotificationRegistrationData = KNullDesC8);
1.588 +
1.589 + IMPORT_C TInt CancelRegisterAudioResourceNotification(TUid aNotificationEventId);
1.590 +
1.591 + IMPORT_C TInt WillResumePlay();
1.592 +
1.593 + IMPORT_C TInt SetThreadPriorityPlayback(const TThreadPriority& aThreadPriority) const;
1.594 + IMPORT_C TInt SetThreadPriorityRecord(const TThreadPriority& aThreadPriority) const;
1.595 +
1.596 + IMPORT_C void UseSharedHeap();
1.597 +private:
1.598 + CMMFMdaAudioRecorderUtility* iProperties;
1.599 + };
1.600 +
1.601 +class CMMFMdaAudioConvertUtility;
1.602 +
1.603 +/**
1.604 +@publishedAll
1.605 +@released
1.606 +
1.607 +Converts the type, sample rate and format of audio data.
1.608 +
1.609 +The audio sample data can be supplied either in a file or as a descriptor.
1.610 +*/
1.611 +class CMdaAudioConvertUtility : public CMdaAudioClipUtility
1.612 + {
1.613 +public:
1.614 +
1.615 + IMPORT_C static CMdaAudioConvertUtility* NewL(
1.616 + MMdaObjectStateChangeObserver& aObserver,
1.617 + CMdaServer* aServer = NULL,
1.618 + TInt aPriority = EMdaPriorityNormal,
1.619 + TInt aPref = EMdaPriorityPreferenceTimeAndQuality);
1.620 +
1.621 + virtual ~CMdaAudioConvertUtility();
1.622 +
1.623 + virtual void OpenL(const TDesC& aPrimaryFile, const TDesC& aSecondaryFile);
1.624 +
1.625 + virtual void OpenL(const TDesC& aPrimaryFile,
1.626 + TMdaClipLocation* aLocation, // Normally file or descriptor
1.627 + TMdaClipFormat* aFormat, // Data format
1.628 + TMdaPackage* aArg1 = NULL, // Normally codec to use
1.629 + TMdaPackage* aArg2 = NULL); // Normally audio settings
1.630 +
1.631 + virtual void OpenL(TMdaClipLocation* aPriLocation,
1.632 + TMdaClipLocation* aSecLocation,
1.633 + TMdaClipFormat* aPriFormat,
1.634 + TMdaClipFormat* aSecFormat,
1.635 + TMdaPackage* aPriArg1 = NULL,
1.636 + TMdaPackage* aPriArg2 = NULL,
1.637 + TMdaPackage* aSecArg1 = NULL,
1.638 + TMdaPackage* aSecArg2 = NULL);
1.639 +
1.640 + // new controller based open
1.641 + // N.B. this override is new and must NOT be made virtual. This is because
1.642 + // it will break BC on the WINS build (due to the MS compiler grouping and
1.643 + // reordering the overrides together in the vtable and _not_ using the
1.644 + // declaration order!)
1.645 +
1.646 + IMPORT_C void OpenL(TMdaClipLocation* aPriLocation,
1.647 + TMdaClipLocation* aSecLocation,
1.648 + TUid aControllerUid,
1.649 + TUid aDestFormatUid,
1.650 + TFourCC aDestDataType);
1.651 +
1.652 + //Data type support
1.653 +
1.654 + IMPORT_C void GetSupportedDestinationDataTypesL(RArray<TFourCC>& aSupportedDestinationDataTypes);
1.655 +
1.656 + IMPORT_C void SetDestinationDataTypeL(TFourCC aDataType);
1.657 +
1.658 + IMPORT_C TFourCC DestinationDataTypeL();
1.659 +
1.660 + IMPORT_C TFourCC SourceDataTypeL();
1.661 + // Bit rate support
1.662 +
1.663 + IMPORT_C void SetDestinationBitRateL(TUint aBitRate);
1.664 +
1.665 + IMPORT_C TUint DestinationBitRateL();
1.666 +
1.667 + IMPORT_C void GetSupportedConversionBitRatesL(RArray<TUint>& aSupportedBitRates);
1.668 +
1.669 + IMPORT_C TInt SourceBitRateL();
1.670 +
1.671 + // Sample rate support
1.672 + IMPORT_C void SetDestinationSampleRateL(TUint aSampleRate);
1.673 +
1.674 + IMPORT_C TUint DestinationSampleRateL();
1.675 +
1.676 + IMPORT_C void GetSupportedConversionSampleRatesL(RArray<TUint>& aSupportedSampleRates);
1.677 +
1.678 + IMPORT_C TUint SourceSampleRateL();
1.679 +
1.680 + // Format support
1.681 + IMPORT_C void SetDestinationFormatL(TUid aFormatUid);
1.682 +
1.683 + IMPORT_C TUid DestinationFormatL();
1.684 +
1.685 + IMPORT_C TUid SourceFormatL();
1.686 +
1.687 + // Number of channels
1.688 + IMPORT_C void SetDestinationNumberOfChannelsL(TUint aNumberOfChannels);
1.689 +
1.690 + IMPORT_C TUint DestinationNumberOfChannelsL();
1.691 +
1.692 + IMPORT_C void GetSupportedConversionNumberOfChannelsL(RArray<TUint>& aSupportedNumChannels);
1.693 +
1.694 + IMPORT_C TUint SourceNumberOfChannelsL();
1.695 +
1.696 + // New function ConvertL (PlayL and RecordL now deprecated for CMdaAudioConvertUtility)
1.697 + IMPORT_C void ConvertL();
1.698 +
1.699 + virtual TState State();
1.700 +
1.701 + virtual void Close();
1.702 +
1.703 + virtual void PlayL();
1.704 +
1.705 + virtual void RecordL();
1.706 +
1.707 + virtual void Stop();
1.708 +
1.709 + virtual void CropL();
1.710 +
1.711 + virtual void SetPosition(const TTimeIntervalMicroSeconds& aPosition);
1.712 +
1.713 + virtual const TTimeIntervalMicroSeconds& Position();
1.714 +
1.715 + virtual const TTimeIntervalMicroSeconds& RecordTimeAvailable();
1.716 +
1.717 + virtual const TTimeIntervalMicroSeconds& Duration();
1.718 +
1.719 + virtual void SetPlayWindow(const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd);
1.720 +
1.721 + virtual void ClearPlayWindow();
1.722 +
1.723 + virtual void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
1.724 +
1.725 + virtual void SetMaxWriteLength(TInt aMaxWriteLength = KMdaClipLocationMaxWriteLengthNone);
1.726 +
1.727 + virtual void CropFromBeginningL();
1.728 +
1.729 + IMPORT_C const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
1.730 +
1.731 + IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
1.732 +
1.733 + IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
1.734 +
1.735 + IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
1.736 +
1.737 + IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
1.738 +
1.739 + IMPORT_C TInt SetThreadPriority(const TThreadPriority& aThreadPriority) const;
1.740 +
1.741 + IMPORT_C void UseSharedHeap();
1.742 +private:
1.743 + CMMFMdaAudioConvertUtility* iProperties;
1.744 +
1.745 + };
1.746 +
1.747 +#endif