srsf/ttscontrollerplugin/src/ttsplugin.h
branchRCL_3
changeset 19 e36f3802f733
parent 0 bf1d17376201
equal deleted inserted replaced
18:cad71a31b7fc 19:e36f3802f733
       
     1 /*
       
     2 * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Interface towards Tts Controller Plugin
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef TTSPLUGIN_H
       
    21 #define TTSPLUGIN_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <mmfcontroller.h>
       
    25 #include <mmfstandardcustomcommands.h>
       
    26 #include <nssttscustomcommandimplementor.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CTtsControllerPluginBody;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 * TTS controller plugin implementation
       
    35 *
       
    36 * @lib nssttsplugin.lib
       
    37 * @since 2.8
       
    38 */
       
    39 class CTtsControllerPlugin : public CMMFController, 
       
    40                              public MMMFAudioControllerCustomCommandImplementor,
       
    41                              public MMMFAudioPlayDeviceCustomCommandImplementor,
       
    42                              public MTtsCustomCommandImplementor
       
    43     {
       
    44     public:  // Constructors and destructor
       
    45         
       
    46         /**
       
    47         * Two-phased constructor.
       
    48         */
       
    49         static CTtsControllerPlugin* NewL();
       
    50         
       
    51         /**
       
    52         * Destructor.
       
    53         */
       
    54         virtual ~CTtsControllerPlugin();
       
    55         
       
    56     public: // New functions
       
    57         /**
       
    58         * Called when initializations are ready
       
    59         */
       
    60         void InitializationReady( TInt aError );
       
    61 
       
    62         /**
       
    63         * Called when synthesis is ready
       
    64         */
       
    65         void SynthesisReady( TInt aError );
       
    66 
       
    67     public: // MMMFAudioControllerCustomCommandImplementor
       
    68         
       
    69         /**
       
    70         * Set the sample rate of the data source in samples per second.
       
    71         *
       
    72         * @param "aSampleRate" "The sample rate, in samples per second."
       
    73         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
    74         * completed with the leave code."
       
    75         * @since 2.8
       
    76         */
       
    77         void MacSetSourceSampleRateL(TUint aSampleRate);
       
    78         
       
    79         /**
       
    80         * Set the bit rate of the data source in bits per second.
       
    81         *
       
    82         * @param "aSampleRate" "The bit rate, in bits per second."
       
    83         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
    84         * completed with the leave code."
       
    85         * @since 2.8
       
    86         */
       
    87         void MacSetSourceBitRateL(TUint aBitRate);
       
    88         
       
    89         /**
       
    90         * Set the number of channels in the data source.
       
    91         * For example, one channel for mono, two channels for stereo etc.
       
    92         *
       
    93         * @param "aNumChannels" "The number of channels."
       
    94         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
    95         * completed with the leave code."
       
    96         * @since 2.8
       
    97         */
       
    98         void MacSetSourceNumChannelsL(TUint aNumChannels);
       
    99         
       
   100         /**
       
   101         * Set the format of the data source.
       
   102         *
       
   103         * The UID corresponds to the uid of the CMMFFormat-derived ECOM plugin to be used.
       
   104         * @param "aFormatUid" "The format plugin to be used."
       
   105         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   106         * completed with the leave code."
       
   107         * @since 2.8
       
   108         */
       
   109         void MacSetSourceFormatL(TUid aFormatUid);
       
   110         
       
   111         /**
       
   112         * Set the fourCC code of the source.
       
   113         *
       
   114         * @param "aDataType" "The fourCC code."
       
   115         * @leave "This function can leave with one of the system-wide error codes. The request will be 
       
   116         * completed with the leave code."
       
   117         * @since 2.8
       
   118         */
       
   119         void MacSetSourceDataTypeL(TFourCC aDataType);
       
   120         
       
   121         /**
       
   122         * Set the sample rate of the data sink in samples per second.
       
   123         *
       
   124         * @param "aSampleRate" "The sample rate, in samples per second."
       
   125         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   126         * completed with the leave code."
       
   127         * @since 2.8
       
   128         */
       
   129         void MacSetSinkSampleRateL(TUint aSampleRate);
       
   130         
       
   131         /**
       
   132         * Set the bit rate of the data sink in bits per second.
       
   133         *
       
   134         * @param "aSampleRate" "The bit rate, in bits per second."
       
   135         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   136         * completed with the leave code."
       
   137         * @since 2.8
       
   138         */
       
   139         void MacSetSinkBitRateL(TUint aRate);
       
   140         
       
   141         /**
       
   142         * Set the number of channels in the data sink.
       
   143         *
       
   144         * For example, one channel for mono, two channels for stereo etc.
       
   145         * @param "aNumChannels" "The number of channels."
       
   146         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   147         * completed with the leave code."
       
   148         * @since 2.8
       
   149         */
       
   150         void MacSetSinkNumChannelsL(TUint aNumChannels);
       
   151         
       
   152         /**
       
   153         * Set the format of the data sink. 
       
   154         *
       
   155         * The UID corresponds to the uid of the CMMFFormat-derived ECOM plugin to be used.
       
   156         * @param "aFormatUid" "The format plugin to be used."
       
   157         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   158         * completed with the leave code."
       
   159         * @since 2.8
       
   160         */
       
   161         void MacSetSinkFormatL(TUid aFormatUid);
       
   162         
       
   163         /**
       
   164         * Set the fourCC code of the sink.
       
   165         *
       
   166         * @param "aDataType" "The fourCC code."
       
   167         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   168         * completed with the leave code."
       
   169         * @since 2.8
       
   170         */
       
   171         void MacSetSinkDataTypeL(TFourCC aDataType);
       
   172         
       
   173         /**
       
   174         * Set the codec to be used.  Useful when recording data.
       
   175         * 
       
   176         * @param "aSourceDataType" "The data type of the source of the codec."
       
   177         * @param "aSinkDataType" "The data type of the sink of the codec."
       
   178         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   179         * completed with the leave code."
       
   180         * @since 2.8
       
   181         */
       
   182         void MacSetCodecL(TFourCC aSourceDataType, TFourCC aSinkDataType);
       
   183         
       
   184         
       
   185         /**
       
   186         * Get the sample rate of the data source in samples per second.
       
   187         *
       
   188         * @param "aRate" "The sample rate, in samples per second."
       
   189         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   190         * completed with the leave code."
       
   191         * @since 2.8
       
   192         */
       
   193         void MacGetSourceSampleRateL(TUint& aRate);
       
   194         
       
   195         /**
       
   196         * Get the bit rate of the data source in bits per second.
       
   197         *
       
   198         * @param "aRate" "The bit rate, in bits per second."
       
   199         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   200         * completed with the leave code."
       
   201         * @since 2.8
       
   202         */
       
   203         void MacGetSourceBitRateL(TUint& aRate);
       
   204         
       
   205         /**
       
   206         * Get the number of channels in the data source.
       
   207         *
       
   208         * For example, one channel for mono, two channels for stereo etc.
       
   209         * @param "aNumChannels" "The number of channels."
       
   210         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   211         * completed with the leave code."
       
   212         * since 2.8
       
   213         */
       
   214         void MacGetSourceNumChannelsL(TUint& aNumChannels);
       
   215         
       
   216         /**
       
   217         * Get the format of the data source.  
       
   218         * 
       
   219         * The UID corresponds to the uid of the CMMFFormat-derived ECOM plugin being used.
       
   220         * @param "aFormatUid" "The format plugin being used."
       
   221         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   222         * completed with the leave code."
       
   223         * @since 2.8
       
   224         */
       
   225         void MacGetSourceFormatL(TUid& aFormat);
       
   226         
       
   227         /**
       
   228         * Get the fourCC code of the source.
       
   229         *
       
   230         * @param "aDataType" "The fourCC code."
       
   231         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   232         * completed with the leave code."
       
   233         * @since 2.8
       
   234         */
       
   235         void MacGetSourceDataTypeL(TFourCC& aDataType);
       
   236         
       
   237         /**
       
   238         * Get the sample rate of the data sink in samples per second.
       
   239         *
       
   240         * @param "aRate" "The sample rate, in samples per second."
       
   241         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   242         * completed with the leave code."
       
   243         * @since 2.8
       
   244         */
       
   245         void MacGetSinkSampleRateL(TUint& aRate);
       
   246         
       
   247         /**
       
   248         * Get the bit rate of the data sink in bits per second.
       
   249         *
       
   250         * @param "aRate" "The bit rate, in bits per second."
       
   251         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   252         * completed with the leave code."
       
   253         * @since 2.8
       
   254         */
       
   255         void MacGetSinkBitRateL(TUint& aRate);
       
   256         
       
   257         /**
       
   258         * Get the number of channels in the data sink.
       
   259         *
       
   260         * For example, one channel for mono, two channels for stereo etc.
       
   261         * @param "aNumChannels" "The number of channels."
       
   262         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   263         * completed with the leave code."
       
   264         * @since 2.8
       
   265         */
       
   266         void MacGetSinkNumChannelsL(TUint& aNumChannels);
       
   267         
       
   268         /**
       
   269         * Get the format of the data sink.  
       
   270         *
       
   271         * The UID corresponds to the uid of the CMMFFormat-derived ECOM plugin being used.
       
   272         * @param "aFormatUid" "The format plugin being used."
       
   273         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   274         * completed with the leave code."
       
   275         * @since 2.8
       
   276         */
       
   277         void MacGetSinkFormatL(TUid& aFormat);
       
   278         
       
   279         /**
       
   280         * Get the fourCC code of the sink.
       
   281         *
       
   282         * @param "aDataType" "The fourCC code."
       
   283         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   284         * completed with the leave code."
       
   285         * @since 2.8
       
   286         */
       
   287         void MacGetSinkDataTypeL(TFourCC& aDataType);
       
   288         
       
   289         
       
   290         /**
       
   291         * Get the list of sample rates supported by the data source.
       
   292         * 
       
   293         * @param "aSupportedRates" "The supported rates.  Warning: Existing objects in this array will be removed by this method."
       
   294         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   295         * completed with the leave code."
       
   296         * @since 2.8
       
   297         */
       
   298         void MacGetSupportedSourceSampleRatesL(RArray<TUint>& aSupportedRates);
       
   299         
       
   300         /**
       
   301         * Get the list of bit rates supported by the data source.
       
   302         *
       
   303         * @param "aSupportedRates" "The supported rates.  Warning: Existing objects in this array will be removed by this method."
       
   304         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   305         * completed with the leave code."
       
   306         * @since 2.8
       
   307         */
       
   308         void MacGetSupportedSourceBitRatesL(RArray<TUint>& aSupportedRates);
       
   309         
       
   310         /**
       
   311         * Get the list of channels supported by the data source L(ie mono, stereo etc).
       
   312         *
       
   313         * @param "aSupportedChannels" "The supported channels.  Warning: Existing objects in this array will be removed by this method."
       
   314         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   315         * completed with the leave code."
       
   316         * @since 2.8
       
   317         */
       
   318         void MacGetSupportedSourceNumChannelsL(RArray<TUint>& aSupportedChannels);
       
   319         
       
   320         /**
       
   321         * Get the list of fourCC codes supported by the data source.
       
   322         *
       
   323         * @param "aSupportedDataTypes" "The supported data types.  Warning: Existing objects in this array will be removed by this method."
       
   324         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   325         * completed with the leave code."
       
   326         * @since 2.8
       
   327         */
       
   328         void MacGetSupportedSourceDataTypesL(RArray<TFourCC>& aSupportedDataTypes);
       
   329         
       
   330         /**
       
   331         * Get the list of sample rates supported by the data sink.
       
   332         *
       
   333         * @param "aSupportedRates" "The supported rates.  Warning: Existing objects in this array will be removed by this method."
       
   334         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   335         * completed with the leave code."
       
   336         * @since 2.8
       
   337         */
       
   338         void MacGetSupportedSinkSampleRatesL(RArray<TUint>& aSupportedRates);
       
   339         
       
   340         /**
       
   341         * Get the list of bit rates supported by the data sink.
       
   342         *
       
   343         * @param "aSupportedRates" "The supported rates.  Warning: Existing objects in this array will be removed by this method."
       
   344         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   345         * completed with the leave code."
       
   346         * @since 2.8
       
   347         */
       
   348         void MacGetSupportedSinkBitRatesL(RArray<TUint>& aSupportedRates);
       
   349         
       
   350         /**
       
   351         * Get the list of channels supported by the data sink L(ie mono, stereo etc).
       
   352         *
       
   353         * @param "aSupportedChannels" "The supported channels.  Warning: Existing objects in this array will be removed by this method."
       
   354         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   355         * completed with the leave code."
       
   356         * @since 2.8
       
   357         */
       
   358         void MacGetSupportedSinkNumChannelsL(RArray<TUint>& aSupportedChannels);
       
   359         
       
   360         /**
       
   361         * Get the list of fourCC codes supported by the data sink.
       
   362         * @param "aSupportedDataTypes" "The supported data types.  Warning: Existing objects in this array will be removed by this method."
       
   363         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   364         * completed with the leave code."
       
   365         * @since 2.8
       
   366         */
       
   367         void MacGetSupportedSinkDataTypesL(RArray<TFourCC>& aSupportedDataTypes);
       
   368 
       
   369 
       
   370     public: // From MMMFAudioPlayDeviceCustomCommandImplementor
       
   371 
       
   372         /**
       
   373         * Set the volume of the sound device.
       
   374         *
       
   375         * @param "aVolume" "The new volume"
       
   376         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   377         * completed with the leave code."
       
   378         * @since 2.8
       
   379         */
       
   380         void MapdSetVolumeL(TInt aVolume);
       
   381         
       
   382         /**
       
   383         * Get the maximum volume supported by the sound device.
       
   384         * @param "aMaxVolume" "The maximum volume, to be filled in by the controller plugin."
       
   385         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   386         * completed with the leave code."
       
   387         * @since 2.8
       
   388         */
       
   389         void MapdGetMaxVolumeL(TInt& aMaxVolume);
       
   390         
       
   391         /**
       
   392         * Get the current playback volume.
       
   393         * @param "aVolume" "The volume, to be filled in by the controller."
       
   394         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   395         * completed with the leave code."
       
   396         * @since 2.8
       
   397         */
       
   398         void MapdGetVolumeL(TInt& aVolume);
       
   399         
       
   400         /**
       
   401         * Set a volume ramp.
       
   402         *
       
   403         * This will cause the sound device to start playing with zero volume,
       
   404         * increasing the volume over aRampDuration microseconds.
       
   405         *
       
   406         * The volume ramp can be removed by setting the ramp duration to zero.
       
   407         *
       
   408         * @param "aRampDuration" "The duration over which the volume is to be 
       
   409         *                        increased, in microseconds."
       
   410         * @leave "This function can leave with one of the system-wide error codes. 
       
   411         *        The request will be completed with the leave code."
       
   412         */
       
   413         void MapdSetVolumeRampL(const TTimeIntervalMicroSeconds& aRampDuration);
       
   414         
       
   415         /**
       
   416         * Set the balance between the left and right stereo audio channels.
       
   417         *
       
   418         * @param "aBalance" "Use a value between <code>KMMFBalanceMaxLeft<\code> and 
       
   419         * <code>KMMFBalanceMaxRight<\code>. Centre balance can be restored by using
       
   420         * <code>KMMFBalanceCenter<\code>."
       
   421         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   422         * completed with the leave code."
       
   423         * @since 2.8
       
   424         */
       
   425         void MapdSetBalanceL(TInt aBalance);
       
   426         
       
   427         /**
       
   428         * Retrieve the balance between the left and right stereo audio channels.
       
   429         *
       
   430         * @param "aBalance""The current balance, filled in by the controller."
       
   431         * @leave "This function can leave with one of the system-wide error codes. The request will be
       
   432         * completed with the leave code."
       
   433         * @since 2.8
       
   434         */
       
   435         void MapdGetBalanceL(TInt& aBalance);
       
   436 
       
   437 
       
   438     public: // MTtsCustomCommandImplementor
       
   439         
       
   440         /**
       
   441         * Adds a new style.
       
   442         *
       
   443         * @param "TTtsStyle& aStyle" Style to add.
       
   444         * @since 2.8
       
   445         */
       
   446         TTtsStyleID MttscAddStyleL( const TTtsStyle& aStyle );
       
   447 
       
   448         /**
       
   449         * Deletes a style based on style ID.
       
   450         *
       
   451         * @param "TTtsStyleID aID" Style ID to be deleted.
       
   452         * @since 2.8
       
   453         */
       
   454         TInt MttscDeleteStyle( TTtsStyleID aID );
       
   455 
       
   456         /**
       
   457         * Gets the synthesis position.
       
   458         *
       
   459         * @retval "TInt& aWordIndex" Returned position of synthesis.
       
   460         * @since 2.8
       
   461         */
       
   462         void MttscGetPositionL( TInt& aWordIndex );
       
   463 
       
   464         /**
       
   465         * Returns the number of registered styles.
       
   466         *
       
   467         * @return Number of styles.
       
   468         * @since 2.8
       
   469         */
       
   470         TUint16 MttscNumberOfStyles();
       
   471 
       
   472         /**
       
   473         * Opens parsed text as source.
       
   474         *
       
   475         * @param "CTtsParsedText& aText" Reference to parsed text.
       
   476         * @since 2.8
       
   477         */
       
   478         void MttscOpenParsedTextL( CTtsParsedText& aText );
       
   479 
       
   480         /**
       
   481         * Sets the synthesis position based on word index.
       
   482         *
       
   483         * @param "TInt aWordIndex" Word index.
       
   484         * @since 2.8
       
   485         */
       
   486         void MttscSetPositionL( TInt aWordIndex );
       
   487 
       
   488         /**
       
   489         * Returns the style based on ID.
       
   490         *
       
   491         * @param "TTtsStyleID aStyleID" Style ID.
       
   492         * @return Reference to style object.
       
   493         * @since 2.8
       
   494         */
       
   495         TTtsStyle& MttscStyleL( TTtsStyleID aStyleID );
       
   496 
       
   497         /**
       
   498         * Returns the style based on index.
       
   499         *
       
   500         * @param "TUint16 aIndex" Style index.
       
   501         * @return Reference to style object.
       
   502         * @since 2.8
       
   503         */
       
   504         TTtsStyle& MttscStyleL( TUint16 aIndex );
       
   505 
       
   506         /**
       
   507         * Sets the default style parameters for synthesis.
       
   508         *
       
   509         * @param "const TTtsStyle& aStyle" Style created by the client
       
   510         * @since 3.2        
       
   511         */        
       
   512         void MttscSetDefaultStyleL( const TTtsStyle& aStyle );
       
   513         
       
   514         /**
       
   515         * Returns the registered default style
       
   516         *
       
   517         * @return Style reference
       
   518         * @leave KErrNotReady if no plugin is loaded to handle the function call
       
   519         * @since 3.2             
       
   520         */
       
   521         TTtsStyle& MttscDefaultStyleL();
       
   522         
       
   523         /**
       
   524         * Sets the speaking rate of synthesizer.
       
   525         *
       
   526         * @param TInt aRate Speaking rate value
       
   527         * @leave KErrNotSupported if synthesizer does not support speaking rate setting
       
   528         * @since 3.2        
       
   529         */        
       
   530         void MttscSetSpeakingRateL( TInt aRate );
       
   531         
       
   532         /**
       
   533         * Returns the current speaking rate value.
       
   534         *
       
   535         * @return Speaking rate value
       
   536         * @leave KErrNotSupported if synthesizer does not support speaking rate setting
       
   537         * @leave KErrNotReady if no plugin is loaded to handle the function call
       
   538         * @since 3.2        
       
   539         */
       
   540         TInt MttscSpeakingRateL();
       
   541       
       
   542         /**
       
   543         * Returns the list of supported languages.
       
   544         * 
       
   545         * @param "RArray<TLanguage>& aLanguages" Output parameter which contains 
       
   546         *        the languages
       
   547         * @leave KErrNotReady if no plugin is loaded to handle the function call
       
   548         * @since 3.2        
       
   549         */
       
   550         void MttscGetSupportedLanguagesL( RArray<TLanguage>& aLanguages );
       
   551         
       
   552         /**
       
   553         * Returns the list of supported voices for a certain language.
       
   554         * 
       
   555         * @param "TLanguage aLanguage" Language
       
   556         * @param "RArray<TTtsStyle>& aVoices" Output parameter which contains the voices
       
   557         * @leave KErrNotReady if no plugin is loaded to handle the function call
       
   558         * @since 3.2
       
   559         */        
       
   560         void MttscGetSupportedVoicesL( TLanguage aLanguage, RArray<TTtsStyle>& aVoices );
       
   561 
       
   562     protected:  // Functions from CMMFController
       
   563         
       
   564         /**
       
   565         * Add a data source to the controller plugin.
       
   566         *
       
   567         *  @param "aDataSource"	"A reference to the data source to be added.
       
   568         *         The controller plugin may call <code>aDataSource.DataSourceType()
       
   569         *         <\code> to find out exactly what type of source it is."
       
   570         * @leave "" "The controller plugin may leave during this method.  
       
   571         *        If the controller plugin does not support the data source, it 
       
   572         *         should leave with <code>KErrNotSupported<\code>.
       
   573         * @since 2.8
       
   574         */
       
   575         void AddDataSourceL( MDataSource& aDataSource );
       
   576         
       
   577         /**
       
   578         * Add a data sink to the controller plugin.
       
   579         *
       
   580         * @param "aDatasink" "A reference to the data sink to be added.
       
   581         *        The controller plugin may call <code>aDatasink.DatasinkType()
       
   582         *        <\code> to find out exactly what type of sink it is."
       
   583         * @leave "" "The controller plugin may leave during this method.
       
   584         *        If the controller plugin does not support the data sink, it 
       
   585         * should leave with <code>KErrNotSupported<\code>.
       
   586         * @since 2.8
       
   587         */
       
   588         void AddDataSinkL( MDataSink& aDataSink );
       
   589         
       
   590         /**
       
   591         * Remove a data source from the controller plugin.
       
   592         *
       
   593         * @param "aDataSource" A reference to the data source to be removed.
       
   594         * @leave "" "The controller plugin may leave during this method.
       
   595         *        If the controller plugin does not support the removal of data 
       
   596         *        sources, it should leave with <code>KErrNotSupported<\code>.
       
   597         *        If the controller plugin leaves, the data source will not be 
       
   598         *        destroyed by the controller framework.  If it does not leave, 
       
   599         *        the data source will be destroyed.
       
   600         * @since 2.8
       
   601         */
       
   602         void RemoveDataSourceL( MDataSource& aDataSource );
       
   603         
       
   604         /**
       
   605         * Remove a data sink from the controller plugin.
       
   606         *
       
   607         * @param "aDatasink" A reference to the data sink to be removed.
       
   608         * @leave "" "The controller plugin may leave during this method.
       
   609         * If the controller plugin does not support the removal of data sinks, 
       
   610         * it should leave with <code>KErrNotSupported<\code>. If the 
       
   611         * controller plugin leaves, the data sink will not be destroyed by 
       
   612         * the controller framework.  If it does not leave, the data sink
       
   613         * will be destroyed.
       
   614         * @since 2.8
       
   615         */
       
   616         void RemoveDataSinkL( MDataSink& aDataSink );
       
   617         
       
   618         /**
       
   619         * Reset the controller plugin.
       
   620         *
       
   621         * The controller should revert back to its newly constructed state. If 
       
   622         * the Reset is successful (i.e. it doesn't leave), the controller 
       
   623         * framework will delete all objects added to the MMFObjectManager 
       
   624         * including any sources and sinks.
       
   625         *
       
   626         * @leave "" "The controller plugin may leave during this method.
       
   627         *        If the controller plugin does not support being reset, 
       
   628         *        it should leave with <code>KErrNotSupported<\code>."
       
   629         * @since 2.8
       
   630         */
       
   631         void ResetL();
       
   632         
       
   633         /**
       
   634         * Prime the controller plugin.
       
   635         *
       
   636         * The controller must prepare to start playing, by initialising its 
       
   637         * sources, sinks and buffers. This moves the controller from the 
       
   638         * STOPPED to the PRIMED state.
       
   639         *
       
   640         * @leave "" "The controller plugin may leave during this method with
       
   641         * any of the standard system-wide error codes."
       
   642         * @since 2.8
       
   643         */
       
   644         void PrimeL();
       
   645         
       
   646         /**
       
   647         * Commence playback.
       
   648         *
       
   649         * The controller must now begin transferring data from its source(s) 
       
   650         * to its sink(s). This moves the controller from the PRIMED to the 
       
   651         * PLAYING state.
       
   652         *
       
   653         * Note: this method must return once playing has commenced, and not 
       
   654         * wait until playing is complete.
       
   655         *
       
   656         * @leave "" "The controller plugin may leave during this method with 
       
   657         *        any of the standard system-wide error codes."
       
   658         * @since 2.8
       
   659         */
       
   660         void PlayL();
       
   661         
       
   662         /**
       
   663         * Pause the controller plugin.
       
   664         *
       
   665         * The controller must now cease transferring data from its source(s) 
       
   666         * to its sink(s). This moves the controller from the PLAYING back to 
       
   667         * the PRIMED state.
       
   668         *
       
   669         * A subsequent call to <code>Play()<\code> will cause the controller 
       
   670         * plugin to resume playback from the point it was paused (unless 
       
   671         * there has been a call to <code>SetPosition()<\code> in the meantime.
       
   672         *
       
   673         * @leave "" "The controller plugin may leave during this method with 
       
   674         *        any of the standard system-wide error codes."
       
   675         * @since 2.8
       
   676         */
       
   677         void PauseL();
       
   678         
       
   679         /**
       
   680         * Stop the controller plugin.
       
   681         *
       
   682         * The controller must now undo anything that occurred during the call 
       
   683         * to <code>Prime()<\code>. This moves the controller from the PRIMED 
       
   684         * back to the STOPPED state.
       
   685         *
       
   686         * @leave "" "The controller plugin may leave during this method with 
       
   687         *        any of the standard system-wide error codes."
       
   688         * @since 2.8
       
   689         */
       
   690         void StopL();
       
   691         
       
   692         /**
       
   693         * Get the current position.
       
   694         *
       
   695         * The controller plugin should calculate the current position in microseconds.
       
   696         *
       
   697         * @return "The current position in microseconds."
       
   698         * @leave "" "The controller plugin may leave during this method with 
       
   699         *        any of the standard system-wide error codes."
       
   700         * @since 2.8
       
   701         */
       
   702         TTimeIntervalMicroSeconds PositionL() const;
       
   703         
       
   704         /**
       
   705         * Set the current position.
       
   706         *
       
   707         * The controller plugin should reposition itself to the position provided.
       
   708         *
       
   709         * @param "The desired position in microseconds."
       
   710         * @leave "" "The controller plugin may leave during this method with
       
   711         *         any of the standard system-wide error codes."
       
   712         * @since 2.8
       
   713         */
       
   714         void SetPositionL( const TTimeIntervalMicroSeconds& aPosition );
       
   715         
       
   716         /**
       
   717         * Get the duration of the clip.
       
   718         *
       
   719         * The controller plugin should calculate the clip duration in microseconds.
       
   720         *
       
   721         * @return "The clip duration in microseconds."
       
   722         * @leave "" "The controller plugin may leave during this method with
       
   723         *         any of the standard system-wide error codes."
       
   724         * @since 2.8
       
   725         */
       
   726         TTimeIntervalMicroSeconds DurationL() const;
       
   727         
       
   728         /**
       
   729         * Set the priority settings.
       
   730         *
       
   731         * The new priority settings must be applied to any resource being used 
       
   732         * by the controller plugin that requires priority settings (for example 
       
   733         * the sound device).
       
   734         *
       
   735         * @param "aPrioritySettings" "The new priority settings"
       
   736         * @since 2.8
       
   737         */
       
   738         void SetPrioritySettings( const TMMFPrioritySettings& aPrioritySettings );
       
   739         
       
   740         /**
       
   741         * Handle a custom command.
       
   742         *
       
   743         * Custom commands allow a controller plugin to define its own API.
       
   744         * If the controller framework does not understand a message from the 
       
   745         * client, it is assumed this is a custom command for the plugin and 
       
   746         * passed into this interface.
       
   747         *
       
   748         * The more common custom commands can be handled by Custom Command 
       
   749         * Parsers on behalf of the controller plugin.  This allows the 
       
   750         * controller plugin to implement a concrete interface (defined by 
       
   751         * mixin classes) rather than having to decode the command itself.
       
   752         * For more information, @see CMMFCustomCommandParserBase.
       
   753         *
       
   754         * The controller plugin must always complete the message passed 
       
   755         * into this method, even if it does not support the interface 
       
   756         * required by the message.
       
   757         *
       
   758         * @param "aMessage" "The message to be handled by the controller plugin."
       
   759         * @since 2.8
       
   760         */
       
   761         void CustomCommand( TMMFMessage& aMessage );
       
   762         
       
   763         /**
       
   764         * Retrieve the number of meta data entries in the clip.
       
   765         *
       
   766         * @param "aNumberOfEntries" "The controller plugin must set this to 
       
   767         * the number of meta data entries in the clip."
       
   768         *
       
   769         * @leave "" "The controller plugin may leave during this method with 
       
   770         *        any of the standard system-wide error codes."
       
   771         * @since 2.8
       
   772         */
       
   773         void GetNumberOfMetaDataEntriesL( TInt& aNumberOfEntries );
       
   774         
       
   775         /**
       
   776         * Retrieve a meta data entry from the clip.
       
   777         *
       
   778         * @param "aIndex" "The index of the meta data entry to retrieve."
       
   779         * @return "A pointer to a newly created CMMFMetaDataEntry object 
       
   780         *         containing the meta information. The controller framework 
       
   781         *         will take ownership of the object when this method returns."
       
   782         * @leave "" "The controller plugin may leave during this method with 
       
   783         *        any of the standard system-wide error codes."
       
   784         * @since 2.8
       
   785         */
       
   786         CMMFMetaDataEntry* GetMetaDataEntryL( TInt aIndex );
       
   787 
       
   788 
       
   789     private:
       
   790         
       
   791         /**
       
   792         * C++ default constructor.
       
   793         */
       
   794         CTtsControllerPlugin();
       
   795         
       
   796         /**
       
   797         * By default Symbian 2nd phase constructor is private.
       
   798         */
       
   799         void ConstructL();
       
   800         
       
   801         // Prohibit copy constructor.
       
   802         CTtsControllerPlugin( const CTtsControllerPlugin& );
       
   803         // Prohibit assigment operator.
       
   804         CTtsControllerPlugin& operator=( const CTtsControllerPlugin& );
       
   805         
       
   806     private: // Data
       
   807 
       
   808         // Implementation class
       
   809         CTtsControllerPluginBody* iBody;
       
   810         
       
   811         // Reserved pointer for future extension
       
   812         TAny* iReserved;
       
   813         
       
   814     };
       
   815 
       
   816 #endif // TTSPLUGIN_H   
       
   817 
       
   818 // End of File
       
   819